Searching for a reliable way to force actors to flee

Post » Sat May 28, 2011 9:34 am

Hello all,

I want to be able to force an actor to flee when certain conditions are met. I am currently doing this by applying the following "flee script effect":

scn 1ntfsFleeScriptEffectshort actorAggressionshort actorConfidence begin ScriptEffectStartSet actorAggression to GetAV AggressionSet actorConfidence to GetAV ConfidencesetAV Aggression 0setAV Confidence 0forceFleeendBegin ScriptEffectFinishsetAV Aggression actorAggressionsetAV Confidence actorConfidence RemoveSpell 1ntfsActorFleeEffectend


problem is, sometimes the enemy just doesn't flee or, worse, he might drop out of combat and enter sandbox mode, making him behave as a settler in Megaton.

Is there a way to be certain that once the effect is applied, the actor will flee for sure?
User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm

Post » Sat May 28, 2011 10:08 am

If there is no threat in the area when they re-evaluate their packages then the flee will cancel. Is the player an enemy?

You might try a ScriptEffectUpdate block to check if they are still fleeing and use this: http://geck.gamesas.com/index.php/GetCurrentAIProcedure


Begin ScriptEffectUpdateif (GetCurrentAIProcedure == 16)  ;fleeelse    forcefleeendifEnd

User avatar
Rachel Cafferty
 
Posts: 3442
Joined: Thu Jun 22, 2006 1:48 am

Post » Sat May 28, 2011 7:48 am

Yep, the player is always the enemy. I have tried setting aggression and confidence to 0 as well as checking for the AI procedure in the script effect update but sometimes they just turn to non-hostile and enter sandbox mode or whatever package they had before combat. I can even talk to some raiders :brokencomputer:

I have tried startCombat player before the forceFlee but they just never flee in that case.

Even with a scriptEffectElapsedSeconds timer they just don't flee.

Any ideas? :D
User avatar
Charlotte Buckley
 
Posts: 3532
Joined: Fri Oct 27, 2006 11:29 am

Post » Sat May 28, 2011 2:33 pm

Comment out the Set Aggression and then do StartCombat Player -> SetAV Confidence and since their Aggressive but lacking Confidence they ~should run away on the ForceFlee command.

That snippet of script I gave you is right out of my FleeOnFire script that forces NPC's to sometimes flee if they are burning to death depending on a few other factors as well -> but it works flawlessly while actively in combat with said actor.

Yours might be failing because they were not actively in combat so setting their Aggression to 0 just made them friendly instead of frightful or another mod could be toying with their AI.
User avatar
STEVI INQUE
 
Posts: 3441
Joined: Thu Nov 02, 2006 8:19 pm

Post » Sat May 28, 2011 5:22 pm

That makes sense because fleeing is a combat state and they are more likely to remain in combat if aggressive.
User avatar
Cheville Thompson
 
Posts: 3404
Joined: Sun Mar 25, 2007 2:33 pm

Post » Sat May 28, 2011 11:33 am

It also makes sense because when I explode cars next to them they continue fleeing as they should :D I'll try it and let you know!
User avatar
Maria Leon
 
Posts: 3413
Joined: Tue Aug 14, 2007 12:39 am

Post » Sat May 28, 2011 5:26 pm

Aaaargh, I just don't get it :banghead: Now I have actors with 0 confidence and 2 aggression who keep attacking me :brokencomputer: Maybe it's FWE or MMM but still wtf...? Should I add a different AI Package instead of forceFlee? Haven't ever made one of those :toughninja:

ps: I even tried the script effect update check for

if (GetCurrentAIProcedure != 16)  ;flee   forcefleeendif


but still nothing. I am debaffled :D
User avatar
Sami Blackburn
 
Posts: 3306
Joined: Tue Jun 20, 2006 7:56 am

Post » Sat May 28, 2011 1:38 pm

Aaaargh, I just don't get it :banghead: Now I have actors with 0 confidence and 2 aggression who keep attacking me :brokencomputer: Maybe it's FWE or MMM but still wtf...? Should I add a different AI Package instead of forceFlee? Haven't ever made one of those :toughninja:

ps: I even tried the script effect update check for

if (GetCurrentAIProcedure != 16)  ;flee   forcefleeendif


but still nothing. I am debaffled :D


Try This

SetAV Confidence 0
EVP

did not even need to use ForceFlee.
User avatar
James Shaw
 
Posts: 3399
Joined: Sun Jul 08, 2007 11:23 pm

Post » Sat May 28, 2011 8:29 pm

I've had troubles getting an NPC to modify combat behavior with FWE loaded.

After the setav confidence 0, I used ResetAI to make them re-evaluate combat as well as their current package.
User avatar
Kerri Lee
 
Posts: 3404
Joined: Sun Feb 25, 2007 9:37 pm

Post » Sat May 28, 2011 4:37 pm

SaidenStorm, your advice was excellent as always :) Worked like a charm! Thanks to everyone for your help!
User avatar
Silvia Gil
 
Posts: 3433
Joined: Mon Nov 20, 2006 9:31 pm


Return to Fallout 3