B
batmanai15
Guest
hello
I have the following code that I wrote. What it’s doing is assigning either room1 or Room2, randomly, to a variable room_. Then using an if statement bring the player to that room that was chosen.
What I want to do is remember what room was chosen so if the player back tracks they don’t get a new room assigned.
So not sure how to do that without re assigning the variable again.
I know I could create a new variable after room_ variable is assigned and have the new variable = room_. So I could call that in the beginning of the script. I just don’t know how to use the new variable instead of re assigning it.
var random_room = choose (Room1, Room2)
room_ = random_room;
if room_ == Room1
{
start_ = Room1Start;
global.from_room_GroupA = Room1;
global.from_start_GroupA = FromStart;
}
if room_ == Room2
{
start_ = Room2Start;
global.from_room_GroupA = Room2
global.from_start_GroupA = FromStart2;
}
I have the following code that I wrote. What it’s doing is assigning either room1 or Room2, randomly, to a variable room_. Then using an if statement bring the player to that room that was chosen.
What I want to do is remember what room was chosen so if the player back tracks they don’t get a new room assigned.
So not sure how to do that without re assigning the variable again.
I know I could create a new variable after room_ variable is assigned and have the new variable = room_. So I could call that in the beginning of the script. I just don’t know how to use the new variable instead of re assigning it.
var random_room = choose (Room1, Room2)
room_ = random_room;
if room_ == Room1
{
start_ = Room1Start;
global.from_room_GroupA = Room1;
global.from_start_GroupA = FromStart;
}
if room_ == Room2
{
start_ = Room2Start;
global.from_room_GroupA = Room2
global.from_start_GroupA = FromStart2;
}
Last edited by a moderator: