• Need Direction On NPC Control
    2 replies, posted
I'm creating a Trouble in Terrorist Town weapon. Currently, the weapon spawns a "zombie vault" which can be interacted with (activated) to start a timer that spawns an npc_fastzombie at customizable increments (default is 4 or 5 seconds). It functions as intended, for the most part. The primary problem I've run into is guiding the zombies away from this "zombie box" as they spawn. They don't really want to move (at all) unless there's someone to aggro onto (and even then, they still sometimes don't). This results in the first zombie not moving, and every one after him spawning inside him. My attempted work-around was to ding the zombie for 1 damage and set the source of the damage from the player who activated the zombie vault. It seemed to work in testing (this was causing the zombie to walk forward a bit, then enter an idle animation where it would wander), but in practice, does not work at all. So I need to look for a new work-around. These are my options as I see them: Spawn the zombies in a circle AROUND the zombie vault entity (this doesn't necessarily fix the problem - zombies may still sit unmoving - which I don't want) Have the zombies nocollide with one another until they're no longer touching Force the zombies to enter their idle animation on spawn (where they wander) Force the zombies to aggro the nearest player at every given moment I'm primarily looking for the functions necessary to control the NPCs' actions, such as forcing their idle animations. However, I'm open to working with the other suggestions.
Bumperoo. I don't know what I'm doing with NPCs. Quite at a loss. What function can I use to force an NPC to enter an idle state?
Just play around with the various NPC functions to see what does what.
Sorry, you need to Log In to post a reply to this thread.