LUA Box

From From the Depths Wiki
Jump to: navigation, search

Contents

Mechanics[edit | edit source]

If a LUA Box is destroyed, execution is suspended until it is repaired. The box will keep its previous state.

Lua code is stopped when the vehicle is pulled out of play. The code is restarted anew when a vehicle is put into play.

Functions[edit | edit source]

Propulsion[edit | edit source]

I:TellAiThatWeAreTakingControl()[edit | edit source]

I:RequestControl(mode,type,drive)[edit | edit source]

I:RequestThrustControl(type)[edit | edit source]

I:RequestThrustControl(type, scale)[edit | edit source]

I:RequestWaterForwards(drive)[edit | edit source]

I:RequestComplexControllerStimulus(stim)[edit | edit source]

I:MoveFortress[edit | edit source]

Target Info[edit | edit source]

I:GetNumberOfMainframes()[edit | edit source]

I:GetNumberOfTargets(mainframeIndex)[edit | edit source]

I:GetTargetInfo(mainframeIndex, targetIndex)[edit | edit source]

I:GetTargetPositionInfo(mainframeIndex, targetIndex)[edit | edit source]

I:GetTargetPositionInfoForPosition(mainframeIndex, x,y,z)[edit | edit source]

Misc[edit | edit source]

I:GetTerrainAltitudeForPosition(x,y,z)[edit | edit source]

I:GetTerrainAltitudeForLocalPosition(x,y,z)[edit | edit source]

I:GetGravityForAltitude(alt)[edit | edit source]

I:GetTime()[edit | edit source]

I:GetTimeSinceSpawn()[edit | edit source]

I:GetGameTime()[edit | edit source]

Self Awareness[edit | edit source]

I:GetConstructPosition()[edit | edit source]

I:GetConstructForwardVector()[edit | edit source]

I:GetConstructRightVector()[edit | edit source]

I:GetConstructUpVector()[edit | edit source]

I:GetConstructMaxDimensions()[edit | edit source]

I:GetConstructMinDimensions()[edit | edit source]

I:GetConstructRoll()[edit | edit source]

I:GetConstructPitch()[edit | edit source]

This is in degrees between 0 and 360. Note that unlike the HUD indicator, positive represents the nose-down direction.

I:GetConstructYaw()[edit | edit source]

I:GetConstructCenterOfMass()[edit | edit source]

I:GetAiPosition(mainframeIndex)[edit | edit source]

I:GetVelocityMagnitude()[edit | edit source]

I:GetForwardsVelocityMagnitude()[edit | edit source]

I:GetVelocityVector()[edit | edit source]

I:GetVelocityVectorNormalized()[edit | edit source]

I:GetAngularVelocity()[edit | edit source]

I:GetLocalAngularVelocity()[edit | edit source]

I:GetAmmoFraction()[edit | edit source]

I:GetFuelFraction()[edit | edit source]

I:GetSparesFraction()[edit | edit source]

Components[edit | edit source]

Component types are as follows:

  • 0: Balloon deployers
  • 1: Drive maintainers
  • 2: Air pump
  • 3: Resource gatherer
  • 4: Oil drill
  • 5: Ammo processor
  • 6: Oil processor
  • 7: Tractor beam
  • 8: Hydrofoil
  • 9: Propulsion
  • 10: Shield projector

I:Component_GetCount(type)[edit | edit source]

I:Component_GetLocalPosition(type,index)[edit | edit source]

I:Component_GetBlockInfo(type,index)[edit | edit source]

I:Component_GetBoolLogic(type,index)[edit | edit source]

I:Component_SetBoolLogic(type,index,bool)[edit | edit source]

I:Component_GetFloatLogic(type,index)[edit | edit source]

I:Component_SetFloatLogic(type,index,float)[edit | edit source]

I:Component_GetIntLogic(type,index)[edit | edit source]

I:Component_SetIntLogic(type,index,integer)[edit | edit source]

I:Component_SetBoolLogicAll(type, bool)[edit | edit source]

I:Component_SetFloatLogicAll(type, float)[edit | edit source]

I:Component_SetIntLogicAll(type, int)[edit | edit source]

Weapon[edit | edit source]

I:GetWeaponCount()[edit | edit source]

I:GetWeaponInfo(weaponIndex)[edit | edit source]

I:AimWeaponInDirection(weaponIndex, x,y,z, weaponSlot)[edit | edit source]

I:FireWeapon(weaponIndex, weaponSlot)[edit | edit source]

I:GetTurretSpinnerCount()[edit | edit source]

I:GetWeaponCountOnTurretOrSpinner(turretSpinnerIndex)[edit | edit source]

I:GetWeaponInfoOnTurretOrSpinner(turretSpinnerIndex, weaponIndex)[edit | edit source]

I:AimWeaponInDirectionOnTurretOrSpinner(turretSpinnerIndex,weaponIndex,x,y,z,weaponSlot)[edit | edit source]

I:FireWeaponOnTurretOrSpinner(turretSpinnerIndex,weaponIndex,weaponSlot)[edit | edit source]

Missile Warning[edit | edit source]

I:GetNumberOfWarnings(mainframeIndex)[edit | edit source]

I:GetMissileWarning(mainframeIndex, missileIndex)[edit | edit source]

Missile Guidance[edit | edit source]

I:GetLuaTransceiverCount()[edit | edit source]

I:GetLuaControlledMissileCount(luaTransceiverIndex)[edit | edit source]

I:GetLuaTransceiverInfo(luaTransceiverIndex)[edit | edit source]

I:GetLuaControlledMissileInfo(luaTransceiverIndex,missileIndex)[edit | edit source]

I:SetLuaControlledMissileAimPoint(luaTransceiverIndex,missileIndex,x,y,z)[edit | edit source]

I:DetonateLuaControlledMissile(luaTransceiverIndex,missileIndex)[edit | edit source]

I:IsLuaControlledMissileAnInterceptor(luaTransceiverIndex,missileIndex)[edit | edit source]

I:SetLuaControlledMissileInterceptorTarget(luaTransceiverIndex,missileIndex,mainframeIndex, targetIndex)[edit | edit source]

I:SetLuaControlledMissileInterceptorStandardGuidanceOnOff(luaTranceiver,missileIndex, onOff)[edit | edit source]

Spin blocks[edit | edit source]

I:GetSpinnerCount()[edit | edit source]

I:GetSpinnerInfo(index)[edit | edit source]

I:SetSpinnerSpeedFactor(index,speedFactor)[edit | edit source]

I:SetSpinnerPowerDrive(index,drive)[edit | edit source]

I:SetSpinnerRotationAngle(index, angle)[edit | edit source]

I:SetSpinnerContinuousSpeed(index, speed)[edit | edit source]

I:SetSpinnerInstaSpin(index,magnitudeAndDirection)[edit | edit source]

I:IsSpinnerDedicatedHelispinner(index)[edit | edit source]

I:IsSpinnerOnHull(index)[edit | edit source]

I:SetDedicatedHelispinnerUpFraction(index,upFraction)[edit | edit source]

Friendlies[edit | edit source]

I:GetFriendlyCount()[edit | edit source]

I:GetFriendlyInfo(index)[edit | edit source]

I:GetFriendlyInfoById(Id)[edit | edit source]

Tables[edit | edit source]

TargetInfo[edit | edit source]

  • Valid
  • Priority
  • Score
  • AimPointPosition
  • Team
  • Protected
  • Position
  • Velocity
  • PlayerTargetChoice
  • Id

TargetPositionInfo[edit | edit source]

  • Valid
  • Azimuth
  • Elevation
  • ElevationForAltitudeComponentOnly
  • Range
  • Direction
  • GroundDistance
  • AltitudeAboveSeaLevel
  • Position
  • Velocity

BlockInfo[edit | edit source]

  • Position
  • LocalPosition
  • LocalPositionRelativeToCom
  • Forwards
  • LocalForwards
  • Rotation
  • LocalRotation

WeaponInfo[edit | edit source]

  • Valid
  • LocalPosition
  • GlobalPosition
  • Speed
  • CurrentDirection
  • WeaponType
  • WeaponSlot
  • PlayerCurrentlyControllingIt

MissileWarningInfo[edit | edit source]

  • Valid
  • Position
  • Velocity
  • Range
  • Azimuth
  • Elevation
  • TimeSinceLaunch
  • Id

FriendlyInfo[edit | edit source]

  • Valid
  • Rotation
  • ReferencePosition
  • PositiveSize
  • NegativeSize
  • CenterOfMass
  • Velocity
  • UpVector
  • RightVector
  • ForwardVector
  • HealthFraction
  • SparesFraction
  • AmmoFraction
  • FuelFraction
  • AxisAlignedBoundingBoxMinimum
  • AxisAlignedBoundingBoxMaximum
  • BlueprintName
  • Id