Larian Studios
Posted By: Meldexun Applying invisibility on kill - 22/06/19 09:47 PM
Hi there,
So i have created a character script which should apply invisibility for 1 round when killing an enemy. But the problem is that after a kill invisibility is applied but it is removed instantly again.
That is what i tried:
Code
EVENT OnKillEvent
ON
	OnDie(_, _, __Me, _)
ACTIONS
	CharacterApplyStatus(__Me, INVISIBLE, 1)

Any suggestions?
Posted By: Tinkerer Re: Applying invisibility on kill - 11/07/19 10:57 AM
The INVISIBLE status gets removed by code from characters when they hit something. My guess is that this "did they hit something" check happens after applying the damage that triggers the Dying event for the hit character (which is what "OnDie" reacts to). The same holds for the Osiris CharacterKilledBy event. I think you'll have to cache the information about who killed the character, and then only apply the invisible status when the Osiris "CharacterDied" event arrives. I don't think there is an equivalent in behaviour script.
Posted By: Meldexun Re: Applying invisibility on kill - 14/07/19 07:20 PM
I had kind of the same thoughts. I will see what i can do in the future. Still thank you.
© Larian Studios forums