alienmist325
Terrarian
How do I reference the position of the npc which threw the projectile then? Main.myPlayer.position returns an error.
Well, I re-installed terraria and everything workedAs 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).
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.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!
When does that error happen?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).
You'll need to set one of the projectile's ai slots to the NPC's whoAmI.How do I reference the position of the npc which threw the projectile then? Main.myPlayer.position returns an error.
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 workThanks 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?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.
You can reference that with projectile.ai[0]. The Projectile's ai field is an array of floats of length 2.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?
I tried projectile.ai[0].position.X but it returns an error.. What am i doing wrong?You can reference that with projectile.ai[0]. The Projectile's ai field is an array of floats of length 2.
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]]I tried projectile.ai[0].position.X but it returns an error.. What am i doing wrong?
To figure this out on your own, find a vanilla item that does what you want and look in the spreadsheet for a property that looks right: https://github.com/bluemagic123/tModLoader/wiki/Vanilla-Item-Field-ValuesHow can I allow the character to rotate during use of the item?
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.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!
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.
Mod reference imkSushisMod System.Exception: Magic Header != "TMOD"
at Terraria.ModLoader.IO.TmodFile.Read()
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?trying to update my mods to tModLoader 0.8 with the same code, but some errors:
imkSushi's Fatal Lava Mod:
imkSushi's Mod Drops Addon: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:Code:Mod reference imkSushisMod System.Exception: Magic Header != "TMOD" at Terraria.ModLoader.IO.TmodFile.Read()
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.
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?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]]
Oh, yeah, for the owner parameter you'll need Main.myPlayer, not 255.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?