Posts: 342
Threads: 64
Joined: Aug 2013
Reputation:
0
Hey, if it's not possible how could I just block one area for NPC's?
Posts: 1,781
Threads: 13
Joined: Sep 2009
Reputation:
0
how big is the area you want to block NPCs from?
is it a 2d-plane or a 3d-room?
are there more areas planned to be added?
i had success at creating a 6000x6000 sized array of integers, each defining 1 square meter which defines IF a npc is allowed to walk on. setting these "forbidden"/"allowed" numbers are hard work - since the area(s) need to be precisely mapped (each mІ) - please provide us more about your intentions so we can help you elaborate a good solution.
my way is not even close to a good solution, since blocking one little area for npcs doesnt justify wasting 72MB.
you could simply add a loop in a timer, where each npc gets checked for being close to your desired location, but as soon you add either more locations and/or npcs, that loop will take more and more CPU time...
Posts: 342
Threads: 64
Joined: Aug 2013
Reputation:
0
I want to block the entire mall area. I'm wondering if y_areas could be the solution?
Posts: 1,781
Threads: 13
Joined: Sep 2009
Reputation:
0
i didnt use y_areas yet, but it sounds like its the best way to go, since ******' codes are proven to work excellent, countless times.
your effort will be to script the npc's leaving that area (or not going there in first place), so one question remains:
are your npcs using pre-recorded paths, or are they moving dynamically?
-for the first case using .record path files, its close to impossibe, since you cannot change the path once its playing back. you will need to record each path again, avoiding all desired areas.
-for the second case, check if the "next step" for any npc would be inside/close to the mall area, therefore avoid them going there, by changing their direction for the next move.