modding:xml:spaceobject
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
modding:xml:spaceobject [2012/05/27 21:15] – tweak star_weaver | modding:xml:spaceobject [2017/03/08 04:10] (current) – DockingPorts and Trade. Someone finish this please 0xabcdef | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | =====Summary===== | ||
+ | * < | ||
+ | * Zero or one < | ||
+ | * **bringToFront=** | ||
+ | * " | ||
+ | * **sendToBack=** | ||
+ | * " | ||
+ | * **maxDist=** | ||
+ | * **portAngle=** | ||
+ | * **portCount=** Number of ports | ||
+ | * **portRadius=** Distance (in pixels) from the center of the object' | ||
+ | * **rotation=** | ||
+ | * **x=** Horizontal offset (in pixels) from the center of the object' | ||
+ | * **y=** Vertical offset (in pixels) from the center of the object' | ||
+ | * Zero or one < | ||
+ | * currency= | ||
+ | * " | ||
+ | * creditConversion= Percentage | ||
+ | * max= | ||
+ | * replenish= | ||
+ | * < | ||
+ | * criteria= | ||
+ | * priceAdj= Percentage adjustment | ||
+ | * actualPrice= | ||
+ | * " | ||
+ | * Zero or more < | ||
+ | * criteria= | ||
+ | * priceAdj= | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * Zero or more < | ||
+ | * criteria= | ||
+ | * inventoryAdj= | ||
+ | * levelFrequency= | ||
+ | * priceAdj= | ||
+ | * noDescription= | ||
+ | * < | ||
+ | * criteria= | ||
+ | * priceAdj= | ||
+ | * < | ||
+ | * criteria= | ||
+ | * priceAdj= | ||
+ | * < | ||
+ | * criteria= | ||
+ | * priceAdj= | ||
+ | * messageID= | ||
+ | * < | ||
+ | * upgradeInstallOnly | ||
+ | * messageID= | ||
+ | * < | ||
+ | * < | ||
+ | * upgradeInstallOnly | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * gSource | ||
+ | * aDockTarget | ||
+ | * Return: | ||
+ | * True | ||
+ | * Nil | ||
+ | * < | ||
+ | * gSource | ||
+ | * gItem | ||
+ | * aArmorSeg | ||
+ | * Return | ||
+ | * True | ||
+ | * Nil | ||
+ | * < | ||
+ | * gSource | ||
+ | * Return | ||
+ | * (list UNID Data Priority) | ||
+ | * (list UNID Priority) | ||
+ | * (list UNID) | ||
+ | * < | ||
+ | * gSource | ||
+ | * Return | ||
+ | * Nil | ||
+ | * UNID | ||
+ | * (UNID bonus cause) | ||
+ | * < | ||
+ | * gSource | ||
+ | * gItem | ||
+ | * aObj | ||
+ | * aService ((CTradingDesc.cpp, | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * aProviderObj | ||
+ | * gData | ||
+ | * Return | ||
+ | * Nil | ||
+ | * Integer | ||
+ | * < | ||
+ | * gSource | ||
+ | * aArmorSeg | ||
+ | * aCause | ||
+ | * aAttacker | ||
+ | * aOrderGiver | ||
+ | * aHitPos | ||
+ | * aHitDir | ||
+ | * aDamageHP | ||
+ | * aDamageType | ||
+ | * aWeaponType | ||
+ | * < | ||
+ | * gPlayerShip | ||
+ | * < | ||
+ | * gSource | ||
+ | * gData | ||
+ | * aBaseObj | ||
+ | * aOwnerObj | ||
+ | * aTargetobj | ||
+ | * aOrbit | ||
+ | * < | ||
+ | * gSource | ||
+ | * aBaseObj | ||
+ | * aTargetObj | ||
+ | * < | ||
+ | * gSource | ||
+ | * aArmorSeg | ||
+ | * aCause | ||
+ | * aAttacker | ||
+ | * aOrderGiver | ||
+ | * aHitPos | ||
+ | * aHitDir | ||
+ | * aDamageHP | ||
+ | * aDamageType | ||
+ | * aWeaponType | ||
+ | * Return | ||
+ | * Integer: Amount of damage to take | ||
+ | * < | ||
+ | * < | ||
+ | * gSource | ||
+ | * aPlayer | ||
+ | * < | ||
+ | * gSource | ||
+ | * aDestroyer | ||
+ | * aOrderGiver | ||
+ | * aWreckObj | ||
+ | * aDestroyReason | ||
+ | * < | ||
+ | * gSource | ||
+ | * Return | ||
+ | * Object | ||
+ | * Nil | ||
+ | * < | ||
+ | * gSource | ||
+ | * aGateObj | ||
+ | * aDestNodeID | ||
+ | * aDestEntryPoint | ||
+ | * < | ||
+ | * gSource | ||
+ | * aGateObj | ||
+ | * < | ||
+ | * gSource | ||
+ | * aVersion | ||
+ | * < | ||
+ | * gSource | ||
+ | * aMiner | ||
+ | * aMinePos | ||
+ | * aMineDir | ||
+ | * aMineProbability | ||
+ | * aHP | ||
+ | * aDamageType | ||
+ | * aWeaponType | ||
+ | * < | ||
+ | * gSource | ||
+ | * aObj | ||
+ | * vOnObjDestroyed> | ||
+ | * gSource | ||
+ | * aObjDestroyed | ||
+ | * aDestroyer | ||
+ | * aOrderGiver | ||
+ | * aWreckObj | ||
+ | * aDestroyReason | ||
+ | * < | ||
+ | * gSource | ||
+ | * aObjDocked | ||
+ | * aDockTarget | ||
+ | * < | ||
+ | * gSource | ||
+ | * aObj | ||
+ | * aGateObj | ||
+ | * aDestNodeID | ||
+ | * aDestEntryPoint | ||
+ | * < | ||
+ | * gSource | ||
+ | * aObj | ||
+ | * < | ||
+ | * gSource | ||
+ | * aObj | ||
+ | * < | ||
+ | * gSource | ||
+ | * aObj | ||
+ | * aJumpPos | ||
+ | * Return | ||
+ | * Position Vector | ||
+ | * Nil | ||
+ | * < | ||
+ | * gSource | ||
+ | * aObj | ||
+ | * < | ||
+ | * gSource | ||
+ | * < | ||
+ | * gSource | ||
+ | * < | ||
+ | * < | ||
+ | * gSource | ||
+ | * aMissionObj | ||
+ | * < | ||
+ | * gSource | ||
+ | * aMissionObj | ||
+ | * aReason | ||
+ | * < | ||
+ | * gSource | ||
+ | * < | ||
+ | * gSource | ||
+ | * aOldShip | ||
+ | * < | ||
+ | * gSource | ||
+ | * Return | ||
+ | * " | ||
+ | * " | ||
+ | * Nil | ||
+ | * < | ||
+ | * gSource | ||
+ | * aNewShip | ||
+ | * < | ||
+ | * gSource | ||
+ | * aGateObj | ||
+ | * aDestNodeID | ||
+ | * aDestEntryPoint | ||
+ | * Return | ||
+ | * " | ||
+ | * " | ||
+ | * Nil | ||
+ | * < | ||
+ | * < | ||
+ | * gSource | ||
+ | * aPlayer | ||
+ | * < | ||
+ | * gSource | ||
+ | * aObjAttacked | ||
+ | * aArmorSeg | ||
+ | * aCause | ||
+ | * aAttacker | ||
+ | * aOrderGiver | ||
+ | * aHitPos | ||
+ | * aHitDir | ||
+ | * aDamageHP | ||
+ | * aDamageType | ||
+ | * aWeaponType | ||
+ | * Return | ||
+ | * True | ||
+ | * Nil | ||
+ | * < | ||
+ | * gSource | ||
+ | * aExplosionObj | ||
+ | * aExplosionUNID | ||
+ | * aExplosionPos | ||
+ | * < | ||
+ | * gSource | ||
+ | * aObjAttacked | ||
+ | * aArmorSeg | ||
+ | * aCause | ||
+ | * aAttacker | ||
+ | * aOrderGiver | ||
+ | * aHitPos | ||
+ | * aHitDir | ||
+ | * aDamageHP | ||
+ | * aDamageType | ||
+ | * aWeaponType | ||
+ | * < | ||
+ | * gSource | ||
+ | * aObjDestroyed | ||
+ | * aDestroyer | ||
+ | * aOrderGiver | ||
+ | * aWreckObj | ||
+ | * aDestroyReason | ||
+ | * < | ||
+ | * gSource | ||
+ | * aFireRepeat | ||
+ | * aShotObj | ||
+ | * aWeaponObj | ||
+ | * aWeaponUNID | ||
+ | * aWeaponPos | ||
+ | * aWeaponType | ||
+ | * < | ||
+ | * gSource | ||
+ | * aMessage | ||
+ | * Return | ||
+ | * String | ||
+ | * Nil | ||
+ | * < | ||
+ | * gSource | ||
+ | |||
+ | * Note: A stargate with the attribute **" | ||
+ | //Inherits [[DesignType]] attributes and elements// | ||
+ | =====Fields===== | ||
+ | * descID | ||
+ | * canInstall | ||
+ | * canRemove | ||
+ | * objID | ||
+ | * pos | ||
+ | * price | ||
+ | * status | ||
+ | * upgradeInstallOnly | ||
+ | //Inherits [[DesignType]] fields// | ||
+ | =====Properties===== | ||
+ | * ascended: If true, then this object is inactive and can be descended into the current system | ||
+ | * category | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * commsKey: If this object appears in the player' | ||
+ | * currency: The UNID of the < | ||
+ | * cyberDefenseLevel | ||
+ | * damaged | ||
+ | * dockingPorts: | ||
+ | * objID: The ID of the object currently occupying the port, if any | ||
+ | * pos: The position vector of the docking port | ||
+ | * status: Whether the port is occupied by an object or not | ||
+ | * " | ||
+ | * " | ||
+ | * enabled | ||
+ | * hasDockingPorts | ||
+ | * hp | ||
+ | * id: Also returned by (objGetID object) | ||
+ | * installArmorMaxLevel | ||
+ | * installDeviceMaxLevel | ||
+ | * installDevicePrice | ||
+ | * installDeviceStatus | ||
+ | * installItemStatus | ||
+ | * known: If this attribute is true and this object has a map label, then the object shows up in the System Map | ||
+ | * level | ||
+ | * mass | ||
+ | * paintLayer | ||
+ | * playerMissionsGiven | ||
+ | * refuelMaxLevel | ||
+ | * removeDevicePrice | ||
+ | * removeDeviceMaxLevel | ||
+ | * removeItemStatus | ||
+ | * repairArmorMaxLevel | ||
+ | * scale | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * underAttack: | ||
+ | //Inherits [[DesignType]] properties// | ||
+ | =====Overview===== | ||
+ | |||
+ | A SpaceObject is a meta-[[DesignType]]. You can't make something that is just a SpaceObject, | ||
+ | |||
+ | =====Criteria===== | ||
+ | |||
+ | These codes are used in various functions that need to check for or list spaceobjects. | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | < | ||
+ | G | ||
+ | G: | ||
+ | s | ||
+ | t | ||
+ | T | ||
+ | T: | ||
+ | A | ||
+ | B: | ||
+ | D: | ||
+ | E Enemy objects only | ||
+ | F | ||
+ | H Only objects whose base = source | ||
+ | M | ||
+ | N | ||
+ | N:nn; | ||
+ | NN: | ||
+ | O: | ||
+ | P only objects visible to source | ||
+ | J only objects from a given sovereign | ||
+ | K only objects that cannot attack | ||
+ | R | ||
+ | R:nn; | ||
+ | V | ||
+ | Z | ||
+ | z Only include player | ||
+ | b Beam Objects | ||
+ | m | ||
+ | X | ||
+ | S:d | ||
+ | S:D | ||
+ | I: | ||
+ | +xyz; | ||
+ | -xyz; | ||
+ | +isPlayerClass: | ||
+ | +data: | ||
+ | -data: | ||
+ | +isPlanet: | ||
+ | -isPlanet: | ||
+ | +property: | ||
+ | -property: | ||
+ | +unid: | ||
+ | -unid: | ||
+ | </ | ||
+ | Note: Virtual stations are not searched by default through t; therefore you should use V as well if searching for a virtual station. | ||
+ | |||
+ | |||
+ | =====Functions===== | ||
+ | |||
+ | Functions starting with ' | ||
+ | |||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[modding: | ||
+ | * [[sysAddObjRecurringTimerEvent]] | ||
+ | * [[sysAddObjTimerEvent]] | ||
+ | * [[sysCancelTimerEvent]] | ||
+ | |||
+ | =====Events===== | ||
+ | SpaceObjects also take the lion's share of event definitions in the game. | ||
+ | |||
+ | ====< | ||
+ | |||
+ | ====< | ||
+ | Identical format to [[designtype# | ||
+ | |||
+ | ====< | ||
+ | |||
+ | ====< | ||
+ | |||
+ | ====< | ||
+ | For systems, stations, ships, at object creation. | ||
+ | |||
+ | ====< | ||
+ | |||
+ | ====< | ||
+ | **Populated variables: | ||
+ | * gSource: station object | ||
+ | * aAttacker: object that attacked | ||
+ | * aHitPos: vector position of hit | ||
+ | * aHitDir: angle direction from which hit came | ||
+ | * aDamageHP: hit points of damage | ||
+ | * aDamageType: | ||
+ | |||
+ | This event is called when an object is hit by a weapon. The event must return the number of hit points of damage to do to the object. For example, imagine an object that takes half damage from the player (but full damage from all others). The event could check aAttacker and return half of aDamageHP if it is the player and full aDamageHP otherwise. | ||
+ | |||
+ | The event should avoid affecting other objects and should not destroy the station (e.g., by calling objDestroy). If necessary, the event could return a very large number to insure that the station is destroyed. //(why is this. Does anyone know)// | ||
+ | |||
+ | ====< | ||
+ | **Populated variables: | ||
+ | * gSource: ship object | ||
+ | * aDestroyer: object that caused destruction | ||
+ | * aWreckObj: ship wreck left behind | ||
+ | |||
+ | The //< | ||
+ | |||
+ | ====< | ||
+ | |||
+ | ====< | ||
+ | **Populated variables: | ||
+ | * gSource: station object | ||
+ | * aGateObj: gate object | ||
+ | * aGateObj: The gate that was entered //(1.07)// | ||
+ | * aDestNodeID: | ||
+ | * aDestEntryPoint: | ||
+ | |||
+ | Version 0.99 uses aGateObj instead of aGate (as in previous versions) to be consistent with //< | ||
+ | |||
+ | ====< | ||
+ | ====< | ||
+ | ====< | ||
+ | ====< | ||
+ | For asteroids. | ||
+ | |||
+ | ====< | ||
+ | ====< | ||
+ | ====< | ||
+ | ====< | ||
+ | ====< | ||
+ | //Todo: check both this and designtype version and find difference?// | ||
+ | |||
+ | ====< | ||
+ | |||
+ | =====Registered SpaceObject Events===== | ||
+ | |||
+ | All //< | ||
+ | |||
+ | After calling (objRegisterForEvents // | ||
+ | |||
+ | ====< | ||
+ | **Populated variables: | ||
+ | * aObjDestroyed: | ||
+ | * aDestroyer: the object that caused the destruction. | ||
+ | * aOrderGiver: | ||
+ | * aDestroyReason: | ||
+ | * aWreckObj: the wreck left behind the destroyed object. | ||
+ | * gSource: the object that holds the event. | ||
+ | |||
+ | Is triggerred when an object A has registered for object B events and object B is destroyed. //< | ||
+ | |||
+ | **0.99c:** the //< | ||
+ | |||
+ | See example on earth slaver. | ||
+ | |||
+ | ====< | ||
+ | **Populated variables: | ||
+ | * aObjdocked: the ship that initiated docking. | ||
+ | * aDockTarget: | ||
+ | * gSource: the object that holds the event. | ||
+ | |||
+ | This was primarily used before //< | ||
+ | |||
+ | ====< | ||
+ | **Populated variables: | ||
+ | * aObj: the ship that used the gate. | ||
+ | * gSource: the object that holds the event. | ||
+ | * aGateObj: The gate that was entered //(1.07)// | ||
+ | * aDestNodeID: | ||
+ | * aDestEntryPoint: | ||
+ | |||
+ | ====< | ||
+ | **Populated variables: | ||
+ | * aObj: the ship that jumped. | ||
+ | * gSource: the object that holds the event. | ||
+ | * (return): //ignored// | ||
+ | |||
+ | ====< | ||
+ | **Populated variables: | ||
+ | * aObj: the ship that jumped. | ||
+ | * gSource: the object that holds the event. | ||
+ | * (return): if a vector is returned, change aObj's position to it | ||
+ | |||
+ | Appears to be used to prevent the player from bypassing the heretic quarentine with a jumpdrive. | ||
+ | |||
+ | ====< | ||
+ | **Populated variables: | ||
+ | * aObj: the object that was reconned by the player. | ||
+ | * gSource: the object that holds the event. | ||
+ | |||
+ | |||
+ | =====Registered System Events===== | ||
+ | |||
+ | |||
+ | ====George' | ||
+ | First, you need to call: | ||
+ | |||
+ | (objRegisterForSystemEvents obj distance) | ||
+ | |||
+ | obj is the object that you want to receive OnSystemWeaponFire | ||
+ | distance is the radius (in light-seconds) of the area (centered on obj) that you want to watch for events. | ||
+ | |||
+ | You will then get called at OnSystemWeaponFire whenever a ship or a station fires a weapon (I believe it will also include calls to sysCreateWeaponFire, | ||
+ | |||
+ | aWeaponObj is the object that fired the weapon. | ||
+ | aWeaponUNID is the UNID of the weapon being fired. | ||
+ | aWeaponPos is the position where the shot originated. | ||
+ | |||
+ | You will also get called at OnSystemExplosion if there are any ships that explode. The parameters are: | ||
+ | |||
+ | aExplosionObj is the ship that exploded. | ||
+ | aExplosionUNID is the UNID of the explosion (look in StdExplosions.xml). | ||
+ | aExplosionPos is the position of the explosion. | ||
+ | |||
+ | ====< | ||
+ | [[events]] | ||
+ | called at any ships that explode. The parameters are: | ||
+ | **Populated variables: | ||
+ | * aExplosionObj is the ship that exploded. | ||
+ | * aExplosionUNID is the UNID of the explosion (look in StdExplosions.xml). | ||
+ | * aExplosionPos is the position of the explosion. | ||
+ | |||
+ | ====< | ||
+ | (New in 1.07)\\ | ||
+ | **Populated variables: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | ====< | ||
+ | (New in 1.07) \\ | ||
+ | **Populated variables: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | ====< | ||
+ | You will then get called at OnSystemWeaponFire whenever a ship or a station fires a weapon (I believe it will also include calls to sysCreateWeaponFire, | ||
+ | |||
+ | **Populated variables: | ||
+ | * aWeaponObj: is the object that fired the weapon. | ||
+ | * aWeaponUNID: | ||
+ | * aWeaponPos: is the position where the shot originated. | ||
+ | |||