I want the game to read some script when the room changes or is just activating the event room_beforefadein for all rooms.
I tried using callroomscript but that doesn't seem to read.I know that I could just paste this script to all rooms but I would rather take a shortcut if possible.The reason I have it this way is because I need the script to run before fade in.
function game_start()
{
//place character
if(CallRoomScript(eEventEnterRoomBeforeFadein))
{
if(player.Room==5)
{}
else
{
player.x=960;
player.y=1080;
}
}
}
I have also tried
if(player.ChangeRoom(player.Room, player.x, player.y))
{
if(player.Room==5)
{}
else
{
player.x=960;
player.y=1080;
}
}
Thanks in advance
If you want something to happen anytime any room is started, there's a "on_event" function (in global script):
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_Event.html#on_event
function on_event(EventType event, int data)
{
if (event == eEventEnterRoomBeforeFadein)
{
// do something
}
}
Thanks I'll do that.