Station Validator

From Elite Wiki
Revision as of 12:13, 12 September 2017 by Phkb (talk | contribs) (Stations supporting)

Overview

In the core game, when a station is destroyed, it magically resurrects after save/load or witchjump. This oxp aim's to make a change to that. When a stationary station is destroyed, this oxp stores it's primary role, the system it died in, the place it died at and the time it died. When that destroyed station is to be spawned next, it can query this oxp, if there has been any destructions of that kind of stations in the current system. Then it's up to the station oxp to decide whether to spawn or not.

In detail

For oxp creators this oxp has two uses

1. Hold the spawning of a destroyed station until it has been rebuild. 2. Create a set of unfinished station models and let it show that the station is being rebuilt

Usage

Call worldScripts.station_validator.$deathTime("your_station_role", rebuildTime) and you'll receive an array of objects. Each object is a death of "your_station_role"-station that has not met the rebuildTime yet in the current system . Each object has two properties: time (integer) and place (Vector3D). RebuildTime parameter is optional and defaults to 30.

Scenarios:

1. There is only one station with "your_station_role" in system

Call worldScripts.station_validator.$deathTime("your_station_role", rebuildTime) and check the array's length. If it's 0, then the station can be built.

2. There are multiple station with "your_station_role" in system

Call worldScripts.station_validator.$deathTime("your_station_role", rebuildTime), iterate through the array and act accordingly

3. Show station in it's construction phase

Call worldScripts.station_validator.$deathTime("your_station_role", rebuildTime) and find the station from the list. Use time-property to decide which phase to show and spawn the unfinished model to the position of the place property.

If the unfinished construct is destroyed, the deathTime of the original station should be resetted. For that construct must have "construct" in it's roles and there must be constructRole = "role_of_the_station_to_be_built" in it's script_info.

Stations supporting

  • SothisTC
  • RandomHits 1.5.3 ->
  • AstroFactory 2.0
  • Stations for Extra Planets
  • Rescue Stations 1.3
  • Free Trade Zone

Download

Quick Facts

Version Released License Features Category Author(s) Feedback
1.0 2014-01-028 CC BY-NC-SA 3.0 Misc Misc OXPs‏‎ Spara Oolite BB