Jump to content

Any way to turn all Active zones to Inactive


Tequila

Recommended Posts

Is there an easy way to change the status of all currently active zones to inactive?

 

I am writing a cartridge where the player will be presented with a multiple choice question. Each possible answer requires the player to walk to a different zone. When they get to the correct zone, I want to turn the currently active zones inactive, present a new question with 3 new zones active.

 

I am looking for a simple way to do this without having to code a separate line for each zone.

 

Thx

Link to comment

This function sets all Zones to Active=false. I'm sure, Jan have a better way :( , but it should work.

 

function unsetZones()
 for k,v in pairs(CartridgeName.AllZObjects) do
if tostring(v) == "a Zone instance" then
  v.Active = false
end
 end
end

 

Best regards

Dirk (Charlenni)

Edited by charlenni
Link to comment

You did then add a call to unsetZones(), I hope?

 

Otherwise, paste the code which Dirk provided but without the first ("function...") and last ("end") lines.

 

I removed the function/end statements and it turned the zones inactive but it also crashed the cartridge in the Emulator.

Link to comment

Try putting all of Dirk's code in the Author Script section and just say "unsetZones()" in your event handler. That shouldn't make any difference, but it's less code each time and it stops anything weid happening if the code gets executed at compile time.

 

I also wonder how the emulator copes if you set the current zone inactive...

Link to comment

Try putting all of Dirk's code in the Author Script section and just say "unsetZones()" in your event handler. That shouldn't make any difference, but it's less code each time and it stops anything weid happening if the code gets executed at compile time.

 

I also wonder how the emulator copes if you set the current zone inactive...

 

Author Script blows up too. In this case, I used just the GS Builder and a text editor.

 

Setting current zone inactive happens all the time. That is how I do all my cartridges. Enter Zone 1, Display a message, De-activate Zone 1, Activate Zone 2 and move on.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...