Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#628097 08/10/17 08:15 AM
Joined: Oct 2017
A
Au2942 Offline OP
stranger
OP Offline
stranger
A
Joined: Oct 2017
I'm trying to create a custom status based on sleeping. The problem is that I don't know how to set the sleep animation while it's active and make it breakable by damage. I tried looking through Statuses.gameScript but couldn't find anything about the animation or damage. Could anyone tell me how to do the above or where I can find the related code?

Also are there any resources to learn more about scripting in divinity engine?

Joined: Sep 2017
Location: Finland
journeyman
Offline
journeyman
Joined: Sep 2017
Location: Finland
All you do here is copy the Sleeping status and change the name and/or make other changes to suit your needs. It'll have the animation and break on damage covered for you.

Joined: Oct 2017
A
Au2942 Offline OP
stranger
OP Offline
stranger
A
Joined: Oct 2017
I don't think I'm doing this correctly but I tried creating a copy in stats editor and what I got is the effect of sleeping(-100% dodging, can't move/cast) but no animation/break on damage (clear-minded and enraged too). Same thing with copy-pasting data from Status_INCAPACITATED.txt.

Joined: Oct 2017
A
Au2942 Offline OP
stranger
OP Offline
stranger
A
Joined: Oct 2017
This is what I came up with after a bit of research.

[quote]IF
CharacterStatusApplied(_Char,"RESTING",_)
THEN
CharacterSetAnimationOverride(_Char,"knockdown_loop");

IF
CharacterReceivedDamage(_Char)
AND
HasActiveStatus(_Char,"RESTING",1)
THEN
RemoveStatus(_Char,"RESTING");[/quote]

There are three problems with this.
1.Animation won't play until the status is over.
2.Misses break the status.
3.What is the name for Lie_Still_01 animation? I can't find it anywhere in _Global_CharacterAnimations.
Can anyone help me with these?

Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
There is no "SLEEPING" animation. SLEEPING puts "zzzzz" over the head of a character (= effect), but it does not make them lie down.

Regarding your questions:
1. Maybe try it on CharacterStatusAttempt? Although I'm not sure why an animation override would fail once the status has been applied
2. No idea why that would happen. I don't immediately see any script that would do this, and a cursory look at code only reveals the removal of the SLEEPING status if you are hit and the hit does more than 0 damage.
3. You cannot directly play this animation afaik. This animation is automatically used if a character gets the LYING status. However, this LYING status, just like the SITTING status, is not a status you can/should apply directly. Instead, they are tied to using items with a Sit/Lie action tied to them and sockets to which the characters can be attach (like beds and chairs).

Joined: Oct 2017
A
Au2942 Offline OP
stranger
OP Offline
stranger
A
Joined: Oct 2017
Thanks for the answer Tinkerer.
The sleeping animation I was talking about is the "stilldrunk" animation that plays when you have the SLEEPING status.
Now as for update on my custom status.
1. I found out that using an incapacitated type status override my animation with the "still" animation.
2. Still no idea why CharacterReceievedDamage would trigger on misses. Could you tell me where I can find the SLEEPING removal code?

Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
The SLEEPING removal happens in code, as in "C++ engine code". It's not in script, so you cannot look at it.


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