SOLVED: Region set properties script - conditions

Started by barefoot, Thu 21/04/2011 17:48:36

Previous topic - Next topic

barefoot

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




I May Not Be Perfect but I Have A Big Heart ..

barefoot

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


I May Not Be Perfect but I Have A Big Heart ..

monkey0506

You could simply set a room-wide variable.

Code: ags
// 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
  }
}

barefoot

Cheers Monkey

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

many thanks

:=

barefoot
I May Not Be Perfect but I Have A Big Heart ..

barefoot

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
I May Not Be Perfect but I Have A Big Heart ..

SMF spam blocked by CleanTalk