Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Sep 2016
journeyman
OP Offline
journeyman
Joined: Sep 2016
So for reasons I won't go into I had to create a new version of the status SLEEPING for a mod of mine. I created a custom status called OVR_SLEEPING in the stats editor with all the same information as the original. Works just fine when it's slotted into the chloroform skill, except for the sleeping animation is no longer tied to it.

Now, I know this looping animation is called "stilldrunk". I can't seem to find out how SLEEPING triggers it, but I have been able to script my own trigger, with mixed results.

I've gotten the animation to play using both of these methods, added to Base.charScript:

Quote
REACTION SleepAnimation, 1000
USAGE ALL
CHECK "c1"
CharacterHasStatus(__Me,OVR_SLEEPING)
ACTIONS
CharacterSetAnimationOverride(__Me,"stilldrunk")

Quote
EVENT SleepAnimation
ON
OnCharacterStatusApplied(__Me,OVR_SLEEPING)
ACTIONS
CharacterSetAnimationOverride(__Me,"stilldrunk")

In each case, oddly enough, the animation loop triggers only after the status has passed. It's as if the status has its own 'empty' animation override that takes precedent.

Can anyone lay some knowledge on me? Either about how I could find my way around this scripting problem or connect my custom status to whatever operation connects SLEEPING to "stilldrunk" in the first place?

Joined: Nov 2017
Location: Ukraine
apprentice
Offline
apprentice
Joined: Nov 2017
Location: Ukraine
Sounds like there is some more scripting attached to the sleeping behaviour.

First thing I'd try is to rename everything you use (skills, statuses, etc.), to make sure the whole thing is made from scratch.
Just to be sure it triggers and touches nothing from base game.
*Unfortunately, it is ussualy the best way to tweak scripted stuff - make smth similar from the very beggining..

Another thing you could try - to "cancel" animation, before applying "stilldrunk".
As wiki says, it is not officialy supported, but devs use this trick alot. Using empty name "" will cancel current animation.

CharacterSetAnimationOverride(__Me,"")

Last edited by Module 003; 11/02/18 11:47 PM.
Joined: Sep 2016
journeyman
OP Offline
journeyman
Joined: Sep 2016
Thanks for the tips! Still getting the same problem though.

Joined: Sep 2017
Location: Belgium, Ghent
addict
Offline
addict
Joined: Sep 2017
Location: Belgium, Ghent
Hey smarmbot,

you're right on the stilldrunk animation.
However, due to how the animation states operate, the looping animation on characters are provided by a code-side check. It checks on the status name and defaults to the default still for all not provided cases in a way similar to this:

Code
If(character has status <status_name> And animation exists for <loop_name of status_name>)
   return loop_name;
... other cases

return default "still";


Hence a custom status name will eventually get your character dropped in the still animation state while the status is in effect. Our apologies for the inconvenience.

Sincerely,
Kevin

Last edited by Larian_KVN; 16/02/18 11:00 AM.

CTRL+K the elf

Moderated by  Larian_KVN 

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