HS-TERRITORIES
From HSpace
What is a territory? A territory is some piece of space, defined by specified boundaries.
HSpace models space territories through one of two ways. These are radial and cubic territories. A radial territory defines a center of the territory and a radius to which the boundaries extend from that center. A cubic territory defines a minimum and maximum set of 3D coordinates (6 coordinates in all) that define a cube in space.
When a ship travels, HSpace looks through the territories in the game to determine which territory the ship is in. If the ship enters or leaves a territory, a message is displayed to the console users on the ship. Further, HSpace triggers an attribute on the game object representing the territory, which can be useful for softcoding border alerts, welcome messages, etc.
Territory Construction
Setting up a territory is much like setting up any other object in HSpace. You first need to create a game object to represent your territory. Perform the following steps for a radial territory:
- @create My Territory
- @space/addterritory My Territory=0 (0 radial .. 1 for cubic).
- @space/set My Territory/uid=0 (Specify UID # for your universe) (@space/list universes will give you UID)
- @space/set My Territory/cx=0
- @space/set My Territory/cy=0
- @space/set My Territory/cz=0
- @space/set My Territory/radius=1000
There you go! You now have a radial territory with its center at 0,0,0 and a radius of 1000 units.
If set on the territory game object, the ENTER and LEAVE (@enter, @leave) messages are displayed to console users as ship s enters or exits a territory. Likewise the AENTER and ALEAVE attributes are likewise triggered to execute user defined code as the boundary is crossed. Due to the mechanism used to model ship motion, the attributes may be appear to be triggered well after a rapidly moving ship as crossed the territory boundary.
Territory Attributes
The following territories have the following attributes that can be set or retrieved using @space/set.
- Radial::
- CX: The central X coordinate.
- CY: The central Y coordinate.
- CZ: The central Z coordinate.
- RADIUS: The radius of the territory boundaries.
- UID: The universe ID of the territory.
- CUBIC:
- MINX: Minimum X coordinate of the boundaries.
- MINY: Minimum Y coordinate of the boundaries.
- MINZ: Minimum Z coordinate of the boundaries.
- MAXX: Maximum X coordinate of the boundaries.
- MAXY: Maximum Y coordinate of the boundaries.
- MAXZ: Maximum Z coordinate of the boundaries.
- UID : The universe ID of the territory.
See Also: TERRITORY-SETUP, TERRITORY-ATTRS, @space/addterritory, @space/delterritory
