Region conditions

Started by steptoe, Sat 24/12/2011 11:03:57

Previous topic - Next topic

steptoe

Hi

I have a region and I am trying to stop it activating except for lighting when first walking into the room. At the moment it obviously says the 'else' part because of conditions ( it could be worked around I suppose.)

I am certain there is a practical solution and I will keep looking.

I did try to make a bool but to no success.

I have so far:

Code: ags


function region3_WalksOnto()
{
 if (cFrankj.HasInventory(iKey) && cFrankj.View==3)
 {
   
   RestoreWalkableArea(2);
   cFrankj.FaceLocation(115, 160);
   cFrankj.Say("Now to find those evil basterds!");
   cFrankj.Walk(115, 195, eBlock);
   object[6].Visible=false;
   object[2].Visible=true; 
  
}
 else {
 
 cFrankj.Say("I'm sure I have useful things to help in here!");

 }

 }


All help appreciated

cheers




Khris

So you couldn't create the bool? Or did you fail at using it? I assume the latter.

Code: ags
function region3_WalksOnto()
{
  if (!region_activated) return;   // if not region_activated, exit the function

  if (cFrankj.HasInventory(iKey) && cFrankj.View==3)
  {
  ...


Create the bool with an initial value of false, then set it to true as soon as you want to activate the region event.

steptoe

Cheers Khris

Works a dream.

I understand about putting bools in better now.

Thank you

steptoe

EDIT: I'm not sure why region is ignored with keyboard movement after bool is set to true



SMF spam blocked by CleanTalk