Larian Banner
Previous Thread
Next Thread
Print Thread
Joined: Sep 2017
J
JRavens Offline OP
journeyman
OP Offline
journeyman
J
Joined: Sep 2017
Hi All!

So I've created a variety of new status effects in my mod that give GMs more flexibility while playing - mostly new visual FX with no stat changes.

I am wondering though where animations are specified for statuses. For example a chilled character will shiver (playing the ABC_Status_Chilled animations)

I thought these might be in the visual effects themselves, but that doesn't seem to be the case... or I'm not understanding how to use the effects editor to correctly specify the effect (I tried making a version of barrel sneaking that removed the barrel, but it did nothing to a character when applied as a status effect - ie he did not "sneak" animate)

I see skills have various animations pre-casting and casting you can specify. That might be another option though much more fiddly...

Finally is there a way to trigger a script though a status effect? Maybe I could hook into animations that way by processing a script on a character that specifies an animation to play.

My ultimate goal is to get an easy to use "emote" feature for GMs via applying statuses to characters and NPCs. Choose the "Dancing" status effect and set duration to -1 and the character will loop dancing until the effect is removed and so on.

This is a fairly widely requested feature animating on the fly vs having to design an entire custom level in the Divinity Editor just to hand place animated characters. It works soooo much better for roleplaying if you can animate a character in real time to react to the player's choices which is why existing statuses like Knocked Down and Terrified are so useful.

Please help me achieve this effect somehow.

Thank you!

Last edited by JRavens; 14/10/17 01:25 PM.
Joined: Oct 2017
Location: Sweden
D
stranger
Offline
stranger
D
Joined: Oct 2017
Location: Sweden
You will need to set this via scripting. Use the CharacterStatusApplied event.

Refer to https://docs.larian.game/Standard_Character_Animations for animations.

Last edited by DeEz; 14/10/17 07:36 PM.
Joined: Oct 2017
A
stranger
Offline
stranger
A
Joined: Oct 2017
You can easily do this by making a new script in the story editor.
Here's a template.
=======================================
IF
CharacterStatusApplied(_Char,"STATUSNAME",_)
THEN
#for looping
CharacterSetAnimationOverride(_Char,"ANIMATIONNAME");
#for non-looping
PlayAnimation(_Char,"ANIMATIONNAME");
=======================================

You can find the list of animation names in Standard Character Animations and in _Global_CharacterAnimations inside story editor (make sure to check both places because not all animations can be found in one place).

For example:
DB_GLO_CharacterAnimation("PlayAnim_Loop_knockdown_loop","knockdown_loop",1);
You can get the animation name from the second string which is "knockdown_loop". As for the number I think it is for telling if it's a looping animation or not (1 for loop, 0 for not).
The animation name for dancing loop is for some reason "Dance_02_Loop" when the actual animation is called "Loop_Dance_01".
Also don't use incapacitated for your status type as it will override your animation with the "still" animation. Hope this help!

Joined: Sep 2017
J
JRavens Offline OP
journeyman
OP Offline
journeyman
J
Joined: Sep 2017
Thank you so much guys for the pointers and Au2942 your script seems to work perfectly!

This was my first time playing with the story editor or scripts (well beyond just looking at some of the default ones and experimenting)

This will be a huge benefit to GMs everywhere. Thank you so much. I'll be sure to credit your contribution. smile

EDIT - when a looping animation is applied the animation does not cease after the status expires (or is removed). Would it be too much trouble to ask for help in cleaning up the script so that an animation is canceled when a status is? Thank you so much! smile

Last edited by JRavens; 14/10/17 08:34 PM.
Joined: Oct 2017
A
stranger
Offline
stranger
A
Joined: Oct 2017
IF
CharacterStatusRemoved(_Char,"Status")
THEN
CharacterSetAnimationOverride(_Char,"")

This should do the trick.

Joined: Sep 2017
J
JRavens Offline OP
journeyman
OP Offline
journeyman
J
Joined: Sep 2017
Thanks again Au2942!

Took a little finagling as the editor didn't quite like the syntax, but I did get it working and this has been a very good learning experience

IF
CharacterStatusRemoved(_Char,"GMTK_EMOTE_BLACKSMITH",_)
THEN
CharacterSetAnimationOverride(_Char,"");

PS - Had to add the trailing ,_ on CharacterStatusRemoved and ; on the end of CharacterSetAnimationOverride to end the block. I've never scripted before so this was... interesting LOL.

PSS - For non-looping animations I made copies in my mod and added the looping flag. This seems to work pretty well though I'm sure there is probably a better way via CharacterPlayAnimation it seems from what I read that Tinkerer posted, but I couldn't suss it out. I assume CharacterPlayAnimation is handled through a script vs the story editor (or I just don't get it's syntax at all)

Joined: May 2017
enthusiast
Offline
enthusiast
Joined: May 2017
The trailing "_" is essentially providing the required parameter for a function, but ignoring the value. CharacterStatusRemoved arguments are Character, Status, and Causee. Causee is what potentially removed the status.

Osiris has an additional animation method - PlayAnimation(_Character, "AnimationName"). That will just play the animation once.


Moderated by  Larian_Koala, Larian_KVN 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5