Jump to content

Zones, distance range, and rthe OnDistant event


twolpert

Recommended Posts

The zone screen (Base Information tab) has an item labeled Distance Range. This translates into the DistanceRange property of the zone in Lua. The tooltips for this item imply that the OnDistant event fires when the player comes within Distance Range of the zone. This is consistent with the description of the event handler script, which reads "When the player is within distance to a zone."

 

To me, this implies that Distance Range behaves like a larger proximity range. I have this mental picture of concentric shapes: the zone, the proximity range, and the distance range. Entering the shapes from outside in would trigger the OnDistant event, then the OnProximity event, then the OnEnter event. (Although there's probably no reason why distance range must be larger than proximity range.)

 

Then I looked at the Lua code for the tutorial cartridge. I was looking for the code which detects the fact that the player is "far enough" (50 m) from the landing zone. This logic is in the OnDistant event for the landing zone. The landing zone has DistanceRange set to -1. It has ProximityRange set to 30m, which (according to the comments), when added to the zone radius, is equal to 50m.

 

This leads me to believe that Distance Range has nothing to do with the OnDistant event. And that OnDistant actually fires when the user exits the proximity range (similar to the OnExit event for the zone).

 

Does anybody know which of these models (if either) is correct?

 

If OnDistant is really analogous to OnExit, then what is DistanceRange really for? Just to control visibility of the zone in the distance list?

 

Tom

Edited by twolpert
Link to comment

The distance range does work as you've described below. The distance range and trigger can act as an early warning system for the author. If the distance range is for example, 1500 feet, when the player gets within that distance to a zone, the ondistant triggers and the author can than have a message pop up or move an item to a zone etc. The zone will not show in the locations list until the distance range has been met or if the distance range is -1, the zone will always show in the locations list. Setting a distance range to -1 will always cause the zone to show up in the locations list.

 

Next is the Proximity. The proximity is just a closer distance and alows the author to trigger yet more actions when the player is within proximity to the zone. Also, objects in the zone will be shown in the you see list if you've specified that you want to show objects when OnProximity to a zone.

 

Next is the Enter. This is the trigger that finally specifies that the player is inside a zone. So, if you create a zone that is too small, you could possibly never get an OnEnter. Same as above, you can specify that objects in the zone show in the you see list only when the player enters a zone.

 

Once the player has entered a zone, the player can now exit a zone. The same trigger mechanisms come into play for the exit.

 

For example:

 

You can create a radar type cartridge where you can trigger sounds when the player gets within distance to a zone. Then, when the player gets within proximity to a zone (closer to the zone), you can trigger a sound and a message guding them to come closer. Then, when the player enters a zone, you can move an object to the zone and reveal it to the player. If the player exits the zone, say without solving a puzzle, you can remove these items from view and show a message to the player that they need to re-enter the zone and try again.

 

David.

Edited by davidloew
Link to comment

OK, figured this out by experimenting with the emulator. Apparently, the OnDistant and OnProximity events fire when the band is entered from either direction. In other words, as the player moves toward and into the zone, these events fire:

 

OnDistant

OnProximity

OnEnter

 

As the player leaves and moves away from the zone, these events fire:

 

OnExit

OnProximity

OnDistant

 

Tom

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...