Skip to content

A way for the reading animation to be continuous? !SOLVED

NeverwinterWightsNeverwinterWights Member Posts: 339
edited August 2022 in Builders - Scripting
The reading animation is a FNF animation which shows the player reading a scroll/papyrus and only lasts about 2 seconds. I've tried every which way I can think of to script it to where it could be a somewhat continuous looping animation, but sadly can't get it to look right. Not sure why this wasn't made a looping animation. It would've been nice. The idea is for a continuous reading animation that can be triggered by a player chat /emote command (which I already have finished for all other emote animations).

Anyway, just wondering if there is a way the community has gotten this to work. Is there a way to script it that I haven't thought of? Is there a separate looping reading animation constant I don't know about? I'm using CEP. Is there a reading phenotype I don't know about? Is there a .hak everyone is using?

Last resort might just be to skip the animation and let players equip a CEP book item instead, but I specifically like the look of the scroll reading animation for things like reading a map, letter, news paper, etc.

Thanks in advance for any insight.

EDIT: Where there's a will there's a way. A bit convoluted but it works. I noticed that if you change the animation speed to 0.01 (something smaller than the default 1.0) , while you do eventually stop the animation of holding of the scroll (you put your arms down), the scroll itself remains (although it moves to the players back). So a combination of changing the animation speed so the scroll stays, using the freeze animation effect, and having to run a recursive script to check if the player location changes to remove the freeze animation effect, it actually works. The only down side is that the player is completely motionless while reading the scroll in this manner, but I'll take what I can get.
Post edited by NeverwinterWights on

Comments

  • ForSeriousForSerious Member Posts: 446
    Not sure if this would change anything about what you've done to solve it, but, you can assign the read emote to a quick slot, and if you click it a bunch of times, it will keep you doing the emote for longer. I feel like it would be easier to do like a little delay command recursion loop than what you've done. It might turn out to be about the same though.
  • NeverwinterWightsNeverwinterWights Member Posts: 339
    ForSerious wrote: »
    Not sure if this would change anything about what you've done to solve it, but, you can assign the read emote to a quick slot, and if you click it a bunch of times, it will keep you doing the emote for longer. I feel like it would be easier to do like a little delay command recursion loop than what you've done. It might turn out to be about the same though.

    Hmm. When I tried adding the read emote to a quick slot and press it multiple times, the character just does the one animation and then won't do it again until you move the character. If I press it slower and time it to where the animation is finished (the character puts their arms down and the scroll disappears), then it will go back into the reading animation (new scroll appears and arms raised again) which wasn't the desired behavior I was looking for. I tried doing it in a new empty mod too just to make sure I didn't have anything overriding anything.
  • ForSeriousForSerious Member Posts: 446
    Maybe I never tried the read emote specifically. With other emotes like fall down backwards, it extends like I described. Maybe they designed it more like the drink potion emote. In that case, you're probably on the right track.
  • NeverwinterWightsNeverwinterWights Member Posts: 339
    ForSerious wrote: »
    Maybe I never tried the read emote specifically. With other emotes like fall down backwards, it extends like I described. Maybe they designed it more like the drink potion emote. In that case, you're probably on the right track.

    Short vid of the two different animation loops. First animation is a standard one with undesired behavior and the second is what I came up with to keep the appearance of uninterrupted reading.
    Link
  • Awas73Awas73 Member Posts: 63
    ForSerious wrote: »
    Maybe I never tried the read emote specifically. With other emotes like fall down backwards, it extends like I described. Maybe they designed it more like the drink potion emote. In that case, you're probably on the right track.

    Short vid of the two different animation loops. First animation is a standard one with undesired behavior and the second is what I came up with to keep the appearance of uninterrupted reading.
    Link

    Any chance we can see the script to see how you did it?
  • NeverwinterWightsNeverwinterWights Member Posts: 339
    @Awas73 I have it set up as commands in the OnPlayerChat event.

    The reading part:
    else if (sSaid == "/reading")
            {
                location lLoc = GetLocation(oSpeaker);
                effect eFreeze = TagEffect(EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION), "READ_FREEZE");
                AssignCommand(oSpeaker, ActionPlayAnimation(ANIMATION_FIREFORGET_READ, 0.01));
                DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eFreeze, oSpeaker));
                RemoveEffectWhenLocationChange(oSpeaker, lLoc, "READ_FREEZE");
            }
    

    The function to remove it or go back to normal:
    void RemoveEffectWhenLocationChange(object oPC, location lLocation, string sEffectTag)
    {
        location lCurrent = GetLocation(oPC);
        if (lCurrent == lLocation)
        {
            DelayCommand(1.0, RemoveEffectWhenLocationChange(oPC, lLocation, sEffectTag));
            //SendMessageToPC(oPC, "Location check running");//test line. remove later
        }
        else
        {
            effect eEffect = GetFirstEffect(oPC);
            while (GetIsEffectValid(eEffect))
            {
                if (GetEffectTag(eEffect) == sEffectTag)
                {
                    RemoveEffect(oPC, eEffect);
                    AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_PAUSE, 1.0, 1.0));//Needed to resolve animation speed issue
                }
                eEffect = GetNextEffect(oPC);
            }
        }
    }
    
Sign In or Register to comment.