TheRecusantX Posted March 24, 2020 Share Posted March 24, 2020 Id like to make a script to make a creature do a certain animation ONCE immediately after being summoned. So something like "if creature is summoned, play animation x 1 time" is that possible ? and if so, how would a script like that look? Link to comment Share on other sites More sharing options...
maxarturo Posted March 24, 2020 Share Posted March 24, 2020 (edited) One way to do this is to place the script on the 'Summon Actor', which when it gets load it will do your stuff. Example: Auto State Waiting Event OnLoad() Utility.Wait(1.0) ; This is for waiting the summon FX to finish, tweak it accordingly Debug.SendAnimationEvent(Self, "MyAnimation") GoToState("Done") EndEvent EndState State Done EndState - "MyAnimation" does not exists is just a random animation name. - The "State Done" is a fail safe in case you go through a 'Load Door' and the summon actors follows you, so it won't play again the animation. I hope it helps. Edited March 24, 2020 by maxarturo Link to comment Share on other sites More sharing options...
TheRecusantX Posted March 24, 2020 Author Share Posted March 24, 2020 Thx but I actually found a much simpler solution :tongue: Turns out creatures already play a certain animation when summoned by default. All I had to do was replace that animation with my own and it worked :smile: Will keep this script in mind for other uses though :smile: If I did end up using the script and wanted no delay for the animation to start id just set the wait to 0.0? and do i add the script to the summon magic effect or to the creature ? Link to comment Share on other sites More sharing options...
maxarturo Posted March 25, 2020 Share Posted March 25, 2020 (edited) - If i remember correctly all 'Summon Npcs' will play their "How or Summon or AggroWarning" if they have one. - If you want the summon to play another animation like 'Dancing', then you need the script. - If you want no 'Delay', then just remove: Utility.Wait(1.0) from the script. * but it will be wise to have some delay because actors that are summon they are "Fade Out" when sommon, like 'enable(True)', so to avoid any issues wait first for the actor to be "Fully Load" and then send the animation. - This specific script must be added to the actor, 'Edit Base' the actor and place it in the Script's section on the left side of the actor's property menu. * There is also an option to place a script on the 'Magic Effect', but this will need a little more scripting than by having this one which actually has only 1 line to execute. Edited March 25, 2020 by maxarturo Link to comment Share on other sites More sharing options...
TheRecusantX Posted March 25, 2020 Author Share Posted March 25, 2020 This is what I did : https://www.nexusmods.com/skyrimspecialedition/mods/33955?tab=images Now it works alright with the summon bubble fx but when I remove it, you can see the skeletons whole body for a split second before it emerges from the ground. You think theres any way to fix that ? I want them to be invisible until the emerge from the ground animation starts EDIT: tried your script out of curiosity and the animation wonât play no matter what... Link to comment Share on other sites More sharing options...
maxarturo Posted March 25, 2020 Share Posted March 25, 2020 "Now it works alright with the summon bubble fx but when I remove it, you can see the skeletons whole body for a split second before it emerges from the ground."This is supposed to happen the way you have done it.The correct way is to use the "Furniture" so that the actor never appeared in front of you, but instead always underground.This approach requires at least 2 scripts and some other tweaks to the "Furniture - Actor's script or Magic Effect script" and the whole set up. "You think there's any way to fix that ?"A quick workaround to support the way you have set this up is to put on the actor a simple script to make him invisible for X sec when it gets load, until it starts playing the animation. Auto State Waiting Event OnLoad() Self.SetAlpha(0.1) Utility.Wait(0.5) Self.SetAlpha(1.0) GoToState("Done") EndEvent EndState State Done EndState You will need to tweak the "Wait" to match the start of the animation. "EDIT: tried your script out of curiosity and the animation wonât play no matter what..."- Did you put the script on the actor's property menu ?- Are you trying to send and "Animation" or "Idle" ?Idle won't work with "SendAnimationEvent()".- Are you sending a valid animation ?There is a difference between the Animations ID and the Animation NAME, you need the NAME and not the ID.- Is your actor capable to play the animation ?.Not all animation can be send/played by all actors, only animations that exists in their "Animation Graph". * And there is something else that escapes me right now... i just woke up... Link to comment Share on other sites More sharing options...
TheRecusantX Posted March 25, 2020 Author Share Posted March 25, 2020 Thx, will try the new scriptAs for your questions:1. I opened the actor in CK and put the script under scripts2. Im trying to send the special_groundemerge.hkx animation3. Yes, I typed special_groundemerge for the animation in the script4. Yes he is capable of playing that animation as he already does it when replacing the special_summon animation and its also in his animation list EDIT: tried your new script, it says "setalpha" is not a function or does not exist Link to comment Share on other sites More sharing options...
Recommended Posts