PDA

View Full Version : Dialog scripting


Canderis
08-18-2009, 11:58 PM
TSL:

For this mod I am working on I want to talk to the a placable (I put a start dialog script in the onuse script slot in the placable's utp file) and then after the dialog is finished to spawn 3 npcs (working). After you kill them you talk to the placable again and it should play a new line. StarAdmiral gave me this script:
int StartingConditional() {
if( GetIsDead( GetObjectByTag( "n_dt" ) ) && GetIsDead( GetObjectByTag( "n_dn" ) ) && GetIsDead( GetObjectByTag( "n_ds" ) ) )
return TRUE;
return FALSE;
}

I have this compiled and put in the first conditional slot. But when I talk to the placable again after they are dead, the placable plays the first dialog option again. What can I do to fix this?

Nirran
08-19-2009, 01:00 AM
put this in the first dialog(one they are alive)

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

should be good

Nirran

Canderis
08-19-2009, 01:02 PM
put this in the first dialog(one they are alive)

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

should be good

Nirran


Conditional slot?

Nirran
08-19-2009, 02:02 PM
yea

Canderis
08-19-2009, 06:42 PM
Now the first node doesn't fire at all. Only the second one. On a side note Nirran, the script to add a bonus to my character works like a charm :D

Star Admiral
08-19-2009, 07:32 PM
The first dialog node should be the dialog that fires after the NPCs are dead. Use this script in the conditional slot:

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

Add SetLocalBoolean( OBJECT_SELF, 40, TRUE ); to the last line of the NPC spawning script.

- Star Admiral