I've not been using AGS long so forgive me if this is a naive question... I have searched high and low for the answer but can't find it so here goes:
I want to program the game so that when my player leaves the room, one of two outcomes will occur depending on whether he has visited another room. Simple enough, and the script I wrote looks like this:
function room_LeaveBottom()
{
if(HasPlayerBeenInRoom(4) ==0)
cChar1.Say("I should check my emails first.");
cChar1.Walk(69, 132);
if(HasPlayerBeenInRoom(4) ==1)
cChar1.ChangeRoom(1, 1000);
}
So if the player has visited room 4, he will change room, if he hasn't, it will display the dialog and move him to another location in the same room. Only problem being that when I run the game, he keeps repeating the same line of dialog over and over unto infinity. Why is this happening and what do I need to change? I'm aware that this is probably a really simple question but I'd really appreciate some help!
Thank you.
I want to program the game so that when my player leaves the room, one of two outcomes will occur depending on whether he has visited another room. Simple enough, and the script I wrote looks like this:
function room_LeaveBottom()
{
if(HasPlayerBeenInRoom(4) ==0)
cChar1.Say("I should check my emails first.");
cChar1.Walk(69, 132);
if(HasPlayerBeenInRoom(4) ==1)
cChar1.ChangeRoom(1, 1000);
}
So if the player has visited room 4, he will change room, if he hasn't, it will display the dialog and move him to another location in the same room. Only problem being that when I run the game, he keeps repeating the same line of dialog over and over unto infinity. Why is this happening and what do I need to change? I'm aware that this is probably a really simple question but I'd really appreciate some help!
Thank you.