![]() |
[Fix] Better NPC spawning - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51) +----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44) +------ Forum: Tutorials (https://mirage-engine.uk/forums/forumdisplay.php?fid=13) +------ Thread: [Fix] Better NPC spawning (/showthread.php?tid=2868) |
[Fix] Better NPC spawning - GIAKEN - 23-06-2009 Well, NPC spawning is a bit fucked...NPCs can spawn on other NPCs and even other players. Also if an NPC doesn't spawn, it's still created...and won't spawn until you /respawn it. This fix will only spawn an NPC if it's able to and when an open slot becomes available it will spawn there. Replace: Code: Public Sub SpawnNpc(ByVal MapNpcNum As Long, ByVal MapNum As Long) With: Code: Public Sub SpawnNpc(ByVal MapNpcNum As Long, ByVal MapNum As Long) Then under that sub add this: Code: Public Function NpcTileIsOpen(ByVal MapNum As Long, ByVal X As Long, ByVal Y As Long) As Boolean And that should be it. Re: [Fix] Better NPC spawning - Robin - 23-06-2009 ty Re: [Fix] Better NPC spawning - Rian - 23-06-2009 Nice one, Harold. Re: [Fix] Better NPC spawning - GIAKEN - 28-06-2009 I'm the best. Re: [Fix] Better NPC spawning - Joost - 29-06-2009 Loop to MAX_PLAYERS instead of a PlayersOnMap variable is messy though ;p. + npc's cant spawn on item attributes, and other attributes that they should be able to spawn on. Re: [Fix] Better NPC spawning - GIAKEN - 12-07-2009 I did loop with max_players... And yeah this isn't a rewrite, I just fixed up the current spawning...which didn't let them spawn on anything but an empty tile. Re: [Fix] Better NPC spawning - GIAKEN - 23-08-2009 Fixed the NpcTileIsOpen function. Wasn't checking if the player was on that specific map. |