Cabal Common Library Doc OXPStrength

From Elite Wiki
Revision as of 23:55, 4 February 2013 by Svengali (talk | contribs) (preparation for v1.7.1 - part I)

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;}