I have 4 npcs following the PC. One is a henchmen, the other 3 are just using a simple script to follow me:
The problem is that they keep cornering me and my character is unable to move. I had to kill the old lady (Sorry Bette) just to get unstuck LOL. What script can I use on them to make them “bump-able” like my henchman is?? Thanks!
Edit: Maybe a script to keep followers a few steps away from me would work too!
Henchmen are designed to move out of your way. Forced followers, though, are not. So one option is to make all four henchmen.
This is also more robust that ActionForceFollowObject, which, while fairly reliable, seems buggy in some modules I’ve played.
If need be, you can tweak the henchmen scripts for the simple followers - for example, you can intercept and disable radial menu commands OnConversation, disable combat, or whatever you need.
If the simple followers must be regular NPCs for some reason, try using ActionMoveAwayFromObject to clear some space. This could be an NPC conversation option, unique power item, player tool or whatever. With three simple followers, move each in turn, with a slight delay between moves, so that they don’t all try to move to the same spot.
Gotcha, I did think about making them all henchmen but just wanted to see if there was another solution (they only join for a short amount of time so I thought it looked weird to have everyone’s portraits and health bar showing), but definitely not a big deal! Thanks for the advice
This is a good advice. Such
AMAFO-based “push” could be triggered via AOE:
- Let’s assume NPC follow range is
r = 2.0
- Apply custom AOE effect to PC with radius
r and custom entering script [see notes]
- When something enters the AOE (read: PC moves into somebody), check if it follows the PC, push it away and immediately make it resume following for a seamless “bump”
The advantage is that it requires no other action from the player than just movement. It makes the NPC thrash around a bit, but it’s very convenient.
AOE's OnEnter script
This is “push” in
EffectAreaOfEffect(AOE_PER_CUSTOM_AOE, "push")... Make sure it is the PC who calls
ApplyEffectToObject() on itself.
// follow distance (should match AOE radius)
const float FOLLOW_RANGE = 2.0;
// NPC to be pushed
object oNPC = GetEnteringObject();
// PC to clear path for
object oPC = GetAreaOfEffectCreator();
// if NPC is following...
// (note: no check if it actually follows the PC;
// this could be done with local variables)
if(GetCurrentAction(oNPC) == ACTION_FOLLOW)
// clear actions, move away, resume following
AssignCommand(oNPC, ActionMoveAwayFromObject(oPC, TRUE, FOLLOW_RANGE));
AssignCommand(oNPC, ActionForceFollowObject(oPC, FOLLOW_RANGE));
AssignCommand(oPC, SpeakString("Outta my way, " + GetName(oNPC) + "!"));
You can make a copy of
vfx_persistent.2da and change
radius to 2.0, or just alter
VFX_CUSTOM if you won’t need it for anything else.
You will also need similar script for AOE’s heartbeat in case someone starts to follow you while inside the AOE (i.e. after conversation).