Guest User

Untitled

a guest
May 5th, 2025
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 79.91 KB | None | 0 0
  1. # The Basics
  2.  
  3. The basic code file needs a function called Update that takes an input called I. It should look like this-
  4.  
  5. ```
  6. function Update(I)
  7. -- put your code here
  8. end
  9. ```
  10.  
  11. 'I' is the interface to the game and contains all the function calls you see on these help pages.
  12.  
  13. The code in Update will be executed every single physics step (the game runs at 40 physics steps per in game second of time)
  14.  
  15. -- creates a comment line so the line '-- put your code here' is never executed by the game. Comments are for explaining how your code functions.
  16.  
  17. Here is a simple example of a function that uses one of the interface functions to write 'Hello' to the HUD
  18.  
  19. ```
  20. function Update(I)
  21. I:Log('Hello')
  22. end
  23. ```
  24.  
  25. # LUA Syntax
  26.  
  27. ## String Concatenation
  28.  
  29. String Concatenation is done with .. i.e 'Hello' .. ' Player' creates 'Hello Player'. Numbers are automatically converted to strings.
  30.  
  31. ## For loops
  32.  
  33. For loops (in this example looping from 0 to 10 in increments of 1) use:
  34.  
  35. ```
  36. for ii=0,10,1 do
  37. -- your code here (note that we don't need to define the step size of 1.. 1 is the default anyway)
  38. end
  39. ```
  40.  
  41. ## Calling functions
  42.  
  43. The colon (:) is used for calling functions. This is why all calls to the interface start with I: (i.e. I:RequestWaterForwards(5))
  44.  
  45. ## Comments
  46.  
  47. -- creates a comment. So this line, in LUA, would be a comment
  48.  
  49. ## Global variables
  50.  
  51. Declare a variable outside of your Update function and it will be persistent from call to call, the example below will log the counter to the Log forever (1,2,3,4,5,etc).
  52.  
  53. ```
  54. count = 0 ;
  55. function MyUpdateFunction()
  56. count = count + 1 ;
  57. I:Log(count);
  58. end
  59. ```
  60.  
  61. ## If Statements
  62.  
  63. To conditionally execute some code you can use an if statement. In this example we only execute the line if 'a' is greater than 0.:
  64.  
  65. ```
  66. if a>0 then
  67. -- your code here
  68. end
  69. ```
  70.  
  71. # Logging and Messages
  72.  
  73. ### `I:Log(message)`
  74.  
  75. ```
  76. inputs
  77. -----
  78. message: [string] the message you want to write to the log.
  79.  
  80. outputs
  81. -------
  82. N/A
  83. ```
  84.  
  85. Writes a message to the log. Log is visible when editing the LUA box and appears in the 'Errors / Log' panel. The last 100 log messages are maintained.
  86.  
  87.  
  88. ### `I:ClearLogs()`
  89.  
  90. ```
  91. inputs
  92. -----
  93. N/A
  94.  
  95. outputs
  96. -------
  97. N/A
  98. ```
  99.  
  100. Clears your log. Pretty harmless!
  101.  
  102.  
  103. ### `I:LogToHud(message)`
  104.  
  105. ```
  106. inputs
  107. -----
  108. message: [string] the message you want to write to the HUD.
  109.  
  110. outputs
  111. -------
  112. N/A
  113. ```
  114.  
  115. Writes a message to the HUD. HUD messages are visible during normal play and when on the map.
  116.  
  117.  
  118. # Libraries
  119.  
  120. ## Mathf
  121.  
  122. The Mathf Library is full of functions you can google. Each function is statically called so use Mathf.Min(1,2) rather than Mathf:Min(1,2).
  123.  
  124. ## Vector3
  125.  
  126. Unity's Vector3 library is full exposed to you. You can create a new Vector3 with v = Vector3(x,y,z), and call functions such as Vector3.Angle(v1,v2). Google Unity Vector3 for more information on this library
  127.  
  128. ## Quaternion
  129.  
  130. Unity's Quaternion library is fully exposed to you also. Google it to find out more
  131.  
  132. # Fleet
  133.  
  134. The Fleet Awareness API provides scripts basic information about the fleet the craft is in.
  135.  
  136. ### `I.FleetIndex` (read only)
  137.  
  138. ```
  139. outputs
  140. -------
  141. [int] Position of the ship in the fleet, starting from 0.
  142. ```
  143.  
  144. Returns the index of the ship in the fleet. Starts at 0.
  145.  
  146.  
  147. ### `I.Fleet` (read only)
  148.  
  149. ```
  150. outputs
  151. -------
  152. [FleetInfo] Information about the fleet
  153. ```
  154.  
  155. Returns the current state of the fleet.
  156.  
  157.  
  158. ### `I.IsFlagship` (read only)
  159.  
  160. ```
  161. outputs
  162. -------
  163. [bool] Is the craft the fleet flagship?
  164. ```
  165.  
  166. Used to determine whether the ship is a flagship of a fleet.
  167.  
  168.  
  169. ### struct `FleetInfo`
  170. ```
  171. ID:[int] Unique ID of the fleet.
  172. Name:[string] Name of the fleet.
  173. Flagship: [FriendlyInfo] Information about the flagship of the fleet.
  174. Members: [FriendlyInfo[]] A table of information regarding the fleet's members. MAY CONTAIN NILS!
  175. ```
  176.  
  177.  
  178. # Resources
  179.  
  180. Scripts can use the following fields to get information about known resource zones. May change in the future to require a detector.
  181.  
  182. ### `I.ResourceZones` (read only)
  183.  
  184. ```
  185. outputs
  186. -------
  187. [ResourceZoneInfo[]] List of ResourceZones
  188. ```
  189.  
  190. Returns a Lua table containing a list of known resource zones.
  191.  
  192.  
  193. ### `I.Resources` (read only)
  194.  
  195. ```
  196. outputs
  197. -------
  198. [ResourceInfo] Ship resource data
  199. ```
  200.  
  201. Returns information about a ship's available resources.
  202.  
  203.  
  204. ### struct `ResourceZoneInfo`
  205. ```
  206. Id [int]: Unique ID of the Resource Zone
  207. Name [string]: Name of the Resource Zone
  208. Position [Vector3]: Position of the Resource Zone
  209. Radius [float]: Radius of the Resource Zone
  210. Resources [ResourceInfo]: Available resources of the Resource Zone
  211. ```
  212.  
  213.  
  214. ### struct `ResourceInfo`
  215. ```
  216. CrystalTotal [float]: Total Crystal resources.
  217. CrystalMax [float]: Max Crystal resources.
  218. MetalTotal [float]: Total Metal resources.
  219. MetalMax [float]: Max Metal resources.
  220. NaturalTotal [float]: Total Natural resources.
  221. NaturalMax [float]: Max Natural resources.
  222. OilTotal [float]: Total Oil resources.
  223. OilMax [float]: Max Oil resources.
  224. ScrapTotal [float]: Total Scrap resources.
  225. ScrapMax [float]: Max Scrap resources.
  226. ```
  227.  
  228.  
  229. # AI
  230.  
  231. ### `I:GetAIMovementMode(index)`
  232.  
  233. ```
  234. inputs
  235. -----
  236. index: [int] index of the AI mainframe
  237.  
  238. outputs
  239. -------
  240. [string] movement mode of the AI mainframe. Possible modes: Off, Manual, Automatic, Fleet
  241. ```
  242.  
  243. returns the movement mode of the AI mainframe specified by the index
  244.  
  245.  
  246. ### `I:GetAIFiringMode(index)`
  247.  
  248. ```
  249. inputs
  250. -----
  251. index: [int] index of the AI mainframe
  252.  
  253. outputs
  254. -------
  255. [string] firing mode of the AI mainframe. Possible modes: Off, On
  256. ```
  257.  
  258. returns the firing mode of the AI mainframe specified by the index
  259.  
  260.  
  261. ### `I.AIMode - Obsolete, please use 'GetAIMovementMode' instead` (read only)
  262.  
  263. ```
  264. outputs
  265. -------
  266. [string] Returns the mode of the AI. Possible modes: off, on
  267. ```
  268.  
  269. Returns the mode of the AI mainframe.
  270.  
  271.  
  272. ### `I.ConstructType - obsolete`
  273.  
  274. ```
  275. outputs
  276. -------
  277. [string] The type of construct.
  278. ```
  279.  
  280. AI's concept of what type of craft this ship is. Posible types: none
  281.  
  282.  
  283. # Using Propulsion
  284.  
  285. ### `I:TellAiThatWeAreTakingControl()`
  286.  
  287. ```
  288. inputs
  289. -----
  290.  
  291.  
  292. outputs
  293. -------
  294.  
  295. ```
  296.  
  297. Will stop the AI from issuing propulsion commands for the next second, after which it will assume control again. This is exactly what happens when the player presses a control key on an AI controlled vehicle.
  298.  
  299.  
  300. ### `I:AddPropulsionRequest(type, drive)`
  301.  
  302. ```
  303. inputs
  304. -----
  305. type: Main = 0, Secondary = 1, Tertiary = 2 , Roll = 3, Pitch = 4, Yaw = 5, Forwards = 6, Up = 7, Right = 8, A = 9, B = 10, C = 11, D = 12, E = 13]
  306. drive: [float] the amount to add to the axis
  307.  
  308. outputs
  309. -------
  310. N/A
  311. ```
  312.  
  313. Adds a propulsion request to the specified axis. This is additive to any other requests made to the axis in the same frame and is clamped between -1 and 1
  314.  
  315.  
  316. ### `I:SetPropulsionRequest(type, drive)`
  317.  
  318. ```
  319. inputs
  320. -----
  321. type: Main = 0, Secondary = 1, Tertiary = 2 , Roll = 3, Pitch = 4, Yaw = 5, Forwards = 6, Up = 7, Right = 8, A = 9, B = 10, C = 11, D = 12, E = 13]
  322. drive: [float] the amount the axis is set to
  323.  
  324. outputs
  325. -------
  326. N/A
  327. ```
  328.  
  329. Sets the propulsion request to the specified axis. This overwrites any other requests made to the axis in the same frame and is clamped between -1 and 1
  330.  
  331.  
  332. ### `I:GetPropulsionRequest(type)`
  333.  
  334. ```
  335. inputs
  336. -----
  337. type: Main = 0, Secondary = 1, Tertiary = 2 , Roll = 3, Pitch = 4, Yaw = 5, Forwards = 6, Up = 7, Right = 8, A = 9, B = 10, C = 11, D = 12, E = 13]
  338.  
  339. outputs
  340. -------
  341. N/A
  342. ```
  343.  
  344. Gets the sum of all requests made to the specified axis in the previous frame or reads the value that the drive is set to if the type is Main, Secondary or Tertiary
  345.  
  346.  
  347. ### `I:RequestComplexControllerStimulus(stim)`
  348.  
  349. ```
  350. inputs
  351. -----
  352. stim: none = 0,T =1,G =2 ,Y =3,H =4,U =5,J =6,I =7,K =8,O= 9,L =10,up=11,down=12,left=13,right=14
  353.  
  354. outputs
  355. -------
  356. N/A
  357. ```
  358.  
  359. Requests a stimuli as per the complex controller block.
  360.  
  361.  
  362. ### `I:MoveFortress`
  363.  
  364. ```
  365. inputs
  366. -----
  367. direction [Vector3]: Direction to move the fortress in. Limited to 1 meter.
  368.  
  369. outputs
  370. -------
  371. N/A
  372. ```
  373.  
  374. Move fortress in any direction. Limited to 1 meter.
  375.  
  376.  
  377. ### `I:RequestCustomAxis(axisName,drive)`
  378.  
  379. ```
  380. inputs
  381. -----
  382. axisName [string]: name of axis to create/use. Limited to 32 characters.
  383. drive [float]: value to add to the axis on this frame.
  384.  
  385. outputs
  386. -------
  387. N/A
  388. ```
  389.  
  390. Creates or uses an axis with a custom name. Adds a value to the axis. Axes values are limited to between -1 and 1. Axes names are limited to 32 characters.
  391.  
  392.  
  393. ### `I:GetCustomAxis(axisName)`
  394.  
  395. ```
  396. inputs
  397. -----
  398. axisName [string]: name of axis to get value for.
  399.  
  400. outputs
  401. -------
  402. The value of the axis as a float. 0 if axis not created yet.
  403. ```
  404.  
  405. Returns the value of the named axis that it had the previous frame, or 0 if axis not created yet.
  406.  
  407.  
  408. # Accessing Target Info
  409.  
  410. ### `I:GetNumberOfMainframes()`
  411.  
  412. ```
  413. inputs
  414. -----
  415. N/A
  416.  
  417. outputs
  418. -------
  419. The number of mainframes on your vehicle.
  420. ```
  421.  
  422. The mainframe count of your vehicle is useful for requesting targets
  423.  
  424.  
  425. ### `I:GetNumberOfTargets(mainframeIndex)`
  426.  
  427. ```
  428. inputs
  429. -----
  430. mainframeIndex: 0 being the first mainframe. Use GetNumberOfMainframes() to find out how many there are.
  431.  
  432. outputs
  433. -------
  434. The number of targets in this particular mainframe. Returns 0 if such a mainframe does not exist.
  435. ```
  436.  
  437. The target count is important when calling GetTarget(mainframeIndex, targetIndex).
  438.  
  439.  
  440. ### `I:GetTargetInfo(mainframeIndex, targetIndex)`
  441.  
  442. ```
  443. inputs
  444. -----
  445. mainframeIndex: 0 being the first mainframe. Use GetNumberOfMainframes() to find out how many there are.
  446. targetIndex: 0 being the first target. If target prioritisation card is in use 0 is the highest priority target.
  447.  
  448. outputs
  449. -------
  450. A TargetInfo object
  451. ```
  452.  
  453. The TargetInfo object contains many interesting variables relating to the target. Valid will be false if the target has died but the AI has not yet cleared it.
  454.  
  455.  
  456. ### struct `TargetInfo`
  457. ```
  458. Valid: [bool] true if a target was correctly returned
  459. Priority: [int] 0 is highest priority
  460. Score: [float] high is a good score- taken from target prioritisation card
  461. AimPointPosition: [Vector3] position in game world of aim point (this is the current position of the block that's being aimed for)
  462. Team: [int] team of target
  463. Protected: [bool] is it salvage? Will be false for salvage.
  464. Position: [Vector3] position in game world of target object.
  465. Velocity: [Vector3] velocity in game world in meters per second
  466. PlayerTargetChoice: [bool] has the player set this as the target?
  467. Id: [int] the unique integer Id of the target.
  468. ```
  469.  
  470.  
  471. ### `I:GetTargetPositionInfo(mainframeIndex, targetIndex)`
  472.  
  473. ```
  474. inputs
  475. -----
  476. mainframeIndex: 0 being the first mainframe. Use GetNumberOfMainframes() to find out how many there are.
  477. targetIndex: 0 being the first target. If target prioritisation card is in use 0 is the highest priority target.
  478.  
  479. outputs
  480. -------
  481. A TargetPositionInfo object
  482. ```
  483.  
  484. The TargetPositionInfo object contains many interesting variables relating to the target. Valid will be false if the target has died but the AI has not yet cleared it.
  485.  
  486.  
  487. ### `I:GetTargetPositionInfoForPosition(mainframeIndex, x,y,z)`
  488.  
  489. ```
  490. inputs
  491. -----
  492. mainframeIndex: [int] 0 being the first mainframe. Use GetNumberOfMainframes() to find out how many there are.
  493. x: [float] east west in meters.
  494. y: [float] up down in meters (0 is sea level).
  495. z: north south in meters.
  496.  
  497. outputs
  498. -------
  499. A TargetPositionInfo object for this point in space. Velocity will be 0.
  500. ```
  501.  
  502. The TargetPositionInfo object contains many interesting variables relating to the target.
  503.  
  504.  
  505. ### struct `TargetPositionInfo`
  506. ```
  507. Valid: [bool] true if target position info correctly returned.
  508. Azimuth: [float] degrees off nose of our vehicle where positive is clockwise
  509. Elevation: [float] degrees off nose of our vehicle where positive is downwards. This often has dodgy values
  510. ElevationForAltitudeComponentOnly: [float] the elevation off nose of the target's altitude. Robustly calculated
  511. Range: [float] the range to the target
  512. Direction: [Vector3] the direction to the target (absolute, not normalised)
  513. GroundDistance: [float] the distance along the ground (ignoring vertical component) to the target
  514. AltitudeAboveSeaLevel: [float] in metres.
  515. Position: [Vector3] position of target
  516. Velocity: [Vector3] meters per second
  517. ```
  518.  
  519.  
  520. # Misc Functions
  521.  
  522. ### `I:GetTerrainAltitudeForPosition(x,y,z)`
  523.  
  524. ```
  525. inputs
  526. -----
  527. x: [float] game world east west position in meters.
  528. y: [float] game world vertical (not important)
  529. z: game world north south position in meters.
  530.  
  531. outputs
  532. -------
  533. [float] the terrain altitude in meters where 0 is sea level.
  534. ```
  535.  
  536. Returns altitude of the terrain at a position in the world. Can be overloaded with a single Vector3 rather than x,y,z components.
  537.  
  538.  
  539. ### `I:GetTerrainAltitudeForLocalPosition(x,y,z)`
  540.  
  541. ```
  542. inputs
  543. -----
  544. x: [float] right offset from construct position in meters.
  545. y: [float] up offset from construct position in meters
  546. z: forwards offset from construct position in meters.
  547.  
  548. outputs
  549. -------
  550. [float] the terrain altitude in meters where 0 is sea level.
  551. ```
  552.  
  553. Returns altitude of the terrain at a position relative to the construct. Can be overloaded with a single Vector3 rather than x,y,z components.
  554.  
  555.  
  556. ### `I:GetGravityForAltitude(alt)`
  557.  
  558. ```
  559. inputs
  560. -----
  561. alt: [float] altitude (0 is sea level)
  562.  
  563. outputs
  564. -------
  565. [Vector3] gravity vector
  566. ```
  567.  
  568. Returns gravity vector for an altitude. gravity.y is the component of interest.
  569.  
  570.  
  571. ### `I:GetTime()`
  572.  
  573. ```
  574. inputs
  575. -----
  576. N/A
  577.  
  578. outputs
  579. -------
  580. [float] the time in seconds.
  581. ```
  582.  
  583. Returns time with an arbitrary offset (i.e. the time will seldom be 0).
  584.  
  585.  
  586. ### `I:GetTimeSinceSpawn()`
  587.  
  588. ```
  589. inputs
  590. -----
  591. N/A
  592.  
  593. outputs
  594. -------
  595. [float] the time in seconds since the construct spawned.
  596. ```
  597.  
  598. Returns time since construct spawned in seconds.
  599.  
  600.  
  601. ### `I:GetGameTime()`
  602.  
  603. ```
  604. inputs
  605. -----
  606. N/A
  607.  
  608. outputs
  609. -------
  610. [float] The time since the Instance started in seconds.
  611. ```
  612.  
  613. Returns time since the instance started in seconds..
  614.  
  615.  
  616. ### `I:GetWindDirectionAndMagnitude()`
  617.  
  618. ```
  619. inputs
  620. -----
  621. N/A
  622.  
  623. outputs
  624. -------
  625. [Vector3] Vector representing the direction and the magnitude of the wind.
  626. ```
  627.  
  628. Get the direction and magnitude of the current wind.
  629.  
  630.  
  631. # Self awareness
  632.  
  633. ### `I:GetConstructPosition()`
  634.  
  635. ```
  636. inputs
  637. -----
  638. N/A
  639.  
  640. outputs
  641. -------
  642. [Vector3] The position (Vector3 has members x, y, and z).
  643. ```
  644.  
  645. Returns the position of the construct. The construct's position is essentially the position of the first ever block placed, or the centre of the starting raft that it was built from.
  646.  
  647.  
  648. ### `I:GetConstructForwardVector()`
  649.  
  650. ```
  651. inputs
  652. -----
  653. N/A
  654.  
  655. outputs
  656. -------
  657. [Vector3] The forward pointing vector of the construct (it has length 1)
  658. ```
  659.  
  660. Return the forward pointing vector of the construct
  661.  
  662.  
  663. ### `I:GetConstructRightVector()`
  664.  
  665. ```
  666. inputs
  667. -----
  668. N/A
  669.  
  670. outputs
  671. -------
  672. [Vector3] The right pointing vector of the construct (it has length 1)
  673. ```
  674.  
  675. Return the right pointing vector of the construct
  676.  
  677.  
  678. ### `I:GetConstructUpVector()`
  679.  
  680. ```
  681. inputs
  682. -----
  683. N/A
  684.  
  685. outputs
  686. -------
  687. [Vector3] The up pointing vector of the construct (it has length 1)
  688. ```
  689.  
  690. Return the up pointing vector of the construct
  691.  
  692.  
  693. ### `I:GetConstructMaxDimensions()`
  694.  
  695. ```
  696. inputs
  697. -----
  698. N/A
  699.  
  700. outputs
  701. -------
  702. [Vector3] The size of the vehicle right, up and forwards of its origin
  703. ```
  704.  
  705. Returns the 'positive' size of the vehicle (right,up,forwards) relative to its origin (GetConstructPosition()). The coordinates are in local space. This minus GetConstructMinDimensions() provides the full size of the vehicle.
  706.  
  707.  
  708. ### `I:GetConstructMinDimensions()`
  709.  
  710. ```
  711. inputs
  712. -----
  713. N/A
  714.  
  715. outputs
  716. -------
  717. [Vector3] The size of the vehicle left, down and back of its origin
  718. ```
  719.  
  720. Returns the 'negative' size of the vehicle (left,down,back) relative to its origin (GetConstructPosition()). The coordinates are in local space.
  721.  
  722.  
  723. ### `I:GetConstructRoll()`
  724.  
  725. ```
  726. inputs
  727. -----
  728. N/A
  729.  
  730. outputs
  731. -------
  732. [float] The roll angle in degrees
  733. ```
  734.  
  735. Return the roll angle in degrees
  736.  
  737.  
  738. ### `I:GetConstructPitch()`
  739.  
  740. ```
  741. inputs
  742. -----
  743. N/A
  744.  
  745. outputs
  746. -------
  747. [float] The pitch angle in degrees
  748. ```
  749.  
  750. Return the pitch angle in degrees
  751.  
  752.  
  753. ### `I:GetConstructYaw()`
  754.  
  755. ```
  756. inputs
  757. -----
  758. N/A
  759.  
  760. outputs
  761. -------
  762. [float] The yaw angle in degrees
  763. ```
  764.  
  765. Return the yaw angle in degrees
  766.  
  767.  
  768. ### `I:GetConstructCenterOfMass()`
  769.  
  770. ```
  771. inputs
  772. -----
  773. N/A
  774.  
  775. outputs
  776. -------
  777. [Vector3] The position (Vector3 has members x, y, and z).
  778. ```
  779.  
  780. Returns the position of the construct's centre of mass in the world
  781.  
  782.  
  783. ### `I:GetAiPosition(mainframeIndex)`
  784.  
  785. ```
  786. inputs
  787. -----
  788. mainframeindex: [int] 0 is the first mainframe.
  789.  
  790. outputs
  791. -------
  792. [Vector3] The position (Vector3 has members x, y, and z).
  793. ```
  794.  
  795. Returns the position of the mainframe in the world. Returns Vector3(0,0,0) if no such mainframe exists.
  796.  
  797.  
  798. ### `I:GetVelocityMagnitude()`
  799.  
  800. ```
  801. inputs
  802. -----
  803. N/A
  804.  
  805. outputs
  806. -------
  807. [float] magnitude of your velocity in meters per second.
  808. ```
  809.  
  810. Returns the magnitude of your velocity in meters per second.
  811.  
  812.  
  813. ### `I:GetForwardsVelocityMagnitude()`
  814.  
  815. ```
  816. inputs
  817. -----
  818. N/A
  819.  
  820. outputs
  821. -------
  822. [float] magnitude of your forwards velocity in meters per second.
  823. ```
  824.  
  825. Returns the magnitude of your velocity in the forwards direction in meters per second. A negative value means you're going predominently backwards.
  826.  
  827.  
  828. ### `I:GetVelocityVector()`
  829.  
  830. ```
  831. inputs
  832. -----
  833. N/A
  834.  
  835. outputs
  836. -------
  837. [Vector3] Your construct's velocity vector in meters per second
  838. ```
  839.  
  840. Returns your construct's velocity vector in world space in meters per second. x is east west, y is up down and z is north south..
  841.  
  842.  
  843. ### `I:GetVelocityVectorNormalized()`
  844.  
  845. ```
  846. inputs
  847. -----
  848. N/A
  849.  
  850. outputs
  851. -------
  852. [Vector3] Your construct's velocity vector in meters per second- normalized to have a length of 1.
  853. ```
  854.  
  855. Returns your construct's velocity vector in world space in meters per second. x is east west, y is up down and z is north south. It's normalized to have a length of 1.
  856.  
  857.  
  858. ### `I:GetAngularVelocity()`
  859.  
  860. ```
  861. inputs
  862. -----
  863. N/A
  864.  
  865. outputs
  866. -------
  867. [Vector3] Your construct's angular velocity in world space
  868. ```
  869.  
  870. Returns your angular velocity. x is speed of turn around the east->west axis, y is around the vertical axis and z is around the north south axis. You're probably going to want the next function instead of this one...
  871.  
  872.  
  873. ### `I:GetLocalAngularVelocity()`
  874.  
  875. ```
  876. inputs
  877. -----
  878. N/A
  879.  
  880. outputs
  881. -------
  882. [Vector3] Your construct's angular velocity in local space
  883. ```
  884.  
  885. Returns your angular velocity. x is pitch, y yaw and z roll.
  886.  
  887.  
  888. ### `I:GetAmmoFraction()`
  889.  
  890. ```
  891. inputs
  892. -----
  893. N/A
  894.  
  895. outputs
  896. -------
  897. [float] fraction. 0 to 1. 1 if no ammo storage is available
  898. ```
  899.  
  900. Returns the fraction of ammo your construct has left
  901.  
  902.  
  903. ### `I:GetFuelFraction()`
  904.  
  905. ```
  906. inputs
  907. -----
  908. N/A
  909.  
  910. outputs
  911. -------
  912. [float] fraction. 0 to 1. 1 if no fuel storage is available
  913. ```
  914.  
  915. Returns the fraction of fuel your construct has left
  916.  
  917.  
  918. ### `I:GetSparesFraction()`
  919.  
  920. ```
  921. inputs
  922. -----
  923. N/A
  924.  
  925. outputs
  926. -------
  927. [float] fraction. 0 to 1. 1 if no spares storage is available
  928. ```
  929.  
  930. Returns the fraction of spares your construct has left
  931.  
  932.  
  933. ### `I:GetEnergyFraction()`
  934.  
  935. ```
  936. inputs
  937. -----
  938. N/A
  939.  
  940. outputs
  941. -------
  942. [float] fraction. 0 to 1. 1 if no batteries are available
  943. ```
  944.  
  945. Returns the fraction of energy your construct has left
  946.  
  947.  
  948. ### `I:GetPowerFraction()`
  949.  
  950. ```
  951. inputs
  952. -----
  953. N/A
  954.  
  955. outputs
  956. -------
  957. [float] fraction. 0 to 1
  958. ```
  959.  
  960. Returns the fraction of power your construct has left
  961.  
  962.  
  963. ### `I:GetElectricPowerFraction()`
  964.  
  965. ```
  966. inputs
  967. -----
  968. N/A
  969.  
  970. outputs
  971. -------
  972. [float] fraction. 0 to 1.
  973. ```
  974.  
  975. Returns the fraction of electric power your construct has left
  976.  
  977.  
  978. ### `I:GetHealthFraction()`
  979.  
  980. ```
  981. inputs
  982. -----
  983. N/A
  984.  
  985. outputs
  986. -------
  987. [float] fraction. 0 to 1. 1 if full health
  988. ```
  989.  
  990. Returns the fraction of health your construct has (including turrets etc)
  991.  
  992.  
  993. ### `I:IsDocked()`
  994.  
  995. ```
  996. inputs
  997. -----
  998. N/A
  999.  
  1000. outputs
  1001. -------
  1002. [bool] Docked? true for yes.
  1003. ```
  1004.  
  1005. Returns true if the vehicle is docked
  1006.  
  1007.  
  1008. ### `I:GetHealthFractionDifference(time)`
  1009.  
  1010. ```
  1011. inputs
  1012. -----
  1013. time[float]: the time you want the difference measured over. Time will be limited to be between 1 and 30.
  1014.  
  1015. outputs
  1016. -------
  1017. [float] health difference as a fraction (0 to 1)
  1018. ```
  1019.  
  1020. Returns health difference over a specified measurement time
  1021.  
  1022.  
  1023. ### `I:GetBlueprintName()`
  1024.  
  1025. ```
  1026. inputs
  1027. -----
  1028. N/A
  1029.  
  1030. outputs
  1031. -------
  1032. [string] name of the bluepritn.
  1033. ```
  1034.  
  1035. Returns the the name of this blueprint.
  1036.  
  1037.  
  1038. ### `I:GetUniqueId()`
  1039.  
  1040. ```
  1041. inputs
  1042. -----
  1043. N/A
  1044.  
  1045. outputs
  1046. -------
  1047. [int] the unique id.
  1048. ```
  1049.  
  1050. Returns the the unique id of this construct. No other construct has the same id.
  1051.  
  1052.  
  1053. # Components
  1054.  
  1055. ## Types
  1056.  
  1057. ### struct `Component types and their logic.`
  1058. ```
  1059. 0 = balloon deployer
  1060. bool 0 get Get whether the balloon is deployed.
  1061. set True to deploy the balloon. False to sever the balloon.
  1062. 1 = drive maintainer
  1063. int 0 get/set Get/set the channel of the drive mainainer (0 = Primary, 1 = Secondary, 2 = Tertiary).
  1064. float 0 get/set Get/set the drive that the drive maintainer is set to.
  1065. 2 = all pumps (helium and air)
  1066. bool 0 get Get whether the pump is on (buoyancy fraction > 0).
  1067. set False sets buoyance fraction to 0. True sets buoyancy fraction to 1.
  1068. float 0 get/set Get/set buoyancy fraction.
  1069. float 1 get Get fraction of volume that is flooded.
  1070. 3 = resource gatherer
  1071. bool 0 get/set On/off.
  1072. 4 = oil drill.
  1073. bool 0 get/set On/off.
  1074. 5 = ammo processor
  1075. bool 0 get/set On/off.
  1076. 6 = fuel refinery.
  1077. bool 0 get/set On/off.
  1078. float 0 get Get dangerous gas level.
  1079. float 1 get Get refining efficiency.
  1080. float 2 get Get time per batch.
  1081. 7 = tractor beams
  1082. bool 0 get/set On/off.
  1083. int 0 get Get the unique id of the selected vehicle. -1 if nothing is selected.
  1084. set Select the vehicle with the specified unique id.
  1085. float 0 get/set Get/set hold distance.
  1086. float 1 get/set Get/set hold azimuth.
  1087. float 2 get/set Get/set hold elevation.
  1088. 8 = hydrofoils
  1089. float 0 get/set Get/set angle.
  1090. 9 = propulsion
  1091. float 0 get/set Get/set drive fraction.
  1092. float 1 get Get propulsion requests to this component so far this frame.
  1093. set Add a propulsion request to this component.
  1094. float 2 get Get total propulsion request to this component last frame.
  1095. float 3 get Max force of this component.
  1096. 10 = shield projector
  1097. bool 0 get Get whether the shield is functioning.
  1098. int 0 get/set Get/set the shield type (0 = off, 1 = reflect, 2 = disrupt, 3 = laser absorb).
  1099. float 0 get/set Get/set strength.
  1100. float 1 get/set Get/set azimuth.
  1101. float 2 get/set Get/set elevation.
  1102. float 3 get/set Get/set range.
  1103. float 4 get/set Get/set width.
  1104. float 5 get/set Get/set height.
  1105. float 6 get/set Get/set alpha.
  1106. float 7 get/set Get/set red.
  1107. float 8 get/set Get/set green.
  1108. float 9 get/set Get/set blue.
  1109. 11 = helium pump
  1110. bool 0 get Get whether the airpump is on (buoyancy fraction > 0).
  1111. set False sets buoyance fraction to 0. True sets buoyancy fraction to 1.
  1112. float 0 get/set Get/set buoyancy fraction.
  1113. float 1 get Get fraction of volume that is flooded.
  1114. 12 = spotlight
  1115. float 0 get/set Get/set cone angle.
  1116. float 1 get/set Get/set azimuth angle.
  1117. float 2 get/set Get/set elevation angle.
  1118. float 3 get/set Get/set intensity.
  1119. float 4 get/set Get/set range.
  1120. float 5 get/set Get/set red.
  1121. float 6 get/set Get/set green.
  1122. float 7 get/set Get/set blue.
  1123. 13 = advanced cannon laser targetter
  1124. int 0 get Get the weapon index of the firing piece it is attached to. -1 otherwise.
  1125. float 0 get/set Get/set timed fuse time.
  1126. float 1 get Get altitude fuse 'low' altitude.
  1127. set Set altitude fuse altitude.
  1128. float 2 get Get altitude fuse 'high' altitude.
  1129. 14 = CRAM cannon laser targetter
  1130. int 0 get Get the weapon index of the firing piece it is attached to. -1 otherwise.
  1131. float 0 get/set Get/set timed fuse time.
  1132. float 1 get Get altitude fuse 'low' altitude.
  1133. set Set altitude fuse altitude.
  1134. float 2 get Get altitude fuse 'high' altitude.
  1135. 15 = warp drive
  1136. bool 0 get Is charging.
  1137. int 0 set 0 = start charging, 1 = warp.
  1138. float 0 get Right jump distance.
  1139. float 1 get Up jump distance.
  1140. float 2 get Forwards jump distance.
  1141. float 3 get Right jump factor based on vehicle size and warp rod size.
  1142. float 4 get Up jump factor.
  1143. float 5 get Forwards jump factor.
  1144. float 6 get Total length of attached chargers.
  1145. float 7 get Charge duration.
  1146. 16 = particle cannon lense
  1147. int 0 get Get the weapon index of the firing piece it is attached to. -1 otherwise.
  1148. 17 = steam boiler controller
  1149. float 0 get/set Get/set burn rate.
  1150. float 1 get Volume of attached boiler.
  1151. float 2 get Pressure of attached boiler.
  1152. 18 = fuel engine generator
  1153. float 0 get/set Get/set max relative rpm.
  1154. float 1 get/set Get/set battery charge drive.
  1155. float 2 get Current relative rpm.
  1156. float 3 get Estimate of maximum power.
  1157. float 4 get Fuel usage per second.
  1158. 19 = sail main block
  1159. int 0 get Get the sail type (0 = three point sail, 1 = square rigged sail).
  1160. float 0 get Mast winch setting.
  1161. set Winch mast towards this setting.
  1162. float 1 get Boom winch setting.
  1163. set Winch boom towards this setting.
  1164. float 2 get Mast height.
  1165. float 3 get Boom length.
  1166. 20 = advanced cannon ammo intake
  1167. int 0 get Get unique id of the associated ammo controller. -1 otherwise.
  1168. set Select an ammo controller by its unique id.
  1169. int 1 get Get component index of the associated ammo controller. -1 otherwise.
  1170. set Select an ammo controller by its component index.
  1171. int 2 get Get the weapon index of the firing piece it is attached to. -1 otherwise.
  1172. 21 = advanced cannon ammo controller
  1173. int 0 get Get unique id.
  1174. 22 = AI wireless transmitter
  1175. int 0 get/set Get/set channel.
  1176. 23 = AI wireless receiver
  1177. int 0 get/set Get/set channel.
  1178. 24 = AI aimpoint selection card
  1179. int 0 get/set Get/set aimpoint selection type (0 = random, 1 = ammo and AI).
  1180. float 0 get/set Get/set retarget time.
  1181. 25 = detection component
  1182. bool 0 get/set On/off.
  1183. 26 = AI mainframe
  1184. int 0 get/set AI movement mode (0 = Off, 1 = Manual, 2 = Automatic, 3 = Fleet).
  1185. int 1 get/set AI firing mode (0 = Off, 1 = On).
  1186. 27 = laser colorer
  1187. float 0 get/set Get/set red.
  1188. float 1 get/set Get/set green.
  1189. float 2 get/set Get/set blue.
  1190. 28 = laser missile defence
  1191. float 0 get/set Get/set red.
  1192. float 1 get/set Get/set green.
  1193. float 2 get/set Get/set blue.
  1194. 29 = particle cannon
  1195. float 0 get/set Get/set red.
  1196. float 1 get/set Get/set green.
  1197. float 2 get/set Get/set blue.
  1198. 30 = light fitting
  1199. float 0 get/set Get/set intensity.
  1200. float 1 get/set Get/set range.
  1201. float 2 get/set Get/set red.
  1202. float 3 get/set Get/set green.
  1203. float 4 get/set Get/set blue.
  1204. 31 = simple laser
  1205. float 0 get/set Get/set red.
  1206. float 1 get/set Get/set green.
  1207. float 2 get/set Get/set blue.
  1208. 32 = smoke generator
  1209. float 0 get/set Get/set particle speed.
  1210. float 1 get/set Get/set particle size.
  1211. float 2 get/set Get/set red.
  1212. float 3 get/set Get/set green.
  1213. float 4 get/set Get/set blue.
  1214. 33 = hologram projector
  1215. bool 0 get/set On/off.
  1216. bool 1 get/set Get/set whether the image is mirrored.
  1217. float 0 get/set Get/set width.
  1218. float 1 get/set Get/set height.
  1219. float 2 get/set Get/set distance.
  1220. float 3 get/set Get/set right translation.
  1221. float 4 get/set Get/set up translation.
  1222. float 5 get/set Get/set aizumth.
  1223. float 6 get/set Get/set elevation.
  1224. float 7 get/set Get/set rotation.
  1225. 34 = poster holder
  1226. float 0 get/set Get/set width.
  1227. float 1 get/set Get/set height.
  1228. 35 = electric engine
  1229. float 0 get/set Get/set power fraction.
  1230. 36 = steam boiler controller
  1231. float 0 get/set Get/set burn rate.
  1232. float 1 get Get storage module pressure.
  1233. 37 = air pump
  1234. bool 0 get Get whether the airpump is on (buoyancy fraction > 0).
  1235. set False sets buoyance fraction to 0. True sets buoyancy fraction to 1.
  1236. float 0 get/set Get/set buoyancy fraction.
  1237. float 1 get Get fraction of volume that is flooded.
  1238. ```
  1239.  
  1240.  
  1241. ### struct `BlockInfo`
  1242. ```
  1243. Valid:[bool] false means this BlockInfo packet is useless
  1244. Position:[Vector3] position in world (east,up,north)
  1245. LocalPosition:[Vector3] position in construct (right,up,forwards)
  1246. LocalPositionRelativeToCom:[Vector3] local position relative to the center of mass
  1247. Forwards:[Vector3] forwards direction in world(east,up,north)
  1248. LocalForwards:[Vector3] forward direction in construct (right,up,forwards)
  1249. Rotation:[Quaternion] the rotation of the block in world coordinates
  1250. LocalRotation:[Quaternion] the rotation of the block in the vehicle's (or turret's) coordinate system.
  1251. SubConstructIdentifier:[int] the sub construct identifier of the subconstruct the block is part of.
  1252. CustomName:[string] the custom name assigned to the block
  1253. ```
  1254.  
  1255.  
  1256. ## Interface Functions / Methods
  1257.  
  1258. ### `I:Component_GetCount(type)`
  1259.  
  1260. ```
  1261. inputs
  1262. -----
  1263. type: [int] the type of component you want the count of.
  1264.  
  1265. outputs
  1266. -------
  1267. [int] the number of components of this type.
  1268. ```
  1269.  
  1270. Returns the number of components of this type
  1271.  
  1272.  
  1273. ### `I:Component_GetLocalPosition(type,index)`
  1274.  
  1275. ```
  1276. inputs
  1277. -----
  1278. type: [int] the type of component you want the local position of.
  1279. index: [int] the index of the component you want the position of.
  1280.  
  1281.  
  1282. outputs
  1283. -------
  1284. [Vector3i] a Vector3i is a Vector3 where .x .y and .z are integers.
  1285. ```
  1286.  
  1287. Returns the local position in the vehicle of this component.
  1288.  
  1289.  
  1290. ### `I:Component_GetBlockInfo(type,index)`
  1291.  
  1292. ```
  1293. inputs
  1294. -----
  1295. type: [int] the type of component you want information on.
  1296. index: [int] the index of the component you want block info for..
  1297.  
  1298.  
  1299. outputs
  1300. -------
  1301. [BlockInfo] a BlockInfo structure relating to the component.
  1302. ```
  1303.  
  1304. Returns an extensive BlockInfo object for the component.
  1305.  
  1306.  
  1307. ### `I:Component_GetBoolLogic(type, blockIndex)`
  1308.  
  1309. ```
  1310. inputs
  1311. -----
  1312. type: [int] the type of component you want boolean logic for.
  1313. blockIndex: [int] the index of the component you want boolean logic for.
  1314.  
  1315.  
  1316. outputs
  1317. -------
  1318. [bool] the first boolean logic for this component. For a component without boolean logic, or a block index that doesn't exist, false is returned.
  1319. ```
  1320.  
  1321. Returns a boolean (true/false) for a component. Depending on the type of this component this means different things (or nothing at all). Default return is false.
  1322.  
  1323.  
  1324. ### `I:Component_GetBoolLogic_1(type, blockIndex, propertyIndex)`
  1325.  
  1326. ```
  1327. inputs
  1328. -----
  1329. type: [int] the type of component you want boolean logic for.
  1330. blockIndex: [int] the index of the component you want boolean logic for.
  1331. propertyIndex: [int] the index of the index of the boolean logic you want.
  1332.  
  1333. outputs
  1334. -------
  1335. [bool] the specified boolean logic for this component. For a component without boolean logic, or an index that doesn't exist, false is returned.
  1336. ```
  1337.  
  1338. Returns a boolean (true/false) for a component. Depending on the type of this component this means different things (or nothing at all). Default return is false.
  1339.  
  1340.  
  1341. ### `I:Component_SetBoolLogic(type,index,bool)`
  1342.  
  1343. ```
  1344. inputs
  1345. -----
  1346. type: [int] the type of component you want to set boolean logic for.
  1347. index: [int] the index of the component you want to set boolean logic for.
  1348. bool: [bool] the true/false you want to set.
  1349.  
  1350. outputs
  1351. -------
  1352. N/A
  1353. ```
  1354.  
  1355. Sets the first boolean logic for a component. Depending on the type of this component this means different things (or nothing at all).
  1356.  
  1357.  
  1358. ### `I:Component_SetBoolLogic_1(type, blockIndex, propertyIndex1, bool1)`
  1359.  
  1360. ```
  1361. inputs
  1362. -----
  1363. type: [int] the type of component you want to set boolean logic for.
  1364. blockIndex: [int] the index of the component you want to set boolean logic for.
  1365. propertyIndex1: [int] the index of the boolean logic you want to set.
  1366. bool1: [bool] the true/false you want to set.
  1367.  
  1368. outputs
  1369. -------
  1370. N/A
  1371. ```
  1372.  
  1373. Sets the specified boolean logic for a component. Depending on the type of this component this means different things (or nothing at all).
  1374.  
  1375.  
  1376. ### `I:Component_SetBoolLogic_2(type, blockIndex, propertyIndex1, bool1, propertyIndex2, bool2)`
  1377.  
  1378. ```
  1379. inputs
  1380. -----
  1381. type: [int] the type of component you want to set boolean logic for.
  1382. blockIndex: [int] the index of the component you want to set boolean logic for.
  1383. propertyIndex1: [int] the index of the first boolean logic you want to set.
  1384. bool1: [bool] the true/false you want to set the first logic to.
  1385. propertyIndex2: [int] the index of the second boolean logic you want to set.
  1386. bool2: [bool] the true/false you want to set the second logic to.
  1387.  
  1388. outputs
  1389. -------
  1390. N/A
  1391. ```
  1392.  
  1393. Sets the two specified boolean logics for a component. Depending on the type of this component this means different things (or nothing at all).
  1394.  
  1395.  
  1396. ### `I:Component_SetBoolLogic_3(type, blockIndex, propertyIndex1, bool1, propertyIndex2, bool2, propertyIndex3, bool3)`
  1397.  
  1398. ```
  1399. inputs
  1400. -----
  1401. type: [int] the type of component you want to set boolean logic for.
  1402. blockIndex: [int] the index of the component you want to set boolean logic for.
  1403. propertyIndex1: [int] the index of the first boolean logic you want to set.
  1404. bool1: [bool] the true/false you want to set the first logic to.
  1405. propertyIndex2: [int] the index of the second boolean logic you want to set.
  1406. bool2: [bool] the true/false you want to set the second logic to.
  1407. propertyIndex3: [int] the index of the third boolean logic you want to set.
  1408. bool3: [bool] the true/false you want to set the third logic to.
  1409.  
  1410. outputs
  1411. -------
  1412. N/A
  1413. ```
  1414.  
  1415. Sets the three specified boolean logics for a component. Depending on the type of this component this means different things (or nothing at all).
  1416.  
  1417.  
  1418. ### `I:Component_GetFloatLogic(type, blockIndex)`
  1419.  
  1420. ```
  1421. inputs
  1422. -----
  1423. type: [int] the type of component you want float logic for.
  1424. blockIndex: [int] the index of the component you want float logic for.
  1425.  
  1426.  
  1427. outputs
  1428. -------
  1429. [float] the first float logic for this component. For a component without float logic, or a block index that doesn't exist, 0 is returned.
  1430. ```
  1431.  
  1432. Returns a floating point value for a component. Depending on the type of this component this means different things (or nothing at all). Default return is 0.
  1433.  
  1434.  
  1435. ### `I:Component_GetFloatLogic_1(type, blockIndex, propertyIndex)`
  1436.  
  1437. ```
  1438. inputs
  1439. -----
  1440. type: [int] the type of component you want float logic for.
  1441. blockIndex: [int] the index of the component you want float logic for.
  1442. propertyIndex: [int] the index of the index of the float logic you want.
  1443.  
  1444. outputs
  1445. -------
  1446. [float] the specified float logic for this component. For a component without float logic, or an index that doesn't exist, 0 is returned.
  1447. ```
  1448.  
  1449. Returns a floating point value for a component. Depending on the type of this component this means different things (or nothing at all). Default return is 0.
  1450.  
  1451.  
  1452. ### `I:Component_SetFloatLogic(type,index,float)`
  1453.  
  1454. ```
  1455. inputs
  1456. -----
  1457. type: [int] the type of component you want to set float logic for.
  1458. index: [int] the index of the component you want to set float logic for.
  1459. float: [float] the floating point value you want to set.
  1460.  
  1461. outputs
  1462. -------
  1463. N/A
  1464. ```
  1465.  
  1466. Sets the first float logic for a component. Depending on the type of this component this means different things (or nothing at all).
  1467.  
  1468.  
  1469. ### `I:Component_SetFloatLogic_1(type, blockIndex, propertyIndex1, float1)`
  1470.  
  1471. ```
  1472. inputs
  1473. -----
  1474. type: [int] the type of component you want to set float logic for.
  1475. blockIndex: [int] the index of the component you want to set float logic for.
  1476. propertyIndex1: [int] the index of the float logic you want to set.
  1477. float1: [float] the floating point value you want to set.
  1478.  
  1479. outputs
  1480. -------
  1481. N/A
  1482. ```
  1483.  
  1484. Sets the specified float logic for a component. Depending on the type of this component this means different things (or nothing at all).
  1485.  
  1486.  
  1487. ### `I:Component_SetFloatLogic_2(type, blockIndex, propertyIndex1, float1, propertyIndex2, float2)`
  1488.  
  1489. ```
  1490. inputs
  1491. -----
  1492. type: [int] the type of component you want to set float logic for.
  1493. blockIndex: [int] the index of the component you want to set float logic for.
  1494. propertyIndex1: [int] the index of the first float logic you want to set.
  1495. float1: [float] the floating point value you want to set the first logic to.
  1496. propertyIndex2: [int] the index of the second float logic you want to set.
  1497. float2: [float] the floating point value you want to set the second logic to.
  1498.  
  1499. outputs
  1500. -------
  1501. N/A
  1502. ```
  1503.  
  1504. Sets the two specified float logics for a component. Depending on the type of this component this means different things (or nothing at all).
  1505.  
  1506.  
  1507. ### `I:Component_SetFloatLogic_3(type, blockIndex, propertyIndex1, float1, propertyIndex2, float2, propertyIndex3, float3)`
  1508.  
  1509. ```
  1510. inputs
  1511. -----
  1512. type: [int] the type of component you want to set float logic for.
  1513. blockIndex: [int] the index of the component you want to set float logic for.
  1514. propertyIndex1: [int] the index of the first float logic you want to set.
  1515. float1: [float] the floating point value you want to set the first logic to.
  1516. propertyIndex2: [int] the index of the second float logic you want to set.
  1517. float2: [float] the floating point value you want to set the second logic to.
  1518. propertyIndex3: [int] the index of the third float logic you want to set.
  1519. float3: [float] the floating point value you want to set the third logic to.
  1520.  
  1521. outputs
  1522. -------
  1523. N/A
  1524. ```
  1525.  
  1526. Sets the three specified float logics for a component. Depending on the type of this component this means different things (or nothing at all).
  1527.  
  1528.  
  1529. ### `I:Component_GetIntLogic(type, blockIndex)`
  1530.  
  1531. ```
  1532. inputs
  1533. -----
  1534. type: [int] the type of component you want int logic for.
  1535. blockIndex: [int] the index of the component you want int logic for.
  1536.  
  1537.  
  1538. outputs
  1539. -------
  1540. [int] the first int logic for this component. For a component without int logic, or a block index that doesn't exist, 0 is returned.
  1541. ```
  1542.  
  1543. Returns a integer number for a component. Depending on the type of this component this means different things (or nothing at all). Default return is 0.
  1544.  
  1545.  
  1546. ### `I:Component_GetIntLogic_1(type, blockIndex, propertyIndex)`
  1547.  
  1548. ```
  1549. inputs
  1550. -----
  1551. type: [int] the type of component you want int logic for.
  1552. blockIndex: [int] the index of the component you want int logic for.
  1553. propertyIndex: [int] the index of the index of the int logic you want.
  1554.  
  1555. outputs
  1556. -------
  1557. [int] the specified int logic for this component. For a component without int logic, or an index that doesn't exist, 0 is returned.
  1558. ```
  1559.  
  1560. Returns a integer number for a component. Depending on the type of this component this means different things (or nothing at all). Default return is 0.
  1561.  
  1562.  
  1563. ### `I:Component_SetIntLogic(type,index,int)`
  1564.  
  1565. ```
  1566. inputs
  1567. -----
  1568. type: [int] the type of component you want to set int logic for.
  1569. index: [int] the index of the component you want to set int logic for.
  1570. int: [int] the integer number you want to set.
  1571.  
  1572. outputs
  1573. -------
  1574. N/A
  1575. ```
  1576.  
  1577. Sets the first int logic for a component. Depending on the type of this component this means different things (or nothing at all).
  1578.  
  1579.  
  1580. ### `I:Component_SetIntLogic_1(type, blockIndex, propertyIndex1, int1)`
  1581.  
  1582. ```
  1583. inputs
  1584. -----
  1585. type: [int] the type of component you want to set int logic for.
  1586. blockIndex: [int] the index of the component you want to set int logic for.
  1587. propertyIndex1: [int] the index of the int logic you want to set.
  1588. int1: [int] the integer number you want to set.
  1589.  
  1590. outputs
  1591. -------
  1592. N/A
  1593. ```
  1594.  
  1595. Sets the specified int logic for a component. Depending on the type of this component this means different things (or nothing at all).
  1596.  
  1597.  
  1598. ### `I:Component_SetIntLogic_2(type, blockIndex, propertyIndex1, int1, propertyIndex2, int2)`
  1599.  
  1600. ```
  1601. inputs
  1602. -----
  1603. type: [int] the type of component you want to set int logic for.
  1604. blockIndex: [int] the index of the component you want to set int logic for.
  1605. propertyIndex1: [int] the index of the first int logic you want to set.
  1606. int1: [int] the integer number you want to set the first logic to.
  1607. propertyIndex2: [int] the index of the second int logic you want to set.
  1608. int2: [int] the integer number you want to set the second logic to.
  1609.  
  1610. outputs
  1611. -------
  1612. N/A
  1613. ```
  1614.  
  1615. Sets the two specified int logics for a component. Depending on the type of this component this means different things (or nothing at all).
  1616.  
  1617.  
  1618. ### `I:Component_SetIntLogic_3(type, blockIndex, propertyIndex1, int1, propertyIndex2, int2, propertyIndex3, int3)`
  1619.  
  1620. ```
  1621. inputs
  1622. -----
  1623. type: [int] the type of component you want to set int logic for.
  1624. blockIndex: [int] the index of the component you want to set int logic for.
  1625. propertyIndex1: [int] the index of the first int logic you want to set.
  1626. int1: [int] the integer number you want to set the first logic to.
  1627. propertyIndex2: [int] the index of the second int logic you want to set.
  1628. int2: [int] the integer number you want to set the second logic to.
  1629. propertyIndex3: [int] the index of the third int logic you want to set.
  1630. int3: [int] the integer number you want to set the third logic to.
  1631.  
  1632. outputs
  1633. -------
  1634. N/A
  1635. ```
  1636.  
  1637. Sets the three specified int logics for a component. Depending on the type of this component this means different things (or nothing at all).
  1638.  
  1639.  
  1640. ### `I:Component_SetBoolLogicAll(type, bool)`
  1641.  
  1642. ```
  1643. inputs
  1644. -----
  1645. type: [int] the type of component you want to set boolean logic for.ool [bool] the bool (true/false) you want to set.
  1646.  
  1647. outputs
  1648. -------
  1649. N/A
  1650. ```
  1651.  
  1652. Sets the first boolean logic for all components of a specific type. Depending on the type of this component this means different things (or nothing at all).
  1653.  
  1654.  
  1655. ### `I:Component_SetBoolLogicAll_1(type, propertyIndex1, bool1)`
  1656.  
  1657. ```
  1658. inputs
  1659. -----
  1660. type: [int] the type of component you want to set boolean logic for.
  1661. blockIndex: [int] the index of the component you want to set boolean logic for.
  1662. propertyIndex1: [int] the index of the boolean logic you want to set.
  1663. bool1: [bool] the true/false you want to set.
  1664.  
  1665. outputs
  1666. -------
  1667. N/A
  1668. ```
  1669.  
  1670. Sets the specified boolean logic for all components of a specific type. Depending on the type of this component this means different things (or nothing at all).
  1671.  
  1672.  
  1673. ### `I:Component_SetBoolLogicAll_2(type, propertyIndex1, bool1, propertyIndex2, bool2)`
  1674.  
  1675. ```
  1676. inputs
  1677. -----
  1678. type: [int] the type of component you want to set boolean logic for.
  1679. propertyIndex1: [int] the index of the first boolean logic you want to set.
  1680. bool1: [bool] the true/false you want to set the first logic to.
  1681. propertyIndex2: [int] the index of the second boolean logic you want to set.
  1682. bool2: [bool] the true/false you want to set the second logic to.
  1683.  
  1684. outputs
  1685. -------
  1686. N/A
  1687. ```
  1688.  
  1689. Sets the two specified boolean logics for all components of a specific type. Depending on the type of this component this means different things (or nothing at all).
  1690.  
  1691.  
  1692. ### `I:Component_SetBoolLogicAll_3(type, propertyIndex1, bool1, propertyIndex2, bool2, propertyIndex3, bool3)`
  1693.  
  1694. ```
  1695. inputs
  1696. -----
  1697. type: [int] the type of component you want to set boolean logic for.
  1698. propertyIndex1: [int] the index of the first boolean logic you want to set.
  1699. bool1: [bool] the true/false you want to set the first logic to.
  1700. propertyIndex2: [int] the index of the second boolean logic you want to set.
  1701. bool2: [bool] the true/false you want to set the second logic to.
  1702. propertyIndex3: [int] the index of the third boolean logic you want to set.
  1703. bool3: [bool] the true/false you want to set the third logic to.
  1704.  
  1705. outputs
  1706. -------
  1707. N/A
  1708. ```
  1709.  
  1710. Sets the three specified boolean logics for all components of a specific type. Depending on the type of this component this means different things (or nothing at all).
  1711.  
  1712.  
  1713. ### `I:Component_SetFloatLogicAll(type, float)`
  1714.  
  1715. ```
  1716. inputs
  1717. -----
  1718. type: [int] the type of component you want to set floating point logic for.
  1719. float [float] the floating point number you want to set.
  1720.  
  1721. outputs
  1722. -------
  1723. N/A
  1724. ```
  1725.  
  1726. Sets the first floating point logic for all components of a specific type. Depending on the type of this component this means different things (or nothing at all).
  1727.  
  1728.  
  1729. ### `I:Component_SetFloatLogicAll_1(type, propertyIndex1, float1)`
  1730.  
  1731. ```
  1732. inputs
  1733. -----
  1734. type: [int] the type of component you want to set float logic for.
  1735. propertyIndex1: [int] the index of the float logic you want to set.
  1736. float1: [float] the floating point value you want to set.
  1737.  
  1738. outputs
  1739. -------
  1740. N/A
  1741. ```
  1742.  
  1743. Sets the specified floating point logic for all components of a specific type. Depending on the type of this component this means different things (or nothing at all).
  1744.  
  1745.  
  1746. ### `I:Component_SetFloatLogicAll_2(type, propertyIndex1, float1, propertyIndex2, float2)`
  1747.  
  1748. ```
  1749. inputs
  1750. -----
  1751. type: [int] the type of component you want to set float logic for.
  1752. propertyIndex1: [int] the index of the first float logic you want to set.
  1753. float1: [float] the floating point value you want to set the first logic to.
  1754. propertyIndex2: [int] the index of the second float logic you want to set.
  1755. float2: [float] the floating point value you want to set the second logic to.
  1756.  
  1757. outputs
  1758. -------
  1759. N/A
  1760. ```
  1761.  
  1762. Sets the two specified floating point logics for all components of a specific type. Depending on the type of this component this means different things (or nothing at all).
  1763.  
  1764.  
  1765. ### `I:Component_SetFloatLogicAll_3(type, propertyIndex1, float1, propertyIndex2, float2, propertyIndex3, float3)`
  1766.  
  1767. ```
  1768. inputs
  1769. -----
  1770. type: [int] the type of component you want to set float logic for.
  1771. propertyIndex1: [int] the index of the first float logic you want to set.
  1772. float1: [float] the floating point value you want to set the first logic to.
  1773. propertyIndex2: [int] the index of the second float logic you want to set.
  1774. float2: [float] the floating point value you want to set the second logic to.
  1775. propertyIndex3: [int] the index of the third float logic you want to set.
  1776. float3: [float] the floating point value you want to set the third logic to.
  1777.  
  1778. outputs
  1779. -------
  1780. N/A
  1781. ```
  1782.  
  1783. Sets the three specified floating point logics for all components of a specific type. Depending on the type of this component this means different things (or nothing at all).
  1784.  
  1785.  
  1786. ### `I:Component_SetIntLogicAll(type, int)`
  1787.  
  1788. ```
  1789. inputs
  1790. -----
  1791. type: [int] the type of component you want to set integer logic for.
  1792. float [int] the integer you want to set.
  1793.  
  1794. outputs
  1795. -------
  1796. N/A
  1797. ```
  1798.  
  1799. Sets the first integer logic for all components of a specific type. Depending on the type of this component this means different things (or nothing at all).
  1800.  
  1801.  
  1802. ### `I:Component_SetIntLogicAll_1(type, propertyIndex1, int1)`
  1803.  
  1804. ```
  1805. inputs
  1806. -----
  1807. type: [int] the type of component you want to set int logic for.
  1808. propertyIndex1: [int] the index of the int logic you want to set.
  1809. int1: [int] the integer number you want to set.
  1810.  
  1811. outputs
  1812. -------
  1813. N/A
  1814. ```
  1815.  
  1816. Sets the specified integer logic for all components of a specific type. Depending on the type of this component this means different things (or nothing at all).
  1817.  
  1818.  
  1819. ### `I:Component_SetIntLogicAll_2(type, propertyIndex1, int1, propertyIndex2, int2)`
  1820.  
  1821. ```
  1822. inputs
  1823. -----
  1824. type: [int] the type of component you want to set int logic for.
  1825. propertyIndex1: [int] the index of the first int logic you want to set.
  1826. int1: [int] the integer number you want to set the first logic to.
  1827. propertyIndex2: [int] the index of the second int logic you want to set.
  1828. int2: [int] the integer number you want to set the second logic to.
  1829.  
  1830. outputs
  1831. -------
  1832. N/A
  1833. ```
  1834.  
  1835. Sets the two specified integer logics for all components of a specific type. Depending on the type of this component this means different things (or nothing at all).
  1836.  
  1837.  
  1838. ### `I:Component_SetIntLogicAll_3(type, propertyIndex1, int1, propertyIndex2, int2, propertyIndex3, int3)`
  1839.  
  1840. ```
  1841. inputs
  1842. -----
  1843. type: [int] the type of component you want to set int logic for.
  1844. propertyIndex1: [int] the index of the first int logic you want to set.
  1845. int1: [int] the integer number you want to set the first logic to.
  1846. propertyIndex2: [int] the index of the second int logic you want to set.
  1847. int2: [int] the integer number you want to set the second logic to.
  1848. propertyIndex3: [int] the index of the third int logic you want to set.
  1849. int3: [int] the integer number you want to set the third logic to.
  1850.  
  1851. outputs
  1852. -------
  1853. N/A
  1854. ```
  1855.  
  1856. Sets the three specified integer logics for all components of a specific type. Depending on the type of this component this means different things (or nothing at all).
  1857.  
  1858.  
  1859. ### `I:SetHologramProjectorURL(index, url)`
  1860.  
  1861. ```
  1862. inputs
  1863. -----
  1864. type: [int] the index of the hologram projector.
  1865. url: [string] the url to set the hologram projector to as a string.
  1866.  
  1867. outputs
  1868. -------
  1869. N/A
  1870. ```
  1871.  
  1872. Sets the url of the specified hologram projector
  1873.  
  1874.  
  1875. ### `I:SetPosterHolderURL(index, url)`
  1876.  
  1877. ```
  1878. inputs
  1879. -----
  1880. type: [int] the index of the poster holder.
  1881. url: [string] the url to set the poster holder to as a string.
  1882.  
  1883. outputs
  1884. -------
  1885. N/A
  1886. ```
  1887.  
  1888. Sets the url of the specified poster holder
  1889.  
  1890.  
  1891. # Weapons
  1892.  
  1893. ### `I:GetWeaponCount()`
  1894.  
  1895. ```
  1896. inputs
  1897. -----
  1898. N/A
  1899.  
  1900. outputs
  1901. -------
  1902. [int] the number of weapons on the hull- doesn't include weapons on the turrets but does include the turrets themselves.
  1903. ```
  1904.  
  1905. Get the number of weapons on the hull. Knowing is number is useful for when you want to call GetWeaponInfo(i) to find out weapon information.
  1906.  
  1907.  
  1908. ### `I:GetWeaponInfo(weaponIndex)`
  1909.  
  1910. ```
  1911. inputs
  1912. -----
  1913. weaponIndex: [int] the index of the weapon you want information on. 0 is the first weapon.
  1914.  
  1915. outputs
  1916. -------
  1917. [WeaponInfo] information on the weapon. weaponInfo.Valid is false if you ask for an invalid weaponIndex.
  1918. ```
  1919.  
  1920. Gets weapon information for a specific weapon. Useful to figure out what sort of weapon is present.
  1921.  
  1922.  
  1923. ### struct `WeaponInfo`
  1924. ```
  1925. Valid [bool]: false means this WeaponInfo packet is useless. Move onto the next valid one.
  1926. LocalPosition [Vector3]: the local position in the vehicle of the weapon. x is right, y is up and z is forwards.
  1927. GlobalPosition [Vector3]: the global position of the weapon. x is East, y is Up and Z is North.
  1928. LocalFirePoint [Vector3]: the local position in the vehicle where the projectile or laser will be created.
  1929. GlobalFirePoint [Vector3]: the global position in the world where the projectile or laser will be created.
  1930. Speed [float]: the speed in meters per second of the weapon- approximately correct for most weapon types.
  1931. CurrentDirection [Vector3]: the direction in global coordinate system that the weapon is facing
  1932. WeaponType [int]: the type of the weapon. cannon = 0,missile = 1 ,laser = 2,harpoon = 3,turret = 4,missilecontrol = 5,fireControlComputer =6
  1933. WeaponSlot [int]: the weapon slot of the weapon itself. 0 -> 5.
  1934. WeaponSlotMask [int]: the weapon slot bit mask. The rightmost bit represents 'ALL' and is always on, and the second bit represents slot 1, etc. (for example 100111 will respond to slots All, 1, 2, and 5)
  1935. PlayerCurrentlyControllingIt [bool]: true if the player is controlling this weapon at the moment
  1936. ```
  1937.  
  1938.  
  1939. ### `I:GetWeaponConstraints(weaponIndex)`
  1940.  
  1941. ```
  1942. inputs
  1943. -----
  1944. weaponIndex: [int] the index of the weapon you want the constraints off. 0 is the first weapon.
  1945.  
  1946. outputs
  1947. -------
  1948. [WeaponConsraints] information on the field-of-fire constraints of the weapon.
  1949. ```
  1950.  
  1951. Gets field-of-fire constrains information for a specific weapon.
  1952.  
  1953.  
  1954. ### struct `WeaponConstraints`
  1955. ```
  1956. Valid [bool]: false means this WeaponConstraints packet is useless. Move onto the next valid one.
  1957. MinAzimuth [float]: the minimum azimuth angle in degrees.
  1958. MaxAzimuth [float]: the maximum azimuth angle in degrees.
  1959. MinElevation [float]: the minimum elevation angle in degrees.
  1960. MaxElevation [float]: the maximum elevation angle in degrees.
  1961. FlipAzimuth [bool]: true if the 'Flip azimuth constraints' toggle is selected.
  1962. InParentConstructSpace [bool]: true if the 'Set the restrictions in the parent construct space' toggle is selected.
  1963. ```
  1964.  
  1965.  
  1966. ### `I:GetWeaponBlockInfo(weaponIndex)`
  1967.  
  1968. ```
  1969. inputs
  1970. -----
  1971. weaponIndex: [int] the index of the weapon you want information on. 0 is the first weapon.
  1972.  
  1973. outputs
  1974. -------
  1975. [BlockInfo] the block inforamation of the main component of the weapon. See 'Components' for information on BlockInfo.
  1976. ```
  1977.  
  1978. Gets the block information for a specific weapon.
  1979.  
  1980.  
  1981. ### `I:AimWeaponInDirection(weaponIndex, x,y,z, weaponSlot)`
  1982.  
  1983. ```
  1984. inputs
  1985. -----
  1986. weaponIndex: [int] 0 is the first weapon.
  1987. x,y,z: [floats] the world coordinate scheme direction components to point in. They don't need to be normalised.
  1988. weaponSlot: [int] 0 for all, otherwise 1 to 5.
  1989.  
  1990. outputs
  1991. -------
  1992. [int] the number of weapons that can fire in this direction. 0 for none.
  1993. ```
  1994.  
  1995. Aims a weapon in a specific direction. For a turret this will aim all weapons on the turret as well as the turret itself.
  1996.  
  1997.  
  1998. ### `I:FireWeapon(weaponIndex, weaponSlot)`
  1999.  
  2000. ```
  2001. inputs
  2002. -----
  2003. weaponIndex: [int] 0 is the first weapon.
  2004. weaponSlot: [int] 0 will control all weapons
  2005.  
  2006. outputs
  2007. -------
  2008. [bool] has any weapon fired? will be true if so.
  2009. ```
  2010.  
  2011. Fires a specific weapon. It's important for most weapons that you aim them first as they won't fire if they can't fire in the direction they are aimed.
  2012.  
  2013.  
  2014. ### `I:GetTurretSpinnerCount() - Obsolete`
  2015.  
  2016. ```
  2017. inputs
  2018. -----
  2019. N/A
  2020.  
  2021. outputs
  2022. -------
  2023. [int] the number of turrets and spinners on the construct
  2024. ```
  2025.  
  2026. Returns the number of turrets and spinners on the construct. You'll need this function if you want to control turreted or spin block mounted weapons individually
  2027.  
  2028.  
  2029. ### `I:GetWeaponCountOnTurretOrSpinner(turretSpinnerIndex) - Obsolete, please use 'GetWeaponCountOnSubConstruct' instead`
  2030.  
  2031. ```
  2032. inputs
  2033. -----
  2034. turretSpinnerIndex: [int] 0 is the first turret or spinner
  2035.  
  2036. outputs
  2037. -------
  2038. [int] the number of weapons on this turret or spinner, not including the turret itself
  2039. ```
  2040.  
  2041. return the number of weapons on the turret or spinner. If you wanted to control the turret itself then note that it is treated as a hull mounted weapon.
  2042.  
  2043.  
  2044. ### `I:GetWeaponInfoOnTurretOrSpinner(turretSpinnerIndex, weaponIndex) - Obsolete, please use 'GetWeaponInfoOnSubConstruct' instead`
  2045.  
  2046. ```
  2047. inputs
  2048. -----
  2049. turretSpinnerIndex: [int] the index of the turret or spinner. 0 is the first one.
  2050. weaponIndex: [int] the index of the weapon. 0 is the first one.
  2051.  
  2052. outputs
  2053. -------
  2054. [WeaponInfo] a WeaponInfo object. See above for the definition of this structure. Note that changes to this structure in LUA do not affect the weapon itself.
  2055. ```
  2056.  
  2057. Get weapon info of a weapon on a turret or spinner
  2058.  
  2059.  
  2060. ### `I:AimWeaponInDirectionOnTurretOrSpinner(turretSpinnerIndex,weaponIndex,x,y,z,weaponSlot) - Obsolete, please use 'AimWeaponInDirectionOnSubConstruct' instead`
  2061.  
  2062. ```
  2063. inputs
  2064. -----
  2065. First argument is now the turret spinner index, otherwise see 'AimWeaponInDirection'
  2066.  
  2067. outputs
  2068. -------
  2069. as per AimWeaponInDirection
  2070. ```
  2071.  
  2072. Aims a specific weapon on the turret without aiming the turret
  2073.  
  2074.  
  2075. ### `I:FireWeaponOnTurretOrSpinner(turretSpinnerIndex,weaponIndex,weaponSlot) - Obsolete, please use 'FireWeaponOnSubConstruct' instead`
  2076.  
  2077. ```
  2078. inputs
  2079. -----
  2080. First argument is now the turret spinner index, otherwise see 'FireWeapon'
  2081.  
  2082. outputs
  2083. -------
  2084. [bool] has any weapon fired? will be true if so.
  2085. ```
  2086.  
  2087. Fires a specific weapon. It's important for most weapons that you aim them first as they won't fire if they can't fire in the direction they are aimed.
  2088.  
  2089.  
  2090. ### `I:GetWeaponCountOnSubConstruct(SubConstructIdentifier)`
  2091.  
  2092. ```
  2093. inputs
  2094. -----
  2095. SubConstructIdentifier: [int] This identifier never change in the blueprint, use the SubConstructs-related functions to get it.
  2096.  
  2097. outputs
  2098. -------
  2099. [int] the number of weapons on this turret or spinner, not including the turret itself
  2100. ```
  2101.  
  2102. return the number of weapons on the turret or spinner. If you wanted to control the turret itself then note that it is treated as a hull mounted weapon.
  2103.  
  2104.  
  2105. ### `I:GetWeaponInfoOnSubConstruct(SubConstructIdentifier, weaponIndex)`
  2106.  
  2107. ```
  2108. inputs
  2109. -----
  2110. SubConstructIdentifier: [int] This identifier never change in the blueprint, use the SubConstructs-related functions to get it.
  2111. weaponIndex: [int] the index of the weapon. 0 is the first one.
  2112.  
  2113. outputs
  2114. -------
  2115. [WeaponInfo] a WeaponInfo object. See above for the definition of this structure. Note that changes to this structure in LUA do not affect the weapon itself.
  2116. ```
  2117.  
  2118. Get weapon info of a weapon on a turret or spinner
  2119.  
  2120.  
  2121. ### `I:GetWeaponConstraintsOnSubConstruct(SubConstructIdentifier, weaponIndex)`
  2122.  
  2123. ```
  2124. inputs
  2125. -----
  2126. SubConstructIdentifier: [int] This identifier never change in the blueprint, use the SubConstructs-related functions to get it.
  2127. weaponIndex: [int] the index of the weapon. 0 is the first one.
  2128.  
  2129. outputs
  2130. -------
  2131. [WeaponConsraints] information on the field-of-fire constraints of the weapon.
  2132. ```
  2133.  
  2134. Gets field-of-fire constrains information for a specific weapon.
  2135.  
  2136.  
  2137. ### `I:GetWeaponBlockInfoOnSubConstruct(SubConstructIdentifier, weaponIndex)`
  2138.  
  2139. ```
  2140. inputs
  2141. -----
  2142. SubConstructIdentifier: [int] This identifier never change in the blueprint, use the SubConstructs-related functions to get it.
  2143. weaponIndex: [int] the index of the weapon. 0 is the first one.
  2144.  
  2145. outputs
  2146. -------
  2147. [BlockInfo] the block inforamation of the main component of the weapon. See 'Components' for information on BlockInfo.
  2148. ```
  2149.  
  2150. Gets the block information for a specific weapon.
  2151.  
  2152.  
  2153. ### `I:AimWeaponInDirectionOnSubConstruct(SubConstructIdentifier,weaponIndex,x,y,z,weaponSlot)`
  2154.  
  2155. ```
  2156. inputs
  2157. -----
  2158. 'SubConstructIdentifier' is the SubConstruct identifier. For the other parameters, see 'AimWeaponInDirection'
  2159.  
  2160. outputs
  2161. -------
  2162. as per AimWeaponInDirection
  2163. ```
  2164.  
  2165. Aims a specific weapon on the turret without aiming the turret
  2166.  
  2167.  
  2168. ### `I:FireWeaponOnSubConstruct(SubConstructIdentifier,weaponIndex,weaponSlot)`
  2169.  
  2170. ```
  2171. inputs
  2172. -----
  2173. 'SubConstructIdentifier' is the SubConstruct identifier. For the other parameters, see 'FireWeapon'
  2174.  
  2175. outputs
  2176. -------
  2177. [bool] has any weapon fired? will be true if so.
  2178. ```
  2179.  
  2180. Fires a specific weapon. It's important for most weapons that you aim them first as they won't fire if they can't fire in the direction they are aimed.
  2181.  
  2182.  
  2183. # Missile Warning
  2184.  
  2185. ### `I:GetNumberOfWarnings()`
  2186.  
  2187. ```
  2188. inputs
  2189. -----
  2190. N/A
  2191.  
  2192. outputs
  2193. -------
  2194. [int] the number of missiles being warned on
  2195. ```
  2196.  
  2197. Return the number of missiles the construct has warnings for
  2198.  
  2199.  
  2200. ### `I:GetMissileWarning(missileIndex)`
  2201.  
  2202. ```
  2203. inputs
  2204. -----
  2205. missileIndex: [int] the index of the missile
  2206.  
  2207. outputs
  2208. -------
  2209. [MissileWarningInfo] information on the missile. missileWarningInfo.Valid = false if you didn't request an existing missile index
  2210. ```
  2211.  
  2212. Request information on a specific missile warning
  2213.  
  2214.  
  2215. ### struct `MissileWarningInfo`
  2216. ```
  2217. Valid: [bool] false if the warning is junk due to incorrect indices.
  2218. Position: [Vector3] the position of the missile
  2219. Velocity: [Vector3] the velocity of the missile in meters per second
  2220. Range : [float] the distance from centre of mass of your construct to the missile
  2221. Azimuth :[float] the azimuth angle between your construct's forward direction and the missile (degrees)
  2222. Elevation: [float] the elevation angle between your construct's forward direction and the missile (degrees)
  2223. TimeSinceLaunch: [float] the time since missile launch.
  2224. Id: [int] the unique Id of the missile
  2225. ```
  2226.  
  2227.  
  2228. # Missile Guidance
  2229.  
  2230. Connect LUA Transceivers to your missile blocks to allow missiles from those missile blocks to be send LUA Guidance points
  2231.  
  2232. ### `I:GetLuaTransceiverCount()`
  2233.  
  2234. ```
  2235. inputs
  2236. -----
  2237. N/A
  2238.  
  2239. outputs
  2240. -------
  2241. [int] the number of LuaTransceivers
  2242. ```
  2243.  
  2244. Return the number of LuaTransceivers. Each transceiver can have a number of missiles which are controllable
  2245.  
  2246.  
  2247. ### `I:GetLuaControlledMissileCount(luaTransceiverIndex)`
  2248.  
  2249. ```
  2250. inputs
  2251. -----
  2252. luaTransceiverIndex: [int] the index of the LuaTransceiver where 0 is the first one
  2253.  
  2254. outputs
  2255. -------
  2256. [int] the number of missiles associated with that LuaTransceiver
  2257. ```
  2258.  
  2259. Returns the number of missiles which that luaTransceiver has communications link to
  2260.  
  2261.  
  2262. ### `I:GetLuaTransceiverInfo(luaTransceiverIndex)`
  2263.  
  2264. ```
  2265. inputs
  2266. -----
  2267. luaTransceiverIndex: [int] the index of the LuaTransceiver where 0 is the first one
  2268.  
  2269. outputs
  2270. -------
  2271. [BlockInfo] a BlockInfo object for the LuaTransceiver's Launchpad
  2272. ```
  2273.  
  2274. Returns a BlockInfo object for the LuaTransceiver's Launchpad. If no Launch pad exists it'll return it for the LuaTransceiver.
  2275.  
  2276.  
  2277. See the Components tab for the BlockInfo structure
  2278.  
  2279. ### `I:GetLuaControlledMissileInfo(luaTransceiverIndex,missileIndex)`
  2280.  
  2281. ```
  2282. inputs
  2283. -----
  2284. luaTransceiverIndex: [int] 0 is the first one.
  2285. missileIndex: [int] 0 is the first missile.
  2286.  
  2287. outputs
  2288. -------
  2289. [MissileWarningInfo] Get a MissileWarningInfo object for your missile.
  2290. ```
  2291.  
  2292. Returns a MissileWarningInfo structure for your missile. You can tell where it is and how fast it is going from this
  2293.  
  2294.  
  2295. See the Missile Warning tab for the MissileWarningInfo structure
  2296.  
  2297. ### `I:SetLuaControlledMissileAimPoint(luaTransceiverIndex,missileIndex,x,y,z)`
  2298.  
  2299. ```
  2300. inputs
  2301. -----
  2302. luaTransceiverIndex: [int] as above.
  2303. missileIndex:[int] as above.
  2304. x,y,z: [floats] global coordinates of the aim point
  2305.  
  2306. outputs
  2307. -------
  2308. N/A
  2309. ```
  2310.  
  2311. Sets the aim point. No guidance modules will help achieve this aim point so do your own predictive guidance. Needs a lua receiver component ON the missile to work.
  2312.  
  2313.  
  2314. ### `I:DetonateLuaControlledMissile(luaTransceiverIndex,missileIndex)`
  2315.  
  2316. ```
  2317. inputs
  2318. -----
  2319. luaTransceiverIndex: [int] as above.
  2320. missileIndex:[int] as above.
  2321.  
  2322. outputs
  2323. -------
  2324. N/A
  2325. ```
  2326.  
  2327. Explodes the missile. Needs a lua receiver component ON the missile to work.
  2328.  
  2329.  
  2330. ### `I:IsLuaControlledMissileAnInterceptor(luaTransceiverIndex,missileIndex)`
  2331.  
  2332. ```
  2333. inputs
  2334. -----
  2335. luaTranceiverIndex:[int] 0 is the first one
  2336. missileIndex:[int] 0 is the first one
  2337.  
  2338. outputs
  2339. -------
  2340. [bool]: true means the missile has an interceptor module, otherwise false is returned. If the missile has no lua receiver false will be returned.
  2341. ```
  2342.  
  2343. Find out if the missile has an interceptor capability.
  2344.  
  2345.  
  2346. ### `I:SetLuaControlledMissileInterceptorTarget(luaTransceiverIndex,missileIndex,targetIndex)`
  2347.  
  2348. ```
  2349. inputs
  2350. -----
  2351. luaTransceiverIndex:[int] 0 is the first one
  2352. missileIndex:[int] 0 is the first one,
  2353. targetIndex:[int] 0 is the first missile which that mainframe has a warning for
  2354.  
  2355. outputs
  2356. -------
  2357. N/A
  2358. ```
  2359.  
  2360. Set the target of an interceptor missile to be a specific missile for which a warning exists. This is enough to get the interceptor missile to behave normally but if you want to actually guide it yourself use SetLuaControlledMissileInterceptorStandardGuidanceOnOff to turn the guidance off.
  2361.  
  2362.  
  2363. ### `I:SetLuaControlledMissileInterceptorStandardGuidanceOnOff(luaTranceiver,missileIndex, onOff)`
  2364.  
  2365. ```
  2366. inputs
  2367. -----
  2368. luaTransceiverIndex:[int] 0 is the first one
  2369. missileIndex:[int] 0 is the first one
  2370. onOff:[bool] true will use standard missile guidance to aim at the interceptors target, false will rely on SetLuaControlledMissileAimPoint for aiming coordinates.
  2371.  
  2372. outputs
  2373. -------
  2374. N/A
  2375. ```
  2376.  
  2377. Turns standard guidance for the missile on and off. Turn it off if you're going to guide the missile in yourself.
  2378.  
  2379.  
  2380. # Spinners
  2381.  
  2382. Spin blocks spinners have their own interface because they use 'SubConstruct' identifiers
  2383.  
  2384. ### `I:SetSpinBlockSpeedFactor(SubConstructIdentifier,speedFactor)`
  2385.  
  2386. ```
  2387. inputs
  2388. -----
  2389. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct.
  2390. speedFactor:[float] 0 to 1, the fractional power output
  2391.  
  2392. outputs
  2393. -------
  2394. N/A
  2395. ```
  2396.  
  2397. Set the speed factor. In continuous mode spinners this allows some blades to spin slower than others, in insta-spin blades this is related to the speed they are spinning at (1 is max speed, 0 is no speed), and in rotation spinners this does nothing.
  2398.  
  2399.  
  2400. ### `I:SetSpinBlockPowerDrive(SubConstructIdentifier,drive)`
  2401.  
  2402. ```
  2403. inputs
  2404. -----
  2405. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct.
  2406. drive:[float] the relative power use of the spinner (0 to 10).
  2407.  
  2408. outputs
  2409. -------
  2410. N/A
  2411. ```
  2412.  
  2413. Sets the power drive. this allows heliblades to produce more force. Requires engine power. 0 removes engine use. 10 is maximum power use.
  2414.  
  2415.  
  2416. ### `I:SetSpinBlockRotationAngle(SubConstructIdentifier, angle)`
  2417.  
  2418. ```
  2419. inputs
  2420. -----
  2421. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct.
  2422. angle:[float] angle in degrees to turn to.
  2423.  
  2424. outputs
  2425. -------
  2426. N/A
  2427. ```
  2428.  
  2429. Sets the angle of rotation. Changes the spinner into Rotate mode. 'Rotatebackwards' is not available through this interface but you shouldn't need it.
  2430.  
  2431.  
  2432. ### `I:SetSpinBlockContinuousSpeed(SubConstructIdentifier, speed)`
  2433.  
  2434. ```
  2435. inputs
  2436. -----
  2437. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct.
  2438. speed:[float] speed to rotate at. 30 is the maximum so values from -30 to 30 work.
  2439.  
  2440. outputs
  2441. -------
  2442.  
  2443. ```
  2444.  
  2445. Sets the speed of rotation. Changes the spinner into continuous mode. 'ContinuouseReverse' mode is not available through this interface so set the speed negative to facilitate reverse spinning.
  2446.  
  2447.  
  2448. ### `I:SetSpinBlockInstaSpin(SubConstructIdentifier,magnitudeAndDirection)`
  2449.  
  2450. ```
  2451. inputs
  2452. -----
  2453. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct.
  2454. magnitudeAndDirection:[float] -1 means spin backwards full speed, 1 is spin forwards full speed
  2455.  
  2456. outputs
  2457. -------
  2458. N/A
  2459. ```
  2460.  
  2461. Spins the blades in a direction and speed determined by magnitudeAndDirection. Will set the spinner into instaspin forwards mode and will affect speed factor variable of the spinner.
  2462.  
  2463.  
  2464. Pistons have their own interface because they use 'SubConstruct' identifiers
  2465.  
  2466. ### `I:GetPistonExtension(SubConstructIdentifier)`
  2467.  
  2468. ```
  2469. inputs
  2470. -----
  2471. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct.
  2472.  
  2473. outputs
  2474. -------
  2475. [float] the extension distance of the piston in meters
  2476. ```
  2477.  
  2478. Get the extension of the piston, -1 if not found.
  2479.  
  2480.  
  2481. ### `I:GetPistonVelocity(SubConstructIdentifier)`
  2482.  
  2483. ```
  2484. inputs
  2485. -----
  2486. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct.
  2487.  
  2488. outputs
  2489. -------
  2490. [float] the velocity of the piston in meters per second
  2491. ```
  2492.  
  2493. Get the velocity of the piston (always positive), -1 if not found.
  2494.  
  2495.  
  2496. ### `I:SetPistonExtension(SubConstructIdentifier,ExtensionDistance)`
  2497.  
  2498. ```
  2499. inputs
  2500. -----
  2501. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct.
  2502. ExtensionDistance:[float]the extension distance of the piston (in meters, will be clamped if necessary)
  2503.  
  2504. outputs
  2505. -------
  2506. N/A
  2507. ```
  2508.  
  2509. Set the extension of the piston.
  2510.  
  2511.  
  2512. ### `I:SetPistonVelocity(SubConstructIdentifier,ExtensionVelocity)`
  2513.  
  2514. ```
  2515. inputs
  2516. -----
  2517. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct.
  2518. ExtensionDistance:[float]the velocity of the piston in meters per second (between 0.1 and 2)
  2519.  
  2520. outputs
  2521. -------
  2522. N/A
  2523. ```
  2524.  
  2525. Set the velocity of the piston.
  2526.  
  2527.  
  2528. Dedicated helicopter spinners have their own interface because they have their own indexing system
  2529.  
  2530. ### `I:GetDedibladeCount()`
  2531.  
  2532. ```
  2533. inputs
  2534. -----
  2535. N/A
  2536.  
  2537. outputs
  2538. -------
  2539. [int] the number of dedicated helicopter spinners
  2540. ```
  2541.  
  2542. Returns the number of dedicated helicopter spinners
  2543.  
  2544.  
  2545. ### `I:GetDedibladeInfo(DedibladeIndex)`
  2546.  
  2547. ```
  2548. inputs
  2549. -----
  2550. DedibladeIndex:[int] 0 is the first dedicated helicopter spinner
  2551.  
  2552. outputs
  2553. -------
  2554. [BlockInfo] a block info object for the dedicated helicopter spinner.
  2555. ```
  2556.  
  2557. Returns block info for the dedicated helicopter spinner.
  2558.  
  2559.  
  2560. ### `I:IsDedibladeOnHull(DedibladeIndex)`
  2561.  
  2562. ```
  2563. inputs
  2564. -----
  2565. DedibladeIndex:[int] 0 is the first dedicated helicopter spinner
  2566.  
  2567. outputs
  2568. -------
  2569. [bool] true if on hull
  2570. ```
  2571.  
  2572. Returns whether the dedicated helicopter spinner is on the hull or on a SubConstruct.
  2573.  
  2574.  
  2575. ### `I:SetDedibladeSpeedFactor(DedibladeIndex,speedFactor)`
  2576.  
  2577. ```
  2578. inputs
  2579. -----
  2580. DedibladeIndex:[int] 0 is the first dedicated helicopter spinner.
  2581. speedFactor:[float] 0 to 1, the fractional power output
  2582.  
  2583. outputs
  2584. -------
  2585. N/A
  2586. ```
  2587.  
  2588. Set the speed factor. In continuous mode spinners this allows some blades to spin slower than others, in insta-spin blades this is related to the speed they are spinning at (1 is max speed, 0 is no speed), and in rotation spinners this does nothing.
  2589.  
  2590.  
  2591. ### `I:SetDedibladePowerDrive(DedibladeIndex,drive)`
  2592.  
  2593. ```
  2594. inputs
  2595. -----
  2596. DedibladeIndex:[int] 0 is the first dedicated helicopter spinner.
  2597. drive:[float] the relative power use of the dedicated helicopter spinner (0 to 10).
  2598.  
  2599. outputs
  2600. -------
  2601. N/A
  2602. ```
  2603.  
  2604. Sets the power drive. this allows heliblades to produce more force. Requires engine power. 0 removes engine use. 10 is maximum power use.
  2605.  
  2606.  
  2607. ### `I:SetDedibladeContinuousSpeed(DedibladeIndex, speed)`
  2608.  
  2609. ```
  2610. inputs
  2611. -----
  2612. DedibladeIndex:[int] 0 is the first dedicated helicopter spinner.
  2613. speed:[float] speed to rotate at. 30 is the maximum so values from -30 to 30 work.
  2614.  
  2615. outputs
  2616. -------
  2617.  
  2618. ```
  2619.  
  2620. Sets the speed of rotation. Changes the dedicated helicopter spinner into continuous mode. 'ContinuouseReverse' mode is not available through this interface so set the speed negative to facilitate reverse spinning.
  2621.  
  2622.  
  2623. ### `I:SetDedibladeInstaSpin(DedibladeIndex,magnitudeAndDirection)`
  2624.  
  2625. ```
  2626. inputs
  2627. -----
  2628. DedibladeIndex:[int] 0 is the first dedicated helicopter spinner.
  2629. magnitudeAndDirection:[float] -1 means spin backwards full speed, 1 is spin forwards full speed
  2630.  
  2631. outputs
  2632. -------
  2633. N/A
  2634. ```
  2635.  
  2636. Spins the blades in a direction and speed determined by magnitudeAndDirection. Will set the dedicated helicopter spinner into instaspin forwards mode and will affect speed factor variable of the spinner.
  2637.  
  2638.  
  2639. ### `I:SetDedibladeUpFraction(DedibladeIndex,upFraction)`
  2640.  
  2641. ```
  2642. inputs
  2643. -----
  2644. DedibladeIndex:[int] 0 is the first dedicated helicopter spinner.
  2645. upFraction:[float] 0 to 1.
  2646.  
  2647. outputs
  2648. -------
  2649. N/A
  2650. ```
  2651.  
  2652. Sets the fraction of the force that will be applied directly upwards, regardless of blade orientation.
  2653.  
  2654.  
  2655. From now on, these functions are obsolete, please use the 'SubConstructs' set of functions
  2656.  
  2657. ### `I:GetSpinnerCount() - Obsolete, please see the 'SubConstructs' set of functions`
  2658.  
  2659. ```
  2660. inputs
  2661. -----
  2662. N/A
  2663.  
  2664. outputs
  2665. -------
  2666. [int] the number of spinners. This includes 'dedicated helispinners', which may be mounted on traditional spin blocks.
  2667. ```
  2668.  
  2669. Returns the number of spin blocks and dedicated helispinners
  2670.  
  2671.  
  2672. ### `I:GetSpinnerInfo(index) - Obsolete, please see the 'SubConstructs' set of functions`
  2673.  
  2674. ```
  2675. inputs
  2676. -----
  2677. index:[int] 0 is the first spin block
  2678.  
  2679. outputs
  2680. -------
  2681. [BlockInfo] a block info object for the spin block.
  2682. ```
  2683.  
  2684. Returns block info for the spinner. For a spin block it will return block info where local positions and rotations are those of the actual spinning assembly, not the block itself.
  2685.  
  2686.  
  2687. ### `I:SetSpinnerSpeedFactor(index,speedFactor) - Obsolete, please see the 'SubConstructs' set of functions`
  2688.  
  2689. ```
  2690. inputs
  2691. -----
  2692. index:[int] the index of the spinner.
  2693. speedFactor:[float] 0 to 1, the fractional power output
  2694.  
  2695. outputs
  2696. -------
  2697. N/A
  2698. ```
  2699.  
  2700. Set the speed factor. In continuous mode spinners this allows some blades to spin slower than others, in insta-spin blades this is related to the speed they are spinning at (1 is max speed, 0 is no speed), and in rotation spinners this does nothing.
  2701.  
  2702.  
  2703. ### `I:SetSpinnerPowerDrive(index,drive) - Obsolete, please see the 'SubConstructs' set of functions`
  2704.  
  2705. ```
  2706. inputs
  2707. -----
  2708. index[int] the index of the spinner. 0 is the first.
  2709. drive:[float] the relative power use of the spinner (0 to 10).
  2710.  
  2711. outputs
  2712. -------
  2713. N/A
  2714. ```
  2715.  
  2716. Sets the power drive. this allows heliblades to produce more force. Requires engine power. 0 removes engine use. 10 is maximum power use.
  2717.  
  2718.  
  2719. ### `I:SetSpinnerRotationAngle(index, angle) - Obsolete, please see the 'SubConstructs' set of functions`
  2720.  
  2721. ```
  2722. inputs
  2723. -----
  2724. index:[int] 0 is the first spinner.
  2725. angle:[float] angle in degrees to turn to.
  2726.  
  2727. outputs
  2728. -------
  2729. N/A
  2730. ```
  2731.  
  2732. Sets the angle of rotation. Changes the spinner into Rotate mode. 'Rotatebackwards' is not available through this interface but you shouldn't need it.
  2733.  
  2734.  
  2735. ### `I:SetSpinnerContinuousSpeed(index, speed) - Obsolete, please see the 'SubConstructs' set of functions`
  2736.  
  2737. ```
  2738. inputs
  2739. -----
  2740. index:[int] 0 is the first spinner.
  2741. speed:[float] speed to rotate at. 30 is the maximum so values from -30 to 30 work.
  2742.  
  2743. outputs
  2744. -------
  2745.  
  2746. ```
  2747.  
  2748. Sets the speed of rotation. Changes the spinner into continuous mode. 'ContinuouseReverse' mode is not available through this interface so set the speed negative to facilitate reverse spinning.
  2749.  
  2750.  
  2751. ### `I:SetSpinnerInstaSpin(index,magnitudeAndDirection) - Obsolete, please see the 'SubConstructs' set of functions`
  2752.  
  2753. ```
  2754. inputs
  2755. -----
  2756. index:[int] 0 is the first spinner.
  2757. magnitudeAndDirection:[float] -1 means spin backwards full speed, 1 is spin forwards full speed
  2758.  
  2759. outputs
  2760. -------
  2761. N/A
  2762. ```
  2763.  
  2764. Spins the blades in a direction and speed determined by magnitudeAndDirection. Will set the spinner into instaspin forwards mode and will affect speed factor variable of the spinner.
  2765.  
  2766.  
  2767. ### `I:IsSpinnerDedicatedHelispinner(index) - Obsolete`
  2768.  
  2769. ```
  2770. inputs
  2771. -----
  2772. index:[int] 0 is the first spinner.
  2773.  
  2774. outputs
  2775. -------
  2776. [bool] true if the spinner is a dedicated spinner.
  2777. ```
  2778.  
  2779. Returns whether the spinner in question is a dedicated helispinner
  2780.  
  2781.  
  2782. ### `I:IsSpinnerOnHull(index) - Obsolete, please see the 'IsDedibladeOnHull' or 'IsSubConstructOnHull' function`
  2783.  
  2784. ```
  2785. inputs
  2786. -----
  2787. index:[int] 0 is the first spinner
  2788.  
  2789. outputs
  2790. -------
  2791. [bool] true if on hull
  2792. ```
  2793.  
  2794. Returns whether the spinner is on the hull or on another spin block. This can only be true for dedicated helispinners
  2795.  
  2796.  
  2797. ### `I:SetDedicatedHelispinnerUpFraction(index,upFraction) - Obsolete, please use the 'SetDedibladeUpFraction' function`
  2798.  
  2799. ```
  2800. inputs
  2801. -----
  2802. index:[int] 0 is the first spinner.
  2803. upFraction:[float] 0 to 1.
  2804.  
  2805. outputs
  2806. -------
  2807. N/A
  2808. ```
  2809.  
  2810. Only works for dedicated helispinners. Sets the fraction of the force that will be applied directly upwards, regardless of blade orientation.
  2811.  
  2812.  
  2813. # SubConstructs
  2814.  
  2815. SubConstructs (turrets and spin blocks) have their own interface dedicated to work with stacked SubConstructs. They all have a unique persistent index which will never be modified in the blueprint (that index starts at 1)
  2816.  
  2817. ### `I:GetAllSubconstructsCount()`
  2818.  
  2819. ```
  2820. inputs
  2821. -----
  2822. N/A
  2823.  
  2824. outputs
  2825. -------
  2826. [int] the total number of SubConstructs on the vehicle
  2827. ```
  2828.  
  2829. Returns the number of SubConstructs on the vehicle, including SubConstructs on SubConstructs
  2830.  
  2831.  
  2832. ### `I:GetSubConstructIdentifier(index)`
  2833.  
  2834. ```
  2835. inputs
  2836. -----
  2837. index:[int] 0 is the first SubConstruct
  2838.  
  2839. outputs
  2840. -------
  2841. [int] the persistent indentifier of the SubConstruct
  2842. ```
  2843.  
  2844. Returns the identifier of the SubConstruct. The indices start at 0 and are in no particular order
  2845.  
  2846.  
  2847. ### `I:GetSubconstructsChildrenCount(SubConstructIdentifier)`
  2848.  
  2849. ```
  2850. inputs
  2851. -----
  2852. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct
  2853.  
  2854. outputs
  2855. -------
  2856. [int] all the number of SubConstructs directly placed on the given SubConstruct.
  2857. ```
  2858.  
  2859. Returns the number of SubConstructs on the given SubConstruct
  2860.  
  2861.  
  2862. ### `I:GetSubConstructChildIdentifier(SubConstructIdentifier, index)`
  2863.  
  2864. ```
  2865. inputs
  2866. -----
  2867. SubConstructIdentifier:[int] the persistent identifier of the parent SubConstruct
  2868. index:[int] 0 is the first child SubConstruct
  2869.  
  2870. outputs
  2871. -------
  2872. [int] the persistent indentifier of the SubConstruct
  2873. ```
  2874.  
  2875. Returns the identifier of the child SubConstruct placed on the parent SubConstruct. The indices start at 0 and are in no particular order
  2876.  
  2877.  
  2878. ### `I:GetParent(SubConstructIdentifier)`
  2879.  
  2880. ```
  2881. inputs
  2882. -----
  2883. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct
  2884.  
  2885. outputs
  2886. -------
  2887. [int] the persistent index of the parent SubConstruct of the given SubConstruct.
  2888. ```
  2889.  
  2890. Returns the persistent index of the parent SubConstruct of the given SubConstruct, '0' for the MainConstruct, '-1' if not found
  2891.  
  2892.  
  2893. ### `I:IsTurret(SubConstructIdentifier)`
  2894.  
  2895. ```
  2896. inputs
  2897. -----
  2898. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct
  2899.  
  2900. outputs
  2901. -------
  2902. [bool] 'true' if the SubConstruct is a turret, 'false' otherwise.
  2903. ```
  2904.  
  2905. Indicates if the SubConstruct is a turret or not
  2906.  
  2907.  
  2908. ### `I:IsSpinBlock(SubConstructIdentifier)`
  2909.  
  2910. ```
  2911. inputs
  2912. -----
  2913. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct
  2914.  
  2915. outputs
  2916. -------
  2917. [bool] 'true' if the SubConstruct is a spin block, 'false' otherwise.
  2918. ```
  2919.  
  2920. Indicates if the SubConstruct is a spin block or not
  2921.  
  2922.  
  2923. ### `I:IsPiston(SubConstructIdentifier)`
  2924.  
  2925. ```
  2926. inputs
  2927. -----
  2928. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct
  2929.  
  2930. outputs
  2931. -------
  2932. [bool] 'true' if the SubConstruct is a piston, 'false' otherwise.
  2933. ```
  2934.  
  2935. Indicates if the SubConstruct is a piston or not
  2936.  
  2937.  
  2938. ### `I:IsAlive(SubConstructIdentifier)`
  2939.  
  2940. ```
  2941. inputs
  2942. -----
  2943. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct
  2944.  
  2945. outputs
  2946. -------
  2947. [bool] 'true' if the SubConstruct is not completely destroyed.
  2948. ```
  2949.  
  2950. Indicates if the SubConstruct is destroyed or not
  2951.  
  2952.  
  2953. ### `I:IsSubConstructOnHull(SubConstructIdentifier)`
  2954.  
  2955. ```
  2956. inputs
  2957. -----
  2958. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct
  2959.  
  2960. outputs
  2961. -------
  2962. [bool] 'true' if the SubConstruct is on the hull.
  2963. ```
  2964.  
  2965. Indicates if the SubConstruct is on the hull or not
  2966.  
  2967.  
  2968. ### `I:GetSubConstructInfo(SubConstructIdentifier)`
  2969.  
  2970. ```
  2971. inputs
  2972. -----
  2973. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct
  2974.  
  2975. outputs
  2976. -------
  2977. [BlockInfo] a BlockInfo object for the SubConstruct active block (the SpinBlock block, the piston or the turret block)
  2978. ```
  2979.  
  2980. Returns a BlockInfo object for the active block of the SubConstruct, and invalid BlockInfo if the SubConstruct hasn't been found.
  2981.  
  2982.  
  2983. ### `I:GetSubConstructIdleRotation(SubConstructIdentifier)`
  2984.  
  2985. ```
  2986. inputs
  2987. -----
  2988. SubConstructIdentifier:[int] the persistent identifier of the SubConstruct
  2989.  
  2990. outputs
  2991. -------
  2992. [Quaternion] the rotation of the subconstruct relative to its parent as it was first placed.
  2993. ```
  2994.  
  2995. Returns a Quaternion representing the orientation of the block in its parent SubConstruct as it was when it was placed.
  2996.  
  2997.  
  2998. # Friendlies
  2999.  
  3000. The following API will provide you with the positions of friendly vehicles- in the same manner as
  3001.  
  3002. ### `I:GetFriendlyCount()`
  3003.  
  3004. ```
  3005. inputs
  3006. -----
  3007. N/A
  3008.  
  3009. outputs
  3010. -------
  3011. [int] the number of friendlies spawned into the world
  3012. ```
  3013.  
  3014. Returns the number of friendly constructs
  3015.  
  3016.  
  3017. ### `I:GetFriendlyInfo(index)`
  3018.  
  3019. ```
  3020. inputs
  3021. -----
  3022. index: [int] 0 is the first construct
  3023.  
  3024. outputs
  3025. -------
  3026. [FriendlyInfo] the FriendlyInfo object
  3027. ```
  3028.  
  3029. Returns a friendly info object for a friendly vehicle
  3030.  
  3031.  
  3032. ### `I:GetFriendlyInfoById(Id)`
  3033.  
  3034. ```
  3035. inputs
  3036. -----
  3037. Id: [int] the Id you want
  3038.  
  3039. outputs
  3040. -------
  3041. [FriendlyInfo] the FriendlyInfo object
  3042. ```
  3043.  
  3044. Returns a friendly info object for an Id
  3045.  
  3046.  
  3047. ### struct `FriendlyInfo`
  3048. ```
  3049. Valid:[bool] false if the Friendly Info could not be retrieved
  3050. Rotation:[Quaternion] the rotation of the friendly construct
  3051. ReferencePosition: [Vector3] the position of the construct (world East Up North frame) from which PositiveSize and Negative size are referenced
  3052. PositiveSize: [Vector3] the extent of the construct in the right,up,forwards direction relative to ReferencePostion
  3053. NegativeSize: [Vector3] the extent of the construct in the left,down,back direction relative to ReferencePosition
  3054. CenterOfMass: [Vector3] the centre of mass of the construct in world East Up North frame
  3055. Velocity: [Vector3] the velocity of the construct in world East Up North frame
  3056. UpVector: [Vector3] The up vector in world East Up North frame
  3057. RightVector: [Vector3] The up vector in world East Up North frame
  3058. ForwardVector: [Vector3] The forward vector in world East Up North frame
  3059. HealthFraction: [float] the fraction of health (including turrets etc)
  3060. SparesFraction: [float] the spares fraction. Returns 1 if no spares storage present
  3061. AmmoFraction: [float] the ammo fraction. Returns 1 if no ammo storage present
  3062. FuelFraction: [float] the fuel fraction. Returns 1 if no fuel storage present
  3063. EnergyFraction: [float] the energy fraction. Returns 1 if no batteries present
  3064. PowerFraction: [float] the power fraction. Returns 1 if no fuel storage present
  3065. ElectricPowerFraction: [float] the electric power fraction. Returns 1 if no fuel storage present
  3066. AxisAlignedBoundingBoxMinimum: [Vector3] the world East Up North minimum extent of the construct
  3067. AxisAlignedBoundingBoxMaximum: [Vector3] the world East Up North maximum extent of the construct
  3068. BlueprintName: [string] the name
  3069. Id: [int] the unique Id of the construct
  3070. ```
  3071.  
  3072.  
  3073.  
Add Comment
Please, Sign In to add comment