Cabal Common Library Doc OXPStrength

From Elite Wiki
Revision as of 21:57, 2 February 2013 by Svengali (talk | contribs) (added deprecated marks)

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.