From the Depths Wiki
Explore
Main Page
All Pages
Interactive Maps
navigation
Main page
Community portal
Recent changes
Random page
Admin noticeboard
Links
Official Website
Steam Forums
Steam Store Page
Facebook Page
Reddit
Twitter Page
YouTube Channel
Discord
Useful pages
Components
Weapon Design
Guides
Items And Skills
Gamepedia
Gamepedia support
Report a bad ad
Help Wiki
Contact us
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
From the Depths Wiki
474
pages
Explore
Main Page
All Pages
Interactive Maps
navigation
Main page
Community portal
Recent changes
Random page
Admin noticeboard
Links
Official Website
Steam Forums
Steam Store Page
Facebook Page
Reddit
Twitter Page
YouTube Channel
Discord
Useful pages
Components
Weapon Design
Guides
Items And Skills
Gamepedia
Gamepedia support
Report a bad ad
Help Wiki
Contact us
Editing
LUA Box
(section)
Back to page
Edit
VisualEditor
View history
Talk (1)
Edit Page
LUA Box
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Functions== === Logging/Debugging === ==== I:Log(Message) ==== * Takes in a <u>string</u> for a log and writes it to the log. These logs will be shown in the "Errors/Logs" panel within the Lua Box. The last 100 of these messages will be maintained. ** Useful for debugging algorithms by printing out values, execution errors, etc. ==== I:ClearLogs() ==== * Clears all current logs. ==== I:LogToHud(Message) ==== * Takes in a <u>string</u> message and displays said message as a pop up on the user's HUD, no matter where they are. === Fleet Awareness === ==== I.FleetIndex ==== * the read only integer that describes the position of the ship in the fleet, starting from zero. ==== I.isFlagship ==== * the read only boolean that tells Lua whether the ship is the flagship of its fleet or not. ==== Fleetinfo ==== * ID ** Integer ID of the fleet. * Name ** String name of the fleet. * Flagship ** FriendlyInfo object of the flagship. * Members ** FriendlyInfo object array that consists of the ships within a fleet. === Resources === ==== I.ResourceZones ==== * An array of [https://fromthedepths.gamepedia.com/LUA_Box#ResourceInfo ResourceZoneInfo] objects that lists all of the resource zones. ==== I.Resources ==== * A [https://fromthedepths.gamepedia.com/LUA_Box#ResourceInfo ResourceInfo] object that describes a vehicle's available resources. ==== ResourceZoneInfo ==== * Id ** Integer ID of resource zone. * Name ** String name of resource zone. * Position ** Vector3 object that describes location of resource zone. * Radius ** floating-point value that describes the radius of the resource zone, i.e. how big the "ring" is. * Resources **[https://fromthedepths.gamepedia.com/LUA_Box#ResourceInfo ResourceInfo] object that describes resources available to the resource zone. ==== ResourceInfo ==== * CrystalTotal ** The floating-point value that describes the total amount of Crystal resources. * CrystalMax ** The floating-point value that describes the max amount of Crystal resources. * MetalTotal ** The floating-point value that describes the total amount of Metal resources. * MetalMax ** The floating-point value that describes the max amount of Metal resources. * OilTotal ** The floating-point value that describes the total amount of Oil resources. * OilMax ** The floating-point value that describes the max amount of Oil resources. * ScrapTotal ** The floating-point value that describes the total amount of Scrap resources. * ScrapMax ** The floating-point value that describes the max amount of Scrap resources. === AI === ==== I:GetAIMovementMode(index) ==== * Takes in the <u>integer</u> index of the AI mainframe to get movement mode from. ** Returns the string name of the AI movement mode. Possibilities: "Off", "Manual", "Automatic", "Fleet". ==== I:GetAIMovementMode(index) ==== * Takes in the <u>integer</u> index of the AI mainframe to get movement mode from. ** Returns the string name of the AI firing mode. Possibilities: "Off", "On". ==== I.AIMode - Deprecated ==== ==== I.ConstructType - Deprecated ==== ===Propulsion=== ====I:TellAiThatWeAreTakingControl()==== *This will stop the AI from moving the ship. Basically does the same thing as what happens when the user presses a key when by a controller. ====I:RequestControl(mode,type,drive)==== *This takes in an enumerated <u>integer</u> for mode (0 for water mode, 1 for land mode, and 2 for air mode), another one for type (0 for left yaw, 1 for right yaw, 2 for left roll, 3 for roll right, 4 for pitch up, 5 for pitch down, 6 for "increase", 7 for "decrease", 8 for primary drives) and any number from 0 to 1 for the non-main-propulsion drives, and -1 to 1 for primary propulsion drives. **This serves as a way to effect the ship's drives, similarly to how one controls a ship manually, in a more general fashion compared to the other methods. ====I:RequestThrustControl(type)==== *This takes in an enumerated <u>integer</u> for the control type (0 for forwards, 1 for backwards, 2 for right, 3 for left, 4 for up, 5 for down, 6 for roll right, 7 for roll left, 8 for yaw right, 9 for yaw left, 10 for nose up, 11 for nose down) **This will request the built in thrust control to perform the action given by the control type. Does the same thing as a manually-controlled [[Thrust Controller|thrust controller]]. **Warning: this will override other propulsion systems in order to provide torque-free thrust. ====I:RequestThrustControl(type, scale)==== *Takes in an enumerated <u>integer</u> with the same values as [https://fromthedepths.gamepedia.com/LUA_Box#I:RequestThrustControl.28type.29 I:RequestThrustControl(type)], but also a number between 0 and 1 as a scaling factor **Same functions and warnings as [https://fromthedepths.gamepedia.com/LUA_Box#I:RequestThrustControl.28type.29 I:RequestThrustControl(type)]. ====I:RequestWaterForwards(drive)==== *Takes in a numerical value clamped in between 5 or -5. **This will request propellers set to the main drive to push forwards for a singular time step, based on the drive value. This is what the Naval AI uses. ====I:RequestComplexControllerStimulus(stim)==== *Takes in an enumerated <u>integer</u> for the requested stimulus. (0 for none, 1 for T, 2 for G, 3 for Y, 4 for H, 5 for U, 6 for J, 7 for I, 8 for K, 9 for O, 10 for L, 11 for up, 12 for down, 13 for left, 14 for right) **Requests a complex stimulus like the [[Complex Controller|complex controller]]. '''I:GetDrive(mode)''' *Takes in an enumerated <u>integer</u> for the drive fraction to be returned. (0 for water, 1 for air, 2 for primary, 3 for secondary, and 4 for tertiary) **Returns the current main drive fraction for the selected drive. '''I:GetInput(mode, type)''' *Takes in two enumerated integers, with the same values as [https://fromthedepths.gamepedia.com/LUA_Box#I:RequestControl.28mode.2Ctype.2Cdrive.29 I:RequestControl(mode, type, drive)]. **Gets the current drive fraction for the specified mode and type. ====I:MoveFortress==== *Takes in a Vector3, but us limited to one meter. **Moves the fortress in any direction. ===Target Info=== ====I:GetNumberOfMainframes()==== ====I:GetNumberOfTargets(mainframeIndex)==== ====I:GetTargetInfo(mainframeIndex, targetIndex)==== ====I:GetTargetPositionInfo(mainframeIndex, targetIndex)==== ====I:GetTargetPositionInfoForPosition(mainframeIndex, x,y,z)==== ===Misc=== ====I:GetTerrainAltitudeForPosition(x,y,z)==== ====I:GetTerrainAltitudeForLocalPosition(x,y,z)==== ====I:GetGravityForAltitude(alt)==== ====I:GetTime()==== ====I:GetTimeSinceSpawn()==== ====I:GetGameTime()==== ===Self Awareness=== ====I:GetConstructPosition()==== ====I:GetConstructForwardVector()==== ====I:GetConstructRightVector()==== ====I:GetConstructUpVector()==== ====I:GetConstructMaxDimensions()==== ====I:GetConstructMinDimensions()==== ====I:GetConstructRoll()==== ====I:GetConstructPitch()==== This is in degrees between 0 and 360. Note that unlike the HUD indicator, positive represents the nose-down direction. ====I:GetConstructYaw()==== ====I:GetConstructCenterOfMass()==== ====I:GetAiPosition(mainframeIndex)==== ====I:GetVelocityMagnitude()==== ====I:GetForwardsVelocityMagnitude()==== ====I:GetVelocityVector()==== ====I:GetVelocityVectorNormalized()==== ====I:GetAngularVelocity()==== ====I:GetLocalAngularVelocity()==== ====I:GetAmmoFraction()==== ====I:GetFuelFraction()==== ====I:GetSparesFraction()==== ===Components=== 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)==== ====I:Component_GetLocalPosition(type,index)==== ====I:Component_GetBlockInfo(type,index)==== ====I:Component_GetBoolLogic(type,index)==== ====I:Component_SetBoolLogic(type,index,bool)==== ====I:Component_GetFloatLogic(type,index)==== ====I:Component_SetFloatLogic(type,index,float)==== ====I:Component_GetIntLogic(type,index)==== ====I:Component_SetIntLogic(type,index,integer)==== ====I:Component_SetBoolLogicAll(type, bool)==== ====I:Component_SetFloatLogicAll(type, float)==== ====I:Component_SetIntLogicAll(type, int)==== ===Weapon=== ====I:GetWeaponCount()==== ====I:GetWeaponInfo(weaponIndex)==== ====I:AimWeaponInDirection(weaponIndex, x,y,z, weaponSlot)==== ====I:FireWeapon(weaponIndex, weaponSlot)==== ====I:GetTurretSpinnerCount()==== ====I:GetWeaponCountOnTurretOrSpinner(turretSpinnerIndex)==== ====I:GetWeaponInfoOnTurretOrSpinner(turretSpinnerIndex, weaponIndex)==== ====I:AimWeaponInDirectionOnTurretOrSpinner(turretSpinnerIndex,weaponIndex,x,y,z,weaponSlot)==== ====I:FireWeaponOnTurretOrSpinner(turretSpinnerIndex,weaponIndex,weaponSlot)==== ===Missile Warning=== ====I:GetNumberOfWarnings(mainframeIndex)==== ====I:GetMissileWarning(mainframeIndex, missileIndex)==== ===Missile Guidance=== ====I:GetLuaTransceiverCount()==== ====I:GetLuaControlledMissileCount(luaTransceiverIndex)==== ====I:GetLuaTransceiverInfo(luaTransceiverIndex)==== ====I:GetLuaControlledMissileInfo(luaTransceiverIndex,missileIndex)==== ====I:SetLuaControlledMissileAimPoint(luaTransceiverIndex,missileIndex,x,y,z)==== ====I:DetonateLuaControlledMissile(luaTransceiverIndex,missileIndex)==== ====I:IsLuaControlledMissileAnInterceptor(luaTransceiverIndex,missileIndex)==== ====I:SetLuaControlledMissileInterceptorTarget(luaTransceiverIndex,missileIndex,mainframeIndex, targetIndex)==== ====I:SetLuaControlledMissileInterceptorStandardGuidanceOnOff(luaTranceiver,missileIndex, onOff)==== ===Spin blocks=== ====I:GetSpinnerCount()==== ====I:GetSpinnerInfo(index)==== ====I:SetSpinnerSpeedFactor(index,speedFactor)==== ====I:SetSpinnerPowerDrive(index,drive)==== ====I:SetSpinnerRotationAngle(index, angle)==== ====I:SetSpinnerContinuousSpeed(index, speed)==== ====I:SetSpinnerInstaSpin(index,magnitudeAndDirection)==== ====I:IsSpinnerDedicatedHelispinner(index)==== ====I:IsSpinnerOnHull(index)==== ====I:SetDedicatedHelispinnerUpFraction(index,upFraction)==== ===Friendlies=== ====I:GetFriendlyCount()==== ====I:GetFriendlyInfo(index)==== ====I:GetFriendlyInfoById(Id)====
Summary:
Please note that all contributions to the From the Depths Wiki are considered to be released under the CC BY-NC-SA
Cancel
Editing help
(opens in new window)
Follow on IG
TikTok
Join Fan Lab