i have a problem with hotspots.
the thing is that i want my character to start in the room and the hotspot at the door to be disable but when he clicks a star play a video and the hotspot get enabled. ok everything fine .
the player is available to leave the room but when he enters the room again the hotspot it's disabled again .
How can i do to block the disable of the hotspot.
here's my code :
if ( event == eEventEnterRoomBeforeFadein)
{
hotspot[3].Enabled = false;
}
thanks!!!
if ((event == eEventEnterRoomBeforeFadein) && (player.previousroom != <Roomnumber>))
{
hotspot[3].Enabled = false;
}
YES ! Thank you so much!
it worked!
You should use the room's "first time enters room" event for that, not the on_event function. Without also checking the current room that code will disable hotspot #3 in almost every room.
After properly adding & linking the event, AGS will add the room_FirstLoad function to your room script, and you'll also be able to use the actual scriptname:
function room_FirstLoad()
{
hDoor.Enabled = false;
}
Using that event already takes care of the "player hasn't been in room previously" check.
Khris' solution is better indeed, I should have thought of that one.