Supreme Commander Lua Script List

Sim
[edit]

[list][]AddBuildRestriction[/list]AddBuildRestriction(army,category) - Add a category to the restricted list [list][]ArmyIsCivilian[/list]ArmyIsCivilian(army) [list][]ArmyIsOutOfGame[/list]ArmyIsOutOfGame(army) – return true iff the indicated army has been defeated. [list][]AttachBeamEntityToEntity[/list]AttachBeamEntityToEntity(self, bone, other, bone, army, blueprint) [list][]AttachBeamToEntity[/list]AttachBeamToEntity(emitter, entity, tobone, army ) [list][]AudioSetLanguage[/list]AudioSetLanguage(name) [list][]ChangeUnitArmy[/list]ChangeUnitArmy(unit,armyIndex) Change a unit’s army [list][]CheatsEnabled[/list]Return true iff cheats are enabled. Logs the cheat attempt no matter what. [list][]CoordinateAttacks[/list]CoordinateAttacks [list][]CreateAimController[/list]CreateAimController(weapon, label, turretBone, [barrelBone], [muzzleBone]) [list][]CreateAnimator[/list]CreateAnimator(unit) – create a manipulator for playing animations [list][]CreateAttachedBeam[/list]CreateAttachedBeam(entity, bone, army, length, thickness, texture_filename) [list][]CreateAttachedEmitter[/list]CreateAttachedEmitter(entity, bone, army, emitter_blueprint) [list][]CreateBeamEmitter[/list]emitter = CreateBeamEmitter(blueprint,army) [list][]CreateBeamEmitterOnEntity[/list]emitter = CreateBeamEmitterOnEntity(entity, tobone, army, blueprint ) [list][]CreateBeamEntityToEntity[/list]CreateBeamEntityToEntity(entity, bone, other, bone, army, blueprint) [list][]CreateBeamToEntityBone[/list]CreateBeamToEntityBone(entity, bone, other, bone, army, thickness, texture_filename) [list][]CreateBuilderArmController[/list]CreateBuilderArmController(unit,turretBone, [barrelBone], [aimBone]) [list][]CreateCollisionDetector[/list]CreateCollisionDetector(unit) – create a collision detection manipulator [list][]CreateDecal[/list]handle = CreateDecal(position, heading, textureName1, textureName2, type, sizeX, sizeZ, lodParam, duration, army, fidelity) [list][]CreateEconomyEvent[/list]event = CreateEconomyEvent(unit, energy, mass, timeInSeconds) [list][]CreateEmitterAtBone[/list]CreateEmitterAtBone(entity, bone, army, emitter_blueprint) [list][]CreateEmitterAtEntity[/list]CreateEmitterAtEntity(entity,army,emitter_bp_name) [list][]CreateEmitterOnEntity[/list]CreateEmitterOnEntity(entity,army,emitter_bp_name) [list][]CreateFootPlantController[/list]CreateFootPlantController(unit, footBone, kneeBone, hipBone, [straightLegs], [maxFootFall]) [list][]CreateInitialArmyUnit[/list]army [list][]CreateLightParticle[/list]CreateLightParticle(entity, bone, army, size, lifetime, textureName, rampName) [list][]CreateLightParticleIntel[/list]CreateLightParticle(entity, bone, army, size, lifetime, textureName, rampName) [list][]CreateProp[/list]CreateProp(location,prop_blueprint_id) [list][]CreatePropHPR[/list]blueprint, x, y, z, heading, pitch, roll [list][]CreateResourceDeposit[/list]type, x, y, z, size [list][]CreateRotator[/list]manip = CreateRotator(unit, bone, axis, [goal], [speed], [accel], [goalspeed]) [list][]CreateSlaver[/list]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. [list][]CreateSlider[/list]CreateSlider(unit, bone, [goal_x, goal_y, goal_z, [speed, [world_space]]]) [list][]CreateSplat[/list]CreateSplat(position, heading, textureName, sizeX, sizeZ, lodParam, duration, army, fidelity) [list][]CreateSplatOnBone[/list]CreateSplatOnBone(boneName, offset, textureName, sizeX, sizeZ, lodParam, duration, army) Add a splat to the game at an entity bone position and heading. [list][]CreateStorageManip[/list]CreateStorageManip(unit, bone, resouceName, minX, minY, minZ, maxX, maxY, maxZ) [list][]CreateThrustController[/list]CreateThrustController(unit, label, thrustBone) [list][]CreateTrail[/list]CreateTrail(entity, bone, army, trail_blueprint) [list][]CreateUnit[/list]blueprint, army, tx, ty, tz, qx, qy, qz, qw, [layer] [list][]CreateUnit2[/list]blueprint, army, layer, x, z, heading [list][]CreateUnitHPR[/list]blueprint, army, x, y, z, pitch, yaw, roll [list][]Damage[/list]Damage(instigator, target, amount, damageType) [list][]DamageArea[/list]DamageArea(instigator,location,radius,amount,damageType,damageFriendly,[damageSelf]) [list][]DamageRing[/list]DamageRing(instigator,location,minRadius,maxRadius,amount,damageType,damageFriendly,[damageSelf]) [list][]EconomyEventIsDone[/list]bool = EconomyEventIsDone(event) [list][]EndGame[/list]Signal the end of the game. Acts like a permanent pause. [list][]EntityCategoryContains[/list]See if a unit category contains this unit [list][]EntityCategoryFilterDown[/list]Filter a list of units to only those found in the category [list][]FlattenMapRect[/list]FlattenRect(x, z, sizex, sizez, elevation) [list][]GameTick[/list]Get the current game time in ticks. The game time is the simulation time, that stops when the game is paused. [list][]GameTime[/list]Get the current game time in seconds. The game time is the simulation time, that stops when the game is paused. [list][]GenerateArmyStart[/list]army [list][]GenerateRandomOrientation[/list]rotation = GenerateRandomOrientation() [list][]GetArmyBrain[/list]army [list][]GetArmyUnitCap[/list]army [list][]GetArmyUnitCostTotal[/list]army [list][]GetCurrentCommandSource[/list]Return the (1 based) index of the current command source. [list][]GetEntitiesInRect[/list]Return the enitities inside the given rectangle [list][]GetFocusArmy[/list]GetFocusArmy() [list][]GetMapSize[/list]sizeX, sizeZ = GetMapSize() [list][]GetSurfaceHeight[/list]type = GetSurfaceHeight(x,z) [list][]GetTerrainHeight[/list]type = GetTerrainHeight(x,z) [list][]GetTerrainType[/list]type = GetTerrainType(x,z) [list][]GetTerrainTypeOffset[/list]type = GetTerrainTypeOffset(x,z) [list][]GetUnitsInRect[/list]Return the units inside the given rectangle [list][]HasLocalizedVO[/list]HasLocalizedVO(language) [list][]InitializeArmyAI[/list]army [list][]IsAlly[/list]IsAlly(army1,army2) [list][]IsCommandDone[/list]IsCommandDone [list][]IsEnemy[/list]IsEnemy(army1,army2) [list][]IsEntity[/list]bool = IsEntity(object) [list][]IsGameOver[/list]Return true if the game is over (i.e. EndGame() has been called). [list][]IsNeutral[/list]IsNeutral(army1,army2) [list][]IssueAggressiveMove[/list]IssueAggressiveMove [list][]IssueAttack[/list]IssueAttack [list][]IssueBuildFactory[/list]IssueBuildFactory [list][]IssueBuildMobile[/list]IssueBuildMobile [list][]IssueCapture[/list]IssueCapture [list][]IssueClearCommands[/list]IssueClearCommands [list][]IssueClearFactoryCommands[/list]IssueClearFactoryCommands [list][]IssueDestroySelf[/list]IssueDestroySelf [list][]IssueDive[/list]IssueDive [list][]IssueEnhance[/list]IssueEnhance [list][]IssueFactoryAssist[/list]IssueFactoryAssist [list][]IssueFactoryRallyPoint[/list]IssueFactoryRallyPoint [list][]IssueFerry[/list]IssueFerry [list][]IssueFormAggressiveMove[/list]IssueFormAggressiveMove [list][]IssueFormAttack[/list]IssueFormAttack [list][]IssueFormMove[/list]IssueFormMove [list][]IssueFormPatrol[/list]IssueFormPatrol [list][]IssueGuard[/list]IssueGuard [list][]IssueKillSelf[/list]IssueKillSelf [list][]IssueMove[/list]IssueMove [list][]IssueMoveOffFactory[/list]IssueMoveOffFactory [list][]IssueNuke[/list]IssueNuke [list][]IssueOverCharge[/list]IssueOverCharge [list][]IssuePatrol[/list]IssuePatrol [list][]IssuePause[/list]IssuePause [list][]IssueReclaim[/list]IssueReclaim [list][]IssueRepair[/list]IssueRepair [list][]IssueSacrifice[/list]IssueSacrifice [list][]IssueSiloBuildNuke[/list]IssueSiloBuildNuke [list][]IssueSiloBuildTactical[/list]IssueSiloBuildTactical [list][]IssueStop[/list]IssueStop [list][]IssueTactical[/list]IssueTactical [list][]IssueTeleport[/list]IssueTeleport [list][]IssueTeleportToBeacon[/list]IssueTeleportToBeacon [list][]IssueTransportLoad[/list]IssueTransportLoad [list][]IssueTransportUnload[/list]IssueTransportUnload [list][]IssueTransportUnloadSpecific[/list]IssueTransportUnloadSpecific [list][]IssueUpgrade[/list]IssueUpgrade [list][]ListArmies[]MetaImpact[/list]MetaImpact(instigator,location,fMaxRadius,iAmount,[damageFriendly]) [list][]NotifyUpgrade[/list]NotifyUpgrade(from,to) [list][]OkayToMessWithArmy[/list]Return true if the current command source is authorized to mess with the given army. Or if cheats are enabled. [list][]ParseEntityCategory[/list]parse a string to generate a new entity category [list][]PlayLoop[/list]handle = PlayLoop(self,sndParams) [list][]Random[/list]Random([[min,] max]) [list][]RemoveBuildRestriction[/list]RemoveBuildRestriction(army,category) - Remove a category from the restricted list [list][]RemoveEconomyEvent[/list]RemoveEconomyEvent(unit, event) [list][]SelectedUnit[/list]unit = SelectedUnit() – Returns the currently selected unit. For use at the lua console, so you can call Lua methods on a unit. [list][]SetAlliance[/list]SetAlliance(army1,army2,<Neutral|Enemy|Ally> [list][]SetAllianceOneWay[/list]SetAllianceOneWay(army1,army2,<Neutral|Enemy|Ally> [list][]SetAlliedVictory[/list]SetAlliedVictory(army,bool) [list][]SetArmyAIPersonality[/list]SetArmyAIPersonality(army,personality) [list][]SetArmyColor[/list]SetArmyColor(army,r,g,b) [list][]SetArmyColorIndex[/list]SetArmyColorIndex(army,index) [list][]SetArmyEconomy[/list]army, mass, energy [list][]SetArmyFactionIndex[/list]SetArmyFactionIndex(army,index) [list][]SetArmyOutOfGame[/list]SetArmyOutOfGame(army) – indicate that the supplied army has been defeated. [list][]SetArmyPlans[/list]army, plans [list][]SetArmyShowScore[/list]SetArmyColor(army, bool) - determines if the user should be able to see the army score [list][]SetArmyStart[/list]army, x, z [list][]SetArmyStatsSyncArmy[/list]Set the army index for which to sync army stats (-1 for none) [list][]SetArmyUnitCap[/list]army, unitCap [list][]SetIgnoreArmyUnitCap[/list]army, flag [list][]SetIgnorePlayableRect[/list]army, flag [list][]SetPlayableRect[/list]SetPlayableRect( minX, minZ, maxX, maxZ ) [list][]SetTerrainType[/list]SetTerrainType(x,z,type) [list][]SetTerrainTypeRect[/list]SetTerrainType(rect,type) [list][]ShouldCreateInitialArmyUnits[]SimConExecute[/list]SimConExecute(‘command string’) – Perform a console command [list][]SplitProp[/list]SplitProp(original, blueprint_name) – split a prop into multiple child props, one per bone; returns all the created props [list][]StopLoop[/list]StopLoop(self,handle) [list][]SubmitXMLArmyStats[/list]Request that we submit xml army stats to gpg.net. [list][]TryCopyPose[/list]TryCopyPose(unitFrom,entityTo,bCopyWorldTransform) [list][]Warp[/list]Warp( unit, location, [orientation] ) [list][]_c_CreateEntity[/list]_c_CreateEntity(spec) [list][]_c_CreateShield[/list]_c_CreateShield(spec) [list][*]print[/list]Print a log message
[edit]

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

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

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

CAnimationManipulator [list][]GetAnimationTime[/list]time = AnimationManipulator:GetAnimationTime() [list][]GetRate[/list]rate = AnimationManipulator:GetRate() [list][]PlayAnim[/list]AnimManipulator:PlayAnim(entity, animName, looping=false) [list][]SetAnimationFraction[/list]AnimationManipulator:SetAnimationFraction(fraction) [list][]SetAnimationTime[/list]AnimationManipulator:SetAnimationTime(fraction) [list][]SetBoneEnabled[/list]AnimationManipulator:SetBoneEnabled(bone, value, include_decscendants=true) [list][]SetRate[/list]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. [list][]base[/list]derived from IAniManipulator [list][*]moho.AnimationManipulator[/list]
[edit]

CBoneEntityManipulator [list][]base[/list]derived from IAniManipulator [list][]moho.BoneEntityManipulator[/list]
[edit]

CBuilderArmManipulator [list][]SetAimingArc[/list]BuilderArmManipulator:SetAimingArc(minHeading, maxHeading, headingMaxSlew, minPitch, maxPitch, pitchMaxSlew) [list][]SetHeadingPitch[/list]CBuilderArmManipulator:SetHeadingPitch( heading, pitch ) [list][]base[/list]derived from IAniManipulator [list][]moho.BuilderArmManipulator[/list]
[edit]

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

CDamage [list][]GetTarget[/list]CDamage:GetTarget() [list][]SetInstigator[/list]CDamage:SetInstigator() [list][]SetTarget[/list]CDamage:SetTarget() [list][]moho.CDamage[/list]
[edit]

CDecalHandle [list][*]moho.CDecalHandle[/list]
[edit]

CEconomyEvent [list][*]moho.EconomyEvent[/list]
[edit]

CFootPlantManipulator [list][*]moho.FootPlantManipulator[/list]
[edit]

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

CRotateManipulator [list][]ClearGoal[/list]RotateManipulator:ClearGoal() [list][]SetAccel[/list]RotateManipulator:SetAccel(degrees_per_second_squared) [list][]SetFollowBone[/list]RotateManipulator:SetFollowBone(bone) [list][]SetGoal[/list]RotateManipulator:SetGoal(self, degrees) [list][]SetSpeed[/list]RotateManipulator:SetSpeed(self, degrees_per_second) [list][]SetSpinDown[/list]RotateManipulator:SetSpinDown(self, flag) [list][]SetTargetSpeed[/list]RotateManipulator:SetTargetSpeed(degrees_per_second) [list][]base[/list]derived from IAniManipulator [list][*]moho.RotateManipulator[/list]
[edit]

CSlaveManipulator [list][]base[/list]derived from IAniManipulator [list][]moho.SlaveManipulator[/list]
[edit]

CSlideManipulator [list][]SetDeceleration[/list]CSlideManipulator:SetDeceleration(dec) [list][]SetGoal[/list]CSlideManipulator:SetGoal(goal_x, goal_y, goal_z) [list][]SetSpeed[/list]CSlideManipulator:SetSpeed(speed) [list][]SetWorldUnits[/list]CSlideManipulator:SetWorldUnits(bool) [list][]base[/list]derived from IAniManipulator [list][]moho.SlideManipulator[/list]
[edit]

CStorageManipulator [list][*]moho.StorageManipulator[/list]
[edit]

CThrustManipulator [list][]base[/list]derived from IAniManipulator [list][]moho.ThrustManipulator[/list]
[edit]

CollisionBeamEntity [list][]Enable[/list]CollisionBeamEntity:Enable() [list][]GetLauncher[/list]CollisionBeamEntity:GetLauncher() [list][]IsEnabled[/list]bool = CollisionBeamEntity:IsEnabled() [list][]SetBeamFx[/list]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. [list][]__init[/list]beam = CreateCollisionBeam(spec) spec is a table with the following fields defined: spec.Weapon = spec.OtherBone = <bone of weapon’s unit to attach to> spec.CollisionCheckInterval = spec.BeamBone = [list][]base[/list]derived from Entity [list][*]moho.CollisionBeamEntity[/list]
[edit]

Entity [list][]AddManualScroller[/list]Entity:AddManualScroller(scrollSpeed1, scrollSpeed2) [list][]AddPingPongScroller[/list]Entity:AddPingPongScroller(ping1, pingSpeed1, pong1, pongSpeed1, ping2, pingSpeed2, pong2, pongSpeed2) [list][]AddShooter[/list]AddShooter(shooter) [list][]AddThreadScroller[/list]Entity:AddThreadScroller(sideDist, scrollMult) [list][]AddWorldImpulse[/list]AddWorldImpulse(self, Ix, Iy, Iz, Px, Py, Pz) [list][]AdjustHealth[/list]Entity:AdjustHealth(instigator, delta) [list][]AttachBoneTo[/list]Entity:AttachBoneTo(selfbone, entity, bone) [list][]AttachBoneToEntityBone[/list]Attach a unit bone position to an entity bone position [list][]AttachTo[/list]Entity:AttachTo(entity, bone) [list][]BeenDestroyed[/list]Entity:BeenDestroyed() [list][]CreateProjectile[/list]Entity:CreateProjectile(proj_bp, [ox, oy, oz], [dx, dy, dz] [list][]CreateProjectileAtBone[/list]Entity:CreateProjectileAtBone(projectile_blueprint, bone) [list][]CreatePropAtBone[/list]Entity:CreatePropAtBone(boneindex,prop_blueprint_id) [list][]Destroy[/list]Entity:Destroy() [list][]DetachAll[/list]Entity:DetachAll(bone,[skipBallistic]) [list][]DetachFrom[/list]Entity:DetachFrom([skipBallistic]) [list][]DisableIntel[/list]Intel:DisableIntel(type) [list][]EnableIntel[/list]EnableIntel(type) [list][]FallDown[/list]Entity:FallDown(dx,dy,dz,force) – start falling down [list][]GetAIBrain[/list]GetAIBrain(self) [list][]GetArmy[/list]GetArmy(self) [list][]GetBlueprint[/list]blueprint = Entity:GetBlueprint() [list][]GetBoneCount[/list]Entity:GetBoneCount() – returns number of bones in this entity’s skeleton [list][]GetBoneDirection[/list]Entity:GetBoneDirection(bone_name) [list][]GetBoneName[/list]Entity:GetBoneName(i) – return the name of the i’th bone of this entity (counting from 0) [list][]GetCollisionExtents[/list]Entity:GetCollisionExtents() [list][]GetEntityId[/list]Entity:GetEntityId() [list][]GetFractionComplete[/list]Entity:GetFractionComplete() [list][]GetHeading[/list]Entity:GetHeading() [list][]GetHealth[/list]Entity:GetHealth() [list][]GetIntelRadius[/list]GetIntelRadius(type) [list][]GetMaxHealth[/list]Entity:GetMaxHealth() [list][]GetOrientation[/list]Entity:GetOrientation() [list][]GetParent[/list]Entity:GetParent() [list][]GetPosition[/list]Entity:GetPosition([bone_name]) [list][]GetScale[/list]Entity:GetScale() → sx,sy,sz – return current draw scale of this entity [list][]InitIntel[/list]InitIntel(army,type,) [list][]IsCollisionBeam[/list]bool = Entity:IsCollisionBeam() [list][]IsIntelEnabled[/list]IsIntelEnabled(type) [list][]IsProjectile[/list]bool = Entity:IsProjectile() [list][]IsProp[/list]bool = Entity:IsProp() [list][]IsUnit[/list]bool = Entity:IsUnit() [list][]IsValidBone[/list]Entity:IsValidBone(nameOrIndex,allowNil=false) [list][]Kill[/list]Entity:Kill(instigator,type,excessDamageRatio) [list][]PlaySound[/list]Entity:PlaySound(params) [list][]PushOver[/list]Entity:PushOver(nx, ny, nz, depth) [list][]ReachedMaxShooters[/list]ReachedMaxShooters() [list][]RemoveScroller[/list]Entity:RemoveScroller() [list][]RemoveShooter[/list]RemoveShooter(shooter) [list][]RequestRefreshUI[/list]Entity:RequestRefreshUI() [list][]SetAmbientSound[/list]Entity:SetAmbientSound(paramTableDetail,paramTableRumble) [list][]SetCollisionShape[/list]Entity:SetCollisionShape([‘Box’|‘Sphere’|‘None’], centerX, Y, Z, size) – size is radius for sphere, x,y,z extent for box [list][]SetDrawScale[/list]Entity:SetDrawScale(size): Change mesh scale on the fly [list][]SetHealth[/list]Entity:SetHealth(instigator,health) [list][]SetIntelRadius[/list]SetRadius(type,radius) [list][]SetMaxHealth[/list]Entity:SetMaxHealth(maxhealth) [list][]SetMesh[/list]Entity:SetMesh(meshBp, bool keepActor): Change mesh on the fly [list][]SetOrientation[/list]Entity:SetOrientation(orientation, immediately ) [list][]SetParentOffset[/list]Entity:SetParentOffset(vector) [list][]SetPosition[/list]Entity:SetPosition(vector,[immediate]) [list][]SetScale[/list]Entity:SetScale(s) or Entity:SetScale(sx,sy,sz) [list][]SetVizToAllies[/list]SetVizToAllies(type) [list][]SetVizToEnemies[/list]SetVizToEnemies(type) [list][]SetVizToFocusPlayer[/list]SetVizToFocusPlayer(type) [list][]SetVizToNeutrals[/list]SetVizToNeutrals(type) [list][]ShakeCamera[/list]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 [list][]SinkAway[/list]Entity:SinkAway(vy) – sink into the ground [list][]moho.entity_methods[/list]
[edit]

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

IEffect [list][]OffsetEmitter[/list]Effect:OffsetEmitter(x,y,z) [list][]ResizeEmitterCurve[/list]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:
[edit]

effect:SetEmitterParam(‘x’,1):ScaleEmitter(3.7) [list][*]ScaleEmitter[/list]effect:ScaleEmitter(param, scale) returns the effect so you can chain calls like:
[edit]

effect:SetEmitterParam(‘x’,1):ScaleEmitter(3.7) [list][]SetBeamParam[/list]effect:SetBeamParam(‘name’, value) [list][]SetEmitterCurveParam[/list]Effect:SetEmitterCurveParam(param_name, height, size) [list][*]SetEmitterParam[/list]effect:SetEmitterParam(‘name’, value)returns the effect so you can chain calls like:
[edit]

effect:SetEmitterParam(‘x’,1):ScaleEmitter(3.7) [list][*]moho.IEffect[/list]
[edit]

MotorFallDown [list][*]moho.MotorFallDown[/list]
[edit]

Projectile [list][]ChangeDetonateBelowHeight[/list]Change the detonate below height for the projectile [list][]ChangeMaxZigZag[/list]Change the amount of zig zag [list][]ChangeZigZagFrequency[/list]Change the frequency of the zig zag [list][]CreateChildProjectile[/list]Projectile:CreateChildProjectile(blueprint) [list][]GetCurrentTargetPosition[/list]Projectile:GetCurrentTargetPosition() [list][]GetLauncher[/list]Get who launched this projectile [list][]GetTrackingTarget[/list]Projectile:GetTrackingTarget() [list][]GetVelocity[/list]Projectile:GetVelocity() → x,y,z [list][]SetAcceleration[/list]Projectile:SetAcceleration(accel) [list][]SetBallisticAcceleration[/list]Wrong number of arguments to Projectile:SetAccelerationVector(), expected 1, 2, or 4 but got %d [list][]SetCollideEntity[/list]Projectile:SetCollideEntity(onoff) [list][]SetCollideSurface[/list]Projectile:SetCollideSurface(onoff) [list][]SetCollision[/list]Projectile:SetCollision(onoff) [list][]SetDamage[/list]Projectile:SetDamage(amount, radius) – change how much damage this projectile will do. Either amount or radius can be nil to leave unchanged. [list][]SetDestroyOnWater[/list]Projectile:SetDestroyOnWater(flag) [list][]SetLifetime[/list]Projectile:SetLifetime(seconds) [list][]SetLocalAngularVelocity[/list]Projectile:SetLocalAngularVelocity(x,y,z) [list][]SetMaxSpeed[/list]Projectile:SetMaxSpeed(speed) [list][]SetNewTarget[/list]Projectile:SetNewTarget( entity ) [list][]SetScaleVelocity[/list]Projectile:SetScaleVelocity(vs) or Projectile:SetScaleVelocity(vsx, vsy, vsz) [list][]SetStayUpright[/list]Projectile:SetStayUpright(truefalse) [list][]SetTurnRate[/list]Projectile:SetTurnRate(radians_per_second) [list][]SetVelocity[/list]Projectile:SetVelocity(speed) or Projectile:SetVelocity(vx,vy,vz) [list][]SetVelocityAlign[/list]Projectile:SetVelocityAlign(truefalse) [list][]SetVelocityRandomUpVector[/list]SetVelocityRandomUpVector(self) [list][]StayUnderwater[/list]Projectile:StayUnderwater(onoff) [list][]TrackTarget[/list]Projectile:TrackTarget(onoff) [list][]base[/list]derived from Entity [list][*]moho.projectile_methods[/list]
[edit]

ReconBlip [list][]GetBlueprint[/list]blueprint = ReconBlip:GetBlueprint() [list][]GetSource[/list]unit = ReconBlip:GetSource() [list][]IsKnownFake[/list]bool = ReconBlip:IsKnownFake() [list][]IsMaybeDead[/list]bool = ReconBlip:IsMaybeDead() [list][]IsOnOmni[/list]bool = ReconBlip:IsOnOmni() [list][]IsOnRadar[/list]bool = ReconBlip:IsOnRadar() [list][]IsOnSonar[/list]bool = ReconBlip:IsOnSonar() [list][]IsSeenEver[/list]bool = ReconBlip:IsSeenEver() [list][]IsSeenNow[/list]bool = ReconBlip:IsSeenNow() [list][]base[/list]derived from Entity [list][*]moho.blip_methods[/list]
[edit]

Shield [list][*]moho.shield_methods[/list]
[edit]

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

UnitWeapon [list][]ChangeDamage[/list]UnitWeapon:ChangeDamage(value) [list][]ChangeDamageRadius[/list]UnitWeapon:ChangeDamageRadius(value) [list][]ChangeDamageType[/list]UnitWeapon:ChangeDamageType(typeName) [list][]ChangeFiringTolerance[/list]UnitWeapon:ChangeFiringTolerance(value) [list][]ChangeMaxHeightDiff[/list]UnitWeapon:ChangeMaxHeightDiff(value) [list][]ChangeMaxRadius[/list]UnitWeapon:ChangeMaxRadius(value) [list][]ChangeMinRadius[/list]UnitWeapon:ChangeMinRadius(value) [list][]ChangeProjectileBlueprint[/list]Change the projectile blueprint of a weapon [list][]ChangeRateOfFire[/list]UnitWeapon:ChangeRateOfFire(value) [list][]CreateProjectile[/list]UnitWeapon:CreateProjectile(muzzlebone) [list][]DoInstaHit[/list]UnitWeapon:DoInstaHit(bone, r,g,b, glow, width, texture, lifetime) [list][]GetBlueprint[/list]blueprint = UnitWeapon:GetBlueprint() [list][]GetCurrentTarget[/list]UnitWeapon:GetCurrentTarget() [list][]GetCurrentTargetPos[/list]UnitWeapon:GetCurrentTargetPos() [list][]GetFireClockPct[/list]Get the firing clock percent (0 - 1) [list][]GetFiringRandomness[/list]Get the firing randomness [list][]IsFireControl[/list]UnitWeapon:IsFireControl(label) [list][]PlaySound[/list]UnitWeapon:PlaySound(weapon,ParamTable) [list][]ResetTarget[/list]UnitWeapon:ResetTarget() [list][]SetEnabled[/list]UnitWeapon:SetEnabled(enabled) [list][]SetFireControl[/list]UnitWeapon:SetFireControl(label) [list][]SetFireTargetLayerCaps[/list]UnitWeapon:SetFireTargetLayerCaps(mask) [list][]SetFiringRandomness[/list]Set the firing randomness [list][]SetTargetingPriorities[/list]Set the targeting priorities for the unit [list][]TransferTarget[/list]Transfer target from 1 weapon to another [list][]WeaponHasTarget[/list]bool = UnitWeapon:HasTarget() [list][*]moho.weapon_methods[/list]
[edit]

User
[edit]

[list][]AddBlinkyBox[/list]AddBlinkyBox(entityId, onTime, offTime, totalTime) [list][]AddCommandFeedbackBlip[/list]AddCommandFeedbackBlip(meshInfoTable, duration) [list][]AddConsoleOutputReciever[/list]handler AddConsoleOutputReciever(func(text)) [list][]AddInputCapture[/list]AddInputCapture(control) - set a control as the current capture [list][]AddSelectUnits[/list]Add these units to the currently Selected lists [list][]AddToSessionExtraSelectList[/list]Add unit to the session extra select list [list][]AnyInputCapture[/list]bool AnyInputCapture() - returns true if there is anything currently on the capture stack [list][]AudioSetLanguage[/list]AudioSetLanguage(name() [list][]ClearCurrentFactoryForQueueDisplay[/list]ClearCurrentFactoryForQueueDisplay() [list][]ClearFrame[/list]ClearFrame(int head) - destroy all controls in frame, nil head will clear all frames [list][]ClearSessionExtraSelectList[/list]Clear the session extra select list [list][]ConExecute[/list]ConExecute(‘command string’) – Perform a console command [list][]ConExecuteSave[/list]ConExecuteSave(‘command string’) – Perform a console command, saved to stack [list][]ConTextMatches[/list]strings ContextMatches(string) [list][]CopyCurrentReplay[/list]CopyCurrentReplay(string profile, string newFilename) - copy the current replay to another file [list][]CreateUnitAtMouse[/list]CreateUnitAtMouse [list][]CurrentTime[/list]Get the current time in seconds, counting from 0 at application start. This is wall-clock time and is unaffected by gameplay. [list][]DebugFacilitiesEnabled[/list]bool DebugFacilitiesEnabled() - returns true if debug facilities are enabled. [list][]DecreaseBuildCountInQueue[/list]DecreaseBuildCountInQueue(queueIndex, count) [list][]DeleteCommand[/list]DeleteCommand(id) [list][]DisableWorldSounds[/list]DisableWorldSounds [list][]EjectSessionClient[/list]EjectSessionClient(int clientIndex) – eject another client from your session [list][]EnableWorldSounds[/list]EnableWorldSounds [list][]EngineStartFrontEndUI[/list]EngineStartFrontEndUI() - kill current UI and start main menu from top [list][]EngineStartSplashScreens[/list]EngineStartSplashScreens() - kill current UI and start splash screens [list][]EntityCategoryContains[/list]See if a unit category contains this unit [list][]EntityCategoryFilterDown[/list]Filter a list of units to only those found in the category [list][]EntityCategoryFilterOut[/list]Filter a list of units to exclude those found in the category [list][]ExecLuaInSim[/list]Execute some lua code in the sim [list][]ExitApplication[/list]ExitApplication - request that the application shut down [list][]ExitGame[/list]ExitGame() - Quits the sim, but not the app [list][]FlushEvents[/list]FlushEvents() – flush mouse/keyboard events [list][]FormatTime[/list]string FormatTime(seconds) - format a string displaying the time specified in seconds [list][]GameTick[/list]Get the current game time in ticks. The game time is the simulation time, that stops when the game is paused. [list][]GameTime[/list]Get the current game time in seconds. The game time is the simulation time, that stops when the game is paused. [list][]GetArmiesTable[/list]armyInfo GetArmiesTable() [list][]GetArmyAvatars[/list]table GetArmyAvatars() - return a table of avatar units for the army [list][]GetArmyScore[/list]int GetArmyScore(armyIndex) [list][]GetAssistingUnitsList[/list]Get a list of units assisting me [list][]GetAttachedUnitsList[/list]Get a list of units blueprint attached to transports [list][]GetCamera[/list]GetCamera(name) [list][]GetCommandLineArg[/list]CommandArgTable GetCommandLineArg(option, number) [list][]GetCurrentUIState[/list]state GetCurrentUIState() - returns ‘splash’, ‘frontend’ or ‘game’ depending on the current state of the ui [list][]GetCursor[/list]GetCursor() [list][]GetEconomyTotals[/list]table GetEconomyTotals() [list][]GetFireState[/list]Get the right fire state for the units passed in [list][]GetFocusArmy[/list]GetFocusArmy() [list][]GetFrame[/list]frame GetFrame(int head) - return the root UI frame for a given head [list][]GetFrontEndData[/list]table GetFrontEndData(key) [list][]GetGameTime[/list]string GetGameTime() - returns a formatted string displaying the time the game has been played [list][]GetGameTimeSeconds[/list]float GetGameTimeSeconds() - returns game time in seconds [list][]GetIdleEngineers[/list]table GetIdleEngineers() - return a table of idle engineer units for the army [list][]GetInputCapture[/list]control GetInputCapture() - returns the current capture control, or nil if none [list][]GetIsAutoMode[/list]See if anyone in the list is auto building [list][]GetIsPaused[/list]Is anyone ins this list builder paused? [list][]GetMouseWorldPos[/list]vector GetMouseWorldPos() – returns mouse coordinates on the surface of the map. X = E/W, Y = surface elevation, Z = N/S [list][]GetMovieVolume[/list]GetMovieVolume() [list][]GetNumRootFrames[/list]int GetNumRootFrames() - returns the current number of root frames (typically one per head [list][]GetPreference[/list]obj GetPreference(string, [default]) [list][]GetResourceSharing[/list]bool GetResourceSharing() [list][]GetRolloverInfo[/list]rolloverInfo GetRolloverInfo() [list][]GetScriptBit[/list]Get the state for the script big [list][]GetSelectedUnits[/list]table GetSelectedUnits() - return a table of the currently selected units [list][]GetSessionClients[/list]GetSessionClients() – return a table of the various clients in the current session. [list][]GetSimRate[/list]number GetSimRate() [list][]GetSimTicksPerSecond[/list]int GetSimTicksPerSecond() [list][]GetSpecialFilePath[/list]string GetSpecialFilePath(string filename, string type) - Given the base name of a special file, retuns the complete path [list][]GetSpecialFiles[/list]table GetSpecialFiles(string type)- returns a table of strings which are the names of files in special locations (currently SaveFile, Replay) [list][]GetSpecialFolder[/list]string GetSpecialFolder(string type) [list][]GetSystemTime[/list]string GetSystemTime() - returns a formatted string displaying the System time [list][]GetSystemTimeSeconds[/list]float GetSystemTimeSeconds() - returns System time in seconds [list][]GetTextureDimensions[/list]width, height GetTextureDimensions(filename, border = 1) [list][]GetUIControlsAlpha[/list]float GetUIControlsAlpha() – get the alpha multiplier for 2d UI controls [list][]GetUnitCommandData[/list]orders, buildableCategories, GetUnitCommandData(unitSet) – given a set of units, gets the union of orders and unit categories (for determining builds) [list][]GetUnitCommandFromCommandCap[/list]string GetUnitCommandFromCommandCap(string) - given a RULEUCC type command, return the equivalent UNITCOMMAND command [list][]GetVolume[/list]float GetVolume(category) [list][]GpgNetActive[/list]bool GpgNetActive() [list][]GpgNetSend[/list]GpgNetSend(cmd,args…) [list][]HasCommandLineArg[/list]HasCommandLineArg(option) [list][]HasLocalizedVO[/list]HasLocalizedVO(languageCode) [list][]IN_AddKeyMapTable[/list]IN_AddKeyMapTable(keyMapTable) - add a set of key mappings [list][]IN_ClearKeyMap[/list]IN_ClearKeyMap() - clears all key mappings [list][]IN_RemoveKeyMapTable[/list]IN_RemoveKeyMapTable(keyMapTable) - removes the keys from the key map [list][]IncreaseBuildCountInQueue[/list]DecreaseBuildCountInQueue(queueIndex, count) [list][]InternalCreateBitmap[/list]InternalCreateBitmap(luaobj,parent) – for internal use by CreateBitmap() [list][]InternalCreateBorder[/list]InternalCreateBorder(luaobj,parent) – for internal use by CreateBorder() [list][]InternalCreateDiscoveryService[/list]InternalCreateDiscoveryService(class) [list][]InternalCreateDragger[/list]InternalCreateDragger(luaobj) – for internal use by CreateDragger() [list][]InternalCreateEdit[/list]InternalCreateEdit(luaobj,parent) [list][]InternalCreateFrame[/list]InternalCreateFrame(luaobj) – For internal use by CreateFrame() [list][]InternalCreateGroup[/list]InternalCreateGroup(luaobj,parent) – For internal use by CreateGroup() [list][]InternalCreateHistogram[/list]InternalCreateHistogram(luaobj,parent) – For internal use by CreateHistogram() [list][]InternalCreateItemList[/list]InternalCreateItemList(luaobj,parent) – for internal use by CreateItemList() [list][]InternalCreateLobby[/list]InternalCreateLobby(class, string protocol, int localPort, int maxConnections, string playerName, string playerUID, Boxed<weak_ptr > natTraversalProvider) [list][]InternalCreateMapPreview[/list]InternalCreateMapPreview(luaobj,parent) [list][]InternalCreateMovie[/list]InternalCreateMovie(luaobj,parent) – for internal use by CreateMovie() [list][]InternalCreateScrollbar[/list]InternalCreateScrollbar(luaobj,parent,axis) – for internal use by CreateScrollBar() [list][]InternalCreateText[/list]InternalCreateText(luaobj,parent) [list][]InternalCreateWldUIProvider[/list]InternalCreateWldUIProvider(luaobj) - create the C++ script object [list][]InternalSaveGame[/list]InternalSaveGame(filename, friendlyname, oncompletion) – save the current session. [list][]IsAlly[/list]IsAlly(army1,army2) [list][]IsKeyDown[/list]IsKeyDown(keyCode) [list][]IsObserver[/list]IsObserver() [list][]IssueBlueprintCommand[/list]IssueBlueprintCommand(command, blueprintid, count, clear = false) [list][]IssueCommand[/list]IssueCommand(command,[string],[clear]) [list][]LaunchGPGNet[/list]LaunchGPGNet() [list][]LaunchReplaySession[/list]bool LaunchReplaySession(filename) - starts a replay of a given file, returns false if unable to launch [list][]LoadMap[/list]bool LoadMap(scenarioFileName, startingFaction, difficulty, suppress_replay) [list][]LoadSavedGame[/list]bool LoadSavedGame(filename) [list][]PauseSound[/list]PauseSound(categoryString,bPause) [list][]PauseVoice[/list]PauseVoice(categoryString,bPause) [list][]PlaySound[/list]handle = PlaySound(sndParams) [list][]PlayTutorialVO[/list]PlayTutorialVO(params) [list][]PlayVoice[/list]PlayVoice(params,duck) [list][]PostDragger[/list]PostDragger(originFrame, keycode, dragger) Make ‘dragger’ the active dragger from a particular frame. You can pass nil to cancel the current dragger. [list][]PrefetchSession[/list]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. [list][]RemoveConsoleOutputReciever[/list]RemoveConsoleOutputReciever(handler) [list][]RemoveFromSessionExtraSelectList[/list]Remove unit from the session extra select list [list][]RemoveInputCapture[/list]RemoveInputCapture(control) - remove the control from the capture array (always first from back) [list][]RemoveProfileDirectories[/list]RemoveProfileDirectories(string profile) - Removes the profile directory and all special files [list][]RemoveSpecialFile[/list]RemoveSpecialFile(string profilename, string basename, string type) - remove a special file from the disc, return false if unable to do it [list][]RenderOverlayEconomy[/list]RenderOverlayEconomy(bool) [list][]RenderOverlayIntel[/list]RenderOverlayIntel(bool) [list][]RenderOverlayMilitary[/list]RenderOverlayMilitary(bool) [list][]RestartSession[/list]RestartSession() - Restart the current mission/skirmish/etc [list][]SavePreferences[/list]SavePreferences() [list][]SelectUnits[/list]Select the specified units [list][]SessionCanRestart[/list]Return true iff the active session can be restarted. [list][]SessionEndGame[/list]End the current game session. The session says active, we just disconnect from everyone else and freeze play. [list][]SessionGetCommandSourceNames[/list]Return a table of command sources. [list][]SessionGetLocalCommandSource[/list]Return the local command source. Returns 0 if the local client can’t issue commands. [list][]SessionGetScenarioInfo[/list]Return the table of scenario info that was originally passed to the sim on launch. [list][]SessionIsActive[/list]Return true iff there is a session currently running [list][]SessionIsBeingRecorded[/list]Return true iff the active session is a being recorded. [list][]SessionIsGameOver[/list]Return true iff the session has been won or lost yet. [list][]SessionIsMultiplayer[/list]Return true iff the active session is a multiplayer session. [list][]SessionIsObservingAllowed[/list]Return true iff observing is allowed in the active session. [list][]SessionIsPaused[/list]Return true iff the session is paused. [list][]SessionIsReplay[/list]Return true iff the active session is a replay session. [list][]SessionRequestPause[/list]Pause the world simulation. [list][]SessionResume[/list]Resume the world simulation. [list][]SessionSendChatMessage[/list]SessionSendChatMessage([client-or-clients,] message) [list][]SetAutoMode[/list]See if anyone in the list is auto building [list][]SetCurrentFactoryForQueueDisplay[/list]currentQueueTable SetCurrentFactoryForQueueDisplay(unit) [list][]SetCursor[/list]SetCursor(cursor) [list][]SetFocusArmy[/list]SetFocusArmy(armyIndex or -1) [list][]SetFrontEndData[/list]SetFrontEndData(key, data) [list][]SetMovieVolume[/list]SetMovieVolume(volume): 0.0 - 2.0 [list][]SetPaused[/list]Pause builders in this list [list][]SetPreference[/list]SetPreference(string, obj) [list][]SetUIControlsAlpha[/list]SetUIControlsAlpha(float alpha) – set the alpha multiplier for 2d UI controls [list][]SetVolume[/list]SetVolume(category, volume) [list][]SimCallback[/list]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 [list][]StopAllSounds[/list]StopAllSounds [list][]StopSound[/list]StopSound(handle,[immediate=false]) [list][]SyncPlayableRect[/list]SyncPlayableRect(region) [list][]TeamColorMode[/list]TeamColorMode(bool) [list][]ToggleFireState[/list]Set the right fire state for the units passed in [list][]ToggleScriptBit[/list]Set the right fire state for the units passed in [list][]UISelectAndZoomTo[/list]UISelectAndZoomTo(userunit,[seconds]) [list][]UISelectionByCategory[/list]UISelectionByCategory(expression, addToCurSel, inViewFrustum, nearestToMouse, mustBeIdle) - selects units based on a category expression [list][]UIZoomTo[/list]UIZoomTo(units,[seconds]) [list][]ValidateIPAddress[/list]str = InternalCreateDiscoveryService(ipaddr) [list][]ValidateUnitsList[/list]Validate a list of units [list][]WorldIsLoading[/list]bool = WorldIsLoading() [list][]_c_CreateCursor[/list]_c_CreateCursor(luaobj,spec) [list][]_c_CreatePathDebugger[/list]_c_CreatePathDebugger(luaobj,spec) [list][]print[/list]Print a log message
[edit]

CDiscoveryService [list][]GetGameCount[/list]CDiscoveryService.GetCount(self) [list][]Reset[/list]CDiscoveryService.Reset(self) [list][*]moho.discovery_service_methods[/list]
[edit]

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

CLuaWldUIProvider [list][*]moho.WldUIProvider_methods[/list]
[edit]

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

CMauiBorder [list][]SetSolidColor[/list]SetSolidColor(color) [list][]base[/list]derived from CMauiControl [list][*]moho.border_methods[/list]
[edit]

CMauiControl [list][]AcquireKeyboardFocus[/list]AcquireKeyboardFocus(bool blocksKeyDown) [list][]ClearChildren[/list]ClearChildren() [list][]Destroy[/list]Control:Destroy() – destroy a control. [list][]DisableHitTest[/list]Control:DisableHitTest([recursive]) – hit testing will be skipped for this control [list][]Dump[/list]Dump [list][]EnableHitTest[/list]Control:EnableHitTest([recursive]) – hit testing will be checked for this control [list][]GetAlpha[/list]float GetAlpha() [list][]GetName[/list]string GetName() [list][]GetParent[/list]Control:GetParent() – return the parent of this control, or nil if it doesn’t have one. [list][]GetRenderPass[/list]int GetRenderPass() [list][]GetRootFrame[/list]Frame GetRootFrame() [list][]Hide[/list]Control:Hide() – stop rendering and hit testing the control [list][]IsHidden[/list]Control:IsHidden() – determine if the control is hidden [list][]IsHitTestDisabled[/list]Control:IsHitTestDisabled() – determine if hit testing is disabled [list][]NeedsFrameUpdate[/list]bool NeedsFrameUpdate() [list][]SetAlpha[/list]SetAlpha(float, children) - Set the alpha of a given control, if children is true, also sets childrens alpha [list][]SetHidden[/list]Control:SetHidden() – set the hidden state of the control [list][]SetName[/list]SetName(string) [list][]SetNeedsFrameUpdate[/list]SetNeedsFrameUpdate(bool needsIt) [list][]SetParent[/list]Control:SetParent(newParentControl) – change the control’s parent [list][]SetRenderPass[/list]int SetRenderPass() [list][]Show[/list]Control:Show() – start rendering and hit testing the control [list][*]moho.control_methods[/list]
[edit]

CMauiCursor [list][]ResetToDefault[/list]Cursor:ResetToDefault() [list][]SetDefaultTexture[/list]Cursor:SetDefaultTexture(filename, hotspotX, hotspotY) [list][]SetNewTexture[/list]Cursor:SetTexture(filename, hotspotX, hotspotY) [list][]Show[/list]Cursor:Show() [list][*]moho.cursor_methods[/list]
[edit]

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

CMauiFrame [list][]GetTopmostDepth[/list]float GetTopmostDepth() [list][]SetTargetHead[/list]SetTargetHead(int) [list][]base[/list]derived from CMauiControl [list][]moho.frame_methods[/list]
[edit]

CMauiGroup [list][*]moho.group_methods[/list]
[edit]

CMauiHistogram [list][]SetXIncrement[/list]SetXIncrement(int) [list][]SetYIncrement[/list]SetYIncrement(int) [list][]base[/list]derived from CMauiControl [list][]moho.histogram_methods[/list]
[edit]

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

CMauiLuaDragger [list][*]moho.dragger_methods[/list]
[edit]

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

CMauiScrollbar [list][]DoScrollPages[/list]DoScrollPages(float) [list][]SetNewTextures[/list]Scrollbar:SetTextures(background, thumbMiddle, thumbTop, thumbBottom) [list][]SetScrollable[/list]Scrollbar:SetScrollable(scrollable) – set the scrollable object connected to this scrollbar [list][]base[/list]derived from CMauiControl [list][*]moho.scrollbar_methods[/list]
[edit]

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

CPathDebugger [list][*]moho.PathDebugger_methods[/list]
[edit]

CUIMapPreview [list][]SetTextureFromMap[/list]CUIMapPreview:SetTextureFromMap(map_name) [list][]base[/list]derived from CMauiControl [list][*]moho.ui_map_preview_methods[/list]
[edit]

CUIWorldView [list][]GetRightMouseButtonOrder[/list]string moho.UIWorldView:GetRightMouseButtonOrder() [list][]GetsGlobalCameraCommands[/list]moho.UIWorldView:GetsGlobalCameraCommands(bool getsCommands) [list][]HasHighlightCommand[/list]bool moho.UIWorldView:HasHighlightCommand() [list][]IsInputLocked[/list]IsInputLocked(camera) [list][]LockInput[/list]LockInput(camera) [list][]ShowConvertToPatrolCursor[/list]bool moho.UIWorldView:ShowConvertToPatrolCursor() [list][]UnlockInput[/list]UnlockInput(camera) [list][]__init[/list]moho.UIWorldView:__init(parent_control, cameraName, depth, isMiniMap, trackCamera) [list][]base[/list]derived from CMauiControl [list][]moho.UIWorldView[/list]
[edit]

CameraImpl [list][]EnableEaseInOut[/list]Camera:EnableEaseInOut() [list][]GetFocusPosition[/list]Camera:GetFocusPosition() – returns a table with X Y Z values for current camera position [list][]GetMaxZoom[/list]Camera:GetMaxZoom() – returns the current widest zoom level. about 1000 on a 10x10 map, 2000 on a 20x20, etc. [list][]GetMinZoom[/list]Camera:GetMinZoom() – returns the current tightest zoom level [list][]GetTargetZoom[/list]Camera:GetTargetZoom() – returns zoom level the camera is heading to [list][]GetZoom[/list]Camera:GetZoom() – returns current actual camera zoom level [list][]HoldRotation[/list]Camera:HoldRotation() [list][]MoveTo[/list]Camera:MoveTo(position, orientationHPR, zoom, seconds) [list][]MoveToRegion[/list]Camera:MoveTo(region[,seconds]) [list][]NoseCam[/list]Camera:NoseCam(ent,pitchAdjust,zoom,seconds) [list][]Reset[/list]Camera:Reset() – snaps camera to maxzoom [list][]RestoreSettings[/list]Camera:RestoreSettings(settings) [list][]RevertRotation[/list]Camera:RevertRotation() [list][]SaveSettings[/list]Camera:SaveSettings() – returns a table with: Focus(table: X, Y, Z), Heading, Pitch, and Zoom [list][]SetTargetZoom[/list]Camera:SetTargetZoom(zoom) – zooms to target zoom, toward cursor position, with current zoom speed [list][]SetZoom[/list]Camera:SetZoom(zoom,seconds) – zooms to target zoom, interpolating for number of seconds, at current camera position [list][]SnapTo[/list]Camera:SnapTo(position, orientationHPR, zoom) – snaps camera to a focus position instantly. roll is ignored. [list][]Spin[/list]Camera:Spin(headingRate[,zoomRate]) [list][]TargetEntities[/list]Camera:TargetEntities(ents,zoom,seconds) [list][]TrackEntities[/list]Camera:TrackEntities(ents,zoom,seconds) [list][]UseGameClock[/list]Camera:UseGameClock() [list][]UseSystemClock[/list]Camera:UseSystemClock()
[edit]

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

Core
[edit]

[list][]Basename[/list]base = Basename(fullPath,stripExtension?) – return the last component of a path [list][]BeginLoggingStats[/list]Begin logging stats [list][]CreatePrefetchSet[/list]create an empty prefetch set [list][]CurrentThread[/list]thread=CurrentThread() – get a handle to the running thread for later use with ResumeThread() or KillThread() [list][]Dirname[/list]base = Dirname(fullPath) – return a path with trailing filename removed [list][]DiskFindFiles[/list]files = DiskFindFiles(directory) returns a list of files in a directory [list][]DiskFindFolders[/list]files = DiskFindFolders(directory,noLocalTransform=false) returns a list of folders in a directory If ‘noLocalTransform’ is true, returns system paths instead of local paths [list][]DiskGetFileInfo[/list]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 [list][]DiskToLocal[/list]localPath = DiskToLocal(SysOrLocalPath) Converts a system path to a local path. Leaves path alone if already local. [list][]EndLoggingStats[/list]EndLoggingStats(bool exit) - End logging stats and optionally exit app [list][]EntityCategoryEmpty[/list]Test for an empty category [list][]EntityCategoryGetUnitList[/list]Get a list of units blueprint names from a category [list][]EnumColorNames[/list]table EnumColorNames() - returns a table containing strings of all the color names [list][]Faction[/list]Faction { spec } – define a new faction [list][]FileCollapsePath[/list]path = FileCollapsePath(fullPath) – collapse out any intermediate /./ or /…/ directory names from a path [list][]ForkThread[/list]thread = ForkThread(function, …) Spawns a new thread running the given function with the given args. [list][]GetCueBank[/list]cue,bank = GetCueBank(params) [list][]GetMovieDuration[/list]GetMovieDuration(localFileName) [list][]GetVersion[/list]GetVersion() → string [list][]IsDestroyed[/list]Has the c++ object been destroyed? [list][]KillThread[/list]KillThread(thread) – destroy a thread started with ForkThread() [list][]LOG[/list]Print a log message [list][]MATH_IRound[/list]Round a number to the nearest integer [list][]MATH_Lerp[/list]float MATH_Lerp(s, a, b) or float MATH_Lerp(s, sMin, sMax, a, b) [list][]OrientFromDir[/list]quaternion OrientFromDir(vector) [list][]PointVector[/list]Create a point vector(px,py,pz, vx,vy,vz) [list][]RPCSound[/list]RPCSound( {cue,bank,cutoff} ) - Make a sound parameters object [list][]Rect[/list]Create a 2d Rectangle (x0,y0,x1,y1) [list][]RegisterBeamBlueprint[/list]BeamBlueprint { spec } - define a beam effect [list][]RegisterEmitterBlueprint[/list]EmitterBlueprint { spec } - define a particle emitter [list][]RegisterMeshBlueprint[/list]MeshBlueprint { spec } - define mesh properties [list][]RegisterProjectileBlueprint[/list]ProjectileBlueprint { spec } - define a type of projectile [list][]RegisterPropBlueprint[/list]PropBlueprint { spec } - define a type of prop [list][]RegisterTrailEmitterBlueprint[/list]TrailEmitterBlueprint { spec } - define a polytrail emitter [list][]RegisterUnitBlueprint[/list]UnitBlueprint { spec } - define a type of unit [list][]ResumeThread[/list]ResumeThread(thread) – resume a thread that had been suspended with SuspendCurrentThread(). Does nothing if the thread wasn’t suspended. [list][]STR_GetTokens[/list]table STR_GetTokens(string,delimiter) [list][]STR_itox[/list]string STR_itox(int) - converts an integer into a hexidecimal string [list][]STR_xtoi[/list]int STR_xtoi(string) - converts a hexidecimal string to an integer [list][]Sound[/list]Sound( {cue,bank,cutoff} ) - Make a sound parameters object [list][]SpecFootprints[/list]SpecFootprints { spec } – define the footprint types for pathfinding [list][]SuspendCurrentThread[/list]SuspendCurrentThread() – suspend this thread indefinitely. Some external event must eventually call ResumeThread() to resume it. [list][]Trace[/list]Trace(true) – turns on debug tracing Trace(false) – turns it off again [list][]VDist2[/list]Distance between two 2d points (x1,y1,x2,y2) [list][]VDist3[/list]Distance between two 3d points (v1,v2) [list][]Vector[/list]Create a vector (x,y,z) [list][]WARN[/list]Pop up a warning dialog [list][]WaitFor[/list]WaitFor(event) – suspend this thread until the event is set [list][]doscript[/list]doscript(script, [env]) – run another script. The environment table, if given, will be used for the script’s global variables. [list][]exists[/list]exists(name) → bool – returns true if the given resource file exists
[edit]

CPrefetchSet [list][]Update[/list]CPrefetchSet:Update({d3d_textures=…, batch_textures=…, models=…, anims=…}) [list][]moho.CPrefetchSet[/list]
[edit]

EntityCategory [list][]__mul[/list]Generate a category list that is an intersection of cat1 and cat2 [list][]__sub[/list]Generate a category list of units that is of cat1 but not of cat2 [list][*]moho.EntityCategory[/list]Retrieved from “http://www.wiki.supcomuniverse.com/wiki/SupCom_LUA_Documentation

[ 本帖最后由 零星 于 2007-4-15 10:33 编辑 ]

有点看不懂呢

好东西啊,修改SupCom所需要的所有脚本都在这里了。

有了这些,没学过电脑语言的我都可以开始中等程度的mod啊!