Supreme Commander Wiki
Advertisement

Sim

<global>

  • AddBuildRestriction
AddBuildRestriction(army,category) - Add a category to the restricted list
  • ArmyInitializePrebuiltUnits
army
  • ArmyIsCivilian
ArmyIsCivilian(army)
  • ArmyIsOutOfGame
ArmyIsOutOfGame(army) -- return true iff the indicated army has been defeated.
  • AttachBeamEntityToEntity
AttachBeamEntityToEntity(self, bone, other, bone, army, blueprint)
  • AttachBeamToEntity
AttachBeamToEntity(emitter, entity, tobone, army )
  • AudioSetLanguage
AudioSetLanguage(name)
  • ChangeUnitArmy
ChangeUnitArmy(unit,armyIndex) Change a unit's army
  • CheatsEnabled
Return true iff cheats are enabled. Logs the cheat attempt no matter what.
  • CoordinateAttacks
CoordinateAttacks
  • CreateAimController
CreateAimController(weapon, label, turretBone, [barrelBone], [muzzleBone])
  • CreateAnimator
CreateAnimator(unit) -- create a manipulator for playing animations
  • CreateAttachedBeam
CreateAttachedBeam(entity, bone, army, length, thickness, texture_filename)
  • CreateAttachedEmitter
CreateAttachedEmitter(entity, bone, army, emitter_blueprint)
  • CreateBeamEmitter
emitter = CreateBeamEmitter(blueprint,army)
  • CreateBeamEmitterOnEntity
emitter = CreateBeamEmitterOnEntity(entity, tobone, army, blueprint )
  • CreateBeamEntityToEntity
CreateBeamEntityToEntity(entity, bone, other, bone, army, blueprint)
  • CreateBeamToEntityBone
CreateBeamToEntityBone(entity, bone, other, bone, army, thickness, texture_filename)
  • CreateBuilderArmController
CreateBuilderArmController(unit,turretBone, [barrelBone], [aimBone])
  • CreateCollisionDetector
CreateCollisionDetector(unit) -- create a collision detection manipulator
  • CreateDecal
handle = CreateDecal(position, heading, textureName1, textureName2, type, sizeX, sizeZ, lodParam, duration, army, fidelity)
  • CreateEconomyEvent
event = CreateEconomyEvent(unit, energy, mass, timeInSeconds)
  • CreateEmitterAtBone
CreateEmitterAtBone(entity, bone, army, emitter_blueprint)
  • CreateEmitterAtEntity
CreateEmitterAtEntity(entity,army,emitter_bp_name)
  • CreateEmitterOnEntity
CreateEmitterOnEntity(entity,army,emitter_bp_name)
  • CreateFootPlantController
CreateFootPlantController(unit, footBone, kneeBone, hipBone, [straightLegs], [maxFootFall])
  • CreateInitialArmyUnit
CreateInitialArmyUnit(armyName, initialUnitName
  • CreateLightParticle
CreateLightParticle(entity, bone, army, size, lifetime, textureName, rampName)
  • CreateLightParticleIntel
CreateLightParticle(entity, bone, army, size, lifetime, textureName, rampName)
  • CreateProp
CreateProp(location,prop_blueprint_id)
  • CreatePropHPR
blueprint, x, y, z, heading, pitch, roll
  • CreateResourceDeposit
type, x, y, z, size
  • CreateRotator
manip = CreateRotator(unit, bone, axis, [goal], [speed], [accel], [goalspeed])
  • CreateSlaver
manip = CreateSlaver(unit, dest_bone, src_bone)

Create a manipulator which copies the motion of src_bone onto dst_bone.Priority matters! Only manipulators which come before the slave manipulator will be copied.

  • CreateSlider
CreateSlider(unit, bone, [goal_x, goal_y, goal_z, [speed, [world_space]]])
  • CreateSplat
CreateSplat(position, heading, textureName, sizeX, sizeZ, lodParam, duration, army, fidelity)
  • CreateSplatOnBone
CreateSplatOnBone(boneName, offset, textureName, sizeX, sizeZ, lodParam, duration, army)

Add a splat to the game at an entity bone position and heading.

  • CreateStorageManip
CreateStorageManip(unit, bone, resouceName, minX, minY, minZ, maxX, maxY, maxZ)
  • CreateThrustController
CreateThrustController(unit, label, thrustBone)
  • CreateTrail
CreateTrail(entity, bone, army, trail_blueprint)
  • CreateUnit
blueprint, army, tx, ty, tz, qx, qy, qz, qw, [layer]
  • CreateUnit2
blueprint, army, layer, x, z, heading
  • CreateUnitHPR
blueprint, army, x, y, z, pitch, yaw, roll
  • Damage
Damage(instigator, target, amount, damageType)
  • DamageArea
DamageArea(instigator,location,radius,amount,damageType,damageFriendly,[damageSelf])
  • DamageRing
DamageRing(instigator,location,minRadius,maxRadius,amount,damageType,damageFriendly,[damageSelf])
  • DebugGetSelection
Get DEBUG info for UI selection
  • DrawLine
Draw a 3d line from a to b with color c
  • EconomyEventIsDone
bool = EconomyEventIsDone(event)
  • EndGame
Signal the end of the game. Acts like a permanent pause.
  • EntityCategoryContains
See if a unit category contains this unit
  • EntityCategoryFilterDown
Filter a list of units to only those found in the category
  • FlattenMapRect
FlattenRect(x, z, sizex, sizez, elevation)
  • GenerateArmyStart
army
  • GenerateRandomOrientation
rotation = GenerateRandomOrientation()
  • GetArmyBrain
army
  • GetArmyUnitCap
army
  • GetArmyUnitCostTotal
army
  • GetBlueprint
blueprint = GetBlueprint(entity)
  • GetCurrentCommandSource
Return the (1 based) index of the current command source.
  • GetEntitiesInRect
Return the enitities inside the given rectangle
  • GetEntityById
Get entity by entity id
  • GetFocusArmy
GetFocusArmy()
  • GetGameTick
Get the current game time in ticks. The game time is the simulation time, that stops when the game is paused.
  • GetGameTimeSeconds
Get the current game time in seconds. The game time is the simulation time, that stops when the game is paused.
  • GetMapSize
sizeX, sizeZ = GetMapSize()
  • GetSurfaceHeight
type = GetSurfaceHeight(x,z)
  • GetTerrainHeight
type = GetTerrainHeight(x,z)
  • GetTerrainType
type = GetTerrainType(x,z)
  • GetTerrainTypeOffset
type = GetTerrainTypeOffset(x,z)
  • GetUnitById
Get entity by entity id
  • GetUnitsInRect
Return the units inside the given rectangle
  • HasLocalizedVO
HasLocalizedVO(language)
  • InitializeArmyAI
army
  • IsAlly
IsAlly(army1,army2)
  • IsBlip
Blip = IsBlip(entity)
  • IsCollisionBeam
CollisionBeam = IsCollisionBeam(entity)
  • IsCommandDone
IsCommandDone
  • IsEnemy
IsEnemy(army1,army2)
  • IsEntity
bool = IsEntity(object)
  • IsGameOver
Return true if the game is over (i.e. EndGame() has been called).
  • IsNeutral
IsNeutral(army1,army2)
  • IsProjectile
Projectile = IsProjectile(entity)
  • IsProp
Prop = IsProp(entity)
  • IsUnit
Unit = IsUnit(entity)
  • IssueAggressiveMove
IssueAggressiveMove
  • IssueAttack
IssueAttack
  • IssueBuildFactory
IssueBuildFactory
  • IssueBuildMobile
IssueBuildMobile
  • IssueCapture
IssueCapture
  • IssueClearCommands
IssueClearCommands
  • IssueClearFactoryCommands
IssueClearFactoryCommands
  • IssueDestroySelf
IssueDestroySelf
  • IssueDive
IssueDive
  • IssueFactoryAssist
IssueFactoryAssist
  • IssueFactoryRallyPoint
IssueFactoryRallyPoint
  • IssueFerry
IssueFerry
  • IssueFormAggressiveMove
IssueFormAggressiveMove
  • IssueFormAttack
IssueFormAttack
  • IssueFormMove
IssueFormMove
  • IssueFormPatrol
IssueFormPatrol
  • IssueGuard
IssueGuard
  • IssueKillSelf
IssueKillSelf
  • IssueMove
IssueMove
  • IssueMoveOffFactory
IssueMoveOffFactory
  • IssueNuke
IssueNuke
  • IssueOverCharge
IssueOverCharge
  • IssuePatrol
IssuePatrol
  • IssuePause
IssuePause
  • IssueReclaim
IssueReclaim
  • IssueRepair
IssueRepair
  • IssueSacrifice
IssueSacrifice
  • IssueScript
IssueScript
  • IssueSiloBuildNuke
IssueSiloBuildNuke
  • IssueSiloBuildTactical
IssueSiloBuildTactical
  • IssueStop
IssueStop
  • IssueTactical
IssueTactical
  • IssueTeleport
IssueTeleport
  • IssueTeleportToBeacon
IssueTeleportToBeacon
  • IssueTransportLoad
IssueTransportLoad
  • IssueTransportUnload
IssueTransportUnload
  • IssueTransportUnloadSpecific
IssueTransportUnloadSpecific
  • IssueUpgrade
IssueUpgrade
  • LUnitMove
ScriptTask.LUnitMove(self,target)
  • LUnitMoveNear
ScriptTask.LUnitMoveNear(self,target,range)
  • ListArmies
  • MetaImpact
MetaImpact(instigator,location,fMaxRadius,iAmount,affectsCategory,[damageFriendly])
  • NotifyUpgrade
NotifyUpgrade(from,to)
  • OkayToMessWithArmy
Return true if the current command source is authorized to mess with the given army. Or if cheats are enabled.
  • ParseEntityCategory
parse a string to generate a new entity category
  • PlayLoop
handle = PlayLoop(self,sndParams)
  • Random
Random([[min,] max])
  • RemoveBuildRestriction
RemoveBuildRestriction(army,category) - Remove a category from the restricted list
  • RemoveEconomyEvent
RemoveEconomyEvent(unit, event)
  • SelectedUnit
unit = SelectedUnit() -- Returns the currently selected unit. For use at the lua console, so you can call Lua methods on a unit.
  • SetAlliance
SetAlliance(army1,army2,<Neutral|Enemy|Ally>
  • SetAllianceOneWay
SetAllianceOneWay(army1,army2,<Neutral|Enemy|Ally>
  • SetAlliedVictory
SetAlliedVictory(army,bool)
  • SetArmyAIPersonality
SetArmyAIPersonality(army,personality)
  • SetArmyColor
SetArmyColor(army,r,g,b)
  • SetArmyColorIndex
SetArmyColorIndex(army,index)
  • SetArmyEconomy
army, mass, energy
  • SetArmyFactionIndex
SetArmyFactionIndex(army,index)
  • SetArmyOutOfGame
SetArmyOutOfGame(army) -- indicate that the supplied army has been defeated.
  • SetArmyPlans
army, plans
  • SetArmyShowScore
SetArmyColor(army, bool) - determines if the user should be able to see the army score
  • SetArmyStart
army, x, z
  • SetArmyStatsSyncArmy
Set the army index for which to sync army stats (-1 for none)
  • SetArmyUnitCap
army, unitCap
  • SetIgnoreArmyUnitCap
army, flag
  • SetIgnorePlayableRect
army, flag
  • SetPlayableRect
SetPlayableRect( minX, minZ, maxX, maxZ )
  • SetTerrainType
SetTerrainType(x,z,type)
  • SetTerrainTypeRect
SetTerrainType(rect,type)
  • ShouldCreateInitialArmyUnits
  • SimConExecute
SimConExecute('command string') -- Perform a console command
  • SplitProp
SplitProp(original, blueprint_name) -- split a prop into multiple child props, one per bone; returns all the created props
  • StopLoop
StopLoop(self,handle)
  • SubmitXMLArmyStats
Request that we submit xml army stats to gpg.net.
  • TryCopyPose
TryCopyPose(unitFrom,entityTo,bCopyWorldTransform)
  • Warp
Warp( unit, location, [orientation] )
  • _c_CreateEntity
_c_CreateEntity(spec)
  • _c_CreateShield
_c_CreateShield(spec)
  • print
Print a log message

CAiAttackerImpl

  • CanAttackTarget
Loop through the weapons to see if the target can be attacked
  • FindBestEnemy
Find the best enemy target for a weapon
  • ForceEngage
Force to engage enemy target
  • GetDesiredTarget
Get the desired target
  • GetMaxWeaponRange
Loop through the weapons to find the weapon with the longest range that is not manual fire
  • GetPrimaryWeapon
Loop through the weapons to find our primary weapon
  • GetTargetWeapon
Loop through the weapons to find one that we can use to attack target
  • GetUnit
Returns the unit this attacker is bound to.
  • GetWeaponCount
Return the count of weapons
  • HasSlavedTarget
Check if the attack has a slaved weapon that currently has a target
  • IsTargetExempt
Check if the target is exempt from being attacked
  • IsTooClose
Check if the target is too close to our weapons
  • IsWithinAttackRange
Check if the target is within any weapon range
  • ResetReportingState
Reset reporting state
  • SetDesiredTarget
Set the desired target
  • Stop
Stop the attacker
  • moho.CAiAttackerImpl_methods

CAiBrain

  • AssignUnitsToPlatoon
CAiBrain:AssignUnitsToPlatoon()
  • BuildPlatoon
brain:BuildPlatoon()
  • BuildStructure
brain:BuildStructure(builder, structureName, locationInfo)
  • BuildUnit
brain:BuildUnit()
  • CanBuildPlatoon
brain:CanBuildPlatoon()
  • CanBuildStructureAt
brain:CanBuildStructureAt(blueprint, location)
  • CreateResourceBuildingNearest
brain:CreateResourceBuildingNearest(structureName, posX, posY)
  • CreateUnitNearSpot
brain:CreateUnitNearSpot(unitName, posX, posY)
  • DecideWhatToBuild
brain:DecideWhatToBuild(builder, type, buildingTypes)
  • DisbandPlatoon
CAiBrain:DisbandPlatoon()
  • DisbandPlatoonUniquelyNamed
CAiBrain:DisbandPlatoonUniquelyNamed()
  • FindClosestArmyWithBase
CAiBrain:FindClosestArmyWithBase()
  • FindPlaceToBuild
brain:FindPlaceToBuild(type, structureName, buildingTypes, relative, builder)
  • FindUnit
brain:FindUnit(unitCategory, needToBeIdle) -- Return an unit that matches the unit name (can specify idle or not)
  • FindUnitToUpgrade
brain:FindUnitToUpgrade(upgradeList) -- Return a unit and it's upgrade blueprint
  • FindUpgradeBP
brain:FindUpgradeBP(unitName, upgradeList) -- Return an upgrade blueprint for the unit passed in
  • GetArmyIndex
Returns the ArmyIndex of the army represented by this brain
  • GetArmyStartPos
brain:GetArmyStartPos()
  • GetArmyStat
brain:GetArmyStat(StatName,defaultValue)
  • GetAttackVectors
CAiBrain:GetAttackVectors()
  • GetAvailableFactories
brain:GetAvailableFactories()
  • GetBlueprintStat
Return a blueprint stat filtered by category
  • GetCurrentEnemy
Return this brain's current enemy
  • GetCurrentUnits
Return how many units of the given categories exist
  • GetEconomyIncome
CAiBrain:GetEconomyIncome()
  • GetEconomyRequested
CAiBrain:GetEconomyRequested()
  • GetEconomyStored
CAiBrain:GetEconomyStored()
  • GetEconomyStoredRatio
CAiBrain:GetEconomyStoredRatio()
  • GetEconomyTrend
CAiBrain:GetEconomyTrend()
  • GetEconomyUsage
CAiBrain:GetEconomyUsage()
  • GetFactionIndex
Returns the faction of the army represented by this brain
  • GetHighestThreatPosition
CAiBrain:GetHighestThreatPosition()
  • GetListOfUnits
brain:GetListOfUnits(entityCategory, needToBeIdle)
  • GetMapWaterRatio
CAiBrain:GetMapWaterRatio()
  • GetNumPlatoonsTemplateNamed
GetNumPlatoonsTemplateNamed
  • GetNumPlatoonsWithAI
GetNumPlatoonsWithAI
  • GetNumUnitsAroundPoint
CAiBrain:GetNumUnitsAroundPoint()
  • GetPersonality
Return the personality for this brain to use
  • GetPlatoonUniquelyNamed
CAiBrain:GetPlatoonUniquelyNamed()
  • GetPlatoonsList
CAiBrain:GetPlatoonsList()
  • GetThreatAtPosition
CAiBrain:GetThreatAtPosition(position)
  • GetUnitBlueprint
blueprint = brain:GetUnitBlueprint(bpName)
  • GetUnitsAroundPoint
CAiBrain:GetUnitsAroundPoint()
  • GiveResource
GiveResource(type,amount)
  • GiveStorage
GiveStorage(type,amount)
  • IsAnyEngineerBuilding
brain:IsAnyEngineerBuilding(category)
  • IsOpponentAIRunning
Returns true if opponent AI should be running
  • MakePlatoon
CAiBrain:MakePlatoon()
  • NumCurrentlyBuilding
brain:NumCurrentlyBuilding( entityCategory )
  • PickBestAttackVector
CAiBrain:PickBestAttackVector()
  • PlatoonExists
CAiBrain:PlatoonExists()
  • RemoveArmyStatsTrigger
Remove an army stats trigger
  • SetArmyStat
SetArmyStat(statname,val)
  • SetArmyStatsTrigger
Sets an army stat trigger
  • SetCurrentEnemy
Set the current enemy for this brain to attack
  • SetCurrentPlan
Set the current plan for this brain to run
  • SetGreaterOf
SetGreaterOf(statname,val)
  • SetResourceSharing
SetResourceSharing(bool)
  • SetUpAttackVectorsToArmy
CAiBrain:SetUpAttackVectorsToArmy()
  • TakeResource
taken = TakeResource(type,amount)
  • moho.aibrain_methods

CAiNavigatorImpl

  • AtGoal
  • BroadcastResumeTaskEvent
Broadcast event to resume any listening task that is currently suspended
  • CanPathToGoal
  • FollowingLeader
  • GetCurrentTargetPos
This returns the current navigator target position for the unit
  • GetGoalPos
This returns the current goal position of our navigator
  • GetStatus
  • HasGoodPath
  • IgnoreFormation
  • IsIgnorningFormation
  • SetDestUnit
Set the navigator's destination as another unit (chase/follow)
  • SetGoal
Set the navigator's destination as a particular position
  • SetSpeedThroughGoal
Set flag in navigator so the unit will know whether to stop at final goal or speed through it. This would be set to True during a patrol or a series of waypoints in a complex path.
  • moho.navigator_methods

CAiPersonality

  • GetAirUnitsEmphasis
CAiPersonality:GetAirUnitsEmphasis()
  • GetArmySize
CAiPersonality:GetArmySize()
  • GetAttackFrequency
CAiPersonality:GetAttackFrequency()
  • GetBotUnitsEmphasis
CAiPersonality:GetBotUnitsEmphasis()
  • GetChatFrequency
CAiPersonality:GetChatFrequency()
  • GetChatPersonality
CAiPersonality:GetChatPersonality()
  • GetCoordinatedAttacks
CAiPersonality:GetCoordinatedAttacks()
  • GetCounterForces
CAiPersonality:GetCounterForces()
  • GetDefenseDriven
CAiPersonality:GetDefenseDriven()
  • GetDifficulty
CAiPersonality:GetDifficulty()
  • GetDirectDamageEmphasis
CAiPersonality:GetDirectDamageEmphasis()
  • GetEconomyDriven
CAiPersonality:GetEconomyDriven()
  • GetExpansionDriven
CAiPersonality:GetExpansionDriven()
  • GetFactoryTycoon
CAiPersonality:GetFactoryTycoon()
  • GetFavouriteStructures
CAiPersonality:GetFavouriteStructures()
  • GetFavouriteUnits
CAiPersonality:GetFavouriteUnits()
  • GetFormationUse
CAiPersonality:GetFormationUse()
  • GetInDirectDamageEmphasis
CAiPersonality:GetInDirectDamageEmphasis()
  • GetIntelBuildingTycoon
CAiPersonality:GetIntelBuildingTycoon()
  • GetIntelGathering
CAiPersonality:GetIntelGathering()
  • GetPersonalityName
CAiPersonality:GetPersonalityName()
  • GetPlatoonSize
CAiPersonality:GetPlatoonSize()
  • GetQuittingTendency
CAiPersonality:GetQuittingTendency()
  • GetRepeatAttackFrequency
CAiPersonality:GetRepeatAttackFrequency()
  • GetSeaUnitsEmphasis
CAiPersonality:GetSeaUnitsEmphasis()
  • GetSpecialtyForcesEmphasis
CAiPersonality:GetSpecialtyForcesEmphasis()
  • GetSuperWeaponTendency
CAiPersonality:GetSuperWeaponTendency()
  • GetSupportUnitsEmphasis
CAiPersonality:GetSupportUnitsEmphasis()
  • GetSurvivalEmphasis
CAiPersonality:GetSurvivalEmphasis()
  • GetTankUnitsEmphasis
CAiPersonality:GetTankUnitsEmphasis()
  • GetTargetSpread
CAiPersonality:GetTargetSpread()
  • GetTeamSupport
CAiPersonality:GetTeamSupport()
  • GetTechAdvancement
CAiPersonality:GetTechAdvancement()
  • GetUpgradesDriven
CAiPersonality:GetUpgradesDriven()
  • moho.aipersonality_methods

CAimManipulator

  • OnTarget
AimManipulator:OnTarget()
  • SetAimHeadingOffset
AimManipulator:SetAimHeadingOffset( offset )
  • SetEnabled
AimManipulator:SetEnabled(flag)
  • SetFiringArc
AimManipulator:SetFiringArc(minHeading, maxHeading, headingMaxSlew, minPitch, maxPitch, pitchMaxSlew)
  • SetHeadingPitch
AimManipulator:SetHeadingPitch( heading, pitch )
  • SetResetPoseTime
AimManipulator:SetResetPoseTime(resetTime)
  • base
derived from IAniManipulator
  • moho.AimManipulator

CAnimationManipulator

  • GetAnimationTime
time = AnimationManipulator:GetAnimationTime()
  • GetRate
rate = AnimationManipulator:GetRate()
  • PlayAnim
AnimManipulator:PlayAnim(entity, animName, looping=false)
  • SetAnimationFraction
AnimationManipulator:SetAnimationFraction(fraction)
  • SetAnimationTime
AnimationManipulator:SetAnimationTime(fraction)
  • SetBoneEnabled
AnimationManipulator:SetBoneEnabled(bone, value, include_decscendants=true)
  • SetDisableOnSignal
AnimationManipulator:SetDisableOnSignal(bool)
  • SetOverwriteMode
AnimationManipulator:SetOverwriteMode(bool)
  • SetRate
AnimationManipulator:SetRate(rate)

Set the relative rate at which this anim plays; 1.0 is normal speed. Rate can be negative to play backwards or 0 to pause.

  • base
derived from IAniManipulator
  • moho.AnimationManipulator

CBoneEntityManipulator

  • base
derived from IAniManipulator
  • moho.BoneEntityManipulator

CBuilderArmManipulator

  • SetAimingArc
BuilderArmManipulator:SetAimingArc(minHeading, maxHeading, headingMaxSlew, minPitch, maxPitch, pitchMaxSlew)
  • SetHeadingPitch
CBuilderArmManipulator:SetHeadingPitch( heading, pitch )
  • base
derived from IAniManipulator
  • moho.BuilderArmManipulator

CCollisionManipulator

  • Enable
Fixme: this should just use base manipulator enable/disable
  • EnableTerrainCheck
Make manipulator check for terrain height intersection
  • WatchBone
CollisionDetector:WatchBone(bone) -- add the given bone to those watched by this manipulator
  • base
derived from IAniManipulator
  • moho.CollisionManipulator

CDamage

  • GetTarget
CDamage:GetTarget()
  • SetInstigator
CDamage:SetInstigator()
  • SetTarget
CDamage:SetTarget()
  • moho.CDamage

CDecalHandle

  • moho.CDecalHandle

CEconomyEvent

  • moho.EconomyEvent

CFootPlantManipulator

  • moho.FootPlantManipulator

CPlatoon

  • AttackTarget
CPlatoon:AttackTarget()
  • CanAttackTarget
CPlatoon:CanAttackTarget()
  • CanConsiderFormingPlatoon
CPlatoon:CanConsiderFormingPlatoon()
  • CanFormPlatoon
CPlatoon:CanFormPlatoon()
  • Destroy
CPlatoon:Destroy()
  • DisbandOnIdle
CPlatoon:DisbandOnIdle()
  • FerryToLocation
CPlatoon:FerryToLocation()
  • FindClosestUnit
CPlatoon:FindClosestUnit()
  • FindClosestUnitToBase
CPlatoon:FindClosestUnitToBase()
  • FindFurthestUnit
CPlatoon:FindFurthestUnit()
  • FindHighestValueUnit
CPlatoon:FindHighestValueUnit()
  • FindPrioritizedUnit
CPlatoon:FindPrioritizedUnit()
  • FormPlatoon
CPlatoon:FormPlatoon()
  • GetAIPlan
CPlatoon:GetAIPlan()
  • GetBrain
CPlatoon:GetBrain()
  • GetFactionIndex
CPlatoon:GetFactionIndex()
  • GetFerryBeacons
CPlatoon:GetFerryBeacons()
  • GetPersonality
CPlatoon:GetPersonality()
  • GetPlatoonPosition
CPlatoon:GetPlatoonPosition()
  • GetPlatoonUniqueName
CPlatoon:GetPlatoonUniqueName()
  • GetPlatoonUnits
platoon:GetPlatoonUnits()
  • GetSquadPosition
CPlatoon:GetSquadPosition()
  • GetSquadUnits
CPlatoon:GetSquadUnits()
  • GuardTarget
CPlatoon:GuardTarget()
  • IsAttacking
CPlatoon:IsAttacking()
  • IsCommandsActive
CPlatoon:IsCommandsActive()
  • IsFerrying
CPlatoon:IsFerrying()
  • IsMoving
CPlatoon:IsMoving()
  • IsOpponentAIRunning
CPlatoon:IsOpponentAIRunning()
  • IsPatrolling
CPlatoon:IsPatrolling()
  • LoadUnits
CPlatoon:LoadUnits()
  • MoveToLocation
CPlatoon:MoveToLocation()
  • MoveToTarget
CPlatoon:MoveToTarget()
  • Patrol
CPlatoon:Patrol()
  • SetPlatoonFormationOverride
CPlatoon:SetPlatoonFormationOverride()
  • SetPrioritizedTargetList
CPlatoon:SetPrioritizedTargetList()
  • Stop
CPlatoon:Stop()
  • SwitchAIPlan
CPlatoon:SwitchAIPlan()
  • UniquelyNamePlatoon
CPlatoon:UniquelyNamePlatoon()
  • UnloadAllAtLocation
CPlatoon:UnloadAllAtLocation()
  • UnloadUnitsAtLocation
CPlatoon:UnloadUnitsAtLocation()
  • UseFerryBeacon
CPlatoon:UseFerryBeacon()
  • UseTeleporter
CPlatoon:UseTeleporter()
  • moho.platoon_methods

CRotateManipulator

  • ClearGoal
RotateManipulator:ClearGoal()
  • SetAccel
RotateManipulator:SetAccel(degrees_per_second_squared)
  • SetFollowBone
RotateManipulator:SetFollowBone(bone)
  • SetGoal
RotateManipulator:SetGoal(self, degrees)
  • SetSpeed
RotateManipulator:SetSpeed(self, degrees_per_second)
  • SetSpinDown
RotateManipulator:SetSpinDown(self, flag)
  • SetTargetSpeed
RotateManipulator:SetTargetSpeed(degrees_per_second)
  • base
derived from IAniManipulator
  • moho.RotateManipulator

CSlaveManipulator

  • base
derived from IAniManipulator
  • moho.SlaveManipulator

CSlideManipulator

  • SetDeceleration
CSlideManipulator:SetDeceleration(dec)
  • SetGoal
CSlideManipulator:SetGoal(goal_x, goal_y, goal_z)
  • SetSpeed
CSlideManipulator:SetSpeed(speed)
  • SetWorldUnits
CSlideManipulator:SetWorldUnits(bool)
  • base
derived from IAniManipulator
  • moho.SlideManipulator

CStorageManipulator

  • moho.StorageManipulator

CThrustManipulator

  • base
derived from IAniManipulator
  • moho.ThrustManipulator

CUnitScriptTask

  • SetAIResult
Set the AI result, success or fail
  • moho.ScriptTask_Methods

CollisionBeamEntity

  • Enable
CollisionBeamEntity:Enable()
  • GetLauncher
CollisionBeamEntity:GetLauncher()
  • IsEnabled
bool = CollisionBeamEntity:IsEnabled()
  • SetBeamFx
CollisionBeamEntity:SetBeamFx(beamEmitter) -- set an emitter to be controlled by this beam. Its length parameter will be set from the beam entity's collision distance.
  • __init
beam = CreateCollisionBeam(spec)

spec is a table with the following fields defined:

   spec.Weapon = <weapon to attach to>
   spec.OtherBone = <bone of weapon's unit to attach to>
   spec.CollisionCheckInterval = <interval in ticks>
   spec.BeamBone = <which end of beam to attach>
  • base
derived from Entity
  • moho.CollisionBeamEntity

Entity

  • AddManualScroller

Entity:AddManualScroller(scrollSpeed1, scrollSpeed2)

  • AddPingPongScroller

Entity:AddPingPongScroller(ping1, pingSpeed1, pong1, pongSpeed1, ping2, pingSpeed2, pong2, pongSpeed2)

  • AddShooter

AddShooter(shooter)

  • AddThreadScroller

Entity:AddThreadScroller(sideDist, scrollMult)

  • AddWorldImpulse

AddWorldImpulse(self, Ix, Iy, Iz, Px, Py, Pz)

  • AdjustHealth

Entity:AdjustHealth(instigator, delta)

  • AttachBoneTo

Entity:AttachBoneTo(selfbone, entity, bone)

  • AttachBoneToEntityBone

Attach a unit bone position to an entity bone position

  • AttachTo

Entity:AttachTo(entity, bone)

  • BeenDestroyed

Entity:BeenDestroyed()

  • CreateProjectile

Entity:CreateProjectile(proj_bp, [ox, oy, oz], [dx, dy, dz]

  • CreateProjectileAtBone

Entity:CreateProjectileAtBone(projectile_blueprint, bone)

  • CreatePropAtBone

Entity:CreatePropAtBone(boneindex,prop_blueprint_id)

  • Destroy

Entity:Destroy()

  • DetachAll

Entity:DetachAll(bone,[skipBallistic])

  • DetachFrom

Entity:DetachFrom([skipBallistic])

  • DisableIntel

Intel:DisableIntel(type)

  • EnableIntel

EnableIntel(type)

  • FallDown

Entity:FallDown(dx,dy,dz,force) -- start falling down

  • GetAIBrain

GetAIBrain(self)

  • GetArmy

GetArmy(self)

  • GetBlueprint

blueprint = Entity:GetBlueprint()

  • GetBoneCount

Entity:GetBoneCount() -- returns number of bones in this entity's skeleton

  • GetBoneDirection

Entity:GetBoneDirection(bone_name)

  • GetBoneName

Entity:GetBoneName(i) -- return the name of the i'th bone of this entity (counting from 0)

  • GetCollisionExtents

Entity:GetCollisionExtents()

  • GetEntityId

Entity:GetEntityId()

  • GetFractionComplete

Entity:GetFractionComplete()

  • GetHeading

Entity:GetHeading()

  • GetHealth

Entity:GetHealth()

  • GetIntelRadius

GetIntelRadius(type)

  • GetMaxHealth

Entity:GetMaxHealth()

  • GetOrientation

Entity:GetOrientation()

  • GetParent

Entity:GetParent()

  • GetPosition

Entity:GetPosition([bone_name])

  • GetScale

Entity:GetScale() -> sx,sy,sz -- return current draw scale of this entity

  • InitIntel

InitIntel(army,type,<radius>)

  • IsIntelEnabled

IsIntelEnabled(type)

  • IsValidBone

Entity:IsValidBone(nameOrIndex,allowNil=false)

  • Kill

Entity:Kill(instigator,type,excessDamageRatio)

  • PlaySound

Entity:PlaySound(params)

  • PushOver

Entity:PushOver(nx, ny, nz, depth)

  • ReachedMaxShooters

ReachedMaxShooters()

  • RemoveScroller

Entity:RemoveScroller()

  • RemoveShooter

RemoveShooter(shooter)

  • RequestRefreshUI

Entity:RequestRefreshUI()

  • SetAmbientSound

Entity:SetAmbientSound(paramTableDetail,paramTableRumble)

  • SetCollisionShape

Entity:SetCollisionShape(['Box'|'Sphere'|'None'], centerX, Y, Z, size) -- size is radius for sphere, x,y,z extent for box

  • SetDrawScale

Entity:SetDrawScale(size): Change mesh scale on the fly

  • SetHealth

Entity:SetHealth(instigator,health)

  • SetIntelRadius

SetRadius(type,radius)

  • SetMaxHealth

Entity:SetMaxHealth(maxhealth)

  • SetMesh

Entity:SetMesh(meshBp, bool keepActor): Change mesh on the fly. Can be used to change shaders on the fly as well. The keepActor bool will retain any animations that are currently active on the unit.

  • SetOrientation

Entity:SetOrientation(orientation, immediately )

  • SetParentOffset

Entity:SetParentOffset(vector)

  • SetPosition

Entity:SetPosition(vector,[immediate])

  • SetScale

Entity:SetScale(s) or Entity:SetScale(sx,sy,sz)

  • SetVizToAllies

SetVizToAllies(type)

  • SetVizToEnemies

SetVizToEnemies(type)

  • SetVizToFocusPlayer

SetVizToFocusPlayer(type)

  • SetVizToNeutrals

SetVizToNeutrals(type)

  • ShakeCamera

Entity:ShakeCamera(radius, max, min, duration)

Shake the camera. This is a method of entities rather than a global function because it takes the position of the entity as the epicenter where it shakes more.

      radius - distance from epicenter at which shaking falls off to 'min'
      max - size of shaking in world units, when looking at epicenter
      min - size of shaking in world units, when at 'radius' distance or farther
      duration - length of time to shake for, in seconds
  • SinkAway

Entity:SinkAway(vy) -- sink into the ground

  • moho.entity_methods

IAniManipulator

  • Disable
Manipulator:Disable() -- disable a manipulator. This immediately removes it from the bone computation, which may result in the bone's position snapping.
  • Enable
Manipulator:Enable() -- enable a manipulator. Manipulators start out enabled so you only need this after calling Disable().
  • SetPrecedence
Manipulator:SetPrecedence(integer) -- change the precedence of this manipulator. Manipulators with higher precedence run first.
  • moho.manipulator_methods

IEffect

  • OffsetEmitter
Effect:OffsetEmitter(x,y,z)
  • ResizeEmitterCurve
Effect:ResizeEmitterCurve(parameter, time_in_ticks)Resize the emitter curve to the number of ticks passed in.

This is so if we change the lifetime of the emitter we can rescale some of the curves to match if needed. Arguably this should happen automatically to all curves but the original design was screwed up.

returns the effect so you can chain calls like: effect:SetEmitterParam('x',1):ScaleEmitter(3.7)

  • ScaleEmitter
effect:ScaleEmitter(param, scale)

returns the effect so you can chain calls like: effect:SetEmitterParam('x',1):ScaleEmitter(3.7)

  • SetBeamParam
effect:SetBeamParam('name', value)
  • SetEmitterCurveParam
Effect:SetEmitterCurveParam(param_name, height, size)
  • SetEmitterParam
effect:SetEmitterParam('name', value)returns the effect so you can chain calls like:

effect:SetEmitterParam('x',1):ScaleEmitter(3.7)

  • moho.IEffect

MotorFallDown

  • moho.MotorFallDown

Projectile

  • ChangeDetonateBelowHeight
Change the detonate below height for the projectile
  • ChangeMaxZigZag
Change the amount of zig zag
  • ChangeZigZagFrequency
Change the frequency of the zig zag
  • CreateChildProjectile
Projectile:CreateChildProjectile(blueprint)
  • GetCurrentTargetPosition
Projectile:GetCurrentTargetPosition()
  • GetLauncher
Get who launched this projectile
  • GetTrackingTarget
Projectile:GetTrackingTarget()
  • GetVelocity
Projectile:GetVelocity() -> x,y,z
  • SetAcceleration
Projectile:SetAcceleration(accel)
  • SetBallisticAcceleration
Wrong number of arguments to Projectile:SetAccelerationVector(), expected 1, 2, or 4 but got %d
  • SetCollideEntity
Projectile:SetCollideEntity(onoff)
  • SetCollideSurface
Projectile:SetCollideSurface(onoff)
  • SetCollision
Projectile:SetCollision(onoff)
  • SetDamage
Projectile:SetDamage(amount, radius) -- change how much damage this projectile will do. Either amount or radius can be nil to leave unchanged.
  • SetDestroyOnWater
Projectile:SetDestroyOnWater(flag)
  • SetLifetime
Projectile:SetLifetime(seconds)
  • SetLocalAngularVelocity
Projectile:SetLocalAngularVelocity(x,y,z)
  • SetMaxSpeed
Projectile:SetMaxSpeed(speed)
  • SetNewTarget
Projectile:SetNewTarget( entity )
  • SetScaleVelocity
Projectile:SetScaleVelocity(vs) or Projectile:SetScaleVelocity(vsx, vsy, vsz)
  • SetStayUpright
Projectile:SetStayUpright(truefalse)
  • SetNewTargetGround (listed on Projectile.lua line 85)

Projectile:SetNewTargetGround(newPos)

  • SetTurnRate
Projectile:SetTurnRate(radians_per_second)
  • SetVelocity
Projectile:SetVelocity(speed) or Projectile:SetVelocity(vx,vy,vz)
  • SetVelocityAlign
Projectile:SetVelocityAlign(truefalse)
  • SetVelocityRandomUpVector
SetVelocityRandomUpVector(self)
  • StayUnderwater
Projectile:StayUnderwater(onoff)
  • TrackTarget
Projectile:TrackTarget(onoff)
  • base
derived from Entity
  • moho.projectile_methods

Prop

  • base
derived from Entity
  • moho.prop_methods

ReconBlip

  • GetSource
unit = ReconBlip:GetSource()
  • IsKnownFake
bool = ReconBlip:IsKnownFake()
  • IsMaybeDead
bool = ReconBlip:IsMaybeDead()
  • IsOnOmni
bool = ReconBlip:IsOnOmni()
  • IsOnRadar
bool = ReconBlip:IsOnRadar()
  • IsOnSonar
bool = ReconBlip:IsOnSonar()
  • IsSeenEver
bool = ReconBlip:IsSeenEver()
  • IsSeenNow
bool = ReconBlip:IsSeenNow()
  • base
derived from Entity
  • moho.blip_methods

Shield

  • moho.shield_methods

Unit

  • AddCommandCap
unit:AddCommandCap(capName) -- Add a command cap to a unit.
  • AddImpulse
AddImpulse(self, x, y, z)
  • AddToggleCap
unit:AddToggleCap(capName) -- Add a toggle cap to a unit.
  • AddUnitToStorage
Unit:AddUnitToStorage( storedUnit )
  • AlterArmor
Unit:AlterArmor(damageTypeName, multiplier)
  • CalculateWorldPositionFromRelative
Calculate the desired world position from the supplied relative vector from the center of the unit
  • CanBuild
CanBuild(self, blueprint
  • CanPathTo
See if the unit can path to the goal
  • ClearFocusEntity
ClearFocusEntity(self)
  • EnableManipulators
Unit:EnableManipulators([string boneName | int boneIndex], bool Enable)
  • GetArmorMult
mult = Unit:GetArmorMult(damageTypeName)
  • GetAttacker
GetAttacker() - get the tactical attack manager object of this unit
  • GetBlip
blip = GetBlip(armyIndex) - returns a blip (if any) that the given army has for the unit
  • GetBuildRate
unit:GetBuildRate() -- returns the build rate of a unit: what fraction of target unit it builds per second.
  • GetCargo
GetCargo(self)
  • GetConsumptionPerSecondEnergy
Get the consumption of energy of the unit
  • GetConsumptionPerSecondMass
Get the consumption of mass of the unit
  • GetCurrentLayer
GetCurrentLayer(self)
  • GetFocusUnit
GetFocusUnit(self)
  • GetFuelRatio
Get the fuel ratio
  • GetFuelUseTime
Get the fuel use time
  • GetGuardedUnit
Unit:GetGuardedUnit()
  • GetGuards
Unit:GetGuards()
  • GetHealth
GetHealth(self)
  • GetNavigator
GetNavigator() - get the navigator object of this unit
  • GetNukeSiloAmmoCount
Unit:GetNukeSiloAmmoCount()
  • GetNumBuildOrders
Get number of factory/engineer build orders that fit in the specified category
  • GetProductionPerSecondEnergy
Get the production of energy of the unit
  • GetProductionPerSecondMass
Get the production of mass of the unit
  • GetRallyPoint
Get the rally point for the factory
  • GetResourceConsumed
Return the fraction of requested resources this unit consumed last tick. Normally 1, but can be fractional if economy is struggling.
  • GetScriptBit
Get the current toggle state of the script bit that matches the string
  • GetStat
GetStat(Name[,defaultVal])
  • GetTacticalSiloAmmoCount
Unit:GetTacticalSiloAmmoCount()
  • GetTargetEntity
Return our target unit if we have one
  • GetTransportFerryBeacon
Unit:GetTransportFerryBeacon()
  • GetUnitId
GetUnitId(self)
  • GetWeapon
GetWeapon(self,index) -- return the index'th weapon of this unit. Index must be between 1 and self:GetWeaponCount(), inclusive.
  • GetWeaponCount
GetWeaponCount(self) -- return the number of weapons on this unit. Note that dummy weapons are not included in the count, so this may differ from the number of weapons defined in the unit's blueprint.
  • GetWorkProgress
GetWorkProgress()
  • GiveNukeSiloAmmo
Unit:GiveNukeSiloAmmo(num)
  • GiveTacticalSiloAmmo
Unit:GiveTacticalSiloAmmo(num)
  • HasMeleeSpaceAroundTarget
Unit:HasMeleeSpaceAroundTarget(target)
  • HasValidTeleportDest
Unit:HasValidTeleportDest()
  • HideBone
HideBone(self,bone,affectChildren)
  • IsBeingBuilt
Unit:IsBeingBuilt()
  • IsDead
IsDead(unit)
  • IsIdleState
IsIdleState(unit)
  • IsMobile
bool IsMobile() - Is this a mobile unit?
  • IsMoving
bool IsMoving() - Is this unit moving?
  • IsPaused
Unit:IsPaused()
  • IsStunned
IsStunned(unit)
  • IsUnitState
IsUnitState(unit, stateName)
  • IsValidTarget
bool = IsValidTarget(self)
  • KillManipulator
Kill a specific manipulator held by a script object
  • KillManipulators
Unit:KillManipulators([boneName|boneIndex])
  • MeleeWarpAdjacentToTarget
Unit:MeleeWarpAdjacentToTarget(target)
  • RecoilImpulse
RecoilImpulse(self, x, y, z)
  • RemoveBuildRestriction
Allow building of categories for this unit
  • RemoveCommandCap
unit:RemoveCommandCap(capName) -- Remove a command cap to a unit.
  • RemoveNukeSiloAmmo
Unit:RemoveNukeSiloAmmo(num)
  • RemoveTacticalSiloAmmo
Unit:RemoveTacticalSiloAmmo(num)
  • RemoveToggleCap
unit:RemoveToggleCap(capName) -- Remove a toggle cap to a unit.
  • RestoreBuildRestrictions
Restore buildable categories to that as defined in the blueprint
  • RestoreCommandCaps
Restore the command caps of the unit back to blueprint spec.
  • RestoreToggleCaps
Restore the toggle caps of the unit back to blueprint spec.
  • RevertCollisionShape
Revert the collision shape to the blueprint spec
  • RevertElevation
Revert the elevation of the unit back to the blueperint spec
  • RevertRegenRate
Restore regen rate of the unit back to blueprint spec.
  • ScaleGetBuiltEmitter
ScaleGetBuiltEmitter(self, emitter)
  • SetAccMult
Set the acceleration multiplier of the unit
  • SetAutoMode
Set auto silo build mode to on/off
  • SetBlockCommandQueue
SetBlockCommandQueue(unit, flag)
  • SetBuildRate
unit:SetBuildRate(frac) -- Set the build rate of a unit: what fraction of target unit it builds per second.
  • SetBusy
SetBusy(unit, flag)
  • SetCapturable
Set if this unit can be captured or not.
  • SetConsumptionActive
Unit:SetConsumptionActive(flag)
  • SetConsumptionPerSecondEnergy
unit:SetConsumptionPerSecondEnergy(value) -- Set the consumption of energy of a unit
  • SetConsumptionPerSecondMass
Set the consumption of mass of the unit
  • SetCreator
Set the creator for this unit
  • SetCustomName
Unit:SetCustomName(name)
  • SetDoNotTarget
SetDoNotTarget(unit, flag)
  • SetElevation
Set the elevation of the unit
  • SetFireState
Set a specific fire state for the retaliation state of the unit
  • SetFocusEntity
SetFocusUnit(self, focus)
  • SetFuelRatio
Set the fuel ratio
  • SetFuelUseTime
Set the fuel use time
  • SetImmobile
SetImmobile(unit, flag)
  • SetIsValidTarget
SetIsValidTarget(self,bool)
  • SetPaused
Unit:SetPaused()
  • SetProductionActive
Unit:SetProductionActive(flag)
  • SetProductionPerSecondEnergy
Set the production of energy of the unit
  • SetProductionPerSecondMass
Set the production of mass of the unit
  • SetReclaimable
Set if this unit can be reclaimed or not.
  • SetRegenRate
unit:SetRegenRate(rate) -- Set the regen rate of a unit.
  • SetScriptBit
Set the script bit that matches the string to the desired state
  • SetSpeedMult
Set the speed multiplier of the unit
  • SetStrategicUnderlay
SetStrategicUnderlay(icon)
  • SetStunned
SetStunned(unit, time)
  • SetTurnMult
Set the turn multiplier of the unit
  • SetUnSelectable
SetUnSelectable(unit, flag)
  • SetUnitState
SetUnitState(name, bool)
  • SetWorkProgress
SetWorkProgress(float)
  • ShowBone
ShowBone(self,bone,affectChildren)
  • StopSiloBuild
StopSiloBuild(unit)
  • TestCommandCaps
Test if a unit has this specified set to true in the blueprint spec.
  • TestToggleCaps
Test if a unit has this specified set to true in the blueprint spec.
  • ToggleFireState
Toggle the fire state for the retaliation state of the unit
  • ToggleScriptBit
Toggle the script bit that matches the string
  • TransportDetachAllUnits
DetachAllUnits(self,destroySomeUnits)
  • TransportHasAvailableStorage
TransportHasAvailableStorage(self)
  • TransportHasSpaceFor
TransportHasSpaceFor(self,target)
  • base
derived from Entity
  • moho.unit_methods

UnitWeapon

  • ChangeDamage
UnitWeapon:ChangeDamage(value)
  • ChangeDamageRadius
UnitWeapon:ChangeDamageRadius(value)
  • ChangeDamageType
UnitWeapon:ChangeDamageType(typeName)
  • ChangeFiringTolerance
UnitWeapon:ChangeFiringTolerance(value)
  • ChangeMaxHeightDiff
UnitWeapon:ChangeMaxHeightDiff(value)
  • ChangeMaxRadius
UnitWeapon:ChangeMaxRadius(value)
  • ChangeMinRadius
UnitWeapon:ChangeMinRadius(value)
  • ChangeProjectileBlueprint
Change the projectile blueprint of a weapon
  • ChangeRateOfFire
UnitWeapon:ChangeRateOfFire(value)
  • CreateProjectile
UnitWeapon:CreateProjectile(muzzlebone)
  • DoInstaHit
UnitWeapon:DoInstaHit(bone, r,g,b, glow, width, texture, lifetime)
  • FireWeapon
bool = UnitWeapon:FireWeapon()
  • GetBlueprint
blueprint = UnitWeapon:GetBlueprint()
  • GetCurrentTarget
UnitWeapon:GetCurrentTarget()

GetCurrentTargetPos

UnitWeapon:GetCurrentTargetPos()
  • GetFireClockPct
Get the firing clock percent (0 - 1)
  • GetFiringRandomness
Get the firing randomness
  • IsFireControl
UnitWeapon:IsFireControl(label)
  • PlaySound
UnitWeapon:PlaySound(weapon,ParamTable)
  • ResetTarget
UnitWeapon:ResetTarget()
  • SetEnabled
UnitWeapon:SetEnabled(enabled)
  • SetFireControl
UnitWeapon:SetFireControl(label)
  • SetFireTargetLayerCaps
UnitWeapon:SetFireTargetLayerCaps(mask)
  • SetFiringRandomness
Set the firing randomness
  • SetTargetEntity
UnitWeapon:SetTarget(entity)
  • SetTargetGround
UnitWeapon:SetTarget(location)
  • SetTargetingPriorities
Set the targeting priorities for the unit
  • TransferTarget
Transfer target from 1 weapon to another
  • WeaponHasTarget
bool = UnitWeapon:HasTarget()
  • moho.weapon_methods

Core

<global>

  • AITarget
Create a target object
  • Basename
base = Basename(fullPath,stripExtension?) -- return the last component of a path
  • BeginLoggingStats
Begin logging stats
  • CreatePrefetchSet
create an empty prefetch set
  • CurrentThread
thread=CurrentThread() -- get a handle to the running thread for later use with ResumeThread() or KillThread()
  • Dirname
base = Dirname(fullPath) -- return a path with trailing filename removed
  • DiskFindFiles
files = DiskFindFiles(directory)

returns a list of files in a directory

  • DiskGetFileInfo
info = DiskGetFileInfo(filename)

returns a table describing the given file, or false if the file doesn't exist. info.IsFolder -- true if the filename refers to a folder info.IsReadOnly -- true if file is read-only info.SizeBytes -- size of file in bytes info.LastWriteTime -- timestamp of last write to file

  • DiskToLocal
localPath = DiskToLocal(SysOrLocalPath)

Converts a system path to a local path. Leaves path alone if already local.

  • EndLoggingStats
EndLoggingStats(bool exit) - End logging stats and optionally exit app
  • EntityCategoryEmpty
Test for an empty category
  • EntityCategoryGetUnitList
Get a list of units blueprint names from a category
  • EnumColorNames
table EnumColorNames() - returns a table containing strings of all the color names
  • FileCollapsePath
path = FileCollapsePath(fullPath) -- collapse out any intermediate /./ or /../ directory names from a path
  • ForkThread
thread = ForkThread(function, ...)

Spawns a new thread running the given function with the given args.

  • GetCueBank
cue,bank = GetCueBank(params)
  • GetMovieDuration
GetMovieDuration(localFileName)
  • GetVersion
GetVersion() ->== string
  • IsDestroyed
Has the c++ object been destroyed?
  • KillThread
KillThread(thread) -- destroy a thread started with ForkThread()
  • LOG
Print a log message
  • MATH_IRound
Round a number to the nearest integer
  • MATH_Lerp
MATH_Lerp(s, a, b) or MATH_Lerp(s, sMin, sMax, a, b) ->== number -- linear interpolation from a (at s=0 or s=sMin) to b (at s=1 or s=sMax)
  • OrientFromDir
quaternion OrientFromDir(vector)
  • PointVector
Create a point vector(px,py,pz, vx,vy,vz)
  • RPCSound
RPCSound( {cue,bank,cutoff} ) - Make a sound parameters object
  • Rect
Create a 2d Rectangle (x0,y0,x1,y1)
  • RegisterBeamBlueprint
BeamBlueprint { spec } - define a beam effect
  • RegisterEmitterBlueprint
EmitterBlueprint { spec } - define a particle emitter
  • RegisterMeshBlueprint
MeshBlueprint { spec } - define mesh properties
  • RegisterProjectileBlueprint
ProjectileBlueprint { spec } - define a type of projectile
  • RegisterPropBlueprint
PropBlueprint { spec } - define a type of prop
  • RegisterTrailEmitterBlueprint
TrailEmitterBlueprint { spec } - define a polytrail emitter
  • RegisterUnitBlueprint
UnitBlueprint { spec } - define a type of unit
  • ResumeThread
ResumeThread(thread) -- resume a thread that had been suspended with SuspendCurrentThread(). Does nothing if the thread wasn't suspended.
  • SPEW
Spew to log
  • STR_GetTokens
table STR_GetTokens(string,delimiter)
  • STR_Utf8Len
int STR_Utf8Len(string) - return the number of characters in a UTF-8 string
  • STR_Utf8SubString
string STR_Utf8SubString(string, start, count) - return a substring from start to count
  • STR_itox
string STR_itox(int) - converts an integer into a hexidecimal string
  • STR_xtoi
int STR_xtoi(string) - converts a hexidecimal string to an integer
  • SecondsPerTick
SecondsPerTick() - Return how many seconds in a tick
  • Sound
Sound( {cue,bank,cutoff} ) - Make a sound parameters object
  • SpecFootprints
SpecFootprints { spec } -- define the footprint types for pathfinding
  • SuspendCurrentThread
SuspendCurrentThread() -- suspend this thread indefinitely. Some external event must eventually call ResumeThread() to resume it.
  • Trace
Trace(true) -- turns on debug tracing

Trace(false) -- turns it off again

  • VAdd
Addition of two vectors
  • VDiff
Difference of two vectors
  • VDist2
Distance between two 2d points (x1,y1,x2,y2)
  • VDist3
Distance between two 3d points (v1,v2)
  • VDot
Dot product of two vectors
  • VMult
Multiplication of vector with scalar
  • VPerpDot
Perp dot product of two vectors
  • Vector
Create a vector (x,y,z)
  • Vector2
Create a vector (x,y)
  • WARN
Pop up a warning dialog
  • WaitFor
WaitFor(event) -- suspend this thread until the event is set
  • doscript
doscript(script, [env]) -- run another script. The environment table, if given, will be used for the script's global variables.
  • exists
exists(name) ->== bool -- returns true if the given resource file exists

CPrefetchSet

  • Update
CPrefetchSet:Update({d3d_textures=..., batch_textures=..., models=..., anims=...})
  • moho.CPrefetchSet

EntityCategory

  • __mul
Generate a category list that is an intersection of cat1 and cat2
  • __sub
Generate a category list of units that is of cat1 but not of cat2
  • moho.EntityCategory

User

<global>

  • AddBlinkyBox
AddBlinkyBox(entityId, onTime, offTime, totalTime)
  • AddCommandFeedbackBlip
AddCommandFeedbackBlip(meshInfoTable, duration)
  • AddConsoleOutputReciever
handler AddConsoleOutputReciever(func(text))
  • AddInputCapture
AddInputCapture(control) - set a control as the current capture
  • AddSelectUnits
Add these units to the currently Selected lists
  • AddToSessionExtraSelectList
Add unit to the session extra select list
  • AnyInputCapture
bool AnyInputCapture() - returns true if there is anything currently on the capture stack
  • AssureMyDocumentsFoldersExist
AssureMyDocumentsFoldersExist() - checks if my documents folders exist, and if not, makes them
  • AudioSetLanguage
AudioSetLanguage(name()
  • ClearCurrentFactoryForQueueDisplay
ClearCurrentFactoryForQueueDisplay()
  • ClearFrame
ClearFrame(int head) - destroy all controls in frame, nil head will clear all frames
  • ClearSessionExtraSelectList
Clear the session extra select list
  • ConExecute
ConExecute('command string') -- Perform a console command
  • ConExecuteSave
ConExecuteSave('command string') -- Perform a console command, saved to stack
  • ConTextMatches
strings ContextMatches(string)
  • CopyCurrentReplay
CopyCurrentReplay(string profile, string newFilename) - copy the current replay to another file
  • CreateUnitAtMouse
CreateUnitAtMouse
  • CurrentTime
Get the current time in seconds, counting from 0 at application start. This is wall-clock time and is unaffected by gameplay.
  • DebugFacilitiesEnabled
bool DebugFacilitiesEnabled() - returns true if debug facilities are enabled.
  • DecreaseBuildCountInQueue
DecreaseBuildCountInQueue(queueIndex, count)
  • DeleteCommand
DeleteCommand(id)
  • DisableWorldSounds
DisableWorldSounds
  • EjectSessionClient
EjectSessionClient(int clientIndex) -- eject another client from your session
  • EnableWorldSounds
EnableWorldSounds
  • EngineStartFrontEndUI
EngineStartFrontEndUI() - kill current UI and start main menu from top
  • EngineStartSplashScreens
EngineStartSplashScreens() - kill current UI and start splash screens
  • EntityCategoryContains
See if a unit category contains this unit
  • EntityCategoryFilterDown
Filter a list of units to only those found in the category
  • EntityCategoryFilterOut
Filter a list of units to exclude those found in the category
  • ExecLuaInSim
Execute some lua code in the sim
  • ExitApplication
ExitApplication - request that the application shut down
  • ExitGame
ExitGame() - Quits the sim, but not the app
  • FlushEvents
FlushEvents() -- flush mouse/keyboard events
  • FormatTime
string FormatTime(seconds) - format a string displaying the time specified in seconds
  • GameTick
Get the current game time in ticks. The game time is the simulation time, that stops when the game is paused.
  • GameTime
Get the current game time in seconds. The game time is the simulation time, that stops when the game is paused.
  • GetArmiesTable
armyInfo GetArmiesTable()
  • GetArmyAvatars
table GetArmyAvatars() - return a table of avatar units for the army
  • GetArmyScore
int GetArmyScore(armyIndex)
  • GetAssistingUnitsList
Get a list of units assisting me
  • GetAttachedUnitsList
Get a list of units blueprint attached to transports
  • GetBlueprint
blueprint = GetBlueprint(entity)
  • GetCamera
GetCamera(name)
  • GetCommandLineArg
CommandArgTable GetCommandLineArg(option, number)
  • GetCurrentUIState
state GetCurrentUIState() - returns 'splash', 'frontend' or 'game' depending on the current state of the ui
  • GetCursor
GetCursor()
  • GetEconomyTotals
table GetEconomyTotals()
  • GetFireState
Get the right fire state for the units passed in
  • GetFocusArmy
GetFocusArmy()
  • GetFrame
frame GetFrame(int head) - return the root UI frame for a given head
  • GetFrontEndData
table GetFrontEndData(key)
  • GetGameTime
string GetGameTime() - returns a formatted string displaying the time the game has been played
  • GetGameTimeSeconds
float GetGameTimeSeconds() - returns game time in seconds
  • GetIdleEngineers
table GetIdleEngineers() - return a table of idle engineer units for the army
  • GetInputCapture
control GetInputCapture() - returns the current capture control, or nil if none
  • GetIsAutoMode
See if anyone in the list is auto building
  • GetIsAutoSurfaceMode
See if anyone in the list is auto surfacing
  • GetIsPaused
Is anyone ins this list builder paused?
  • GetMouseScreenPos
vector GetMouseScreenPos()
  • GetMouseWorldPos
vector GetMouseWorldPos()
  • GetMovieVolume
GetMovieVolume()
  • GetNumRootFrames
int GetNumRootFrames() - returns the current number of root frames (typically one per head
  • GetPreference
obj GetPreference(string, [default])
  • GetResourceSharing
bool GetResourceSharing()
  • GetRolloverInfo
rolloverInfo GetRolloverInfo()
  • GetScriptBit
Get the state for the script big
  • GetSelectedUnits
table GetSelectedUnits() - return a table of the currently selected units
  • GetSessionClients
GetSessionClients() -- return a table of the various clients in the current session.
  • GetSimRate
number GetSimRate()
  • GetSimTicksPerSecond
int GetSimTicksPerSecond()
  • GetSpecialFilePath
string GetSpecialFilePath(string filename, string type) - Given the base name of a special file, retuns the complete path
  • GetSpecialFiles
table GetSpecialFiles(string type)- returns a table of strings which are the names of files in special locations (currently SaveFile, Replay)
  • GetSpecialFolder
string GetSpecialFolder(string type)
  • GetSystemTime
string GetSystemTime() - returns a formatted string displaying the System time
  • GetSystemTimeSeconds
float GetSystemTimeSeconds() - returns System time in seconds
  • GetTextureDimensions
width, height GetTextureDimensions(filename, border = 1)
  • GetUIControlsAlpha
float GetUIControlsAlpha() -- get the alpha multiplier for 2d UI controls
  • GetUnitById
GetUnitById(id)
  • GetUnitCommandData
orders, buildableCategories, GetUnitCommandData(unitSet) -- given a set of units, gets the union of orders and unit categories (for determining builds)
  • GetUnitCommandFromCommandCap
string GetUnitCommandFromCommandCap(string) - given a RULEUCC type command, return the equivalent UNITCOMMAND command
  • GetVolume
float GetVolume(category)
  • GpgNetActive
bool GpgNetActive()
  • GpgNetSend
GpgNetSend(cmd,args...)
  • HasCommandLineArg
HasCommandLineArg(option)
  • HasLocalizedVO
HasLocalizedVO(languageCode)
  • IN_AddKeyMapTable
IN_AddKeyMapTable(keyMapTable) - add a set of key mappings
  • IN_ClearKeyMap
IN_ClearKeyMap() - clears all key mappings
  • IN_RemoveKeyMapTable
IN_RemoveKeyMapTable(keyMapTable) - removes the keys from the key map
  • IncreaseBuildCountInQueue
DecreaseBuildCountInQueue(queueIndex, count)
  • InternalCreateBitmap
InternalCreateBitmap(luaobj,parent) -- for internal use by CreateBitmap()
  • InternalCreateBorder
InternalCreateBorder(luaobj,parent) -- for internal use by CreateBorder()
  • InternalCreateDiscoveryService
InternalCreateDiscoveryService(class)
  • InternalCreateDragger
InternalCreateDragger(luaobj) -- for internal use by CreateDragger()
  • InternalCreateEdit
InternalCreateEdit(luaobj,parent)
  • InternalCreateFrame
InternalCreateFrame(luaobj) -- For internal use by CreateFrame()
  • InternalCreateGroup
InternalCreateGroup(luaobj,parent) -- For internal use by CreateGroup()
  • InternalCreateHistogram
InternalCreateHistogram(luaobj,parent) -- For internal use by CreateHistogram()
  • InternalCreateItemList
InternalCreateItemList(luaobj,parent) -- for internal use by CreateItemList()
  • InternalCreateLobby
InternalCreateLobby(class, string protocol, int localPort, int maxConnections, string playerName, string playerUID, Boxed<weak_ptr<INetNATTraversalProvider>== >== natTraversalProvider)
  • InternalCreateMapPreview
InternalCreateMapPreview(luaobj,parent)
  • InternalCreateMovie
InternalCreateMovie(luaobj,parent) -- for internal use by CreateMovie()
  • InternalCreateScrollbar
InternalCreateScrollbar(luaobj,parent,axis) -- for internal use by CreateScrollBar()
  • InternalCreateText
InternalCreateText(luaobj,parent)
  • InternalCreateWldUIProvider
InternalCreateWldUIProvider(luaobj) - create the C++ script object
  • InternalSaveGame
InternalSaveGame(filename, friendlyname, oncompletion) -- save the current session.
  • IsAlly
IsAlly(army1,army2)
  • IsEnemy
IsEnemy(army1,army2)
  • IsKeyDown
IsKeyDown(keyCode)
  • IsNeutral
IsNeutral(army1,army2)
  • IsObserver
IsObserver()
  • IssueBlueprintCommand
IssueBlueprintCommand(command, blueprintid, count, clear = false)
  • IssueCommand
IssueCommand(command,[string],[clear])
  • IssueDockCommand
IssueDockCommand(clear)
  • IssueUnitCommand
IssueUnitCommand(unitList,command,[string],[clear])
  • LaunchGPGNet
LaunchGPGNet()
  • LaunchReplaySession
bool LaunchReplaySession(filename) - starts a replay of a given file, returns false if unable to launch
  • LaunchSinglePlayerSession
LaunchSinglePlayerSession(sessionInfo) -- launch a new single player session.
  • LoadSavedGame
bool LoadSavedGame(filename)
  • OpenURL
OpenURL(string) - open the default browser window to the specified URL
  • ParseEntityCategory
parse a string to generate a new entity category
  • PauseSound
PauseSound(categoryString,bPause)
  • PauseVoice
PauseVoice(categoryString,bPause)
  • PlaySound
handle = PlaySound(sndParams)
  • PlayTutorialVO
PlayTutorialVO(params)
  • PlayVoice
PlayVoice(params,duck)
  • PostDragger
PostDragger(originFrame, keycode, dragger)

Make 'dragger' the active dragger from a particular frame. You can pass nil to cancel the current dragger.

  • PrefetchSession
PrefetchSession(mapname, mods, hipri) -- start a background load with the given map and mods. If hipri is true, this will interrupt any previous loads in progress.
  • Random
Random([[min,] max])
  • RemoveConsoleOutputReciever
RemoveConsoleOutputReciever(handler)
  • RemoveFromSessionExtraSelectList
Remove unit from the session extra select list
  • RemoveInputCapture
RemoveInputCapture(control) - remove the control from the capture array (always first from back)
  • RemoveProfileDirectories
RemoveProfileDirectories(string profile) - Removes the profile directory and all special files
  • RemoveSpecialFile
RemoveSpecialFile(string profilename, string basename, string type) - remove a special file from the disc, return false if unable to do it
  • RenderOverlayEconomy
RenderOverlayEconomy(bool)
  • RenderOverlayIntel
RenderOverlayIntel(bool)
  • RenderOverlayMilitary
RenderOverlayMilitary(bool)
  • RestartSession
RestartSession() - Restart the current mission/skirmish/etc
  • SavePreferences
SavePreferences()
  • SelectUnits
Select the specified units
  • SessionCanRestart
Return true iff the active session can be restarted.
  • SessionEndGame
End the current game session. The session says active, we just disconnect from everyone else and freeze play.
  • SessionGetCommandSourceNames
Return a table of command sources.
  • SessionGetLocalCommandSource
Return the local command source. Returns 0 if the local client can't issue commands.
  • SessionGetScenarioInfo
Return the table of scenario info that was originally passed to the sim on launch.
  • SessionIsActive
Return true iff there is a session currently running
  • SessionIsBeingRecorded
Return true iff the active session is a being recorded.
  • SessionIsGameOver
Return true iff the session has been won or lost yet.
  • SessionIsMultiplayer
Return true iff the active session is a multiplayer session.
  • SessionIsObservingAllowed
Return true iff observing is allowed in the active session.
  • SessionIsPaused
Return true iff the session is paused.
  • SessionIsReplay
Return true iff the active session is a replay session.
  • SessionRequestPause
Pause the world simulation.
  • SessionResume
Resume the world simulation.
  • SessionSendChatMessage
SessionSendChatMessage([client-or-clients,] message)
  • SetAutoMode
See if anyone in the list is auto building
  • SetAutoSurfaceMode
See if anyone in the list is auto surfacing
  • SetCurrentFactoryForQueueDisplay
currentQueueTable SetCurrentFactoryForQueueDisplay(unit)
  • SetCursor
SetCursor(cursor)
  • SetFocusArmy
SetFocusArmy(armyIndex or -1)
  • SetFrontEndData
SetFrontEndData(key, data)
  • SetMovieVolume
SetMovieVolume(volume): 0.0 - 2.0
  • SetPaused
Pause builders in this list
  • SetPreference
SetPreference(string, obj)
  • SetUIControlsAlpha
SetUIControlsAlpha(float alpha) -- set the alpha multiplier for 2d UI controls
  • SetVolume
SetVolume(category, volume)
  • SimCallback
SimCallback(callback[,bool]): Execute a lua function in sim

callback = {

  Func    =   function name (in the SimCallbacks.lua module) to call
  Args    =   Arguments as a lua object

} If bool is specified and true, sends the current selection with the command

  • StopAllSounds
StopAllSounds
  • StopSound
StopSound(handle,[immediate=false])
  • SyncPlayableRect
SyncPlayableRect(region)
  • TeamColorMode
TeamColorMode(bool)
  • ToggleFireState
Set the right fire state for the units passed in
  • ToggleScriptBit
Set the right fire state for the units passed in
  • UISelectAndZoomTo
UISelectAndZoomTo(userunit,[seconds])
  • UISelectionByCategory
UISelectionByCategory(expression, addToCurSel, inViewFrustum, nearestToMouse, mustBeIdle) - selects units based on a category expression
  • UIZoomTo
UIZoomTo(units,[seconds])
  • UnProject
VECTOR3 UnProject(self,VECTOR2)
  • ValidateIPAddress
str = InternalCreateDiscoveryService(ipaddr)
  • ValidateUnitsList
Validate a list of units
  • WorldIsLoading
bool = WorldIsLoading()
  • _c_CreateCursor
_c_CreateCursor(luaobj,spec)
  • _c_CreateDecal
Create a decal in the user layer
  • _c_CreatePathDebugger
_c_CreatePathDebugger(luaobj,spec)
  • print
Print a log message

CLobby

  • ConnectToPeer
void CLobby.ConnectToPeer(self,address,name,uid
  • DebugDump
void CLobby.DebugDump()
  • Destroy
CLobby.Destroy(self)
  • DisconnectFromPeer
void CLobby.DisconnectFromPeer(self,uid
  • EjectPeer
void CLobby.EjectPeer(self,targetID,reason)
  • GetLocalPlayerID
int CLobby.GetLocalPlayerID(self)
  • GetLocalPlayerName
string CLobby.GetLocalPlayerName(self)
  • GetLocalPort
int-or-nil CLobby.GetLocalPort(self)
  • GetPeer
table CLobby.GetPeer(self,uid)
  • GetPeers
table CLobby.GetPeers(self)
  • HostGame
void CLobby.HostGame(self)
  • IsHost
bool CLobby.IsHost(self)
  • JoinGame
void CLobby.JoinGame(self, string-or-boxedInt32 address, string-or-nil remotePlayerName, string remotePlayerUID)
  • LaunchGame
void CLobby.LaunchGame(self,gameConfig)
  • MakeValidGameName
string CLobby.MakeValidGameName(self,origName)
  • MakeValidPlayerName
string CLobby.MakeValidPlayerName(self,uid,origName)
  • SendData
void CLobby.SendData(self,targetID,table)
  • moho.lobby_methods

CLuaWldUIProvider

  • moho.WldUIProvider_methods

CMauiBitmap

  • GetNumFrames
GetNumFrames()
  • Loop
Loop(bool)
  • Play
Play()
  • SetBackwardPattern
SetBackwardPattern()
  • SetForwardPattern
SetForwardPattern()
  • SetFrame
SetFrame(int)
  • SetFramePattern
SetFramePattern(pattern)
  • SetFrameRate
SetFrameRate(float)
  • SetLoopPingPongPattern
SetLoopPingPongPattern()
  • SetNewTexture
Bitmap:SetNewTexture(filename(s), border=1)
  • SetPingPongPattern
SetPingPongPattern()
  • SetSolidColor
Bitmap:SetSolidColor(color)
  • SetTiled
SetTiled(bool)
  • SetUV
Bitmap:SetUV(float u0, float v0, float u1, float v1)
  • ShareTextures
ShareTextures(bitmap) - allows two bitmaps to use the same textures
  • Stop
Stop()
  • UseAlphaHitTest
UseAlphaHitTest(bool)
  • base
derived from CMauiControl
  • moho.bitmap_methods

CMauiBorder

  • SetSolidColor
SetSolidColor(color)
  • base
derived from CMauiControl
  • moho.border_methods

CMauiControl

  • AcquireKeyboardFocus
AcquireKeyboardFocus(bool blocksKeyDown)
  • ApplyFunction
ApplyFunction(func) - applys a function to this control and all children, function will recieve the control object as the only parameter
  • ClearChildren
ClearChildren()
  • Destroy
Control:Destroy() -- destroy a control.
  • DisableHitTest
Control:DisableHitTest([recursive]) -- hit testing will be skipped for this control
  • Dump
Dump
  • EnableHitTest
Control:EnableHitTest([recursive]) -- hit testing will be checked for this control
  • GetAlpha
float GetAlpha()
  • GetName
string GetName()
  • GetParent
Control:GetParent() -- return the parent of this control, or nil if it doesn't have one.
  • GetRenderPass
int GetRenderPass()
  • GetRootFrame
Frame GetRootFrame()
  • Hide
Control:Hide() -- stop rendering and hit testing the control
  • HitTest
bool HitTest(x, y) - given x,y coordinates, tells you if the control is under the coordinates
  • IsHidden
Control:IsHidden() -- determine if the control is hidden
  • IsHitTestDisabled
Control:IsHitTestDisabled() -- determine if hit testing is disabled
  • NeedsFrameUpdate
bool NeedsFrameUpdate()
  • SetAlpha
SetAlpha(float, children) - Set the alpha of a given control, if children is true, also sets childrens alpha
  • SetHidden
Control:SetHidden() -- set the hidden state of the control
  • SetName
SetName(string)
  • SetNeedsFrameUpdate
SetNeedsFrameUpdate(bool needsIt)
  • SetParent
Control:SetParent(newParentControl) -- change the control's parent
  • SetRenderPass
int SetRenderPass()
  • Show
Control:Show() -- start rendering and hit testing the control
  • moho.control_methods

CMauiCursor

  • ResetToDefault
Cursor:ResetToDefault()
  • SetDefaultTexture
Cursor:SetDefaultTexture(filename, hotspotX, hotspotY)
  • SetNewTexture
Cursor:SetTexture(filename, hotspotX, hotspotY)
  • Show
Cursor:Show()
  • moho.cursor_methods

CMauiEdit

  • AcquireFocus
AcquireFocus()
  • ClearText
Edit:ClearText()
  • DisableInput
Edit:Disable()
  • EnableInput
Edit:EnableInput()
  • GetBackgroundColor
color Edit:GetBackgroundColor()
  • GetCaretColor
color Edit:GetCaretColor()
  • GetCaretPosition
int GetCaretPosition
  • GetFontHeight
int GetFontHeight()
  • GetForegroundColor
color Edit:GetForegroundColor()
  • GetHighlightBackgroundColor
color GetHighlightBackgroundColor()
  • GetHighlightForegroundColor
color GetHighlightForegroundColor()
  • GetMaxChars
int Edit:GetMaxChars()
  • GetStringAdvance
number Edit:GetAdvance(string) - get the advance of a string using the same font as the control
  • GetText
string Edit:GetText()
  • IsBackgroundVisible
bool Edit:IsBackgroundVisible()
  • IsCaretVisible
bool Edit:IsCaretVisible()
  • IsEnabled
bool Edit:IsEnabled()
  • SetCaretCycle
edit:SetCaretCycle(float seconds, uint32 minAlpha, uint32 maxAlpha)
  • SetCaretPosition
SetCaretPosition(int)
  • SetDropShadow
SetDropShadow(bool)
  • SetMaxChars
Edit:SetMaxChars(int size)
  • SetNewBackgroundColor
Edit:SetNewBackgroundColor(color)
  • SetNewCaretColor
Edit:SetNewCaretColor(color)
  • SetNewFont
Edit:SetNewFont(family, pointsize)
  • SetNewForegroundColor
Edit:SetNewForegroundColor(color)
  • SetNewHighlightBackgroundColor
SetNewHighlightBackgroundColor(color)
  • SetNewHighlightForegroundColor
SetNewHightlightForegroundColor(color)
  • SetText
Edit:SetText(string text)
  • ShowBackground
Edit:ShowBackground(bool)
  • ShowCaret
Edit:ShowCaret(bool)
  • base
derived from CMauiControl
  • moho.edit_methods===CMauiFrame===
  • GetTopmostDepth
float GetTopmostDepth()
  • SetTargetHead
SetTargetHead(int)
  • base
derived from CMauiControl
  • moho.frame_methods

CMauiGroup

  • moho.group_methods

CMauiHistogram

  • SetXIncrement
SetXIncrement(int)
  • SetYIncrement
SetYIncrement(int)
  • base
derived from CMauiControl
  • moho.histogram_methods

CMauiItemList

  • DeleteAllItems
itemlist = ItemList:DeleteAllItems()
  • DeleteItem
itemlist = ItemList:DeleteItem(index)
  • Empty
bool ItemList:Empty()
  • GetItem
item = ItemList:GetItem(index)
  • GetItemCount
int ItemList:GetItemCount()
  • GetRowHeight
float ItemList:GetRowHeight()
  • GetSelection
index = ItemList:GetSelection()
  • GetStringAdvance
number ItemList:GetAdvance(string) - get the advance of a string using the same font as the control
  • ModifyItem
itemlist = ItemList:ModifyItem(index, string)
  • ScrollToBottom
ItemList:ScrollToBottom()
  • ScrollToTop
ItemList:ScrollToTop()
  • SetNewColors
ItemList:SetNewColors(foreground, background, selected_foreground, selected_background)
  • SetNewFont
ItemList:SetNewFont(family, pointsize) -- set the font to use in this ItemList control
  • SetSelection
ItemList:SetSelection(index)
  • ShowItem
ItemList:ShowItem(index)
  • ShowMouseoverItem
ShowMouseoverItem(bool) - enable or disable the showing of the mouseover item
  • ShowSelection
ShowSelection(bool) - enable or disable the highlighting of the selected item
  • base
derived from CMauiControl
  • moho.item_list_methods

CMauiLuaDragger

  • moho.dragger_methods

CMauiMovie

  • GetNumFrames
int GetNumFrames() - returns the number of frames in the movie
  • InternalSet
bool Movie:InternalSet(filename)
  • IsLoaded
IsLoaded()
  • Loop
Loop(bool)
  • Play
Play()
  • Stop
Stop()
  • base
derived from CMauiControl
  • moho.movie_methods

CMauiScrollbar

  • DoScrollPages
DoScrollPages(float)
  • SetNewTextures
Scrollbar:SetTextures(background, thumbMiddle, thumbTop, thumbBottom)
  • SetScrollable
Scrollbar:SetScrollable(scrollable) -- set the scrollable object connected to this scrollbar
  • base
derived from CMauiControl
  • moho.scrollbar_methods

CMauiText

  • GetText
string Text:GetText()
  • SetCenteredHorizontally
Text:SetCenteredHorizontally(bool)
  • SetCenteredVertically
Text:SetCenteredVertically(bool)
  • SetDropShadow
Text:SetDropShadow(bool)
  • SetNewClipToWidth
SetNewClipToWidth(bool) - will cause the control to only render as many charachters as fit in its width
  • SetNewColor
Text:SetNewColor(color)
  • SetNewFont
Text:SetNewFont(family, pointsize)
  • SetText
Text:SetText(text)
  • base
derived from CMauiControl
  • moho.text_methods

CPathDebugger

  • moho.PathDebugger_methods

CUIMapPreview

  • SetTexture
CUIMapPreview:SetTexture(texture_name)
  • SetTextureFromMap
CUIMapPreview:SetTextureFromMap(map_name)
  • base
derived from CMauiControl
  • moho.ui_map_preview_methods

CUIWorldView

  • EnableResourceRendering
EnableResourceRendering(bool)
  • GetRightMouseButtonOrder
string moho.UIWorldView:GetRightMouseButtonOrder()
  • GetScreenPos
(vector2f|nil) = GetScreenPos(unit)
  • GetsGlobalCameraCommands
moho.UIWorldView:GetsGlobalCameraCommands(bool getsCommands)
  • HasHighlightCommand
bool moho.UIWorldView:HasHighlightCommand()
  • IsCartographic
bool IsCartographic()
  • IsInputLocked
IsInputLocked(camera)
  • IsResourceRenderingEnabled
bool IsResourceRenderingEnabled()
  • LockInput
LockInput(camera)
  • Project
VECTOR2 Project(self,VECTOR3) - given a point in world space, projects the point to control space
  • SetCartographic
SetCartographic(bool)
  • SetHighlightEnabled
SetHighlightEnabled(bool)
  • ShowConvertToPatrolCursor
bool moho.UIWorldView:ShowConvertToPatrolCursor()
  • UnlockInput
UnlockInput(camera)
  • ZoomScale
ZoomScale(x, y, wheelRot, wheelDelta) - cause the world to zoom based on wheel rotation event
  • __init
moho.UIWorldView:__init(parent_control, cameraName, depth, isMiniMap, trackCamera)
  • base
derived from CMauiControl
  • moho.UIWorldView

CameraImpl

  • EnableEaseInOut
Camera:EnableEaseInOut()
  • GetFocusPosition
Camera:GetFocusPosition()
  • GetMaxZoom
Camera:GetMaxZoom()
  • GetMinZoom
Camera:GetMinZoom()
  • GetTargetZoom
Camera:GetTargetZoom()
  • GetZoom
Camera:GetZoom()
  • HoldRotation
Camera:HoldRotation()
  • MoveTo
Camera:MoveTo(position, orientationHPR, zoom, seconds)
  • MoveToRegion
Camera:MoveTo(region[,seconds])
  • NoseCam
Camera:NoseCam(ent,pitchAdjust,zoom,seconds)
  • Reset
Camera:Reset()
  • RestoreSettings
Camera:RestoreSettings(settings)
  • RevertRotation
Camera:RevertRotation()
  • SaveSettings
Camera:SaveSettings()
  • SetTargetZoom
Camera:SetTargetZoom(zoom)
  • SetZoom
Camera:SetZoom(zoom,seconds)
  • SnapTo
Camera:SnapTo(position, orientationHPR, zoom)
  • Spin
Camera:Spin(headingRate[,zoomRate])
  • TargetEntities
Camera:TargetEntities(ents,zoom,seconds)
  • TrackEntities
Camera:TrackEntities(ents,zoom,seconds)
  • UseGameClock
Camera:UseGameClock()
  • UseSystemClock
Camera:UseSystemClock()

ScriptedDecal

  • SetPositionByScreen
Set the position based on screen space mouse coords
  • SetScale
Scale the text
  • SetTexture
Set the texture and add it to the decal manager
  • moho.userDecal_methods

UserUnit

  • AddSelectionSet
AddSelectionSet(string) -- add a selection set name to an unit
  • GetArmy
GetArmy() -- returns the army index
  • GetBlueprint
blueprint = UserUnit:GetBlueprint()
  • GetCustomName
string GetCustomName() -- get the current custom name, nil if none
  • GetEntityId
Entity:GetEntityId()
  • GetFocus
GetFocus() -- returns the unit this unit is currently focused on, or nil
  • GetFootPrintSize
UserUnit:GetFootPrintSize()
  • GetHealth
GetHealth() -- return current health
  • GetMaxHealth
GetMaxHealth() -- return max health
  • GetPosition
VECTOR3 GetPosition() - returns the current world posititon of the unit
  • GetSelectionSets
table GetSelectionSets() -- get table of all selection sets unit belongs to
  • GetStat
GetStat(Name[,defaultVal])
  • GetUnitId
UserUnit:GetUnitId()
  • HasSelectionSet
bool HasSelectionSet(string) -- see if a unit belongs to a given selection set
  • HasUnloadCommandQueuedUp
See if this unit already has an unload from transport queued up
  • IsAutoMode
bool = UserUnit:IsAutoMode()
  • IsAutoSurfaceMode
bool = UserUnit:IsAutoSurfaceMode()
  • IsDead
IsDead() -- return true if the unit has been destroyed
  • IsIdle
IsIdle() -- return true if the unit is idle
  • IsInCategory
bool = UserUnit:IsInCategory(category)
  • IsRepeatQueue
bool = UserUnit:IsRepeatQueue()
  • IsStunned
flag = UserUnit:IsStunned()
  • ProcessInfo
UserUnit:ProcessInfoPair()
  • RemoveSelectionSet
RemoveSelectionSet(string) -- remove a selection set name from an unit
  • SetCustomName
SetCustomName(string) -- Set a custom name for the unit
Advertisement