HW2 Function Reference

*Note: Please do not create dummy pages for functions that have not yet been documented.*

**A**
abs
acos

addAbility

addAmbientSound
addAsteroid
addCamera
addCloud
addDustCloud
AddLocalizedText
addNebula
addPath
addPebble
addPoint
addReactiveFleetResourceSlot
addReactiveFleetSlot
addRegion
addSalvage
addShield
AddShipAbility
AddShipMultiplier
AddSpeechEvent
addSphere
addSquadron
addSquadronToSOBGroup
AddSubSystemAbility
AddSubSystemMultiplier
AddSubtitleEvent
addTheme
addToSOBGroup
AddWeaponResult
AdjustForBadDrivers
appendto
AREA
AreAllied
ascii
asin
assert
atan
atan2
ATI\_AddColour
ATI\_AddFloat
ATI\_AddGraphic2D
ATI\_AddGraphic3D
ATI\_AddPosition
ATI\_AddScale
ATI\_AddString
ATI\_AddWString
ATI\_Clear
ATI\_CreateParameters
ATI\_Display2D
ATI\_Display3D
ATI\_LoadTemplates

**B**
BattleChatMisc
bind1
bindEffect
bindup
BreakAlliance

**C**
call
cameraCollision
Camera\_AllowControl
Camera\_AltFocus
Camera\_AltFocusWithVolume
Camera\_FocusCameraPoint
Camera\_FocusCancel
Camera\_FocusRestore
Camera\_FocusSave
Camera\_FocusSobGroup
Camera\_FocusSobGroupWithBuffer
Camera\_FocusVolume
Camera\_FocusVolumeKeepingEyePosition
Camera\_FocusVolumeWithBuffer
Camera\_GetDistanceToSobGroup
Camera\_GetLastZoomAmount
Camera\_Interpolate
Camera\_IsFocused
Camera\_PanCmd
Camera\_PlayerHasFocused
Camera\_PlayerHasPanned
Camera\_PlayerHasRotated
Camera\_ResetFocused
Camera\_ResetPanned
Camera\_ResetRotated
Camera\_SetLetterboxState
Camera\_SetLetterboxStateNoUI
Camera\_UseCameraPoint
Camera\_UsePanning
Camera\_ZoomClose
Campaign\_QuickSaveNb
ceil
ChatterMisc
ChatterMiscHighPriority
Chatter\_Init
ClearAllControlGroups
ClearSelectedFromControlGroups
ClearTOSettings
clock
closefile
collectgarbage
CommandAttackGiven
CommandCancelOrder
CommandCaptureGiven
CommandCombatMan
CommandConstructionComplete
CommandConstructionStarted
CommandDefenseFieldChanged
CommandDockGiven
CommandEngagementRangeChanged
CommandEngagementRangeForceChanged
CommandGuardGiven
CommandHotKeyGroupSelected
CommandHyperspaceGiven
CommandLaunchGiven
CommandMoveAttackGiven
CommandMoveGiven
CommandMoveToSobGiven
CommandMultiplay
CommandParadeGiven
CommandPaused
CommandResourceGiven
CommandRetireGiven
CommandShipsSelected
CommandStrikeGroupFormed
CommandTacticsChanged
CommandWayPointMoveGiven
copytagmethods
cos
CPU\_AddDefendSobGroup
CPU\_AddDefendTarget
CPU\_AddSobGroup
CPU\_DoFile
CPU\_DoString
CPU\_Enable
CPU\_EnableAll
CPU\_Exist
CPU\_GetDebugFlag
CPU\_GetVar
CPU\_GetVarString
CPU\_IsDebugFlagSet
CPU\_RemoveDefendTarget
CPU\_RemoveResourceBlob
CPU\_RemoveSobGroup
CPU\_SetAttackTargetPriority
CPU\_SetDebug
CPU\_SetDebugFlag
CPU\_SetDebugMode
CPU\_SetDebugPlayer
CPU\_SetDefendTargetCapturePriority
CPU\_SetDefendTargetPriority
CPU\_SetDefendTargetRadius
createAmbientLight
createDirLight
createSOBGroup

**D**
date
debug
debugRegionMode
deg
distlessthan
distsqvec3
dofile
dofilepath
dostring
dr\_clear
dr\_setautoclear
dr\_setdisplay
dr\_text2d

**E**
EnableATIDisplay
EnableBuildInBadges
Enable\_Pebble\_Distribution
error
EventPointer\_AddSobGroup
EventPointer\_AddSubSystemFromSobGroup
EventPointer\_AddVolume
EventPointer\_Remove
Event\_IsDone
Event\_Start
Event\_Stop
execute
exit
exp

**F**
FE\_ExitToMainMenu
FE\_ExitToWindows
FE\_FocusOnLastEvent
FE\_GetCurrentPlayerIndex
FE\_LoadGameScreen
FE\_LoadGameScreen\_Campaign
FE\_LoadGameScreen\_RecordedGame
FE\_NextTutorial
FE\_RestartGame
FE\_Retire
FE\_SaveGameScreen
FE\_SaveGameScreen\_Campaign
FE\_TaskbarIgnoreProfilePhase
floor
flush
fogAddInterpolator
fogSetActive
fogSetColour
fogSetDensity
fogSetEnd
fogSetStart
fogSetType
foreach
foreachi
foreachvar
format
formationSlot
formStrikeGroup
FOWVis
FOW\_ForceUpdate
FOW\_RevealGroup
frexp
function\_set\_error
FX\_DestroyEffectOnBackground
FX\_Flush
FX\_FlushLod
FX\_Lights
FX\_PlayEffect
FX\_PlayEffectBetweenPoints
FX\_PlayEffectOnBackground
FX\_PlayEffectOnBackgroundVolume
FX\_StartEvent
FX\_StopEffect
FX\_StopEffectOnBackground
FX\_StopEvent

**G**
gamemisc\_dumprules
gcinfo
GetActualPlayerFleetExtraRU
GetActualPlayerFleetSizeInRU
GetControlTabs
getenv
GetFOWVis
GetGameSettingAsNumber
GetGameSettingAsString
getglobal
getLevelOfDifficulty
getLoopCount
GetMultiplierForExtraRU
GetMultiplierForExtraShips
getn
getPauseTime
GetResearchId
GetShipId
getState
GetSubSystemId
getSyncCheckingLevel
gettagmethod
getTime
getType
GetVersionInfo
globals
gsub

**H**
HEIGHT
HW2\_CameraPanned
HW2\_CameraRotated
HW2\_CreateEventPointerSobGroup
HW2\_CreateEventPointerSubSystem
HW2\_CreateEventPointerVolume
HW2\_DisableBuilderOnCapture
HW2\_Fade
HW2\_GrantBuild
HW2\_GrantResearch
HW2\_InitializeBuilder
HW2\_IsRunTimeSobGroupAlive
HW2\_IsRunTimeSobGroupEmpty
HW2\_Letterbox
HW2\_LocationCardEvent
HW2\_Pause
HW2\_PingCreateWithLabel
HW2\_PingCreateWithLabelPoint
HW2\_PlayerHasMilitary
HW2\_ReactiveInfo
HW2\_RestrictBuild
HW2\_RestrictResearch
HW2\_rgb
HW2\_SetResearchLevel
HW2\_SobGroup\_AddHealthPercentage
HW2\_SobGroup\_ReduceHealthPercentage
HW2\_SubTitleEvent
HW2\_VaygrBuildShips
HW2\_VaygrOrder
HW2\_Wait
Hyperspace\_SetStateForPlayer
Hyperspace\_SetStateForVolume

**I**
instantParadeOnSkip
isAnimRunning
isCapital

**L**
ldexp
leaveStrikeGroup
loadBackground
LoadGame
LoadHODFile
LoadModel
loadNIS
loadPatchList
LoadRecordedGame
LoadSharedModel
loadShipPatchList
LocationCard
LocationCard\_IsDone
LOD\_SetAllowGoblins
LOD\_SetDesiredFPS
LOD\_SetEnabled
log
log10

**M**
MainUI\_DisableAllCommands
MainUI\_DisableCommand
MainUI\_PopAllEnabledCommandStates
MainUI\_PopEnabledCommandState
MainUI\_UserEventData
MainUI\_UserEventData2
math\_and
math\_or
math\_shl
math\_shr
max
maxActiveLights
min
mod
movieOutputDirectory
movieOverExpose
movieRecorderStart
movieRecorderStop
MPRestrict

**N**
newtag
next
nextvar
NISComplete
NISDebug
NISDisableInterface
NISGetPlayingHandle
NISLoad
NISPlay
NISPlayFromGroup
NISSeek
NISSeekForward
NISSetSkippable

**O**
Objective\_Add
Objective\_AddDescription
Objective\_GetState
Objective\_Select
Objective\_SetState
OnInit
openfile

**P**
paradeSlot
pauseAnim
persistentFeedback
Ping\_AddDescription
Ping\_AddPoint
Ping\_AddSobGroup
Ping\_LabelVisible
Ping\_Remove
playAnimatic
playAnimaticNis
playBgLightAnim
Player\_AllowDockFromUIOverride
Player\_CancelResearch
Player\_CanResearch
Player\_FillProximitySobGroup
Player\_FillShipsByType
Player\_FillSobGroupInVolume
Player\_GetName
Player\_GetNumberOfSquadronsOfTypeAwakeOrSleeping
Player\_GetRace
Player\_GetRU
Player\_GetShipsByType
Player\_GrantAllResearch
Player\_GrantResearchOption
Player\_HasQueuedBuild
Player\_HasQueuedResearch
Player\_HasResearch
Player\_HasShipWithBuildQueue
Player\_InstantDockAndParade
Player\_InstantlyGatherAllResources
Player\_IsAlive
Player\_IsShipInVolume
Player\_Kill
Player\_NumberOfAwakeShips
Player\_Research
Player\_RestrictBuildOption
Player\_RestrictResearchOption
Player\_SetBadgeTexture
Player\_SetBounty
Player\_SetDefaultShipTactic
Player\_SetPlayerName
Player\_SetRU
Player\_SetTeamColours
Player\_ShareVision
Player\_UnrestrictBuildOption
Player\_UnrestrictResearchOption
playNIS
playPatch
playSpeechActor
playSpeechActorLinked
playSpeechFreq
postLevelComplete
Preload\_Ship
print
Profile\_SetMissionsComplete
Profile\_SetSingleMissionComplete
Profile\_UnlockAll
Profile\_UnlockMovies
proposeAlliance

**R**
raceHelper
rad
random
RandomIntMax
RandomRange
randomseed
rawget
rawgetglobal
rawgettable
rawset
rawsetglobal
rawsettable
read
readfrom
RecorderPauseUniverse
RecorderSwitchPlayer
RecordGame
remove
rename
RenderEffects
RenderShips
resetPatchList
RestrictOptions
Rule\_Add
Rule\_AddInterval
Rule\_Exists
Rule\_Remove

**S**
SaveDetGame
SaveGame
SaveRecordedGame
saveVar
screenshot
seek
SelectBuildFacility
SelectNextIdleHarvester
SendBuildOrder
SendCancelShipOrder
SendCancelSubSystemOrder
SendPauseShipOrder
SendPauseSubSystemOrder
Sensors\_EnableCameraZoom
Sensors\_EnableToggle
Sensors\_FlashWorldPlane
Sensors\_ManagerIsUp
Sensors\_SetCameraMinMax
Sensors\_SetZoomOutDistance
Sensors\_Switch
Sensors\_Toggle
setAccuracy
SetAlliance
setAngles
setDefaultMusic
setDetailLevel
setDustCloudAmbient
setEngineBurn
setEngineTrail
setForceLOD
setGameOver
setGlareIntensity
setglobal
setGlobalFrequencyMax
setGlobalFrequencyMin
setGlobalFrequencyModifier
setJointVisible
setLevelOfDifficulty
setLevelShadowColour
setLightColour
setLightSpecular
setlocale
setLoopCount
setMiscValues

setMissionComplete
setMusicPath
setNebulaAmbient
setOutOfSync
setPatchListUI
setPatchParams
setPatchVol
setPauseTime
setPenetration
setSensorsManagerCameraDistances
SetSpeechFolder
SetStartFleetSuffix
setState
settag
settagmethod
setTime
SetTOSettings
setUseLighting
setWorldBoundsInner
setWorldBoundsOuter
ShowBackground
ShowBattleScar
ShowEngines
ShowInfo
ShowLevelVolumes
showNISDebug
ShowPathTolerance
ShowResourceDebug
ShowShipDebug
ShowUnitCaps
ShowWeaponDebug
sin
SobGroup\_AbilityActivate
SobGroup\_AllowPassiveActionsAlways
SobGroup\_AreAllInHyperspace
SobGroup\_AreAllInRealSpace
SobGroup\_AreAnyFromTheseAttackFamilies
SobGroup\_AreAnyOfTheseTypes
SobGroup\_AreAnySquadronsInsideDustCloud
SobGroup\_AreAnySquadronsInsideNebula
SobGroup\_AreAnySquadronsOutsideDustCloud
SobGroup\_AreAnySquadronsOutsideNebula
SobGroup\_AssignedToGroup
SobGroup\_Attack
SobGroup\_AttackPlayer
SobGroup\_AttackSobGroupHardPoint
SobGroup\_AutoEngineGlow
SobGroup\_AvoidanceIgnore
SobGroup\_CanDoAbility
SobGroup\_CaptureSobGroup
SobGroup\_ChangePower
SobGroup\_Clear
SobGroup\_Count
SobGroup\_CountByPlayer
SobGroup\_Create
SobGroup\_CreateShip
SobGroup\_CreateSubSystem
SobGroup\_DeployMines
SobGroup\_DeSelectAll
SobGroup\_Despawn
SobGroup\_DockSobGroup
SobGroup\_DockSobGroupAndStayDocked
SobGroup\_DockSobGroupInstant
SobGroup\_DoDamageProximitySobGroup
SobGroup\_Empty
SobGroup\_EnterHyperSpaceOffMap
SobGroup\_ExitHyperSpace
SobGroup\_ExitHyperSpaceSobGroup
SobGroup\_FillBattleScar
SobGroup\_FillBattleScar\_Debug
SobGroup\_FillCompare
SobGroup\_FillProximitySobGroup
SobGroup\_FillShipsByType
SobGroup\_FillSobGroupInVolume
SobGroup\_FillSubstract
SobGroup\_FillUnion
SobGroup\_FollowPath
SobGroup\_ForceStayDockedIfDocking
SobGroup\_FormHyperspaceGate
SobGroup\_FormStrikeGroup
SobGroup\_GetActualSpeed
SobGroup\_GetAttackers
SobGroup\_GetHardPointHealth
SobGroup\_GetPosition
SobGroup\_GetSobGroupBeingCapturedGroup
SobGroup\_GetSobGroupCapturingGroup
SobGroup\_GetSobGroupDockedWithGroup
SobGroup\_GetSobGroupRepairingGroup
SobGroup\_GetSobGroupSalvagingGroup
SobGroup\_GetSpeed
SobGroup\_GetSquadronsInsideDustCloud
SobGroup\_GetSquadronsInsideNebula
SobGroup\_GetTactics
SobGroup\_GroupInGroup
SobGroup\_GuardSobGroup
SobGroup\_HasFiredAtSobGroup
SobGroup\_HasUpgrade
SobGroup\_HealthPercentage
SobGroup\_InStrikeGroup
SobGroup\_InWorldBound
SobGroup\_IsBuilding
SobGroup\_IsCloaked
SobGroup\_IsDocked
SobGroup\_IsDockedSobGroup
SobGroup\_IsDoingAbility
SobGroup\_IsGateDeployed
SobGroup\_IsGuardingSobGroup
SobGroup\_IsInControlGroup
SobGroup\_IsInVolume
SobGroup\_IsSelectable
SobGroup\_IsShipNearPoint
SobGroup\_Kamikaze
SobGroup\_Launch
SobGroup\_LoadPersistantData
SobGroup\_MakeSelectable
SobGroup\_MakeUntargeted
SobGroup\_ManualEngineGlow
SobGroup\_Move
SobGroup\_MoveToSobGroup
SobGroup\_OnScreen
SobGroup\_OwnedBy
SobGroup\_ParadeSobGroup
SobGroup\_PlayerIsInSensorRange
SobGroup\_RemoveType
SobGroup\_RepairSobGroup
SobGroup\_ResearchModuleExistOrSelected
SobGroup\_ResetAvoidanceIgnore
SobGroup\_Resource
SobGroup\_RestrictBuildOption
SobGroup\_SalvagedByPlayer
SobGroup\_SalvageSobGroup
SobGroup\_Selected
SobGroup\_SelectSobGroup
SobGroup\_SetAsDeployed
SobGroup\_SetAutoLaunch
SobGroup\_SetBuildSpeedMultiplier
SobGroup\_SetCaptureAlwaysDisables
SobGroup\_SetCaptureState
SobGroup\_SetDisplayedRestrictedHardpoint
SobGroup\_SetFiredAtSobGroup
SobGroup\_SetHardPointHealth
SobGroup\_SetHealth
SobGroup\_SetInvulnerability
SobGroup\_SetInvulnerabilityOfHardPoint
SobGroup\_SetMadState
SobGroup\_SetMaxSpeedMultiplier
SobGroup\_SetSpeed
SobGroup\_SetSwitchOwnerFlag
SobGroup\_SetTactics
SobGroup\_SetTeamColours
SobGroup\_SobGroupAdd
SobGroup\_Spawn
SobGroup\_SpawnNewShipInSobGroup
SobGroup\_Stop
SobGroup\_SubSystemSelected
SobGroup\_SwitchOwner
SobGroup\_TakeDamage
SobGroup\_UnderAttack
SobGroup\_UnRestrictBuildOption
SobGroup\_UseHyperspaceGate
sort
Sound\_EnableAllSpeech
Sound\_EnterIntelEvent
Sound\_ExitIntelEvent
Sound\_MusicPlay
Sound\_MusicPlayType
Sound\_Reload
Sound\_SetMuteActor
Sound\_SFXPlay3D
Sound\_SFXPlay3DPos
Sound\_SpeechPlay
Sound\_SpeechSubtitlePath
Sound\_StingerPlay
Sound\_ToggleSpeech
SpawnSalvageOnDeath
SpawnShipOnDeath
sqrt
ssJPG
ssSetMode
ssSetPosterRes
ssSetSuperSample
ssUI
startAnim
StartAsteroidConfig
StartCloudConfig
StartDustCloudConfig
startEffect
StartMissileConfig
StartNebulaConfig
startParamAnim
StartPebbleConfig
StartSalvageConfig

StartShipConfig

StartShipHardPointConfig

StartShipWeaponConfig

StartSubSystemConfig

StartSubSystemWeaponConfig

StartWeaponConfig

statMon
statMonLog
Stats\_BuildShipsBuilt
Stats\_BuildShipsBuiltInRUs
Stats\_DumpFramesToDisk
Stats\_EnemyShipsCaptured
Stats\_EnemyShipsCapturedInRUs
Stats\_GatheredRUAsteroid
Stats\_GatheredRUDustCloud
Stats\_GatheredRUNebula
Stats\_GatheredRUs
Stats\_GatheredRUSalvage
Stats\_HarvestersBuilt
Stats\_HarvestersBuiltInRUs
Stats\_OwnShipsCaptured
Stats\_OwnShipsCapturedInRUs
Stats\_PlayerAt
Stats\_PlayerCount
Stats\_ResearchCount
Stats\_ResearchRUValue
Stats\_ResearchTotal
Stats\_ShipsCaptured
Stats\_ShipsCapturedInRUs
Stats\_ShipsCreated
Stats\_ShipsCreatedInRUs
Stats\_ShipsFirstBuilt
Stats\_ShipsLost
Stats\_ShipsLostInRUs
Stats\_SpentRUs
Stats\_SquadronsActive
Stats\_SquadronsMax
Stats\_SquadronsQueued
Stats\_SubsystemsBuilt
Stats\_SubsystemsBuiltInRUs
Stats\_TimeKilled
Stats\_TotalDuration
Stats\_TotalKills
Stats\_TotalKillsInRUs
Stats\_TotalLosses
Stats\_TotalLossesInRUs
Stats\_TotalShipsBuilt
Stats\_TotalShipsBuiltInRUs
Stats\_TotalSquadKillsInRUs
Stats\_TotalSquadLossesInRUs
Stats\_TributeDonated
Stats\_TributeReceived
StatusAttackComplete
StatusBattleMomentum
StatusBuildAvailable
StatusCaptureComplete
StatusCloud
StatusCriticallyDamaged
StatusDamaged
StatusHyperspaceExit
StatusHyperspaceInterrupted
StatusInMineField
StatusRepairs
StatusResearchAvailable
StatusResearchComplete
StatusResearchNoRUs
StatusResources
StatusRetaliating
StatusShipDestroyed
StatusShipDocked
StatusSubsystem
StatusTakingHeavyDamage
StatusTakingLightDamage
StatusUnderAttack
StatusUnderFireNeedOrders
StatusUpdgradeNoRUs
StatusUpgradeAvailable
StatusUpgradeComplete
stopAnim
strbyte
strchar
strfind
strlen
strlower
strrep
strsub
strupper
Subtitle\_Add
Subtitle\_IsDone
Subtitle\_IsMessageDone
Subtitle\_Message
Subtitle\_TimeCounter
Subtitle\_TimeCounterEnd

**T**
tag
tan
Timer\_Add
Timer\_Display
Timer\_End
Timer\_GetRemaining
Timer\_Pause
Timer\_Resume
Timer\_Start
tinsert
tmpname
toggleEngineBurns
toggleNavLights
tonumber
tostring
tremove
type
typeid

**U**
UC\_Family
UC\_FamilyOverride
UC\_ShipType
UC\_ShipTypeOverride
UI\_AddToEventScreen
UI\_BindKeyEvent
UI\_ClearEventScreen
UI\_DialogAccept
UI\_DialogAcceptID
UI\_DialogCancel
UI\_DialogCancelID
UI\_ExitApp
UI\_FlashButton
UI\_GetCurrentScreenID
UI\_GetScreenID
UI\_GiveFocus
UI\_HideScreen
UI\_IsNamedElementVisible
UI\_IsScreenActive
UI\_NextScreen
UI\_PlaySound
UI\_PopState
UI\_PreviousScreen
UI\_PushState
UI\_ReloadAllScreens
UI\_ReloadCurrentScreen
UI\_ReloadScreen
UI\_ScreenIsActive
UI\_SetButtonPressed
UI\_SetButtonTextHotkey
UI\_SetElementEnabled
UI\_SetElementPosition
UI\_SetElementSize
UI\_SetElementVisible
UI\_SetInterfaceEnabled
UI\_SetInterfaceVisible
UI\_SetLabelTextHotkey
UI\_SetNextScreen
UI\_SetPreviousScreen
UI\_SetScreenEnabled
UI\_SetScreenVisible
UI\_SetTextLabelText
UI\_ShowDialog
UI\_ShowScreen
UI\_StartGameWithSelectedLevel
UI\_StopFlashButton
UI\_SubtitleNarrow
UI\_SubtitleWide
UI\_ToggleScreen
UI\_ToggleScreenElement
UI\_ToggleScreenGameRubrick
UI\_UnBindKeyEvent
Universe\_AllowClicks
Universe\_AllowPlayerOrders
Universe\_AllowSelect
Universe\_ClipToWorldBounds
Universe\_CurrentPlayer
Universe\_EnableCmd
Universe\_EnableSkip
Universe\_Fade
Universe\_GameTime
Universe\_GetCurrentMoveHeight
Universe\_GetWorldBounds
Universe\_IsPiePlateActive
Universe\_MoveRestrictToVolume
Universe\_NebulaDelete
Universe\_Pause
Universe\_PlayerCount
Universe\_SetAvoidance
Universe\_SlowDown **unpauseAnim**

**V**
version
Volume\_AddCube
Volume\_AddSphere
Volume\_Delete

**W**
Wait\_End
Wait\_Start
WIDTH
Wireframe
write
writeto