npc_citizen queries

Need Help? The Day isnt going so well on the Mapping front?
Post Reply
DaMaN
npc_combinegunship
npc_combinegunship
Posts: 782
Joined: Tue Nov 07, 2006 12:03 am
Location: Parent's Basement
Contact:

npc_citizen queries

Post 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 ;) )
Current projects: Return to City 17 and Rising Dead
Also, check out my Blag: http://daman-amappersworld.blogspot.com/
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post 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!
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post 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.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
DaMaN
npc_combinegunship
npc_combinegunship
Posts: 782
Joined: Tue Nov 07, 2006 12:03 am
Location: Parent's Basement
Contact:

Post 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!
Current projects: Return to City 17 and Rising Dead
Also, check out my Blag: http://daman-amappersworld.blogspot.com/
User avatar
Shana
Lead Developer
Lead Developer
Posts: 2971
Joined: Tue Aug 29, 2006 8:12 pm
Location: Germany
Contact:

Post by Shana »

Try giving them (the citizens) the "startscripting" input and "stopscripting" after they played their sequences
DaMaN
npc_combinegunship
npc_combinegunship
Posts: 782
Joined: Tue Nov 07, 2006 12:03 am
Location: Parent's Basement
Contact:

Post 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.
Current projects: Return to City 17 and Rising Dead
Also, check out my Blag: http://daman-amappersworld.blogspot.com/
Post Reply