Does this tool (and mods for it) work with the GOG version of Terraria?Current version: v0.7.1.1
Compatible with Terraria 1.3.0.8
Requires Steam
Platforms: Windows, Mac, Linux
Servers currently only work on Windows
Hmm, maybe the port hasn't been forwarded on the computer that's hosting the server. You could use the port-forwarding tool that I linked you to, to check if port 7777 (or which ever port you chose) is open on the IP address of the computer hosting the server. If it isn't, you will need to find a port forwarding guide specific to the router of the computer that is hosting the server.So i tried to join my friends server like i was told and we used an ip address using hamachi but it still wont work, we have the tmodloader server program opened and everything
Sadly, no. Nobody on the tModLoader team has the GOG version, so they can't make tModLoader work for GOG.Apologies if this has already been asked. I've done a search on this thread and did not find anything.
Does this tool (and mods for it) work with the GOG version of Terraria?
You'll want to create a class that derives from GlobalNPC. Inside that class, override the NPCLoot function, check the type of the NPC and drop the item if necessary:How do you add a drop to a specific vanilla mob? For example, gastropod.
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace MyMod.NPCs
{
public class MyModNPC : GlobalNPC
{
public override void NPCLoot(NPC npc)
{
if(npc.type == NPCID.Gastropod)
{
// Drop your item.
}
}
}
}
How doesn't it work? Could you show your code?I think I found a bug UseItem doesn't work for me. Does anyone else having this problem?
Do any vanilla bosses do that? I think sprite effects will only flip horizontally.Could anyone tell me what to put in public override void BossHeadSpriteEffects(ref SpriteEffects spriteEffects) to make it actually rotate the boss icon? Putting it in visual studio isn't helping me out for once.
Ah that's what I meant, like it mirroring right? That's what I'm looking for anyway...Do any vanilla bosses do that? I think sprite effects will only flip horizontally.
Bummer.Sadly, no. Nobody on the tModLoader team has the GOG version, so they can't make tModLoader work for GOG.
To increase the max health/mana more, you'll have to create some fields in your ModPlayer class, increase player.statLifeMax2 or player.statManaMax2 based on those stats, and save/load those fields in SaveCustomData and LoadCustomData.Thanks for your help since the start of porting my mod. I successfully made my own Ui and it works. Even tho the old ui still draw. I got one last question: How can we surpass max mana and max health in tmodloader. As I saw the max health can go beyond but does save at 500. So when you load again you lost the over health. The mana can't go over 400 as far as I tried. If someone got an answer I would be happy to work with it. Thank you.
And so far the mod is coming great togheter. Had to change a good part of it to port it to tModLoader.
The bug's somewhere in your mod; can you show us the code?I think I found a bug UseItem doesn't work for me. Does anyone else having this problem?
You can make the boss head icon flip by setting spriteEffects to either SpriteEffects.FlipHorizontally or SpriteEffects.FlipVertically. SpriteEffects is in the Microsoft.Xna.Framework.Graphics namespace.Could anyone tell me what to put in public override void BossHeadSpriteEffects(ref SpriteEffects spriteEffects) to make it actually rotate the boss icon? Putting it in visual studio isn't helping me out for once.
if (Main.netMode != 1) //if not a client
{
int proNam = Projectile.NewProjectile(player.Center.X + (player.width + offsetX) * player.direction, (player.Center.Y + offsetY), (float)Math.Cos(player.itemRotation) * 3 * player.direction + (Main.rand.NextFloat() * 1f - 0.2f), (float)Math.Sin(player.itemRotation) * 3 * player.direction + (Main.rand.NextFloat() * 1f - 0.2f), mod.ProjectileType("NamPowerLead"), damage, knockBack, player.whoAmI);
namLeader = Main.projectile[proNam]; //this line needs to happen on a client also
if (Main.netMode == 2) //if a server
{
NetMessage.SendData(27, -1, -1, "", proNam, 0.0f, 0.0f, 0.0f, 0); //Sync clients with server
}
}
Sure here:The bug's somewhere in your mod; can you show us the code?
public override bool UseItem(Item item, Player player)
{
//Main.NewText("USE");
Main.NewText(Main.projectile.Length.ToString());
for(int m = 0; m < Main.projectile.Length; m++)
{
if(Main.projectile[m].type == mod.ProjectileType("CustomProjectile"))
{
CustomProjectile pro = (CustomProjectile)Main.projectile[m].modProjectile;
pro.test();
}
}
return true;
}
Hm, the solution would depend on what exactly you're trying to use proNam for. I would think that you could set it somewhere from the projectile's AI.I've got a bit of a conundrum here. I'm trying to spawn a projectile and store the projectile inside a field, but I'm having trouble getting it synced across a server.
I want namLeader to be set on clients and the server. I can't move it outside of the first if clause because it won't have access to proNam anymore.Code:if (Main.netMode != 1) //if not a client { int proNam = Projectile.NewProjectile(player.Center.X + (player.width + offsetX) * player.direction, (player.Center.Y + offsetY), (float)Math.Cos(player.itemRotation) * 3 * player.direction + (Main.rand.NextFloat() * 1f - 0.2f), (float)Math.Sin(player.itemRotation) * 3 * player.direction + (Main.rand.NextFloat() * 1f - 0.2f), mod.ProjectileType("NamPowerLead"), damage, knockBack, player.whoAmI); namLeader = Main.projectile[proNam]; //this line needs to happen on a client also if (Main.netMode == 2) //if a server { NetMessage.SendData(27, -1, -1, "", proNam, 0.0f, 0.0f, 0.0f, 0); //Sync clients with server } }
The way I see it, I either need to get the server set namLeader on all clients, or send proNam to all clients and have them use that to set namLeader. Any suggestions?
At the moment no. I'll add that to the to-do list.Is there any way to check if item is crafted?Like tAPI's hook OnCraft?
For example, if I craft some item(even vanilla one), there's random chance that it would have "someRandomVar" variable set to 1.
Can you show the rest of the item's code too? It doesn't help when we only have code that we already know isn't being called.Sure here:
the Main.NewText are just for testingCode:public override bool UseItem(Item item, Player player) { //Main.NewText("USE"); Main.NewText(Main.projectile.Length.ToString()); for(int m = 0; m < Main.projectile.Length; m++) { if(Main.projectile[m].type == mod.ProjectileType("CustomProjectile")) { CustomProjectile pro = (CustomProjectile)Main.projectile[m].modProjectile; pro.test(); } } return true; }
There is no more code it is inside a GlobalItemCan you show the rest of the item's code too?