Page 1 of 1

Statue In A Pose

Posted: Tue Nov 11, 2003 8:34 pm
by Sili

Code: Select all

void main()
{
    object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);
    SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
    ActionPlayAnimation(ANIMATION_FIREFORGET_TAUNT);
    object oTarget;
    oTarget = OBJECT_SELF;
    DelayCommand(0.5,ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectPetrify(), oTarget));
    SetPlotFlag(OBJECT_SELF, TRUE);
}
for some reason this won't fire. the fomating is messed up here. Called from OnSpawn

Posted: Tue Nov 11, 2003 8:48 pm
by Actually
The whole thing doesn't fire, or just the EffectPetrify()?

And this is a piddly point, but why are you declaring and assigning your oTarget on two different lines? Why not:

object oTarget = OBJECT_SELF;

Bye Now,
Jerry Cornelius - Script Monkey

Posted: Tue Nov 11, 2003 8:52 pm
by Neve
I tried a similiar thing, but the NPC will only play the animation at the time you're near it. If you leave the area and re-enter it, the statue will be standing in default pose again :?

[edit]

What exactly should the script do ? With your code you are trying to petrify the nearest player to the spawning player, is that what it needs to do ? Also, you did define an object oPC, and assigned an object to it, but it isn't used in the rest of the code...

Posted: Tue Nov 11, 2003 9:01 pm
by Sili
Ok got the petrify to work. I want the creature this is attatched to, to stay in the taunt pose. The creature doens't even do the taunt

Code: Select all

void main()
{
    object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);
    SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
    ActionPlayAnimation(ANIMATION_FIREFORGET_TAUNT);
    object oTarget;
    oTarget = OBJECT_SELF;
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_PETRIFY), OBJECT_SELF);
    SetPlotFlag(OBJECT_SELF, TRUE);
}

Posted: Tue Nov 11, 2003 9:02 pm
by JollyOrc
I'm not sure, but is EffectPetrify() a valid effect ?

Otherwise I agree with Neve and Actually:

Code: Select all

void main {
    object oTarget = OBJECT_SELF;
    ActionPlayAnimation(ANIMATION_FIREFORGET_TAUNT); 
    DelayCommand(0.5,ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectPetrify(), oTarget));
    SetPlotFlag(OBJECT_SELF, TRUE);
}
should suffice. The rest seems ballast.

Dunno if this works as intended in the end, as I don't know if this will actually freeze the animation. Can't test it right now.

Posted: Tue Nov 11, 2003 9:03 pm
by JollyOrc
uhm... off the top of my head:

perhaps AssignCommand() (or whatever it's called) should do the trick ?

Posted: Tue Nov 11, 2003 9:37 pm
by Neve
You got it right there Jolly ;)

Code: Select all

void main {  
    AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_FIREFORGET_TAUNT)); 
    DelayCommand(0.5,ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectPetrify(), OBJECT_SELF)); 
    SetPlotFlag(OBJECT_SELF, TRUE); 
}