so im working on my mod with sonicR and so far he has been a great help but where a bit stuck, just wondering if anyone has or has any knowledge about how to spawn a custom npc only in a certain world, because at the moment i have a portal item that teleports you to another world (Robot land) and i wanted only my npc to spawn there so far i have tried these codes. Code: public static bool SpawnNPC(int x, int y, int playerID) { if(ModPlayer.currentWorld = "Robot Land") return true; return false; } and Code: public static bool SpawnNPC(int x, int y, int playerID) { if(Main.worldName == "Robot Land") return true; return false; } and they don't work it dose not compile
Fixed it, code needs to be: Code: public static bool SpawnNPC(int x, int y, int playerID) { if(ModPlayer.currentWorld == "Robot Land") return true; return false; } An extra '=' was missing! BTW, the second example compiled fine for me, don't know what went wrong for you.
ok as soon as we get the enemy npc working right it should be good, i think this may be the same for the town npc that i was trying to do there not spawning but everything elce dose and every once and a while i get these big holes in the ground that usualy have wood in them i just can think of what might have been there to cause this, maby curuption or jungle or somthing