[solved] can the player "die" when a certain dialog option is toggled?

Started by pier, Fri 15/05/2020 16:46:17

Previous topic - Next topic

pier

Hi! And pardon me once again if i ask silly or stupid question. This time i don't know if it's even possible...
In a dialog, i wanted the player to choose an option that will led him to "death" switching is position to a game over room
is this possible?
I tried...but with poor results
Code: ags

function cdio_Talk()
{
dDialog2.Start();
if (player.dDialog2 option is @4){
  player.ChangeRoom (9,  415,  245);
}
}


this is the idea, obviously it doesen't work... 

Slasher

Put an option inside dialog options  (dDialog2)  that when selected changes player to Game Over room..

Khris

1. Remove lines 4 - 6 of that snippet
2. Open the dialog script for dDialog2
3. Find entry point @4 in the dialog script
4. add this (note that the regular script command has to be indented by at least one space):
Code: ags
  player.ChangeRoom (9,  415,  245);
stop

pier

thank you! It was very easy indeed. Sorry for the stupid question  :tongue:

Khris

Not stupid at all; before we were able to put script commands in a dialog script, what one had to do was in fact very similar to what you attempted :)

SMF spam blocked by CleanTalk