Difference between revisions of "Cabal Common Library Doc OXPStrength"
m (added deprecated marks) |
m (preparation for v1.7.1 - part I) |
||
Line 7: | Line 7: | ||
* accuracy (v1.7.1) |
* accuracy (v1.7.1) |
||
− | * |
+ | * Distance to the hotspots (MainStation,WP and lanes WP,WS,PS) |
− | * |
+ | * Equipment |
* escorts / defense ships |
* escorts / defense ships |
||
− | * |
+ | * Laser |
* mass (v1.7.1) |
* mass (v1.7.1) |
||
* maxEnergy |
* maxEnergy |
||
Line 18: | Line 18: | ||
* primaryRole |
* primaryRole |
||
* shieldRechargeRates |
* shieldRechargeRates |
||
− | * |
+ | * Subent laser |
* turrets |
* turrets |
||
− | The script can set a missionVariable to be used for strong entities. <sup>Deprecated in favour of condition scripts.</sup> |
||
+ | |||
− | {{CodeEx|codeex=missionVariables.CCL_OXPStrength}} |
||
+ | == Functions == |
||
− | Main purpose is to prevent the spawning by the populator. These entities can define conditions in <tt>shipdata.plist</tt>. Default is 9. Suggested classes: |
||
+ | === checkPower() === |
||
+ | {{CodeEx|codeex=worldScripts.Cabal_Common_OXPStrength.checkOXPStrength.checkPower(entity,logging); }} |
||
+ | Checks entities and returns the gathered coefficient. |
||
+ | |||
+ | For NPCs the standard range is 0..192, but OXP entities can have a lot higher value based on their settings. |
||
+ | Playerships are treated different and are getting higher values. A standard Cobra MkIII has a value of 86 in the beginning and gets up to 293 if fully equipped with standard weaponry, missiles and other equipment. The Boa Class Cruiser even gets 304. |
||
+ | |||
+ | '''Parameters:''' |
||
+ | :;entity:Entity. If specified only this entity will be checked, otherwise all entities in the system (except the player). |
||
+ | :: Optional. |
||
+ | :;logging:Boolean. If true a verbose lits will be logged to Latest.log. |
||
+ | ::Optional. |
||
+ | |||
+ | '''Returns:''' |
||
+ | :;coef:Number. Calculated coefficient. |
||
+ | ::If entity was specified the value for this specific entity, otherwise the highest gathered coefficient in the system. |
||
+ | |||
+ | |||
+ | == Properties == |
||
+ | === CCL_OXPStrength === |
||
+ | The script can set a property to be used for strong entities. |
||
+ | {{CodeEx|codeex=worldScripts.Cabal_Common_OXPStrength.CCL_OXPStrength = 5;}} |
||
+ | Main purpose is to prevent the spawning by the populator. OXPs can use it in condition scripts. Default is 9. |
||
+ | |||
+ | Suggested classes: |
||
* 1 = coef < 100 |
* 1 = coef < 100 |
||
Line 34: | Line 58: | ||
* 8 = coef < 1000 |
* 8 = coef < 1000 |
||
* 9 = otherwise, default. |
* 9 = otherwise, default. |
||
− | {{CodeEx|codeex=conditions = ("mission_CCL_OXPStrength greaterthan 3"); }} |
||
− | Starting with v1.7.1 this is replaced by a property |
||
− | {{CodeEx|codeex=worldScripts.Cabal_Common_OXPStrength.CCL_OXPStrength}} |
||
− | Missionships should use a script_info key that excludes the entity from cleaning to avoid breaking other missions. <sup>Deprecated.</sup> |
||
+ | == scriptInfo == |
||
+ | === ccl_missionShip === |
||
+ | Missionships can also use a script_info key to indicate that this entity has to be handled with care by other scripts. |
||
{{CodeEx|codeex=script_info = {ccl_missionShip = true;} }} |
{{CodeEx|codeex=script_info = {ccl_missionShip = true;} }} |
||
− | |||
− | Additionally a property with the same effect can be set for a specific entity. <sup>Deprecated.</sup> |
||
− | {{CodeEx|codeex=this.ccl_missionShip = true; }} |
||
− | |||
− | |||
− | A third way is to exclude names of entities. This must be done in your own startUp. <sup>Deprecated. Cleaning is removed in v1.7.1.</sup> |
||
− | {{CodeEx|codeex=worldScripts.Cabal_Common_OXPStrength.ccl_strengthExclEntByName.push("name1"); }} |
||
− | |||
− | |||
− | == Functions == |
||
− | === checkPower() === |
||
− | {{CodeEx|codeex=worldScripts.Cabal_Common_OXPStrength.checkOXPStrength.checkPower(entity); }} |
||
− | Checks the specified entity and returns the gathered coefficient. |
||
− | |||
− | For NPCs the standard range is <100 (except some Vipers), but OXP entities can have a lot higher value based on their settings. |
||
− | Playerships are treated different and are getting higher values. A standard Cobra MkIII has a value of 86 in the beginning and gets up to 293 if fully equipped with standard weaponry, missiles and other equipment. The Boa Class Cruiser even gets 304. |
||
− | |||
− | '''Parameters:''' |
||
− | :;entity:Entity. |
||
− | |||
− | '''Returns:''' |
||
− | :;coef:Number. Calculated sum. |
||
− | |||
− | |||
− | === registerLocation() === |
||
− | {{CodeEx|codeex=worldScripts.Cabal_Common_OXPStrength.registerLocation(obj); }} |
||
− | Scripts can specify systems where logging should happen. Only one object with a few properties has to be passed. |
||
− | |||
− | '''Properties of obj:''' |
||
− | :;CSS:String. Required. worldScriptname. |
||
− | :;CSP:String. Required. Propertyname to be checked. If true start logging. |
||
− | :;Gal:Number. Required. Galaxy. |
||
− | :;ID:Number. Required. System ID. |
||
− | :;ISS:Boolean. Required. Interstellar (if used activation on leaving ID && misjump). |
||
− | :;GJump:Array. galacticHyperspaceFixedCoordsInLY for galactic jumps, e.g. [6.4,51,0]. |
||
− | :;Strength:Number. Strength for missionVariables.CCL_OXPStrength. <sup>Deprecated.</sup> |
||
− | :;checkC:Number. Threshold for logging. |
||
− | :;checkK:Number. Threshold for cleaning. The script checks the distance to the player and used handlers. <sup>Deprecated.</sup> |
||
− | :;delay:Number. Timer delay for logging. |
||
− | :;locate:Number. Only for hotspot 0=all, 1=MainStation, 2=WP, 3=LaneWP, 4=LaneWS, 5=LanePS. |
||
− | :;repeat:Number. Repeat logging n times. |
||
− | :;logging:Boolean. Log actions. <sup>Deprecated.</sup> |
||
− | :;Permanent:Boolean. Flag to keep the entry. If player leaves the specified system and Permanent is not set, the entry will be deleted. |
||
− | :;Suspend:Array. Names of worldScripts to be suspended. Following Oktis approach, e.g. ["OXPA","OXPB"]. <sup>Deprecated - unused by OXPs.</sup> |
||
---- |
---- |
||
− | |||
[[Category:OXPDoc]] |
[[Category:OXPDoc]] |
Revision as of 23:55, 4 February 2013
Contents
Overview
This is the main class for the OXPStrength with its members and part of the Cabal_Common_Library.
It is a helper tool specially for mission OXPs to check the environment and helps to determine the players strength.
The underlaying API calculates a checksum (coef) for entities. This checksum can be gathered by scripts for specific entities (Player and NPCs). Factors are:
- accuracy (v1.7.1)
- Distance to the hotspots (MainStation,WP and lanes WP,WS,PS)
- Equipment
- escorts / defense ships
- Laser
- mass (v1.7.1)
- maxEnergy
- maxSpeed
- maxThrust
- missiles
- primaryRole
- shieldRechargeRates
- Subent laser
- turrets
Functions
checkPower()
worldScripts.Cabal_Common_OXPStrength.checkOXPStrength.checkPower(entity,logging); |
Checks entities and returns the gathered coefficient.
For NPCs the standard range is 0..192, but OXP entities can have a lot higher value based on their settings. Playerships are treated different and are getting higher values. A standard Cobra MkIII has a value of 86 in the beginning and gets up to 293 if fully equipped with standard weaponry, missiles and other equipment. The Boa Class Cruiser even gets 304.
Parameters:
- entity
- Entity. If specified only this entity will be checked, otherwise all entities in the system (except the player).
- Optional.
- logging
- Boolean. If true a verbose lits will be logged to Latest.log.
- Optional.
Returns:
- coef
- Number. Calculated coefficient.
- If entity was specified the value for this specific entity, otherwise the highest gathered coefficient in the system.
Properties
CCL_OXPStrength
The script can set a property to be used for strong entities.
worldScripts.Cabal_Common_OXPStrength.CCL_OXPStrength = 5; |
Main purpose is to prevent the spawning by the populator. OXPs can use it in condition scripts. Default is 9.
Suggested classes:
- 1 = coef < 100
- 2 = coef < 120
- 3 = coef < 150
- 4 = coef < 180
- 5 = coef < 200
- 6 = coef < 300
- 7 = coef < 500
- 8 = coef < 1000
- 9 = otherwise, default.
scriptInfo
ccl_missionShip
Missionships can also use a script_info key to indicate that this entity has to be handled with care by other scripts.
script_info = {ccl_missionShip = true;} |