Difference between revisions of "Station Validator"
(→Stations supporting) |
Cholmondely (talk | contribs) (Added Links, minor tweaks) |
||
Line 1: | Line 1: | ||
==Overview== |
==Overview== |
||
− | In the core game, when a station is destroyed, it magically resurrects after save/load or witchjump. This oxp |
+ | In the core game, when a station is destroyed, it magically resurrects after save/load or witchjump. This oxp aims to change 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== |
==In detail== |
||
For oxp creators this oxp has two uses |
For oxp creators this oxp has two uses |
||
− | |||
+ | :1. Hold the spawning of a destroyed station until it has been rebuild. |
||
− | 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 |
||
− | 2. Create a set of unfinished station models and let it show that the station is being rebuilt |
||
===Usage=== |
===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. |
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. |
||
Line 17: | Line 15: | ||
1. There is only one station with "your_station_role" in system |
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. |
||
− | 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 |
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 |
||
− | Call worldScripts.station_validator.$deathTime("your_station_role", rebuildTime), iterate through the array and act accordingly |
||
3. Show station in it's construction phase |
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. |
||
− | 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. |
||
− | |||
− | 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== |
==Stations supporting== |
||
Line 40: | Line 34: | ||
==Download== |
==Download== |
||
− | |||
* Download version 1.0 from [https://app.box.com/s/9108ivpmxn26tzkkvqvi the box]. |
* Download version 1.0 from [https://app.box.com/s/9108ivpmxn26tzkkvqvi the box]. |
||
Line 55: | Line 48: | ||
{{misc-OXP}} |
{{misc-OXP}} |
||
+ | [[Category:Oolite stations| ]] |
Revision as of 10:06, 3 May 2021
Overview
In the core game, when a station is destroyed, it magically resurrects after save/load or witchjump. This oxp aims to change 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
- Download version 1.0 from the box.
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 |