User Tools

Site Tools


modding:function:shporder

This is an old revision of the document!


Discuss this page on this pages TalkPage

shpOrder

See shpOrder at Xelerus

Syntax (shpOrder ship string [expression])
Arguments ship: The ship that you want to order.
string: A string representing the order.
expression: The optional arguments if needed by the order. Multiple arguments possible
Returns condition: True if successful, Nil otherwise.
Category orders, ship
Description Gives the ship the order.
  • shpOrder
    • ship
      • order
        • “guard”: Ship docks with a target and fights enemies that attack or come near the target. Ship gives up attacking an enemy if it is no longer detectable to the target.
          • SpaceObject: Target
        • “sentry”: Similar to guard but makes the ship hold at its current position and has a duration.
          • SpaceObject: Target
          • Integer: Duration in seconds; infinite by default.
        • “dock”: Ship attempts to dock with a target. If no docking ports are available, ship will move back and forth over the target until a port is available.
          • SpaceObject: Target
        • “attack”: Ship fires its weapons against a target for a specified duration or until the target is destroyed.
          • SpaceObject: Target
          • [Integer]: Duration in seconds; infinite by default
        • “wait”: Ship does absolutely nothing for a specified duration
          • [Integer]: Duration in seconds; infinite by default
        • “gate”: Ship attempts to leave the system through an object (typically a stargate)
          • SpaceObject (does not need to be a stargate): Target
        • “gateOnThreat”: Ship waits until it is attacked and then attempts to leave the system. This order usually comes after a dock order. Ship is considered a subordinate of the object it is docked at.
        • “gateOnStationDestroyed”: Ship waits until a station is destroyed and then attempts to leave the system. This order usually comes after a dock order. Ship is considered a subordinate of the object it is docked at.
        • “patrol”: Ship orbits the target at a specified distance and fights enemies that attack or come near the target. Ship gives up fighting an enemy if it is no longer detectable by the target.
          • SpaceObject: Target
          • [Integer]: Distance at which to orbit the target.
        • “escort”: Ship follows a target, fighting enemies that attack or come near the target. Ship gives up fighting an enemy if it is no longer detectable by the target.
          • SpaceObject: Target
          • [Integer]: Angle or Formation
          • [Integer]: Distance
        • “scavenge”: Ship wanders around system until there is a wreck with items in it, at which point the ship will loot the wreck. Does not retaliate if the wreck is destroyed.
        • “followPlayerThroughGate”: Cannot be given by shpOrder; returned by the event OnPlayerLeftSystem as “followPlayer”. Ship follows the player through the nearest gate.
          • SpaceObject: Target
        • “attackNearestEnemy”
        • “tradeRoute”
        • “wander”: Ship follows a diamond-like path around the system, fighting enemies that attack it
        • “loot”: Ship takes all items from the target after a few seconds, ignoring cargo space. Ship does not retaliate to attacks while looting. Does not retaliate if target is destroyed.
          • SpaceObject: Target
        • “hold”: Ship brakes and attempts to stay at its current position, attacking nearby enemies
          • Integer: Duration
        • “mine”
          • SpaceObject: Target
        • “waitForPlayer”: Cannot be given by shpOrder; returned by the event OnPlayerLeftSystem. Ship waits for the player to return to the system.
        • “attackPlayerOnReturn”: Usually given during the OnPlayerLeftSystem event. Ship will attack player upon gating back into the system.
        • “follow”: Ship follows a target, staying at a position relative to the target and matching the target's direction.
          • SpaceObject: Target
          • Integer: Angle in degrees
          • Integer: Distance in light-seconds
        • “navPath”
          • Integer 1)
        • “goto”
          • Object
        • “waitForTarget”: Ship waits until a target approaches a certain distance or until a certain amount of time passes.
          • SpaceObject: Target to wait for.
          • Integer: Maximum distance from the target in light-seconds, defaults to detection range.
          • Integer: Maximum duration in seconds until the wait ends; infinite by default.
        • “waitForEnemy”
          • Duration: Maximum duration in seconds until the wait ends; infinite by default.
        • “bombard”: Orders a ship to attack a station
          • SpaceObject (must be a station): Target
          • Integer: Duration in seconds that the ship will spend bombarding
        • “approach”: Ship approaches a target until a certain distance
          • SpaceObject: Target
          • Distance: Distance in light-seconds
        • “aim”: Ship aims at a target without firing weapons
          • SpaceObject: Target
        • “orbit”: Ship moves clockwise in a circular path around the target at a specified distance for a specified duration
          • SpaceObject: Target
          • Integer: Distance in light-seconds
          • Integer: Duration in seconds
        • “holdCourse”
          • Angle
          • Distance
        • “turnTo”
          • Angle (absolute)
        • “attackHold”
          • Target
          • Duration
        • “attackStation”
          • Target
          • Integer 2)
        • “fireEvent” Fires the event on the target's event handler. aShipObj is the ship that fired it.
          • Target
          • String (event name)
        • “waitForUndock”
          • Target
          • Duration
        • “sendMessage”
          • Target
          • Message
        • “attackArea”
          • Target 3)
          • Integer 4)
          • Integer 5)
        • “holdAndAttack”
          • Target
          • Integer 6)
        • “gotoPos”
          • Position vector
        • “waitForThreat”
          • Duration

Example

(shpOrder gPlayerShip 'wait)

Returns True, ordering the player to wait doesn't do much. Return to Functions list

1) , 2) , 3) , 4) , 5) , 6)
Unknown
modding/function/shporder.1498260284.txt.gz · Last modified: 2017/06/23 23:24 by 0xabcdef