So I ran into another problem with a widget. This time what I'm trying to do is make "chain" tool for player guards to "arrest" someone in the server. It's supposed to make the player who's being arrested follow them where ever they wanted, but I've ran into two problems.
Edit: Found the EffectBeam entry in the Lexicon. The beam effect is fixed now.
Just thought I'd warn ya.
The other thing that seems to be messing up is that the player who's being arrested can still move around, which cancels the command. My brain's still pretty foggy on how to stop this as well as making the arrested player follow the guard player around. I know it's been done before, but I'm drawing blanks here. When I use the widget again, it changes the local variables just fine like a toggle should.. I just can't seem to get it where the player can't cancel out the forced walk. Preferably where the player that's arrested can still talk. I know how to disable the hud.. But giving players a chance to plead their case on their way to the slammer would be epic.
Ran into an additional problem; the player of the widget can have an unlimited amount of people following them. x.x I'm gonna try another local variable to stop that and see if that works.
And an optional: If someone could show me how to make it where the player being arrested has to roll a reflex save better than 40 or be arrested, that'd be extra awesome! But it's not required. I was never good at applying checks like that to my scripts (kind of like what's happening to my visual effects right now, they just won't show up). =/
Anyways! I'm sorry for going on and on. This is the script I'm working with now. I tried to comment what does what (or at least what I'm wanting it to do) within the script.
And as always any and all help is greatly appreciated!
Another edit: Updated the script to mark my fixes, but I also removed SetCommands as I don't think they work for PC's. But PLEASE correct me if I'm wrong! Cause, I love learning. :D
#include "nw_i0_spells"
void main()
{
effect eVFX;
object oUser = GetItemActivated();
object oCriminalScum = GetItemActivatedTarget();
location lActTarget = GetItemActivatedTargetLocation();
object oActivator = GetItemActivator();
if (GetIsObjectValid(oCriminalScum))
{
if (GetLocalInt(oCriminalScum, "Arrested"))
{ //Remove Local
DeleteLocalInt(oCriminalScum, "Arrested");
//Remove Beam Chain visuals
effect eVFX = EffectVisualEffect(VFX_BEAM_CHAIN);
RemoveSpecificEffect(EFFECT_TYPE_VISUALEFFECT, oCriminalScum);
// Clear all actions and allow them to move again.
AssignCommand(oCriminalScum, ClearAllActions());
}
else
{ //Set Local
SetLocalInt(oCriminalScum, "Arrested", TRUE);
//Use Beam Chain visual effects
object oSource = GetItemActivatedTarget();
object oTarget = GetItemActivator();
effect eBeam = EffectBeam(VFX_BEAM_CHAIN, oSource, BODY_NODE_CHEST);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBeam, oTarget);
//Set the player to follow and not break from Force Follow.
AssignCommand(oCriminalScum, ActionForceFollowObject(oActivator, 0.8));
}
}
}





Retour en haut






