Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#630437 13/10/17 05:42 AM
Joined: Jun 2013
addict
OP Offline
addict
Joined: Jun 2013
I would like to destroy the corpses of slain creatures after a while. But what is a corpse ?
A new character ? A character with a status ? A container ? A ULO (Unknown Laying Object) ?
I tried to start a script timer onDie event of a character, so that after a while, that character dies, but it doesn't seem to work (while this works for living characters)

Any help appreciated, cheers, modders smile


Un chemin de 1000 lieues commence par un premier pas.

Project:
Steam workshop Frontiere
Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
A corpse is a character for which the Osiris API CharacterIsDead() returns true.

The behaviour scripts of dead characters stop executing, which is why your approach did not work.

If you want to do something with dead characters, you will have to do it from Osiris or possibly from a game script (throw an event in that OnDie handler that you catch in a gamescript, and implement your logic there).

Joined: Jan 2010
Location: USA
F
enthusiast
Offline
enthusiast
F
Joined: Jan 2010
Location: USA
Is there an event that catches when any creature dies?

(I am, of course, being lazy and could investigate this on my own, but please hold my hand...)

Joined: Jun 2013
addict
OP Offline
addict
Joined: Jun 2013
Yes, both in script (OnDie) and osiris (characterdied)

However, I don't get it? A corpse is still a character, although it is registered as dead. Why won't character specific scripts, like character destroy, work ?

Moreover, I see no API in Osiris to destroy a character, like there is in a script.


Un chemin de 1000 lieues commence par un premier pas.

Project:
Steam workshop Frontiere
Joined: Jun 2013
addict
OP Offline
addict
Joined: Jun 2013
Ok, fuck. I just spent the whole fucking afternoon, probably 4 or 5 hours, trying to remove a fucking corpse, either after looting it, or some times after death.
Fuck all this fucking shit.
fuck this osiris and scripting and whatever piece of fucking shit.

Cheers.


Un chemin de 1000 lieues commence par un premier pas.

Project:
Steam workshop Frontiere
Joined: Jun 2013
addict
OP Offline
addict
Joined: Jun 2013
Solved. Alleluiah !
So, this is the osiris part:
Code
IF
CharacterLootedCharacterCorpse(_Player,_Corpse)
AND
CharacterIsPlayer(_Player,1)
THEN
DB_CharacterCorpseToRemove(_Corpse);
UserSetFlag(_Corpse,"corpse_loot_interaction");
ProcObjectTimer((CHARACTERGUID)_Corpse,"delayUntildestroyCorpse",60000);


PROC
ProcObjectTimerFinished((CHARACTERGUID)_Corpse,"delayUntildestroyCorpse")
AND
DB_CharacterCorpseToRemove(_Corpse)
THEN
UserSetFlag((CHARACTERGUID)_Corpse,"remove_corpse");
NOT DB_CharacterCorpseToRemove(_Corpse);


And this is the script part, attached to the character:
Code
INIT
	CHARACTER:__Me
	
EVENTS
EVENT OnDeathStartTimer
ON
	OnCharacterFlagSet("remove_corpse",__Me)
ACTIONS	
	CharacterDestroy(__Me)


Cheers.

Last edited by Cromcrom; 13/10/17 08:13 PM.

Un chemin de 1000 lieues commence par un premier pas.

Project:
Steam workshop Frontiere

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