Page 1 of 1

npc_citizen queries

Posted: Fri Feb 08, 2008 9:11 am
by DaMaN
Ok. So here's the scenario: I've got to get the players to guide a group of citizens from point A to point B. At point A, the citizens are just hanging out doing nothing, until a trigger tells them to start following, at which point the citizens follow the nearest player until they get to point B. At point B, the citizens disengage from the player, and run into another room.

There are two main problems that arise, each method I have tried has solved only one of them:
1) The citizens don't follow the player
2) The citizens won't stop following the player

Currently, I've tried a couple of methods:

1) ai_follow entity. This worked really well for stopping the citizens from following the player - I just disabled the ai entity and the players stopped. Simple. Easy. The problem with it was that the citizens always got in the players way, and went running off to get themselves killed whenever possible. (Note: I DON'T want them to get themselves killed!)
2) Make them commandable. This worked really well for following - the citizens followed the player without getting in the way, and kept out of combat for the most part. Also had the advantage that you could tell them where to run to when the going got tough. The problem with it was that the citizens wouldn't STOP following the player.
At point A they follow the player with a "SetCommandable" input. I put a trigger_multiple at point B telling the citizens to do a scripted sequence to run into the next room, while at the same time triggering the citizens "remove from player squad" input. Immediately after the citizens were removed from the players squad, they were put back into it!! Is there a "SetUncommandable" input or it's equivalent for the npc_citizen?

Any help on this would be greatly appreciated. (Perhaps I'll let you name a citizen ;) )

Posted: Fri Feb 08, 2008 10:27 am
by fug4life
Scripted_sequence is the only true way of getting npcs to ignore players and follow defined orders/scripts. Just have the trigger, trigger the script when players get npcs within proximity. The lots of flags in scripted sequences you can check, like interuptability, repeatable, and priority.
Play with stuff like that. And use the scripts custom movement. Give me a shout if you still have trouble. But I'd still say scripted_sequence is your best bet. Scripted_schedule is good, but scripted_sequence is the daddy!

Posted: Fri Feb 08, 2008 10:41 am
by fug4life
Scripted sequences are a bitch to get working right but, you gotta keep playing with them.
I'll have a look later and tell you what flags I would use on the scripted_sequence and the citizen, plus i/o's.

Posted: Fri Feb 08, 2008 11:07 am
by DaMaN
Thanks fug, I took a look at the scripted sequences I'm using, and I've already set everything as high as it'll go. Flags are set to repeatable, no interruptions, override AI, and priority script. But still same thing - citizens keep getting stalled and aren't running to the scripted sequences (move to position is "run"). Let me know if you find anything!

Posted: Fri Feb 08, 2008 11:11 am
by Shana
Try giving them (the citizens) the "startscripting" input and "stopscripting" after they played their sequences

Posted: Tue Feb 12, 2008 5:07 am
by DaMaN
W0rf0x wrote:Try giving them (the citizens) the "startscripting" input and "stopscripting" after they played their sequences
Damn, I thought that would work... evidently not :cry:

I gave the citizens the startscripting input, and two of them did what they were supposed to but the third just stopped dead in her tracks. Ugh. I'll see about working with this further when I have less homework.