Hello,
I am currently trying to spawn a NPC through Lua and I have the problem that custom NPC work but the Zombies and Combines don't. When i spawn the Zombies or Combines it says
NPC npc_zombie stuck in wall--level design error at (4138.91 -12799.97 -0.07)
in console and just spawns them at 0 0 0.
Custom NPC work fine and get spawned where i want them.
Bye
Mattzimann
You'd need to set their spawn point which you can walk to a spot you want them to spawn and type getpos in console and it'll give you the vector. Also keep in mind you should do multiple points in that area so they don't stack inside of each other.
example
local spawnPoints = {Vector, Vector, Vector} // three spawn points you choose on the map
then to set it use
local randomNum = math.Floor(math.Random(3)) // selects a random spawn point
yourEntsName:SetPos(spawnPoints[randomNum])
Yeah I am kinda doin it like that but the problem is that Standard GMod NPCs are always spawning at 0 0 0
I've not spawned NPC's so I'm not 100% i was going off information on the wiki and my experience with spawning props. Are you getting any error codes? Have you tried writing the vector it's supposed to get in console to see if it's invalid and returning 0,0,0? Just set up a bunch of prints() and see if there is something getting stuck.
Sorry, you need to Log In to post a reply to this thread.