Hi,
I have come across a situation that I am trying to overcome.
It involves going from location to location and returning to previous location (and x y - scripted).
Whilst the below code works fine there is a hurdle to overcome if you then go from 19 to 20 or 20 to 19 (after locating from a sewer room - there will are 5 +). PreviousRoom is not valid, nor is HasPlayerBeenInRoom.
So obviously I need a way to check Room you are in (19 or 20) and to always go back to the sewer room you were in last time if you then click the Sewer Location button.
Code: ags
Hope this is understandable and that you can help.
Thanks
I have come across a situation that I am trying to overcome.
It involves going from location to location and returning to previous location (and x y - scripted).
Whilst the below code works fine there is a hurdle to overcome if you then go from 19 to 20 or 20 to 19 (after locating from a sewer room - there will are 5 +). PreviousRoom is not valid, nor is HasPlayerBeenInRoom.
So obviously I need a way to check Room you are in (19 or 20) and to always go back to the sewer room you were in last time if you then click the Sewer Location button.
function Button75_OnClick(GUIControl *control, MouseButton button)
{
if(cCharles.PreviousRoom==21 && Button75.NormalGraphic==1861 && (cCharles.Room==19 || cCharles.Room==20)){
cCharles.Say("I think I'll go back to the old sewers.");
cCharles.ChangeRoom(21);
}
else if(cCharles.PreviousRoom==22 && Button75.NormalGraphic==1861 && (cCharles.Room==19 || cCharles.Room==20)){
cCharles.Say("I think I'll go back to the old sewers.");
cCharles.ChangeRoom(22);
}
else if(cCharles.PreviousRoom==23 && Button75.NormalGraphic==1861 && (cCharles.Room==19 || cCharles.Room==20)){
cCharles.Say("I think I'll go back to the old sewers.");
cCharles.ChangeRoom(23);
}
Hope this is understandable and that you can help.
Thanks