Skip to content

Obscure Query

There is a crystal placeable that when you click on it little "floaties" go upward.
I tried scripting the placeable to activate but can't get the "floaties" to activate.
DoPlaceableObjectAction(OBJECT_SELF, ANIMATION_PLACEABLE_ACTIVATE));

The only reservation about this is: it's on the OnHeartbeat handler and I'm uncertain how the animation will react to being played every six seconds.

Comments

  • ForSeriousForSerious Member Posts: 466
    For all the placeables I have used, I get them to animate using
    ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
    
    Some are backwards, so you have to deactivate them to get them to animate.
    Anyway, once activated, they stay that way until you call a script to deactivate them.
    DoPlaceableObjectAction(oNPC, PLACEABLE_ACTION_*));
    
    This function is used to have a player or henchman do things like unlock or use a placeable.
  • ProlericProleric Member Posts: 1,316
    Some placeables also have open/close animations which are different. I don't know which crystal we're talking about, but it sounds like it could be an open animation, which you can play with the same function and the appropriate constant.
  • ZephiriusZephirius Member Posts: 419
    OK. thanks guys. Will give it a try. :)
  • ZephiriusZephirius Member Posts: 419
    ForSerious wrote: »
    For all the placeables I have used, I get them to animate using
    ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
    
    Some are backwards, so you have to deactivate them to get them to animate.
    Anyway, once activated, they stay that way until you call a script to deactivate them.

    Yes sir. That did the trick. It was ActionPlayAnimation...

  • ZephiriusZephirius Member Posts: 419
    edited June 2021
    Hmm, I works sort of. I seems that the farther away from where I spawn, the crystals stop playing their "floaty" animation. This is strange. Any interesting theories?

    Script so far...
    void main()
    {
    
    int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
    if (DoOnce==TRUE) return;
    SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
    
    effect eGlow  = EffectVisualEffect(VFX_DUR_AURA_WHITE);
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGlow, OBJECT_SELF);
    
    effect eIceskin = EffectVisualEffect(VFX_DUR_ICESKIN);
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eIceskin, OBJECT_SELF);
    
    AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE, 1.5f, 6.0f));
    
    }
    
  • ForSeriousForSerious Member Posts: 466
    Not strange at all. You are telling it to activate for only 6 seconds. Using the default of 0.0f will make it play until you make it play the deactivate animation.
  • ZephiriusZephirius Member Posts: 419
    Same thing. I think I originally changed it from 0.0 to 6.0 in the hope that something would stick.
    The crystals are dispersed intermittently throughout the map, but the farther I get from the start, they just stop playing their animations.

    Thanks for the reply Serious.
  • ForSeriousForSerious Member Posts: 466
    Did you try it without the two other visual effects? If it's the same crystal I'm thinking of, it glows white when activated. I also tried to change the animation speed, but it was the same, no matter what I set it to.
  • ForSeriousForSerious Member Posts: 466
    edited June 2021
    How are you calling this script? I tried it in the OnUsed slot. It works just fine. You can strip it down to:
    void main()
    {
        int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
        if(DoOnce==TRUE)
        {
            return;
        }
        SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
        effect eGlow  = EffectVisualEffect(VFX_DUR_AURA_WHITE);
        ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGlow, OBJECT_SELF);
        effect eIceskin = EffectVisualEffect(VFX_DUR_ICESKIN);
        ApplyEffectToObject(DURATION_TYPE_PERMANENT, eIceskin, OBJECT_SELF);
        ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
    }
    
    and it will work the exact same. I guess speed and duration don't affect placable animations.

    Unless you're going to deactivate the crystal at some point, you can just set the state to activated in the toolset. I guess you lose the other effects that way.

    Man I'm all out of ideas. I put your script in OnHeartbeat in about 15 crystals and they all activate and stay that way.
  • ZephiriusZephirius Member Posts: 419
    edited June 2021
    Thanks for the help again. I'll eventually figure it out. I'm actually obsessing over this little bugger.
    I wish I could just mail you the area .erf. Ha!
  • ForSeriousForSerious Member Posts: 466
    PM away.
Sign In or Register to comment.