PDA

View Full Version : If dead conditional


Canderis
08-05-2009, 08:31 PM
I need a script that checks if certain NPC's are dead. This is for a dialog so it should be for determining when new dialog becomes available. I need it for 3 npc's.
n_dt
n_dn
n_ds
Also I need a script that spawns an npc when another one is dead.

Star Admiral
08-05-2009, 11:15 PM
I assume it means the script returns true only when all three NPCs are dead.

int StartingConditional() {
if( GetIsDead( GetObjectByTag( "n_dt" ) ) && GetIsDead( GetObjectByTag( "n_dn" ) ) && GetIsDead( GetObjectByTag( "n_ds" ) ) )
return TRUE;
return FALSE;
}

For the spawning script:

void main() {
if( GetIsDead( GetObjectByTag( "NPCToCheck" ) ) )
CreateObject( OBJECT_TYPE_CREATURE, "NPCToSpawn", Location( Vector( 0.0, 0.0, 0.0 ), 0.0 ) );
}

- Star Admiral

Canderis
08-05-2009, 11:39 PM
Wow. I am so dumb. I forgot like 3 letters in the 2nd one lol. Thanks!!!