[Solved] Cutscene sequencing variable

Started by Stranga, Sat 08/10/2016 13:51:02

Previous topic - Next topic

Stranga

Hello everyone!

This is my first time using AGS. I've programmed games n Game Maker Studio and want to try AGS because I've bee eyeing this off for so long.

My question is: Is there some sort of way to make a global numbering variable to sequence all cutscenes. For example if the variable is set to 0 on gamestart, each time a cutscene is finished the variable raises (from 0 - 1 then 1 - 2 e.c.t). The reason for this is I want to be able to control all my cutscenes and dialogues through this variable.

Example:
if (cutscene variable==1){  //Play cutscene
player.Say("Yadda yadda")
}else{
player.Say("ive already played that cutscene")

Sorry if I have confused anyone like I said i'm a noob at this.


Slasher

#1
I suppose you could make a variable Cutscene set to 0

and every time a cutscene ends you could add

Code: ags

Cutscene++; // add 1


so you could put your conditions (which could be put within a function depending what you want)
Code: ags

{
if (Cutscene==1){  //Play cutscene
player.Say("Yadda yadda");
} else if (Cutscene==2){  //Play cutscene
player.Say("ya ya ya");
}else{
player.Say("ive already played that cutscene");
}
}


Hope this helps

Stranga

Yes! It worked! Thank you very much this is perfect. Now I will be able to control every story sequence with these.   :smiley:

SMF spam blocked by CleanTalk