Difference between revisions of "Cabal Common Library Doc OXPStrength"
m (documentation added) |
m (→Overview) |
||
Line 12: | Line 12: | ||
Missionships should use a script_info key that excludes the entity from cleaning to avoid breaking other missions. |
Missionships should use a script_info key that excludes the entity from cleaning to avoid breaking other missions. |
||
− | {{CodeEx|codeex=script_info = {" |
+ | {{CodeEx|codeex=script_info = {"ccl_missionShip" = "true";} }} |
Additionally a property with the same effect can be set for a specific entity. |
Additionally a property with the same effect can be set for a specific entity. |
||
− | {{CodeEx|codeex=this. |
+ | {{CodeEx|codeex=this.ccl_missionShip = true; }} |
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 == |
Revision as of 01:01, 22 November 2011
Overview
This is the main class for the OXPStrength with its members.
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). maxEnergy, maxSpeed, maxThrust, shieldRechargeRates, laser, turrets and subent laser, missiles, escorts/defense ships, primaryRole, distance to the hotspots (MainStation,WP and lanes WP,WS,PS) and EQs are used.
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.
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 282 if fully equipped with standard weaponry and missiles.
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. Oolites own missions (if triggered) have priority and the script uses internal settings for them.
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 the mV.
- checkC
- Number. Threshold for logging/cleaning.
- checkK
- Number. Threshold for 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.
- 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"]