• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua a bit silly question about npcs

zbizu

Legendary OT User
Joined
Nov 22, 2010
Messages
3,329
Solutions
27
Reaction score
2,720
Location
Poland
Hello. I've noticed that every NPC placed on surface, on my ot which is not locked in his shop is able to walk absolutely everywhere.
How do I fix that? I want temple NPC to stay in temple and quest npcs to stay in certain positions.
It happens to all npcs on my ot.
Ask me which files you need and I'll paste them there.
 
It's (fairly) simple.
(Note: I got no idea if it's doable otherwise)
You will probably be best off making an internally opened box for the npc to stay inside, on each tile you put an actionid, and then you make an onStepIn() event that checks the creature's name, if it's equal to the NPC, it moves him back to fromPosition.
 
@2up should help, I'll check it later maybe it depends on their spawn size also

@up
I want them to walk, but I also want them to stay nearby their spawn
 
In 0.3 npcs cannot walk out of spawn range. Check what "radius" says in spawn file, it has to be != -1 in order to work.
When moving the npc checks whether he can walk there.

Which rev are you using?
 
In 0.3 npcs cannot walk out of spawn range. Check what "radius" says in spawn file, it has to be != -1 in order to work.
When moving the npc checks whether he can walk there.

Which rev are you using?

modified 0.3.7, but npcsystem wasn't touched
I just found out that my npc was placed on spawn areas conflict (two spawns covered same sqms) and he was attached to larger one
 
Back
Top