Difference between revisions of "Cabal Common Library Doc OXPStrength"
m (→Overview) |
m (Preparation for v1.6) |
||
Line 4: | Line 4: | ||
It is a helper tool specially for mission OXPs to control the environment and helps to determine the players strength. |
It is a helper tool specially for mission OXPs to control 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). |
+ | The underlaying API calculates a checksum (coef) for entities. This checksum can be gathered by scripts for specific entities (Player and NPCs). Factors are: |
− | The script can set a missionVariable to be used for strong entities. Main purpose is to prevent the spawning by the populator. These entities can define conditions in shipdata.plist. 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=<1000, 9=otherwise, default. |
||
+ | * maxEnergy |
||
+ | * maxSpeed |
||
+ | * maxThrust |
||
+ | * shieldRechargeRates |
||
+ | * laser |
||
+ | * turrets |
||
+ | * subent laser |
||
+ | * missiles |
||
+ | * escorts/defense ships |
||
+ | * primaryRole |
||
+ | * distance to the hotspots (MainStation,WP and lanes WP,WS,PS) |
||
+ | * EQs |
||
+ | |||
+ | The script can set a missionVariable to be used for strong entities. |
||
+ | {{CodeEx|codeex=missionVariables.CCL_OXPStrength}} |
||
+ | Main purpose is to prevent the spawning by the populator. These entities can define conditions in shipdata.plist. 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. |
||
{{CodeEx|codeex=conditions = ("mission_CCL_OXPStrength greaterthan 3"); }} |
{{CodeEx|codeex=conditions = ("mission_CCL_OXPStrength greaterthan 3"); }} |
||
Line 20: | Line 45: | ||
A third way is to exclude names of entities. This must be done in your own startUp |
A third way is to exclude names of entities. This must be done in your own startUp |
||
{{CodeEx|codeex=worldScripts.Cabal_Common_OXPStrength.ccl_strengthExclEntByName.push("name1"); }} |
{{CodeEx|codeex=worldScripts.Cabal_Common_OXPStrength.ccl_strengthExclEntByName.push("name1"); }} |
||
+ | |||
== Functions == |
== Functions == |
||
Line 34: | Line 60: | ||
'''Returns:''' |
'''Returns:''' |
||
:;coef:Number. Calculated sum. |
:;coef:Number. Calculated sum. |
||
+ | |||
=== registerLocation() === |
=== registerLocation() === |
||
Line 40: | Line 67: | ||
'''Properties of obj:''' |
'''Properties of obj:''' |
||
− | :;CSS:String. Required. |
+ | :;CSS:String. Required. worldScriptname. |
:;CSP:String. Required. Propertyname to be checked. If true start cleaning. |
:;CSP:String. Required. Propertyname to be checked. If true start cleaning. |
||
:;Gal:Number. Required. Galaxy. |
:;Gal:Number. Required. Galaxy. |
||
Line 46: | Line 73: | ||
:;ISS:Boolean. Required. Interstellar (if used activation on leaving ID && misjump). |
:;ISS:Boolean. Required. Interstellar (if used activation on leaving ID && misjump). |
||
:;GJump:Array. galacticHyperspaceFixedCoordsInLY for galactic jumps, e.g. [6.4,51,0]. |
:;GJump:Array. galacticHyperspaceFixedCoordsInLY for galactic jumps, e.g. [6.4,51,0]. |
||
− | :;Strength:Number. Strength for |
+ | :;Strength:Number. Strength for missionVariables.CCL_OXPStrength. |
:;checkC:Number. Threshold for logging/cleaning. |
:;checkC:Number. Threshold for logging/cleaning. |
||
− | :;checkK:Number. Threshold for cleaning. |
+ | :;checkK:Number. Threshold for cleaning. The script checks the distance to the player and used handlers. |
:;delay:Number. Timer delay for logging/cleaning. |
:;delay:Number. Timer delay for logging/cleaning. |
||
:;locate:Number. Only for hotspot 0=all, 1=MainStation, 2=WP, 3=LaneWP, 4=LaneWS, 5=LanePS. |
:;locate:Number. Only for hotspot 0=all, 1=MainStation, 2=WP, 3=LaneWP, 4=LaneWS, 5=LanePS. |
Revision as of 21:48, 14 June 2012
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 control 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:
- maxEnergy
- maxSpeed
- maxThrust
- shieldRechargeRates
- laser
- turrets
- subent laser
- missiles
- escorts/defense ships
- primaryRole
- distance to the hotspots (MainStation,WP and lanes WP,WS,PS)
- EQs
The script can set a missionVariable to be used for strong entities.
missionVariables.CCL_OXPStrength |
Main purpose is to prevent the spawning by the populator. These entities can define conditions in shipdata.plist. 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.
conditions = ("mission_CCL_OXPStrength greaterthan 3"); |
Missionships should use a script_info key that excludes the entity from cleaning to avoid breaking other missions.
script_info = {"ccl_missionShip" = "true";} |
Additionally a property with the same effect can be set for a specific entity.
this.ccl_missionShip = true; |
A third way is to exclude names of entities. This must be done in your own startUp
worldScripts.Cabal_Common_OXPStrength.ccl_strengthExclEntByName.push("name1"); |
Functions
checkPower()
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()
worldScripts.Cabal_Common_OXPStrength.registerLocation(obj); |
Scripts can specify systems where logging and / or cleaning 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 cleaning.
- 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.
- checkC
- Number. Threshold for logging/cleaning.
- checkK
- Number. Threshold for cleaning. The script checks the distance to the player and used handlers.
- delay
- Number. Timer delay for logging/cleaning.
- locate
- Number. Only for hotspot 0=all, 1=MainStation, 2=WP, 3=LaneWP, 4=LaneWS, 5=LanePS.
- repeat
- Number. Repeat logging/cleaning n times.
- logging
- Boolean. Log actions.
- 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"]