Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Thu 21/04/2011 17:48:36

Title: SOLVED: Region set properties script - conditions
Post by: barefoot on Thu 21/04/2011 17:48:36
Hi

I know that Manually Set Region properties is something that may be implemented some time in the near future but i wonder if there is a present work-around for this scenario:

The player is sent back to an earlier room. In that earlier room is a region where events happen... when sent back I have to disable the region to stop events happening.  This all works fine...

I know about region[3].LightLevel = 40; but the region has to be on..

It would be nice if we could draw a region on top of another and disable/enable at will.

The bug bear is the lighting.... any thoughts / ideas?

cheers

barefoot




Title: Re: Region set properties... for returning back to room - properties (lighting)
Post by: barefoot on Thu 21/04/2011 18:30:21
Hi

To get around the problem I disabled the walkable area where the said region was when player returns.. Sneaked another region on the other walkable area where player never goes to unless he returns back to that room and it works fine this way..

barefoot


Title: Re: Region set properties... for returning back to room - properties (lighting)
Post by: monkey0506 on Thu 21/04/2011 22:04:03
You could simply set a room-wide variable.

// room script
bool firstLoad = false;

function room_Load()
{
  firstLoad = Game.DoOnceOnly("room1_FirstLoad");
}

function region1_WalksOnto()
{
  if (firstLoad)
  {
    // do some events
  }
  else
  {
    // do some other stuff
  }
}
Title: Re: Region set properties... for returning back to room - properties (lighting)
Post by: barefoot on Fri 22/04/2011 05:58:54
Cheers Monkey

It's done now but I'll try that at some point...and for the future..

many thanks

:=

barefoot
Title: Re: Region set properties... for returning back to room - properties (lighting)
Post by: barefoot on Fri 22/04/2011 06:48:15
Hi

would you believe it... I've just had to implement Monkey's script.. and yes, it works a treat... hip hooray..

cheers again monkey..

:=

barefoot