Jump to content

[LE] Need help with script for IdleMarker in Skyrim.


8lis8

Recommended Posts

Hello everyone, I really need help with a simple script for IdleMarker in Skyrim. In general, I create a beach island mod, the world itself is already finished, it remains to fill it with inhabitants and animations for a lively atmosphere, I took some beach animations from the GomaPeroPoses mod, and then there was a dead end, the animations turned out to be looped by themselves (I did not go into such details before :)) and it turned out that when the Character interacted with IdleMarker, the animation started, and even after leaving the marker, the character continued to be and move with this animation.

I ask for help from those who understand scripts and can write a simple script, the animation on IdleMarker should play for example (1 minute), then the character accepts its standard Idle animation.

Everything is according to the standard IdleMarker principle in Skyrim.

Thanks for your participation and your time.

Link to comment
Share on other sites

https://www.creationkit.com/index.php?title=PlayAnimation_-_ObjectReference

 

You wrote: "I ask for help from those who understand scripts and can write a simple script, the animation on IdleMarker should play for example (1 minute), then the character accepts its standard Idle animation."

 

Its not as simple as you think. You have to save the actor who is doing the animation related to IdleMarker. Now the script has to wait for each actor 60 seconds and then a stop animation has to be called to revert the actor to normal behavior. Best way would be to create a new spell (fire and forget) with a script on magic effect.

 

lis8IdleMarkerMGEFScript

 

Scriptname lis8IdleMarkerMGEFScript extends ActiveMagicEffect
; https://forums.nexusmods.com/index.php?/topic/10943138-need-help-with-script-for-idlemarker-in-skyrim/

  Idle PROPERTY IdleStop_Loose auto        ; vanilla animation fill in here

  Actor target


; -- EVENTs --

EVENT OnEffectStart(Actor akTarget, Actor akCaster)
    target = akTarget
    myF_Action(akTarget)
ENDEVENT


; -- FUNCTION --

;----------------------------------
FUNCTION myF_Action(Actor akTarget)
;----------------------------------
int i = 60
    WHILE akTarget.Is3DLoaded()
        IF (i == 0)
                                                                                      ;* -- edited next code lines
;;;         (akTarget as ObjectReference).PlayAnimation("IdleStop_Loose")             ;* stop animation, this line is rubbish here
;;;         Debug.SendAnimationEvent((akTarget as ObjectReference), "IdleStop_Loose") ;* idle variant to play for actors without a property setting
            akTarget.PlayIdle(IdleStop_Loose)                                         ;* -- caused by earlier brain misfunction

            RETURN ; - STOP -
        ENDIF
;        ---------------------
        i = i - 1                                        ; counter
        Utility.Wait(1.0)
    ENDWHILE

    target = None            ; remove actors script persistence
ENDFUNCTION

 


What is the problem? I do not know how to cast the spell on the actor. You do not tell us with your post, what have you done to make the actor to interact with the idlemarker.

In the same interaction you should cast the spell on the actor.

Edited by ReDragon2013
Link to comment
Share on other sites

ReDragon2013 thank you very much for the script, I really appreciate your help. I'll explain the idea a bit.

I created a marker with animation from the mod, the characters themselves interact with it,

as with ordinary markers in the game, just after interacting with a regular marker,

let's say the character got up from the chair and went on,

and with my marker he still moves with an inflatable ring without going into normal condition.

Thanks for the offer with the spell, but I want the characters to interact with the maker themselves as in a normal game,

it makes no sense to walk and cast spells on 20 characters just to see them doing some kind of activity,

the idea is in live content when the characters do a feathered type of action in the necessary places, just by markers.

I will try to apply it.

Link to comment
Share on other sites

I added this script to IdleMarker, NPCs use looped animation and won't stop.

What can I be doing wrong? Also a question on this line, I need to add something in it, if so, what exactly? (you indicated a comment in it) - Idle PROPERTY IdleStop_Loose auto ; vanilla animation fill in here

And another question, what to specify in Properties? IdleStop_Loose?

 



Link to comment
Share on other sites

If you are hung up on an animation try this one to break the trance

 

Debug.SendAnimationEvent(Game.GetPlayer(),"JumpLand")

 

ForceIdleState or whatever often doesnt work especially on pose mods I found. JumpLand I have never seen fail. Only issue there is you might feel that animation visually clashes with your immersion for a split second

Link to comment
Share on other sites

Sphered, thank you for your help, but I can’t understand the script with these animations, I understand the concept, but I can’t compose it in the script, I managed to do scripts with a teleport and interaction with non-Game furniture, maybe it was luck :)) If you can show how this script looks like (description and event), I tried to substitute different values ​​and animations, but NPCs still move in this animation after interacting with the marker.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...