So I've painted myself into a bit of a corner here. I have an object on an object, specifically a wad of gum over the peephole on a door. My character has to ask an NPC to leave the room before the main character can interact with the door or the gum. (The character must 'talk to' or eat the gum to get it off the peephole. So I set a boolean at the beginning of the script for isgumondoor = true; so that when he chews it i can set that to false and have the gum permanently disappear. The problem I'm having is that when I close the door, the gum disappears and doesn't come back when I open it. I've tried everything and I just keep getting caught in a mental loop. It's driving me bonkers, please help!
Ps if the door is closed, the gum is outside the room and should not be visible
if the door is open the gum should be visible unless the main character has tripped the boolean by 'talking to' (or chewing) the gum.
Thanks guys
Code: ags
Ps if the door is closed, the gum is outside the room and should not be visible
if the door is open the gum should be visible unless the main character has tripped the boolean by 'talking to' (or chewing) the gum.
Thanks guys
function oGum_Look()
{
cBingo.Say("Looks like a wad of chewing gum covering the peephole.");
}
function oGum_Interact()
{
if ( cMackey.x<500) {
cBingo.Say("It's too sticky to grab with my fingers...");
}
else {
cBingo.Say("Mackey is blocking the door.");
}
}
function oOpenHotelDoor_Look()
{
cBingo.Say("It's the door to the victim's room.");
}
function oOpenHotelDoor_Interact()
{
if ( cMackey.x<500 ) {
cBingo.Walk(590, 450, eBlock, eWalkableAreas);
oOpenHotelDoor.Visible = false;
oClosedHotelDoor.Visible = true;
oGum.Visible = false;
}
else {
cBingo.FaceObject(oOpenHotelDoor);
cBingo.Say("Mackey is blocking the door.");
}
}
function hCSExit_Interact()
{
cBingo.Walk(569, 378, eBlock, eWalkableAreas);
cBingo.ChangeRoom(2,405,445 );
}
function hCSExit_Look()
{
cBingo.Say("It's the way back to the elevators.");
}
function oClosedHotelDoor_Interact()
{
if (isgumondoor == false) {
cBingo.Walk(590, 450, eBlock, eWalkableAreas);
oClosedHotelDoor.Visible = false;
oOpenHotelDoor.Visible = true;
oGum.Visible = false;
}
else {
cBingo.Walk(590, 450, eBlock, eWalkableAreas);
oClosedHotelDoor.Visible = false;
oOpenHotelDoor.Visible = true;
oGum.Visible = true;
}}
function oGum_Talk()
{
cBingo.Say("Gross, but ok. I'll chew it off.");
oGum.Visible = false;
isgumondoor = false;
cBingo.AddInventory(iGum);
}