(Solved)How to determine if character changes to any room.

Started by FanOfHumor, Wed 30/03/2022 05:09:50

Previous topic - Next topic

FanOfHumor

I don't know if I've asked this before or not but whatever the case it still isn't solved.If I could make a condition that if the character changes the room I could save much time.Is there a way to have something like.
if(player.ChangeRoom==true)
{}
Now I know this doesn't work but is there anything similar that works?

Matti

You can check if the player enters or leaves a room in the on_event function in the global script.

Code: ags

function on_event(EventType event, int data) 
{
  if (event == eEventLeaveRoom) 
  {
    // do something 
  }
}



FanOfHumor

#2
Iv'e tried that but for some reason it doesn't always recognise if they leave.Sometimes it works but sometimes it doesn't until you enter the room again and leave.

Khris

If you've already tried something, please always show your code.

FanOfHumor

I don't have access to the code anymore.I'm just gonna assume that it's just something I did wrong.Thanks anyways.

SMF spam blocked by CleanTalk