Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Eleri on Fri 20/05/2011 02:34:08

Title: Cut scene triggered by puzzle
Post by: Eleri on Fri 20/05/2011 02:34:08
Have been having a bit of trouble finding the proper code for this set up:

Player is in puzzle screen- if they solve puzzle correctly, they get cut scene A, if they don't, they get cut scene B

I'm unsure of the variable you'd use to pick one cut scene or the other based on the player actions.



Title: Re: Cut scene triggered by puzzle
Post by: Khris on Fri 20/05/2011 02:47:25
Since it's A or B, a bool is all you need.
Create one via the Global variables pane, e.g. "puzzle_solved", initial value "false".

If they solve it, call:

  puzzle_solved = true;

Then go to the next room, and in before/after fadein, check it:

  if (puzzle_solved) {
    scene A
  }
  else {
    scene B
  }
Title: Re: Cut scene triggered by puzzle
Post by: Eleri on Fri 27/05/2011 16:16:51
ahha! thank you Khris :)