Update: I got them to follow through with an OnHeartbeat script and an include script with a jump function. However it I get a repeated cycle of toggling the widget. I can't figure out what I'm wrong. I also can't get the chains to stay after the area jump. Anyone have any suggestions? Here's the scripts.
In the meantime, I think I'm gonna try and put them in the OnEnter area properties to see what that gives me. But I'm getting closer, I can feel it. '>
Edit: LOL. So... I put them OnEnter of the area, nothing. I put them OnEnter of a trigger? NWServer crashed on me. So I'm pretty sure it's my borked/butchered script that's definitely borked. They haven't changed in terms of the actual scripting, just where I put them.
Edit 2: I got the player to go across one transition and hold all of the effects. However when trying to go back the way I was leading them, they got stuck behind the second transition. This, I really think has to do with the OnHeartbeat script. I've cleaned the other two to the best of my ability, though I'm wondering why it's not refiring. Waited 2 minutes and the other player didn't pop through the transition. I threw them on triggers to see if I got that crash after I cleaned them thoroughly, and so far no crashes. It's aaaaaaall most there, I can feel it in my bones! Also, there's a few functions and commands that are commented out, that's mostly me doing the whole "Nope. It's not this." trial and error spiel.
OnHeartbeat:
#include "inc_guardchain"
void checkareas(object oActivator, object oCriminalScum = OBJECT_SELF)
{
object oGuardArea = GetArea(oActivator);
object oCriminalArea = GetArea(oCriminalScum);
if ( GetLocalInt (oCriminalScum, "IsArrested") == 1)
{
if (oCriminalArea != oGuardArea)
{//Incorrect areas, so jump
AssignCommand(oCriminalScum, GuardCommand_Follow(oActivator, TRUE));
}
}
}
Item Activate script
#include "nw_i0_spells"
#include "inc_guardchain"
void main()
{
object oUser = GetItemActivated();
object oCriminalScum = GetItemActivatedTarget();
location lActTarget = GetItemActivatedTargetLocation();
object oActivator = GetItemActivator();
if ( GetLocalInt(oActivator, "ONEPERSON") == 1 )
{
//Reset Local Variables (Though they kind of don't seem to?)
DeleteLocalInt(oActivator, "ONEPERSON");
SetLocalInt(oCriminalScum, "IsArrested", 0);
//Assign Commands
RemoveSpecificEffect(EFFECT_TYPE_BEAM, oCriminalScum);
RemoveSpecificEffect(EFFECT_TYPE_DOMINATED, oCriminalScum);
AssignCommand(oCriminalScum, ClearAllActions());
AssignCommand(oCriminalScum, SetCommandable(TRUE));
//Send float to guard
FloatingTextStringOnCreature("You unbind your prisoner.", oActivator);
//Remove any beams on guard.
RemoveSpecificEffect(EFFECT_TYPE_BEAM, oActivator);
}
else
{ //***Set Local Variables to 1.
SetLocalInt(oActivator, "ONEPERSON", 1);
SetLocalInt(oCriminalScum, "IsArrested", 1);
//String to player on how many people can be arrested at once (one)
FloatingTextStringOnCreature("You have a person arrested!", oActivator);
AssignCommand(oCriminalScum, GuardCommand_Follow(oActivator, TRUE));
}
}
And the include script that I'm using to link commands from:
#include "nw_i0_spells"
void GuardCommand_Follow(object oActivator, int bJump = FALSE)
{ // Follow oTarget
if(bJump)
ClearAllActions();
// Queue: Jump to Target
JumpToObject(oActivator);
// Set Commands to false
//SetCommandable(FALSE);
// Queue: Follow oTarget
object oSource = GetItemActivatedTarget();
object oTarget = GetItemActivator();
effect eBeam = EffectBeam(VFX_BEAM_CHAIN, oSource, BODY_NODE_CHEST);
effect eDom = SupernaturalEffect( EffectCutsceneDominated());
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBeam, oTarget);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDom, oSource);
//Set the player to follow and not break from Force Follow.
DelayCommand(2.0, ActionForceFollowObject(oActivator, 0.);
}