Groundspeak Forums: Show zone when all other zones are inactive - Groundspeak Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Show zone when all other zones are inactive

#1 User is offline   Leaky Spoon 

  • Cache on and on and on
  • Group: +Premium Members
  • Posts: 88
  • Joined: 06-March 07

Posted 22 February 2011 - 04:05 PM

I'm creating a cart where all the zones start out as active. Upon leaving each one, they are then moved to inactive. I want the player to be able to go to any zone in any order, but when they get all the zones finished, I want it to show the final zone. Is this a command? How would that expression look? HELP! :)

I am using Urwigo, if it helps :)

This post has been edited by Leaky Spoon: 22 February 2011 - 04:31 PM


#2 User is offline   Tequila 

  • Premium Member
  • Group: +Premium Members
  • Posts: 2968
  • Joined: 17-June 01

Posted 22 February 2011 - 04:26 PM

There may be more elegant ways but I would set out an Active_Zone_Ctr, initialized to the number of active zones at the start.

As you exit each zone, and turn it inactive, decrement the counter by 1. Then do a test on the value of the counter. If it equals 0, you know all the zones have been visited.

#3 User is offline   Leaky Spoon 

  • Cache on and on and on
  • Group: +Premium Members
  • Posts: 88
  • Joined: 06-March 07

Posted 22 February 2011 - 04:38 PM

Thanks, Tequila. That does sound like it would work and I understood every single word you wrote...that said, I'm not sure where to put the Active_Zone_CTR and how to actually implement your suggestion. This building thing is a struggle and I've dumbed down my concept quite a bit :) I see the end in sight, but I'm getting more and more confused!

Can you explain where it would go?

#4 User is offline   Tequila 

  • Premium Member
  • Group: +Premium Members
  • Posts: 2968
  • Joined: 17-June 01

Posted 22 February 2011 - 04:48 PM

I would code as follows: (English, not LUA)

Set Zone1 to Inactive
Set Active_Zone_ctr = Active_Zone_Ctr - 1
If Active_Zone_Ctr = 0 then set Final_Zone to Active.

#5 User is offline   Leaky Spoon 

  • Cache on and on and on
  • Group: +Premium Members
  • Posts: 88
  • Joined: 06-March 07

Posted 22 February 2011 - 06:07 PM

Thanks. I'll give it a whirl :)

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic