E
EMm
Guest
So my game is a choose your own adventure style game where the player makes decisions and depending on those decisions they go to certain rooms. I'm trying to make it so theres a string which checks which decision you made and then adds it to an existing string, which then prints on an end screen to show which choices the player made. right now I have:
In the event the player presses the 1 key -
var roomName = room_get_name(room)
global.Choices = "You chose to:";
if roomName = "rm_j1" {
global.Choices += " Be diplomatic,"
}
if roomName = "rm_jw1" {
global.Choices += " Agree with the President"
}
which then prints in a seperate object.
However, the issue I'm having is the variable global.choices is not re setting to the new vaule of global.Choices and is just using the variable set at the top of the code.
I would like it to print:
"You chose to: Be diplomatic, Agree with the president"
But its only printing:
"You chose to: Agree with the President"
I was wondering if anyone could help me understand what is going wrong and how to add each string to the one initialized, without getting rid of the previous one.
In the event the player presses the 1 key -
var roomName = room_get_name(room)
global.Choices = "You chose to:";
if roomName = "rm_j1" {
global.Choices += " Be diplomatic,"
}
if roomName = "rm_jw1" {
global.Choices += " Agree with the President"
}
which then prints in a seperate object.
However, the issue I'm having is the variable global.choices is not re setting to the new vaule of global.Choices and is just using the variable set at the top of the code.
I would like it to print:
"You chose to: Be diplomatic, Agree with the president"
But its only printing:
"You chose to: Agree with the President"
I was wondering if anyone could help me understand what is going wrong and how to add each string to the one initialized, without getting rid of the previous one.