Standalone [1.3] tModLoader - A Modding API

As I asked before - whath?
Error CS1704: ******(A lot of *s because of translation) "Steamworks.NET, Version=7.0.0.0, Culture=neutral, PublickKeyToken=null (Much more of *s).
 
So I saw in bugfixes for v0.8 you had done some work on trying to fix the issue of NPCs disappearing on multiplayer servers. I was excited for this because me and my friends have been trying to get a server with mods on it for a while only to find modded enemies would disappear on hit each time. So I did some testing on my private server running the tremor mod and this is what I've found.
-Only Certain enemies are disappearing on hit (Undead Warriors from the tremor mod)
-Sometimes if there are multiple on screen if I hit one the other will disappear (I'm not sure if im imagining this one or not)
-The guide on the new world I've started still shoots at the invisible enemies as if they are still there and following me
-The guide can still be hit by the enemies if I lead them into
-After about 30 seconds the invisible mob sometimes reappears and stays visible
-After they reappear they seem to have taken damage from the guide
-I'm the only one on my server at the moment ( I have no one else to test with at the moment)
-A little off topic is enemies are sometimes teleporting around once they get close to me even though my server is ran off the same network which suggests some desyncronization which doesn't happen on my vanilla server
-I have none of these problems on vanilla so they should all be a result of using the mod
-these situations do not happen in single player
If There is any other testing you would like me to do I would be glad to help! I hope this is of some use!
Thanks for all that information! Now that mods are updating to the new v0.8 format it should be easy for me to test this problem.

Whath?
Error CS1704: ******(A lot of *s because of translation) "Steamworks.NET, Version=7.0.0.0, Culture=neutral, PublickKeyToken=null (Much more of *s).
When does that error happen?

How do I reference the position of the npc which threw the projectile then? Main.myPlayer.position returns an error.
You'll need to set one of the projectile's ai slots to the NPC's whoAmI.
 
Thanks for all that information! Now that mods are updating to the new v0.8 format it should be easy for me to test this problem.


When does that error happen?


You'll need to set one of the projectile's ai slots to the NPC's whoAmI.
I had Russian patch and that changed some things like error texts, but when I deleted everything and installed clean version and installed tmodloader everything got to work
 
Thanks for all that information! Now that mods are updating to the new v0.8 format it should be easy for me to test this problem.


When does that error happen?


You'll need to set one of the projectile's ai slots to the NPC's whoAmI.
so as in Projectile.NewProjectile(nx , ny, (float)((px - nx)/50), (float)((py - ny)/50), mod.ProjectileType("VulcHammer"), 20, 0.3f, 255, npc.whoAmI, 0f);. If so, how do I referemce the ai0 slot?
 
so as in Projectile.NewProjectile(nx , ny, (float)((px - nx)/50), (float)((py - ny)/50), mod.ProjectileType("VulcHammer"), 20, 0.3f, 255, npc.whoAmI, 0f);. If so, how do I referemce the ai0 slot?
You can reference that with projectile.ai[0]. The Projectile's ai field is an array of floats of length 2.
 
So I saw in bugfixes for v0.8 you had done some work on trying to fix the issue of NPCs disappearing on multiplayer servers. I was excited for this because me and my friends have been trying to get a server with mods on it for a while only to find modded enemies would disappear on hit each time. So I did some testing on my private server running the tremor mod and this is what I've found.
-Only Certain enemies are disappearing on hit (Undead Warriors from the tremor mod)
-Sometimes if there are multiple on screen if I hit one the other will disappear (I'm not sure if im imagining this one or not)
-The guide on the new world I've started still shoots at the invisible enemies as if they are still there and following me
-The guide can still be hit by the enemies if I lead them into
-After about 30 seconds the invisible mob sometimes reappears and stays visible
-After they reappear they seem to have taken damage from the guide
-I'm the only one on my server at the moment ( I have no one else to test with at the moment)
-A little off topic is enemies are sometimes teleporting around once they get close to me even though my server is ran off the same network which suggests some desyncronization which doesn't happen on my vanilla server
-I have none of these problems on vanilla so they should all be a result of using the mod
-these situations do not happen in single player
If There is any other testing you would like me to do I would be glad to help! I hope this is of some use!
Just to make sure, this is with v0.8, and you've also copied the updated v0.8 tModLoaderServer.exe to your Terraria's Steam folder, right? For some reason I can't get the Undead Warriors to disappear.

Edit: Also, something just came to mind. Do they disappear every single time you hit them, or is it random?
 
Last edited:
trying to update my mods to tModLoader 0.8 with the same code, but some errors:

imkSushi's Fatal Lava Mod:
Code:
error CS1704: An assembly with the same simple name 'MP3Sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign them to enable side-by-side.
imkSushi's Mod Drops Addon:
Code:
Mod reference imkSushisMod System.Exception: Magic Header != "TMOD"
   at Terraria.ModLoader.IO.TmodFile.Read()
imkSushi's Mod:
Code:
error CS1704: An assembly with the same simple name 'MP3Sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign them to enable side-by-side.
 
trying to update my mods to tModLoader 0.8 with the same code, but some errors:

imkSushi's Fatal Lava Mod:
Code:
error CS1704: An assembly with the same simple name 'MP3Sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign them to enable side-by-side.
imkSushi's Mod Drops Addon:
Code:
Mod reference imkSushisMod System.Exception: Magic Header != "TMOD"
   at Terraria.ModLoader.IO.TmodFile.Read()
imkSushi's Mod:
Code:
error CS1704: An assembly with the same simple name 'MP3Sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign them to enable side-by-side.
Did you read the bold text in the update news post?
 
I verified the integrity of the game cache in Steam to get a clean Terraria install then I put the Linux tmodloader v0.8 files into the folder, overwriting when there was a filename conflict. I'm getting a crash to desktop after the Re-Logic splash screen fades out. This is with Linux Mint 17.3, and I don't have anything in the Mods folder at the moment. Is there a way to get more information about what's causing the crash? I don't know where to look for logs or anything.
 
No, it stores the NPC's whoAmI, not the NPC itself. To get the actual NPC you'll need Main.npc[(int)projectile.ai[0]]
Actually, after looking at it a bit, it doesn't work... I outputted the x and y position. I used 'Projectile.NewProjectile(a,b,c,d,e,f,g,h, npc.whoAmI, i);' ,where a-i are all irrelevant, in my npc code and in my projectile code, i put: 'Main.npc[(int)projectile.ai[0]].position.X' but the value of that was not the x of the npc... What am i doing wrong?
 
Actually, after looking at it a bit, it doesn't work... I outputted the x and y position. I used 'Projectile.NewProjectile(a,b,c,d,e,f,g,h, npc.whoAmI, i);' ,where a-i are all irrelevant, in my npc code and in my projectile code, i put: 'Main.npc[(int)projectile.ai[0]].position.X' but the value of that was not the x of the npc... What am i doing wrong?
Oh, yeah, for the owner parameter you'll need Main.myPlayer, not 255.
 
NPC's on multiplayer still do disappear... Man i'm so excited to actually play multiplayer with bosses, still have to get that fixed completely :/
 
Back
Top Bottom