Difference between revisions of "Cabal Common Library Doc OXPStrength"

From Elite Wiki
m (Preparation for v1.6)
m (added deprecated marks)
Line 2: Line 2:
 
This is the main class for the OXPStrength with its members and part of the [[Cabal_Common_Library]].
 
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.
+
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:
 
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)
  +
* EQs
  +
* escorts / defense ships
  +
* laser
  +
* mass (v1.7.1)
 
* maxEnergy
 
* maxEnergy
 
* maxSpeed
 
* maxSpeed
 
* maxThrust
 
* maxThrust
* shieldRechargeRates
 
* laser
 
* turrets
 
* subent laser
 
 
* missiles
 
* missiles
* escorts/defense ships
 
 
* primaryRole
 
* primaryRole
* distance to the hotspots (MainStation,WP and lanes WP,WS,PS)
 
  +
* shieldRechargeRates
* EQs
 
  +
* subent laser
  +
* turrets
   
The script can set a missionVariable to be used for strong entities.
+
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}}
 
{{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:
+
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:
   
 
* 1 = coef < 100
 
* 1 = coef < 100
Line 33: Line 35:
 
* 9 = otherwise, default.
 
* 9 = otherwise, default.
 
{{CodeEx|codeex=conditions = ("mission_CCL_OXPStrength greaterthan 3"); }}
 
{{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.
+
Missionships should use a script_info key that excludes the entity from cleaning to avoid breaking other missions. <sup>Deprecated.</sup>
{{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.
+
Additionally a property with the same effect can be set for a specific entity. <sup>Deprecated.</sup>
 
{{CodeEx|codeex=this.ccl_missionShip = true; }}
 
{{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. <sup>Deprecated. Cleaning is removed in v1.7.1.</sup>
 
{{CodeEx|codeex=worldScripts.Cabal_Common_OXPStrength.ccl_strengthExclEntByName.push("name1"); }}
 
{{CodeEx|codeex=worldScripts.Cabal_Common_OXPStrength.ccl_strengthExclEntByName.push("name1"); }}
   
Line 64: Line 68:
 
=== registerLocation() ===
 
=== registerLocation() ===
 
{{CodeEx|codeex=worldScripts.Cabal_Common_OXPStrength.registerLocation(obj); }}
 
{{CodeEx|codeex=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.
+
Scripts can specify systems where logging should happen. Only one object with a few properties has to be passed.
   
 
'''Properties of obj:'''
 
'''Properties of obj:'''
 
:;CSS:String. Required. worldScriptname.
 
:;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 logging.
 
:;Gal:Number. Required. Galaxy.
 
:;Gal:Number. Required. Galaxy.
 
:;ID:Number. Required. System ID.
 
:;ID:Number. Required. System ID.
 
:;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 missionVariables.CCL_OXPStrength.
+
:;Strength:Number. Strength for missionVariables.CCL_OXPStrength. <sup>Deprecated.</sup>
:;checkC:Number. Threshold for logging/cleaning.
+
:;checkC:Number. Threshold for logging.
:;checkK:Number. Threshold for cleaning. The script checks the distance to the player and used handlers.
+
:;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/cleaning.
+
:;delay:Number. Timer delay for logging.
 
:;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.
:;repeat:Number. Repeat logging/cleaning n times.
+
:;repeat:Number. Repeat logging n times.
:;logging:Boolean. Log actions.
+
:;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.
 
:;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"]
+
:;Suspend:Array. Names of worldScripts to be suspended. Following Oktis approach, e.g. ["OXPA","OXPB"]. <sup>Deprecated - unused by OXPs.</sup>
   
   

Revision as of 21:57, 2 February 2013

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)
  • EQs
  • escorts / defense ships
  • laser
  • mass (v1.7.1)
  • maxEnergy
  • maxSpeed
  • maxThrust
  • missiles
  • primaryRole
  • shieldRechargeRates
  • subent laser
  • turrets

The script can set a missionVariable to be used for strong entities. Deprecated in favour of condition scripts.

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");

Starting with v1.7.1 this is replaced by a property

worldScripts.Cabal_Common_OXPStrength.CCL_OXPStrength


Missionships should use a script_info key that excludes the entity from cleaning to avoid breaking other missions. Deprecated.

script_info = {ccl_missionShip = true;}


Additionally a property with the same effect can be set for a specific entity. Deprecated.

this.ccl_missionShip = true;


A third way is to exclude names of entities. This must be done in your own startUp. Deprecated. Cleaning is removed in v1.7.1.

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 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. Deprecated.
checkC
Number. Threshold for logging.
checkK
Number. Threshold for cleaning. The script checks the distance to the player and used handlers. Deprecated.
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. Deprecated.
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"]. Deprecated - unused by OXPs.