User Tools

Site Tools


modding:xml:spaceobject

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
modding:xml:spaceobject [2014/06/10 17:56] – [<OnObjDestroyed>] gpmmodding:xml:spaceobject [2017/03/08 04:10] (current) – DockingPorts and Trade. Someone finish this please 0xabcdef
Line 1: Line 1:
 +=====Summary=====
 +  * <StationType> or <ShipClass>
 +    * Zero or one <DockingPorts>. Can use either **maxDist** + **portAngle** + **portCount** + **portRadius** or **x** + **y**
 +      * **bringToFront=**
 +        * "true"
 +      * **sendToBack=**
 +        * "true"
 +      * **maxDist=**
 +      * **portAngle=**
 +      * **portCount=** Number of ports
 +      * **portRadius=** Distance (in pixels) from the center of the object's image
 +      * **rotation=**
 +      * **x=** Horizontal offset (in pixels) from the center of the object's image. Positive values move the port right.
 +      * **y=** Vertical offset (in pixels) from the center of the object's image. Positive values move the port down.
 +    * Zero or one <Trade>
 +      * currency=
 +        * "credit"
 +      * creditConversion= Percentage
 +      * max=
 +      * replenish=
 +      * <AcceptDonation>
 +        * criteria=
 +        * priceAdj= Percentage adjustment
 +        * actualPrice=
 +          * "true"
 +      * Zero or more <Buy>. Station buys items
 +        * criteria=
 +        * priceAdj=
 +          * "variable"
 +          * "constant:{price}"
 +          * "unavailable"
 +      * Zero or more <Sell>. Station sells items
 +        * criteria=
 +        * inventoryAdj=
 +        * levelFrequency=
 +        * priceAdj=
 +        * noDescription=
 +      * <Refuel>
 +        * criteria=
 +        * priceAdj=
 +      * <RepairArmor>
 +        * criteria=
 +        * priceAdj=
 +      * <ReplaceArmor>
 +        * criteria=
 +        * priceAdj=
 +        * messageID=
 +      * <InstallDevice>
 +        * upgradeInstallOnly
 +        * messageID=
 +      * <UpgradeDevice>
 +      * <RemoveDevice>
 +        * upgradeInstallOnly
 +      * <EnhanceItem>
 +      * <RepairItem>
 +      * <BuyShip>
 +      * <SellShip>
 +      * <Custom>
 +    * <Events>
 +      * <CanDockAsPlayer>
 +        * gSource
 +        * aDockTarget
 +        * Return:
 +          * True
 +          * Nil
 +      * <CanInstallItem>
 +        * gSource
 +        * gItem
 +        * aArmorSeg
 +        * Return
 +          * True
 +          * Nil
 +      * <GetDockScreen>
 +        * gSource
 +        * Return
 +          * (list UNID Data Priority)
 +          * (list UNID Priority)
 +          * (list UNID)
 +      * <GetExplosionType>
 +        * gSource
 +        * Return
 +          * Nil
 +          * UNID
 +          * (UNID bonus cause)
 +      * <GetPlayerPriceAdj>
 +        * gSource
 +        * gItem
 +        * aObj
 +        * aService ((CTradingDesc.cpp, 43))
 +          * "(serviceNone)"
 +          * "priceOfferedToPlayer"
 +          * "priceForPlayerToBuy"
 +          * "valueOfDonation"
 +          * "priceToRefuel"
 +          * "priceToRepairArmor"
 +          * "priceToReplaceArmor"
 +          * "priceToInstallDevice"
 +          * "priceToRemoveDevice"
 +          * "priceToUpgradeDevice"
 +          * "priceToEnhanceItem"
 +          * "priceToRepairItem"
 +          * "customPrice"
 +          * "priceOfShipOffered"
 +          * "priceOfShipForSale"
 +          * "unknown"
 +        * aProviderObj
 +        * gData
 +        * Return
 +          * Nil
 +          * Integer
 +      * <OnAttacked>
 +        * gSource
 +        * aArmorSeg
 +        * aCause
 +        * aAttacker
 +        * aOrderGiver
 +        * aHitPos
 +        * aHitDir
 +        * aDamageHP
 +        * aDamageType
 +        * aWeaponType
 +      * <OnAttackedByPlayer>
 +        * gPlayerShip
 +      * <OnCreate>
 +        * gSource
 +        * gData
 +        * aBaseObj
 +        * aOwnerObj
 +        * aTargetobj
 +        * aOrbit
 +      * <OnCreateOrders>
 +        * gSource
 +        * aBaseObj
 +        * aTargetObj
 +      * <OnDamage>
 +        * gSource
 +        * aArmorSeg
 +        * aCause
 +        * aAttacker
 +        * aOrderGiver
 +        * aHitPos
 +        * aHitDir
 +        * aDamageHP
 +        * aDamageType
 +        * aWeaponType
 +        * Return
 +          * Integer: Amount of damage to take
 +      * <OnDataTransfer>
 +      * <OnDeselected>
 +        * gSource
 +        * aPlayer
 +      * <OnDestroy>
 +        * gSource
 +        * aDestroyer
 +        * aOrderGiver
 +        * aWreckObj
 +        * aDestroyReason
 +      * <OnDockObjAdj>
 +        * gSource
 +        * Return
 +          * Object
 +          * Nil
 +      * <OnEnteredGate>
 +        * gSource
 +        * aGateObj
 +        * aDestNodeID
 +        * aDestEntryPoint
 +      * <OnEnteredSystem>
 +        * gSource
 +        * aGateObj
 +      * <OnLoad>
 +        * gSource
 +        * aVersion
 +      * <OnMining>
 +        * gSource
 +        * aMiner
 +        * aMinePos
 +        * aMineDir
 +        * aMineProbability
 +        * aHP
 +        * aDamageType
 +        * aWeaponType
 +      * <OnObjBlacklistedPlayer>
 +        * gSource
 +        * aObj
 +      * vOnObjDestroyed>
 +        * gSource
 +        * aObjDestroyed
 +        * aDestroyer
 +        * aOrderGiver
 +        * aWreckObj
 +        * aDestroyReason
 +      * <OnObjDocked>
 +        * gSource
 +        * aObjDocked
 +        * aDockTarget
 +      * <OnObjEnteredGate>
 +        * gSource
 +        * aObj
 +        * aGateObj
 +        * aDestNodeID
 +        * aDestEntryPoint
 +      * <OnObjGate>
 +        * gSource
 +        * aObj
 +      * <OnObjJumped>
 +        * gSource
 +        * aObj
 +      * <OnObjJumpPosAdj>
 +        * gSource
 +        * aObj
 +        * aJumpPos
 +        * Return
 +          * Position Vector
 +          * Nil
 +      * <OnObjReconned>
 +        * gSource
 +        * aObj
 +      * <OnOrderChanged>
 +        * gSource
 +      * <OnOrdersCompleted>
 +        * gSource
 +      * <OnEventHandlerInit>
 +      * <OnMissionAccepted>
 +        * gSource
 +        * aMissionObj
 +      * <OnMissionCompleted>
 +        * gSource
 +        * aMissionObj
 +        * aReason
 +      * <OnPlayerBlacklisted>
 +        * gSource
 +      * <OnPlayerEnteredShip>
 +        * gSource
 +        * aOldShip
 +      * <OnPlayerEnteredSystem>
 +        * gSource
 +        * Return
 +          * "followPlayer"
 +          * "waitForPlayer"
 +          * Nil
 +      * <OnPlayerLeftShip>
 +        * gSource
 +        * aNewShip
 +      * <OnPlayerLeftSystem>
 +        * gSource
 +        * aGateObj
 +        * aDestNodeID
 +        * aDestEntryPoint
 +        * Return
 +          * "followPlayer"
 +          * "waitForPlayer"
 +          * Nil
 +      * <OnRandomEncounter>. Not defined. Inherited from [[DesignType]]
 +      * <OnSelected>
 +        * gSource
 +        * aPlayer
 +      * <OnSubordinateAttacked>
 +        * gSource
 +        * aObjAttacked
 +        * aArmorSeg
 +        * aCause
 +        * aAttacker
 +        * aOrderGiver
 +        * aHitPos
 +        * aHitDir
 +        * aDamageHP
 +        * aDamageType
 +        * aWeaponType
 +        * Return
 +          * True
 +          * Nil
 +      * <OnSystemExplosion>
 +        * gSource
 +        * aExplosionObj
 +        * aExplosionUNID
 +        * aExplosionPos
 +      * <OnSystemObjAttacked>
 +        * gSource
 +        * aObjAttacked
 +        * aArmorSeg
 +        * aCause
 +        * aAttacker
 +        * aOrderGiver
 +        * aHitPos
 +        * aHitDir
 +        * aDamageHP
 +        * aDamageType
 +        * aWeaponType
 +      * <OnSystemObjDestroyed>
 +        * gSource
 +        * aObjDestroyed
 +        * aDestroyer
 +        * aOrderGiver
 +        * aWreckObj
 +        * aDestroyReason
 +      * <OnSystemWeaponFire>
 +        * gSource
 +        * aFireRepeat
 +        * aShotObj
 +        * aWeaponObj
 +        * aWeaponUNID
 +        * aWeaponPos
 +        * aWeaponType
 +      * <OnTranslateMessage>
 +        * gSource
 +        * aMessage
 +        * Return
 +          * String
 +          * Nil
 +      * <OnUpdate>
 +        * gSource
 +
 +  * Note: A stargate with the attribute **"uncharted"** will cause **objGetNearestStargate** to ignore it.
 +//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
 +    * "beam"
 +    * "effect"
 +    * "marker"
 +    * "missile"
 +    * "ship"
 +    * "station"
 +  * commsKey: If this object appears in the player's Communications menu, this attribute is the key that the player presses to select this object.
 +  * currency: The UNID of the <EconomyType> that represents the currency used by this station
 +  * cyberDefenseLevel
 +  * damaged
 +  * dockingPorts: Returns a list of structs, each with the following fields
 +    * 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
 +      * "inUse"
 +      * "empty"
 +  * 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
 +    * "star"
 +    * "world"
 +    * "station"
 +    * "ship"
 +    * "flotsam"
 +  * underAttack: True if there is at least one enemy object that with this object as its target
 +//Inherits [[DesignType]] properties//
 +=====Overview=====
 +
 A SpaceObject is a meta-[[DesignType]]. You can't make something that is just a SpaceObject, but all [[ShipClass|ShipClasses]] and [[StationType|StationTypes]] are considered SpaceObjects for various funtions and other similarities. A SpaceObject is a meta-[[DesignType]]. You can't make something that is just a SpaceObject, but all [[ShipClass|ShipClasses]] and [[StationType|StationTypes]] are considered SpaceObjects for various funtions and other similarities.
  
Line 4: Line 377:
  
 These codes are used in various functions that need to check for or list spaceobjects. These codes are used in various functions that need to check for or list spaceobjects.
 +
 +[[https://forums.kronosaur.com/viewtopic.php?f=8&t=7567|Criteria is here as of 1.7a]]
  
 <code> <code>
Line 26: Line 401:
 J         only objects from a given sovereign J         only objects from a given sovereign
 K         only objects that cannot attack K         only objects that cannot attack
 +R         Return only the farthest object to the source
 R:nn;     Return only objects greater than nn light-seconds away R:nn;     Return only objects greater than nn light-seconds away
 V         Include Virtual objects V         Include Virtual objects
Line 36: Line 412:
 S:D       returns objects sorted by distance (in descending order) S:D       returns objects sorted by distance (in descending order)
 I:angle   returns only objects that intersect a line from the source at the given angle I:angle   returns only objects that intersect a line from the source at the given angle
-+xyz;     Include objects with the given attribute ++xyz;     Include objects with the attribute xyz 
--xyz;     Exclude objects with the given attribute +-xyz;     Exclude objects with the attribute xyz
-+unid:UNID                   Return ships of type UNID. +
 +isPlayerClass:true/false    Filter based on presence of PlayerSettings in object's type, ships only. +isPlayerClass:true/false    Filter based on presence of PlayerSettings in object's type, ships only.
-+data:attribute              Checks if (objGetData theObject 'attribute) is non-nil ++data:attribute              Return objects for which (objGetData theObject 'attribute) would return a non-Nil value 
--data:attribute              Checks if (objGetData theObject 'attribute) is nil+-data:attribute              Return objects for which (objGetData theObject 'attribute) would return a Nil 
 ++isPlanet:true               Return planets 
 +-isPlanet:true               Exclude planets 
 ++property:xyz                Return objects for which (objGetProperty theObject 'xyz) returns a non-Nil value 
 +-property:xyz                Return objects for which (objGetProperty theObject 'xyz) returns Nil 
 ++unid:UNID                   Return objects of type UNID.  
 +-unid:UNID                   Excludes objects of type UNID
 </code> </code>
 Note: Virtual stations are not searched by default through t; therefore you should use V as well if searching for a virtual station. Note: Virtual stations are not searched by default through t; therefore you should use V as well if searching for a virtual station.
modding/xml/spaceobject.1402422987.txt.gz · Last modified: 2014/12/27 04:40 (external edit)