Options
All
  • Public
  • Public/Protected
  • All
Menu

@aoemods/aoetypes

noselfinfile

Index

Enumerations

Interfaces

Variables

Functions

Variables

AIArmyType_ANY: 2
AIArmyType_LAND: 0
AIArmyType_NAVAL: 1
AID_EASY: 0
AID_EXPERT: 3
AID_HARD: 2
AID_INVALID: 127
AID_NORMAL: 1
AIEncounterNotification_Cancelled: 3
AIEncounterNotification_Failure: 1
AIEncounterNotification_SquadAdded_Count: 8
AIEncounterNotification_SquadAdded_ID: 7
AIEncounterNotification_SquadReleased_Count: 6
AIEncounterNotification_SquadReleased_ID: 5
AIEncounterNotification_StateTreeExit: 4
AIEncounterNotification_Success: 0
AIEncounterNotification_Transition: 2
AIEncounterStage_Engaged: 3
AIEncounterStage_Fallback: 4
AIEncounterStage_Idle: 1
AIEncounterStage_Moving: 2
AIEncounterType_Ability: 3
AIEncounterType_AttackArea: 1
AIEncounterType_DefendArea: 0
AIEncounterType_FormationAttackMove: 5
AIEncounterType_FormationDefendArea: 6
AIEncounterType_FormationMove: 4
AIEncounterType_FormationPhase: 8
AIEncounterType_Move: 2
AIEncounterType_TownLife: 7
AIFormationPhaseEncounter_EndReason_AtDestination: 1
AIFormationPhaseEncounter_EndReason_CannotReachDestination: 7
AIFormationPhaseEncounter_EndReason_CombatThreshold: 3
AIFormationPhaseEncounter_EndReason_EnemiesAtTargetCleared: 5
AIFormationPhaseEncounter_EndReason_Invalid: 0
AIFormationPhaseEncounter_EndReason_SelfSquadsEmpty: 9
AIFormationPhaseEncounter_EndReason_ShouldFallback: 4
AIFormationPhaseEncounter_EndReason_Timeout: 2
AIFormationPhaseEncounter_EndReason_Torndown: 8
AIFormationPhaseEncounter_EndReason_WasAttacked: 6
AIMTT_INVALID: 2147483647
AIMTT_hq: 0
AIMTT_relic: 1
AIMTT_relic_dropoff: 2
AIMTT_resource_deposit: 3
AIMTT_squad: 4
AIMTT_structure: 5
AIMTT_wall: 6
AIMTT_wonder: 7
AISniperReactionMode_FallbackAnyDamaged: 3
AISniperReactionMode_FallbackSelfDamaged: 2
AISniperReactionMode_None: 0
AISniperReactionMode_Respond: 1
AIWanderRadiusMode_Leash: 0
AIWanderRadiusMode_Override: 2
AIWanderRadiusMode_TargetArea: 1
Ai: TAi
CE_ABBCAMELSUPPORTTRACKING: 0
CE_ABBCONVERSIONIMMUNITY: 1
CE_ABBIMPROVEDDEPOSITSTRACKING: 2
CE_ABBMEDICALCENTERHEALTRACKING: 3
CE_ABBSINGLEUNITCONVERSION: 4
CE_ACHIEVALLCANNONSSURVIVEFORMIGNY: 5
CE_ACHIEVALLGOLDCHESTSPATAY: 6
CE_ACHIEVBEGINSACREDSITECAPTURE: 7
CE_ACHIEVCINEISENDING: 8
CE_ACHIEVCINEISSTARTING: 9
CE_ACHIEVDANECAMPLOOTED: 10
CE_ACHIEVDEFEATSIEGEOFLINCOLNEARLY: 11
CE_ACHIEVDESTROYALLSIEGEOFKAZAN: 12
CE_ACHIEVDIEDTOZHANGJIAKOUGATE: 13
CE_ACHIEVFREGUILDHALLRESOURCES: 14
CE_ACHIEVFULLTRANSPORTDEATH: 15
CE_ACHIEVHORSEARCHERSSURVIVE: 16
CE_ACHIEVHUIHUIPAOSURVIVES: 17
CE_ACHIEVNETWORKOFCASTLESDOWN: 18
CE_ACHIEVNETWORKOFCASTLESUP: 19
CE_ACHIEVNODEATHSINCOMBAT30ARENA: 20
CE_ACHIEVOUTPOSTKILLSUGRA: 21
CE_ACHIEVPAYMONGOLTRIBUTEEARLY: 22
CE_ACHIEVPROTECTWALLSWALLINGFORD: 23
CE_ACHIEVPURCHASEKNIGHTSTINCHEBRAY: 24
CE_ACHIEVRUSHUNTINGCABINGOLD: 25
CE_ACHIEVSHUTDOWNCHARGE: 26
CE_ACHIEVSTOPMONGOLENTERCITY: 27
CE_ACHIEVSUBUTAIBEATSBATU: 28
CE_ACHIEVUPGRADECANNONSNORMANDY: 29
CE_Begin: 0
CE_CASTLEAGEUPDELAY: 30
CE_CHIDYNASTYUNITSPAWNSPIRITWAYINFLUENCED: 31
CE_CHIIMPADDGOLDBASETAX: 32
CE_CHIIMPADDGOLDSQUADSPAWNED: 33
CE_CHIIMPADDGOLDUPGRADECOMPLETE: 34
CE_CHISPYREVEALVILLAGERS: 35
CE_Count: 56
CE_DEERSTONESSTONEBONUS: 36
CE_ENGCAMPFIREHEAL: 37
CE_ENGINFLUENCEDFARM: 38
CE_FRELANCERCHARGEBEGINS: 39
CE_FRELANCERCHARGEENDS: 40
CE_HREHEALINGAURA: 41
CE_HREINSPIREACTIVATE: 42
CE_HREINSPIREDEACTIVATE: 43
CE_MONKCONVERSIONTRACKING: 44
CE_MONRAIDRESOURCEADDED: 45
CE_MONSIGNALARROWACTIVATE: 46
CE_ORTOOSPEEDAURA: 47
CE_PALINGDAMAGE: 48
CE_RELICGATHER: 49
CE_RUSBLESSINGAURA: 50
CE_RUSBOUNTY: 51
CE_RUSINFLUENCEDLUMBERCAMP: 52
CE_SULBERRYENHANCE: 53
CE_SULSCHOLARLOADMADRASA: 54
CE_SULTRACKMOSQUEHEALING: 55
COUNTER_Count: 2
COUNTER_CountUpTo: 3
COUNTER_None: -1
COUNTER_TimerDecreasing: 0
COUNTER_TimerIncreasing: 1
COUNTER_TurnsDecreasing: 4
COUNTER_TurnsIncreasing: 5
CampaignAutotestStatus_Fail: 3
CampaignAutotestStatus_InProgress: 1
CampaignAutotestStatus_NotRun: 0
CampaignAutotestStatus_Pass: 2
EXTID_Ability: "ability_ext"
EXTID_ActionApply: "action_apply_ext"
EXTID_AideStation: "aide_station_ext"
EXTID_AttachmentChild: "attachment_child_ext"
EXTID_Attention: "attention_ext"
EXTID_AttentionGen: "attention_gen_ext"
EXTID_Burn: "burn_ext"
EXTID_Camouflage: "camouflage_ext"
EXTID_Casualty: "casualty_ext"
EXTID_Combat: "combat_ext"
EXTID_Construction: "construction_ext"
EXTID_Cost: "cost_ext"
EXTID_Cover: "cover_ext"
EXTID_Crew: "crew_ext"
EXTID_Crush: "crush_ext"
EXTID_Crushee: "crushee_ext"
EXTID_Demolishable: "demolishable_ext"
EXTID_DemolitionCharge: "demolition_charge_ext"
EXTID_Element: "element_ext"
EXTID_Explosion: "explosion_ext"
EXTID_FieldSupport: "field_support_ext"
EXTID_Flight: "flight_ext"
EXTID_Health: "health_ext"
EXTID_Hold: "hold_ext"
EXTID_Holdable: "holdable_ext"
EXTID_InteractiveObject: "interactive_object_ext"
EXTID_Market: "market_ext"
EXTID_Medic: "medic_ext"
EXTID_Mine: "mine_ext"
EXTID_MineClearer: "mine_clearer_ext"
EXTID_Modifier: "modifier_ext"
EXTID_ModifierApply: "modifier_apply_ext"
EXTID_MoveType: "movetype_ext"
EXTID_MovementBlocker: "movement_blocker_ext"
EXTID_Moving: "moving_ext"
EXTID_MultiControlTerritoryController: "multi_control_territory_controller_ext"
EXTID_OOCTarget: "ooc_target_ext"
EXTID_ObjCover: "obj_cover_ext"
EXTID_Paradrop: "paradrop_ext"
EXTID_Posture: "posture_ext"
EXTID_ProductionQueue: "production_queue_ext"
EXTID_Projectile: "projectile_ext"
EXTID_Recrewable: "recrewable_ext"
EXTID_RepairEngineer: "repair_engineer_ext"
EXTID_RepairStation: "repair_station_ext"
EXTID_Resource: "resource_ext"
EXTID_Road: "road_ext"
EXTID_Sight: "sight_ext"
EXTID_StimulusEmission: "stimulus_emission_ext"
EXTID_StimulusPerception: "stimulus_perception_ext"
EXTID_StrategicPoint: "strategic_point_ext"
EXTID_Supply: "supply_ext"
EXTID_SupplyRoad: "supply_road_ext"
EXTID_TeamWeaponUser: "team_weapon_user_ext"
EXTID_Territory: "territory_ext"
EXTID_UI: "ui_ext"
EXTID_Upgrade: "upgrade_ext"
EXTID_WalkableSurface: "walkable_surface_ext"
EXTID_Wall: "wall_ext"
EXTID_Weapon: "weapon_ext"
Element: { prototype: Element }

Type declaration

Encounter: TEncounter
Event: { AT_TARGET: number; BUBBLING_PHASE: number; CAPTURING_PHASE: number; NONE: number; prototype: Event }

Type declaration

  • Readonly AT_TARGET: number
  • Readonly BUBBLING_PHASE: number
  • Readonly CAPTURING_PHASE: number
  • Readonly NONE: number
  • prototype: Event
GD_EASY: 0
GD_EXPERT: 3
GD_HARD: 2
GD_INVALID: 127
GD_NORMAL: 1
GE_AIPlayer_EncounterNotification: 6619136
GE_AIPlayer_EncounterSniped: 6684672
GE_AIPlayer_Migrated: 7143424
GE_AITakeOver: 6553600
GE_AbilityCanCast: 7929856
GE_AbilityComplete: 2490368
GE_AbilityExecuted: 2424832
GE_AbilityRecharged: 2555904
GE_AccessoryWeaponFired: 2752512
GE_AnimatorSwap: 8781824
GE_ArtilleryFired: 2228224
GE_BoobyTrapTriggered: 3145728
GE_BroadcastMessage: 7733248
GE_BuildItemCancelled: 7995392
GE_BuildItemComplete: 1638400
GE_BuildItemStart: 1572864
GE_CasualtySquadSpawned: 4259840
GE_ChallengeCustomEvent: 9371648
GE_CommandReceiverStatusUpdate: 1704192
GE_CommandStatusUpdate: 1638656
GE_ConstructionCancelled: 917504
GE_ConstructionComplete: 983040
GE_ConstructionFieldComplete: 1114112
GE_ConstructionPlanComplete: 1048576
GE_ConstructionStart: 851968
GE_CustomUIEvent: 7077888
GE_DamageArea: 6881280
GE_DamageReceived: 5111808
GE_DefaultCommandIssued: 852224
GE_DistrictChanged: 9109504
GE_DistrictCreated: 8978432
GE_DistrictRatingChanged: 9175040
GE_DistrictRemoved: 9043968
GE_DriverDecrewed: 7274496
GE_DriverRecrewed: 7340032
GE_EnemyActivitySpotted: 7864320
GE_EnemyTerritoryEntered: 6029312
GE_EntityAbandoned: 3276800
GE_EntityBlueprintChanged: 393216
GE_EntityCommandIssued: 721152
GE_EntityCrushed: 589824
GE_EntityDespawn: 262144
GE_EntityKilled: 458752
GE_EntityLandmarkDestroyed: 655360
GE_EntityOwnerChange: 327680
GE_EntityParadropComplete: 2293760
GE_EntityPrecached: 1179904
GE_EntityRecrewed: 3342336
GE_EntityRestored: 786432
GE_EntitySelectionVisualChanged: 8650752
GE_EntitySpawn: 196608
GE_EntityTeleported: 524288
GE_EntityWrecked: 720896
GE_ExperienceGranted: 5177344
GE_FieldSupportChange: 3407872
GE_FormationSquadGroupCommandIssued: 590080
GE_GameOver: 983296
GE_GameStart: 917760
GE_Garrison: 1441792
GE_GarrisonSquad: 1507328
GE_ImportantUnitSighted: 3211264
GE_InfluenceUpdate: 9240576
GE_ItemAvailabilityChanged: 7536640
GE_LocalPlayerChanged: 6094848
GE_MineDefused: 2359296
GE_MoveFailed: 2883584
GE_MovementNodeUpdated: 5898240
GE_MusicIntensityChange: 1769728
GE_NonGlobalCamoDetected: 2162688
GE_OccupiedBuildingChangedOwner: 1310720
GE_OnHealthExtBPConvert: 1376256
GE_PathFound: 2818048
GE_PathfindingBlockersUpdated: 3080192
GE_PathfindingCanBuildBlockersAdded: 2949120
GE_PathfindingCanBuildBlockersRemoved: 3014656
GE_Ping: 459008
GE_PlannedStructureCancelled: 1900544
GE_PlannedStructurePlaced: 1835008
GE_PlayerAddEntity: 8257536
GE_PlayerAddResource: 8126464
GE_PlayerBeingAttacked: 5046272
GE_PlayerCheat: 5242880
GE_PlayerCommandIssued: 786688
GE_PlayerDebugBuildOrder: 5570560
GE_PlayerDebugBuildTime: 5505024
GE_PlayerDebugDestroy: 5636096
GE_PlayerDebugEndMatch: 5373952
GE_PlayerDebugFogOfWar: 5439488
GE_PlayerDebug_DELETED: 5308416
GE_PlayerDonation: 6160384
GE_PlayerDropped: 196864
GE_PlayerEndStateChanged: 1966336
GE_PlayerFormationFinalized: 8716288
GE_PlayerHostMigrated: 393472
GE_PlayerKicked: 262400
GE_PlayerKilled: 327936
GE_PlayerLagComplaint: 131328
GE_PlayerLose: 1114368
GE_PlayerNameChanged: 6225920
GE_PlayerObjectiveChanged: 6356992
GE_PlayerObjectiveDeleted: 6291456
GE_PlayerPhaseUp: 6422528
GE_PlayerPingOfShame: 256
GE_PlayerPingOfShameLocal: 65792
GE_PlayerRemoveEntity: 8323072
GE_PlayerRemoveSquad: 8454144
GE_PlayerResourcesAwarded: 6488064
GE_PlayerSetResource: 9306112
GE_PlayerSquadInitialized: 8388608
GE_PlayerSubResource: 8192000
GE_PlayerSurrendered: 7012352
GE_PlayerTeamIdUpdated: 8585216
GE_PlayerWin: 1048832
GE_PresentatonSoundEvent: 1835264
GE_ProjectileFired: 2621440
GE_ProjectileLanded: 2686976
GE_ReinforcementCreated: 1703936
GE_ResourceDepleted: 2031616
GE_ResourceGathererAtCapacity: 2097152
GE_SectorLinkProviderChanged: 7208960
GE_SectorOutOfSupply: 9568256
GE_SelectionChanged: 1442048
GE_SpawnActionComplete: 6815744
GE_SpeechAction: 7405568
GE_SpeechTelemetryEvent: 1900800
GE_SpeechWarningAction: 7798784
GE_SquadAudioGameObjectRemoved: 1310976
GE_SquadBuildCommandIssued: 524544
GE_SquadCalledIn: 4718592
GE_SquadCold: 4587520
GE_SquadCommandIssued: 655616
GE_SquadFormation: 4194304
GE_SquadFreezing: 4653056
GE_SquadIdleEnter: 3932160
GE_SquadIdleExit: 3997696
GE_SquadItemDeposit: 3866624
GE_SquadItemPickup: 3801088
GE_SquadKilled: 3538944
GE_SquadMembersChanged: 4521984
GE_SquadMerge: 4456448
GE_SquadOwnerChange: 4915200
GE_SquadParadropComplete: 4325376
GE_SquadPinned: 3604480
GE_SquadPrecached: 1245440
GE_SquadProductionQueue: 3670016
GE_SquadReplaced: 4784128
GE_SquadRetreat: 4063232
GE_SquadRetreatMsgReceived: 4128768
GE_SquadSizeChanged: 7667712
GE_SquadSpawn: 3473408
GE_SquadSplit: 4390912
GE_SquadTeleported: 4980736
GE_SquadUnloaded: 4849664
GE_SquadVeterancyRank: 3735552
GE_StatsCustomEvent: 9437184
GE_StrategicPointChanged: 1769472
GE_StructureReplaced: 1966080
GE_SubselectionChanged: 1507584
GE_SuperAbility: 6750208
GE_TerrainAreaDeformed: 6946816
GE_TerritoryCornerDeoccupied: 1245184
GE_TerritoryEdgeDeoccupied: 1179648
GE_TerritoryEntered: 5963776
GE_TickerValuesUpdated: 8519680
GE_TradeRouteCompleted: 25601
GE_UpgradeCancelled: 7602176
GE_UpgradeComplete: 65536
GE_UpgradeRemoved: 7471104
GE_UpgradeStart: 0
GE_UpgradeTentative: 131072
GE_WaitObjectDone: 8060928
GE_WalkableSurfacePurgeOrphans: 9502720
GE_WallCombatEnded: 5832704
GE_WallCombatStarted: 5767168
GE_WallWalked: 5701632
INVALID_AISQUADID: 0
Multiplayer: 1
PBGTYPE_Entity: 1245184
PBGTYPE_Squad: 3014656
PBGTYPE_Upgrade: 3407872
PBG_Ability: 0
PBG_Camera: 4653312
PBG_EntityProperties: 1245184
PBG_Formation: 1310720
PBG_HitMaterial: 1572864
PBG_Material: 1900544
PBG_MoveType: 2097152
PBG_PassType: 2555904
PBG_Posture: 2818048
PBG_Race: 2228224
PBG_SlotItem: 2883584
PBG_SquadFormation: 2949120
PBG_SquadProperties: 3014656
PBG_Tuning: 3276800
PBG_TurnPlan: 3342336
PBG_UIMissionArea: 4260096
PBG_UISelection: 3604480
PBG_UITacticalMap: 4456704
PBG_UITerritory: 3735552
PBG_Upgrade: 3407872
PBG_Weapon: 3866624
RT_Action: 0
RT_Begin: 0
RT_Command: 1
RT_Count: 8
RT_Food: 2
RT_Gold: 3
RT_Militia_HRE: 4
RT_Popcap: 5
RT_Stone: 6
RT_Wood: 7
Request: { prototype: Request }

Type declaration

SCARTYPE_AIENCOUNTER: 1634297198
SCARTYPE_AIENTITY: 1634297204
SCARTYPE_AIPLAYER: 1634300012
SCARTYPE_AISQUAD: 1634300785
SCARTYPE_CONSTENTITY: 1667591796
SCARTYPE_CONSTPLAYER: 1668312178
SCARTYPE_CONSTSQUAD: 1668510052
SCARTYPE_EGROUP: 1701257248
SCARTYPE_ENTITY: 1701737504
SCARTYPE_LOCSTRING: 1970562616
SCARTYPE_MARKER: 1835758112
SCARTYPE_MODIFIER: 1836016754
SCARTYPE_PBG: 1885497120
SCARTYPE_PLAYER: 1886157170
SCARTYPE_PREFAB: 1885757794
SCARTYPE_RESOURCEAMOUNT: 1919251297
SCARTYPE_SCARPOS: 1936748403
SCARTYPE_SGROUP: 1936138272
SCARTYPE_SQUAD: 1936811040
SQUADEXTID_Ability: "squad_ability_ext"
SQUADEXTID_ActionApply: "squad_action_apply_ext"
SQUADEXTID_Attention: "squad_attention_ext"
SQUADEXTID_Audio: "squad_audio_ext"
SQUADEXTID_CombatBehaviour: "squad_combat_behaviour_ext"
SQUADEXTID_CombatStance: "squad_combat_stance_ext"
SQUADEXTID_Experience: "squad_experience_ext"
SQUADEXTID_Formation: "squad_formation_ext"
SQUADEXTID_Health: "squad_health_ext"
SQUADEXTID_Holdable: "squad_holdable_ext"
SQUADEXTID_Item: "squad_item_ext"
SQUADEXTID_ItemSlot: "squad_item_slot_ext"
SQUADEXTID_Loadout: "squad_loadout_ext"
SQUADEXTID_Modifier: "squad_modifier_ext"
SQUADEXTID_MoveType: "squad_move_type_ext"
SQUADEXTID_PlantDemolition: "squad_plant_demolition_ext"
SQUADEXTID_Production: "squad_production_queue_ext"
SQUADEXTID_Resource: "squad_resource_ext"
SQUADEXTID_TeamWeapon: "squad_team_weapon_ext"
SQUADEXTID_UI: "squad_ui_ext"
SQUADEXTID_Upgrade: "squad_upgrade_ext"
SQUADEXTID_Veterancy: "squad_veterancy_ext"
Singleplayer: 0
Skirmish: 2
TASK_COUNT: 47
TEAM_NEUTRAL: 10001
TFF_All: 0
TFF_CausingSuppression: 8
TFF_FriendlyTargets: 512
TFF_InEnemySectors: 64
TFF_InFriendlySectors: 32
TFF_InMostClumpedSector: 128
TFF_InSectorProducingResources: 2048
TFF_Infantry: 2
TFF_InjuredInfantry: 1024
TFF_MeleeCombat: 4096
TFF_NotNearPlayerStartingPositions: 256
TFF_NotVisible: 16
TFF_RangedCombat: 8192
TFF_Vehicle: 4
TFF_Visible: 1
WR_ANNIHILATION: 0
WR_Begin: 0
WR_CONQUEST: 1
WR_Count: 14
WR_ELIMINATION: 2
WR_KEEPRUSH: 3
WR_NONE: 4
WR_OBJECTIVECOMPLETE: 5
WR_OBJECTIVEFAILED: 6
WR_REGICIDE: 7
WR_RELICHUNT: 8
WR_RELIGIOUS: 9
WR_SETTLEMENTS: 10
WR_SIEGE: 11
WR_SURRENDER: 12
WR_WONDER: 13
huge: typeof NaN
maxinteger: 9223372036854776000
mininteger: -9223372036854776000
pi: 3.1415926535898

Functions

  • AIAbilityGoal_AdjustDefaultGoalData(additionalDefaultGoalData: any): any
  • Adjust default goal data for ability goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter ability goal values.

    Parameters

    • additionalDefaultGoalData: any

    Returns any

  • AIAbilityGoal_SetDefaultGoalData(defaultGoalData: any): void
  • Set default goal data for ability goals. defaultGoalData is cloned; any values specified are used for unspecified encounter ability goal values.

    Parameters

    • defaultGoalData: any

    Returns void

  • AIAbilityGoal_SetModifyGoalData(modifyGoalData: any): void
  • Set modify goal data for ability goals. modifyGoalData is cloned; values specified via keyname_Multiplier are used for the numeric keyname encounter ability goal value.

    Parameters

    • modifyGoalData: any

    Returns void

  • AIAbilityGoal_SetOverrideGoalData(overrideGoalData: any): void
  • Set override goal data for ability goals. overrideGoalData is cloned; any values specified are used for encounter ability goal values.

    Parameters

    • overrideGoalData: any

    Returns void

  • AIAttackGoal_AdjustDefaultGoalData(additionalDefaultGoalData: any): any
  • Adjust default goal data for attack goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter attack goal values.

    Parameters

    • additionalDefaultGoalData: any

    Returns any

  • AIAttackGoal_SetDefaultGoalData(defaultGoalData: any): void
  • Set default goal data for attack goals. defaultGoalData is cloned; any values specified are used for unspecified encounter attack goal values.

    Parameters

    • defaultGoalData: any

    Returns void

  • AIAttackGoal_SetModifyGoalData(modifyGoalData: any): void
  • Set modify goal data for attack goals. modifyGoalData is cloned; values specified via keyname_Multiplier are used for the numeric keyname encounter attack goal value.

    Parameters

    • modifyGoalData: any

    Returns void

  • AIAttackGoal_SetOverrideGoalData(overrideGoalData: any): void
  • Set override goal data for attack goals. overrideGoalData is cloned; any values specified are used for encounter attack goal values.

    Parameters

    • overrideGoalData: any

    Returns void

  • AIBaseGoal_AdjustDefaultGoalData(additionalDefaultGoalData: any): any
  • Adjust default goal data. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter goal values.

    Parameters

    • additionalDefaultGoalData: any

    Returns any

  • AIBaseGoal_SetDefaultGoalData(defaultGoalData: any): void
  • Set default goal data. defaultGoalData is cloned; any values specified are used for unspecified encounter goal values.

    Parameters

    • defaultGoalData: any

    Returns void

  • AIBaseGoal_SetModifyGoalData(modifyGoalData: any): void
  • Set modify goal data. modifyGoalData is cloned; values specified via keyname_Multiplier are used for the numeric keyname encounter goal value.

    Parameters

    • modifyGoalData: any

    Returns void

  • AIBaseGoal_SetOverrideGoalData(overrideGoalData: any): void
  • Set override goal data. overrideGoalData is cloned; any values specified are used for encounter goal values.

    Parameters

    • overrideGoalData: any

    Returns void

  • AIDefendGoal_AdjustDefaultGoalData(additionalDefaultGoalData: any): any
  • Adjust default goal data for defend goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter defend goal values.

    Parameters

    • additionalDefaultGoalData: any

    Returns any

  • AIDefendGoal_SetDefaultGoalData(defaultGoalData: any): void
  • Set default goal data for defend goals. defaultGoalData is cloned; any values specified are used for unspecified encounter defend goal values.

    Parameters

    • defaultGoalData: any

    Returns void

  • AIDefendGoal_SetModifyGoalData(modifyGoalData: any): void
  • Set modify goal data for defend goals. modifyGoalData is cloned; values specified via keyname_Multiply are used for the numeric keyname encounter defend goal value.

    Parameters

    • modifyGoalData: any

    Returns void

  • AIDefendGoal_SetOverrideGoalData(overrideGoalData: any): void
  • Set override goal data for defend goals. overrideGoalData is cloned; any values specified are used for encounter defend goal values.

    Parameters

    • overrideGoalData: any

    Returns void

  • AIEncounter_CombatGuidance_AddForcedCombatTargetEntity(pEncounter: AIEncounterID, pEntity: EntityID): any
  • AIEncounter_CombatGuidance_AddForcedCombatTargetSquad(pEncounter: AIEncounterID, pSquad: SquadID): any
  • AIEncounter_CombatGuidance_ClearForcedCombatTargets(pEncounter: AIEncounterID): any
  • AIEncounter_CombatGuidance_EnableCombatGarrison(pEncounter: AIEncounterID, enable: boolean): any
  • AIEncounter_CombatGuidance_RemoveForcedCombatTargetEGroup(pEncounter: AIEncounterID, egroup: EGroupID): any
  • AIEncounter_CombatGuidance_RemoveForcedCombatTargetEntity(pEncounter: AIEncounterID, pEntity: EntityID): any
  • AIEncounter_CombatGuidance_RemoveForcedCombatTargetSGroup(pEncounter: AIEncounterID, sgroup: SGroupID): any
  • AIEncounter_CombatGuidance_RemoveForcedCombatTargetSquad(pEncounter: AIEncounterID, pSquad: SquadID): any
  • Set Combat Range Policy for the encounter policy is one of: AICombatRangePolicy_Default, AICombatRangePolicy_Ranged_MinRange, AICombatRangePolicy_Ranged_MaxRange, AICombatRangePolicy_MeleeRange

    Parameters

    Returns void

  • AIEncounter_CombatGuidance_SetSpreadAttackers(pEncounter: AIEncounterID, value: boolean): void
  • AIEncounter_DataDictionarySetBool(pEncounter: AIEncounterID, varName: string, value: boolean): void
  • AIEncounter_DataDictionarySetNumber(pEncounter: AIEncounterID, varName: string, value: number): void
  • AIEncounter_DefenseGuidance_EnableIdleGarrison(pEncounter: AIEncounterID, enable: boolean): any
  • AIEncounter_EngagementGuidance_ClearSetupLocationOverrides(pEncounter: AIEncounterID): any
  • AIEncounter_EngagementGuidance_EnableAggressiveEngagementMove(pEncounter: AIEncounterID, enable: boolean): any
  • AIEncounter_EngagementGuidance_EnableConstruction(pEncounter: AIEncounterID, enable: boolean): any
  • AIEncounter_EngagementGuidance_EnableSetupLocations(pEncounter: AIEncounterID, enable: boolean): any
  • AIEncounter_EngagementGuidance_SetAllowResourceGatheringOutsideLeash(pEncounter: AIEncounterID, allowOutsideLeash: boolean): void
  • Sets a TownLife Encounter whether to allow resource gathering from deposits outside of Encounter leash.

    Parameters

    Returns void

  • AIEncounter_EngagementGuidance_SetAllowReturnToPreviousStages(pEncounter: AIEncounterID, enable: boolean): void
  • Enable encounter to return to previous stages if they fail to meet conditions for current stage.

    Parameters

    Returns void

  • AIEncounter_EngagementGuidance_SetCoordinatedSetup(pEncounter: AIEncounterID, enable: boolean): void
  • AIEncounter_EngagementGuidance_SetEnableSniperReactions(pEncounter: AIEncounterID, enable: boolean): void
  • AIEncounter_EngagementGuidance_SetEnableSubEngagementAreas(pEncounter: AIEncounterID, enable: boolean): void
  • AIEncounter_EngagementGuidance_SetMaxEngagementTime(pEncounter: AIEncounterID, seconds: number): void
  • AIEncounter_EngagementGuidance_SetMaxIdleTime(pEncounter: AIEncounterID, seconds: number): void
  • AIEncounter_EngagementGuidance_SetSetupLocationSbpPriority(pEncounter: AIEncounterID, sbp: ScarSquadPBG, priority: number): void
  • AIEncounter_FallbackGuidance_EnableReinforceDuringCombat(pEncounter: AIEncounterID, value: boolean): any
  • AIEncounter_FallbackGuidance_EnableRetreatOnPinned(pEncounter: AIEncounterID, enable: boolean): any
  • AIEncounter_FallbackGuidance_EnableRetreatOnSuppression(pEncounter: AIEncounterID, enable: boolean): any
  • AIEncounter_FallbackGuidance_SetEntitiesRemainingThreshold(pEncounter: AIEncounterID, value: number): void
  • Set entities remaining threshold of encounter [-1 to N] to fallback at. (negative disables)

    Parameters

    Returns void

  • AIEncounter_FallbackGuidance_SetFallbackCapacityPercentage(pEncounter: AIEncounterID, value: number): void
  • AIEncounter_FallbackGuidance_SetFallbackCombatRating(pEncounter: AIEncounterID, value: number): void
  • AIEncounter_FallbackGuidance_SetFallbackSquadHealthPercentage(pEncounter: AIEncounterID, fallbackStartValue: number, fallbackEndValue: number): void
  • Set Squad health threshold [-1 to 1] to fallback at. (negative disables)

    Parameters

    • pEncounter: AIEncounterID
    • fallbackStartValue: number
    • fallbackEndValue: number

    Returns void

  • AIEncounter_FallbackGuidance_SetFallbackSquadShieldPercentage(pEncounter: AIEncounterID, fallbackStartValue: number, fallbackEndValue: number): void
  • Set Squad Shield threshold [-1 to 1] to fallback at. (negative disables)

    Parameters

    • pEncounter: AIEncounterID
    • fallbackStartValue: number
    • fallbackEndValue: number

    Returns void

  • AIEncounter_FallbackGuidance_SetFallbackVehicleHealthPercentage(pEncounter: AIEncounterID, fallbackStartValue: number, fallbackEndValue: number): void
  • Set Vehicle health threshold [-1 to 1] to fallback at. (negative disables)

    Parameters

    • pEncounter: AIEncounterID
    • fallbackStartValue: number
    • fallbackEndValue: number

    Returns void

  • AIEncounter_FallbackGuidance_SetGlobalFallbackPercentage(pEncounter: AIEncounterID, value: number): void
  • AIEncounter_FallbackGuidance_SetGlobalFallbackRetreat(pEncounter: AIEncounterID, value: boolean): void
  • AIEncounter_FallbackGuidance_SetReinforceHealthPercentage(pEncounter: AIEncounterID, value: number): void
  • AIEncounter_FallbackGuidance_SetReinforceMaxDistance(pEncounter: AIEncounterID, value: number): void
  • AIEncounter_FallbackGuidance_SetReinforceMinHealthRatioToReachReinforcePoint(pEncounter: AIEncounterID, value: number): void
  • Set the Min Health Ratio Required To Reach Reinforce Point [0.0, 1.0] (negative value: no constrain)

    Parameters

    Returns void

  • AIEncounter_FallbackGuidance_SetRetreatCapacityPercentage(pEncounter: AIEncounterID, value: number): void
  • AIEncounter_FallbackGuidance_SetRetreatCombatRating(pEncounter: AIEncounterID, value: number): void
  • AIEncounter_FallbackGuidance_SetRetreatHealthPercentage(pEncounter: AIEncounterID, value: number): void
  • AIEncounter_FormationGuidance_SetFormUpAtBuildingOfType(encounter: AIEncounterID, unitTypeList: string): void
  • Set formup type for formation encounter to be at building of type from AE tuning list (must set before triggering)

    Parameters

    Returns void

  • AIEncounter_FormationGuidance_SetFormUpAtPositionTarget(encounter: AIEncounterID, postion: Position): void
  • AIEncounter_FormationGuidance_SetFormUpAtSquadAverage(encounter: AIEncounterID): void
  • Set formup position for formation encounter at the average of current squad positions (must set before triggering)

    Parameters

    Returns void

  • AIEncounter_FormationGuidance_SetFormUpAtTimeOutParams(encounter: AIEncounterID, timeoutSeconds: number, requiredSquadsPercent: number): void
  • Set formup position timeout and % squads that must arrive or else it will fail. Setting zero for timeout means infinite

    Parameters

    • encounter: AIEncounterID
    • timeoutSeconds: number
    • requiredSquadsPercent: number

    Returns void

  • AIEncounter_FormationPhaseGuidance_SetCombatExitParams(encounter: AIEncounterID, timeoutSeconds: number, testTargetDestroyed: boolean, testEnemySquadsCleared: boolean, testEnemyBuildingsCleared: boolean, enemyScanRange: number, excludeBuildingTypeNames: string): void
  • Set params for terminating a formation phase encounter based on combat, fallback params can also be used

    Parameters

    • encounter: AIEncounterID
    • timeoutSeconds: number
    • testTargetDestroyed: boolean
    • testEnemySquadsCleared: boolean
    • testEnemyBuildingsCleared: boolean
    • enemyScanRange: number
    • excludeBuildingTypeNames: string

    Returns void

  • AIEncounter_FormationPhaseGuidance_SetMoveEnemiesExitParams(encounter: AIEncounterID, enemyScanRange: number, combatFitnessThreshold: number, enemyFormationHeading: number, enemyFormationPosition: number, enemyFormationDistance: number, excludeBuildingTypeNames: string): void
  • Set params for terminating a formation phase encounter that is moving somewhere and encounters enemies enemyScanRange is scan range from current centre of the formation to look for enemies in meters combatFitnessThreshold is the fitness rating against all detected enemies, < 0 means do not use, 0 means our team will win taking no damage, 1.0 means the enemy will win taking now damage. enemyFormationAngle is the relative heading of the strongest enemy formation in degrees, 0 means do not use enemyFormationPosition is the relative position of the strongest enemy formation in degrees, where 360.0f means directly behind us, 0 means do not use enemyFormationDistance is the distance threshold of the strongest enemy formation in meters

    Parameters

    • encounter: AIEncounterID
    • enemyScanRange: number
    • combatFitnessThreshold: number
    • enemyFormationHeading: number
    • enemyFormationPosition: number
    • enemyFormationDistance: number
    • excludeBuildingTypeNames: string

    Returns void

  • AIEncounter_FormationPhaseGuidance_SetMoveExitParams(encounter: AIEncounterID, timeoutSeconds: number, requiredSquadsPercent: number, wasRecentlyAttackedSecs: number): void
  • Set params for terminating a formation phase encounter that is moving somewhere timeoutSeconds is how long to wait for squads to get to destination (0 means run indefinitely) requiredSquadsPercent is how many squads must be in the target area, 1.0 means all wasRecentlyAttackedSecs was any unit attacked in this interval, 0 means do not use. Recommend not using if you are also using combat threshold

    Parameters

    • encounter: AIEncounterID
    • timeoutSeconds: number
    • requiredSquadsPercent: number
    • wasRecentlyAttackedSecs: number

    Returns void

  • AIEncounter_FormationPhase_GetEndPosition(encounterID: AITaskID): any
  • Get the average position of squads of this finished formation phase encounter (may be the same as target if successful). You should call AIEncounter_FormationPhase_HasValidExitInfo before this to avoid an error

    Parameters

    Returns any

  • AIEncounter_FormationPhase_GetEndReason(encounterID: AITaskID): any
  • Get the end position of this finished formation phase move encounter (may be the same as target if successful)

    Parameters

    Returns any

  • Get Groups containing the enemies encountered by this formation phase encounter (encounter must have completed) false indicates the exit info was not available for this encounter

    Parameters

    Returns any

  • AIEncounter_FormationPhase_GetExitCombatFitnessResult(encounterID: AITaskID): any
  • Get the combat fitness result for a finished phase encounter, will only be valid for exit states CombatFitnessThreshold or WasAttacked. -1.0f means invalid.

    Parameters

    Returns any

  • AIEncounter_FormationPhase_GetSquadsAvailableAtEnd(encounterID: AITaskID, squadsAvailable: SGroupID, squadsUnavailable: SGroupID): any
  • Get SGRoups containing the squads who made it to the destination of a formation phase move encounter and those who didn't (encounter must have completed) false indicates the exit info was not available for this encounter

    Parameters

    Returns any

  • AIEncounter_FormationPhase_HasValidExitInfo(encounterID: AITaskID): any
  • Query if there is valid exit info for this encounter (will only return true for phase encounters)

    Parameters

    Returns any

  • AIEncounter_FormationTaskStateGuidance_MinRange(encounter: AIEncounterID, priority: number, minSquads: number, maxSquads: number, maxTasks: number, repositionIntervalSecs: number, useTactics: boolean, unitTypeNames: string, targetPriorityPBG: PropertyBagGroup): any
  • Specify data for formation encounter to create a formation min range task state repositionInterval is how often they will check to see if they need to reposition

    Parameters

    • encounter: AIEncounterID
    • priority: number
    • minSquads: number
    • maxSquads: number
    • maxTasks: number
    • repositionIntervalSecs: number
    • useTactics: boolean
    • unitTypeNames: string
    • targetPriorityPBG: PropertyBagGroup

    Returns any

  • AIEncounter_FormationTaskStateGuidance_MinRangeWithProtect(encounter: AIEncounterID, priority: number, minSquads: number, maxSquads: number, maxTasks: number, repositionIntervalSecs: number, useTactics: boolean, unitTypeNames: string, targetPriorityPBG: PropertyBagGroup, protectMinSquads: number, protectMaxSquads: number, protectProportionSquads: number, protectDistance: number, protectRepositionThreshold: number, protectRepositionIntervalSecs: number, protectUnitTypeNames: string): any
  • Specify data for formation encounter to create a formation min range task state with protect task enemyScanRange is scan range from current centre of the formation to look for enemies in meters

    Parameters

    • encounter: AIEncounterID
    • priority: number
    • minSquads: number
    • maxSquads: number
    • maxTasks: number
    • repositionIntervalSecs: number
    • useTactics: boolean
    • unitTypeNames: string
    • targetPriorityPBG: PropertyBagGroup
    • protectMinSquads: number
    • protectMaxSquads: number
    • protectProportionSquads: number
    • protectDistance: number
    • protectRepositionThreshold: number
    • protectRepositionIntervalSecs: number
    • protectUnitTypeNames: string

    Returns any

  • AIEncounter_FormationTaskStateGuidance_Move(encounter: AIEncounterID, attackMove: boolean, priority: number, minSquads: number, maxSquads: number, maxTasks: number, unitTypeNames: string): any
  • Specify data for formation encounter to create a formation move task state

    Parameters

    • encounter: AIEncounterID
    • attackMove: boolean
    • priority: number
    • minSquads: number
    • maxSquads: number
    • maxTasks: number
    • unitTypeNames: string

    Returns any

  • AIEncounter_FormationTaskStateGuidance_SetupRanged(encounter: AIEncounterID, priority: number, minSquads: number, maxSquads: number, maxTasks: number, unitTypeNames: string, targetPriorityPBG: PropertyBagGroup): any
  • Specify data for formation encounter to create a formation setup ranged task state

    Parameters

    • encounter: AIEncounterID
    • priority: number
    • minSquads: number
    • maxSquads: number
    • maxTasks: number
    • unitTypeNames: string
    • targetPriorityPBG: PropertyBagGroup

    Returns any

  • AIEncounter_FormationTaskStateGuidance_SetupRangedWithProtect(encounter: AIEncounterID, priority: number, minSquads: number, maxSquads: number, maxTasks: number, unitTypeNames: string, targetPriorityPBG: PropertyBagGroup, protectMinSquads: number, protectMaxSquads: number, protectProportionSquads: number, protectDistance: number, protectRepositionThreshold: number, protectRepositionIntervalSecs: number, protectUnitTypeNames: string): any
  • Specify data for formation encounter to create a formation setup ranged task state and along with a formation of other units to protect it

    Parameters

    • encounter: AIEncounterID
    • priority: number
    • minSquads: number
    • maxSquads: number
    • maxTasks: number
    • unitTypeNames: string
    • targetPriorityPBG: PropertyBagGroup
    • protectMinSquads: number
    • protectMaxSquads: number
    • protectProportionSquads: number
    • protectDistance: number
    • protectRepositionThreshold: number
    • protectRepositionIntervalSecs: number
    • protectUnitTypeNames: string

    Returns any

  • AIEncounter_FormationTaskStateGuidance_SimpleMelee(encounter: AIEncounterID, priority: number, minSquads: number, maxSquads: number, maxTasks: number, unitTypeNames: string, targetPriorityPBG: PropertyBagGroup): any
  • Specify data for formation encounter to create a formation simple melee task state

    Parameters

    • encounter: AIEncounterID
    • priority: number
    • minSquads: number
    • maxSquads: number
    • maxTasks: number
    • unitTypeNames: string
    • targetPriorityPBG: PropertyBagGroup

    Returns any

  • AIEncounter_FormationTaskStateGuidance_TransportMove(encounter: AIEncounterID, priority: number, minSquads: number, maxSquads: number, maxTasks: number, unitTypeNames: string, minPassengerSquads: number, maxPassengerSquadsPerTransport: number, unloadAbilityPBG: PropertyBagGroup, passengerUnitTypeNames: string, targetPriorityPBG: PropertyBagGroup): any
  • Specify data for formation encounter to create a formation transport move task state

    Parameters

    • encounter: AIEncounterID
    • priority: number
    • minSquads: number
    • maxSquads: number
    • maxTasks: number
    • unitTypeNames: string
    • minPassengerSquads: number
    • maxPassengerSquadsPerTransport: number
    • unloadAbilityPBG: PropertyBagGroup
    • passengerUnitTypeNames: string
    • targetPriorityPBG: PropertyBagGroup

    Returns any

  • Determines if encounter is still valid. Must be true before calling any other of the AIEncounter_* function. Return true if valid, false otherwise.

    Parameters

    Returns any

  • AIEncounter_LogDebug(pPlayer: PlayerID, encounterID: number, debugString: string): any
  • in non RTM builds, if verboseEncounterLogging is enabled, will spew string to AI log file

    Parameters

    • pPlayer: PlayerID
    • encounterID: number
    • debugString: string

    Returns any

  • AIEncounter_MoveGuidance_EnableAggressiveMove(pEncounter: AIEncounterID, enable: boolean): any
  • AIEncounter_MoveGuidance_SetSquadCoherenceRadius(pEncounter: AIEncounterID, radius: number): void
  • Set radius (follow distance) for coordinated move phase (<= 0 disables coordinated movement)

    Parameters

    Returns void

  • AIEncounter_Notify_ClearCallbacks(pEncounter: AIEncounterID): any
  • AIEncounter_Notify_SetEnableSnipedCallbacks(pEncounter: AIEncounterID, value: boolean): void
  • AIEncounter_Notify_SetPlayerEventEncounterID(pEncounter: AIEncounterID, id: number): void
  • AIEncounter_Pause(pEncounter: AIEncounterID, bPause: boolean): any
  • AIEncounter_ResourceGuidance_CalculateEstimatedSquadProductionTime(pEncounter: AIEncounterID, pbgShortname: string, canAffordNowOnly: boolean): any
  • Calculates approximately how long it will take for a specified Encounter to produce a specified squad. Returns production time in seconds. Negative value means the specified PBG cannot be produced at the specified Encounter. pEncounter is the Encounter Module that can service a production request. pbgShortname is the PBG of the squad to query. if canAffordNowOnly is set and we currently don't have enough resource now, report "cannot be produced".

    Parameters

    • pEncounter: AIEncounterID
    • pbgShortname: string
    • canAffordNowOnly: boolean

    Returns any

  • AIEncounter_ResourceGuidance_ClearEntities(pEncounter: AIEncounterID): any
  • AIEncounter_ResourceGuidance_ClearSquads(pEncounter: AIEncounterID): any
  • AIEncounter_ResourceGuidance_SetResourceMoney(pEncounter: AIEncounterID, resourceAmount: Record<number, number>): void
  • AIEncounter_SetDebugName(pEncounter: AIEncounterID, name: string): void
  • AIEncounter_TacticFilter_ResetAbilityGuidance(pEncounter: AIEncounterID): any
  • AIEncounter_TacticFilter_ResetTacticGuidance(pEncounter: AIEncounterID): any
  • AIEncounter_TacticFilter_ResetTargetGuidance(pEncounter: AIEncounterID): any
  • AIEncounter_TacticFilter_SetAbilityGuidance(pEncounter: AIEncounterID, ability: PropertyBagGroup, maxCasters: number, retrySecs: number, waitSelfSecs: number, waitEncounterSecs: number, timeoutSecs: number, initialWait: boolean, maxRange: number, castChanceOverride: number): void
  • Set tactic ability constraints for encounter maxCasters is maximum concurrent casters of this ability (-1 is unlimited), waitRetrySecs is time in seconds between ability tactic retrying ability retry, wait[self/encounter], and timeout Secs are: the number of seconds to try doing a tactic after a previous try; seconds after last successful try; how long the successful tactic can run. initialWait is true if the waitTime applies before the first ability use. maxRange is the maximum range to look for ability target from caster (other range constraints may limit the max range to a smaller value) castChanceOverride is the probability to cast the ability, must be between 0.0 and 1.0

    Parameters

    • pEncounter: AIEncounterID
    • ability: PropertyBagGroup
    • maxCasters: number
    • retrySecs: number
    • waitSelfSecs: number
    • waitEncounterSecs: number
    • timeoutSecs: number
    • initialWait: boolean
    • maxRange: number
    • castChanceOverride: number

    Returns void

  • AIEncounter_TacticFilter_SetDefaultAbilityGuidance(pEncounter: AIEncounterID, maxCasters: number, retrySecs: number, waitSelfSecs: number, waitEncounterSecs: number, timeoutSecs: number, initialWait: boolean, maxRange: number, castChanceOverride: number): void
  • Set default tactic ability constraints for encounter (ability specific guidance takes priority over defaults) maxCasters is maximum concurrent casters of ability (-1 is unlimited), waitRetrySecs is time in seconds between ability tactic retrying ability, retry, wait[self/encounter], and timeout Secs are: the number of seconds to try doing a tactic after a previous try; seconds after last successful try; how long the successful tactic can run. initialWait is true if the waitTime applies before the first ability use. maxRange is the maximum range to look for ability target from caster (other range constraints may limit the max range to a smaller value) castChanceOverride is the probability to cast the ability, must be between 0.0 and 1.0

    Parameters

    • pEncounter: AIEncounterID
    • maxCasters: number
    • retrySecs: number
    • waitSelfSecs: number
    • waitEncounterSecs: number
    • timeoutSecs: number
    • initialWait: boolean
    • maxRange: number
    • castChanceOverride: number

    Returns void

  • AIEncounter_TacticFilter_SetDefaultTacticGuidance(pEncounter: AIEncounterID, maxUsers: number, retrySecs: number, waitSecs: number, timeoutSecs: number, initialWait: boolean, maxRange: number): void
  • Set default tactic constraints for encounter (tactic specific guidance takes priority over defaults) maxUsers is maximum concurrent users of tactic (-1 is unlimited), waitRetrySecs is time in seconds between tactic retrying retry, wait, and timeout Secs are: the number of seconds to try doing a tactic after a previous try; seconds after last successful try; how long the successful tactic can run. initialWait is true if the waitTime applies before the first tactic use. maxRange is the maximum range to look for tactic target from caster (other range constraints may limit the max range to a smaller value)

    Parameters

    • pEncounter: AIEncounterID
    • maxUsers: number
    • retrySecs: number
    • waitSecs: number
    • timeoutSecs: number
    • initialWait: boolean
    • maxRange: number

    Returns void

  • AIEncounter_TacticFilter_SetTacticGuidance(pEncounter: AIEncounterID, tactic: AITacticType, maxUsers: number, retrySecs: number, waitSecs: number, timeoutSecs: number, initialWait: boolean, maxRange: number): void
  • Set tactic constraints for encounter maxUsers is maximum concurrent users of this tactic (-1 is unlimited), waitRetrySecs is time in seconds between tactic retry retry, wait, and timeout Secs are: the number of seconds to try doing a tactic after a previous try; seconds after last successful try; how long the successful tactic can run. initialWait is true if the waitTime applies before the first tactic use. maxRange is the maximum range to look for tactic target from caster (other range constraints may limit the max range to a smaller value)

    Parameters

    • pEncounter: AIEncounterID
    • tactic: AITacticType
    • maxUsers: number
    • retrySecs: number
    • waitSecs: number
    • timeoutSecs: number
    • initialWait: boolean
    • maxRange: number

    Returns void

  • AIEncounter_TargetGuidance_SetPatrolPathByName(pEncounter: AIEncounterID, pathName: string, delaySecs: number, invertPathAtEnd: boolean, startInverted: boolean): void
  • Sets target patrol path for encounter

    Parameters

    • pEncounter: AIEncounterID
    • pathName: string
    • delaySecs: number
    • invertPathAtEnd: boolean
    • startInverted: boolean

    Returns void

  • AIEncounter_TargetGuidance_SetPatrolWander(pEncounter: AIEncounterID, delaySecs: number, radiusMode: number, radiusOverride: number, overrideCenter: boolean, centerOverride: Position): void
  • Sets random wander target patrol for encounter; delaySecs is the time in secs to pause at each random point

    Parameters

    • pEncounter: AIEncounterID
    • delaySecs: number
    • radiusMode: number
    • radiusOverride: number
    • overrideCenter: boolean
    • centerOverride: Position

    Returns void

  • AIEncounter_TargetGuidance_SetSquadPatrolPathByName(pEncounter: AIEncounterID, pSquad: SquadID, pathName: string, delaySecs: number, invertPathAtEnd: boolean, startInverted: boolean): void
  • AIEncounter_TargetGuidance_SetSquadPatrolWander(pEncounter: AIEncounterID, pSquad: SquadID, delaySecs: number, radiusMode: number, radiusOverride: number, overrideCenter: boolean, centerOverride: Position): void
  • Sets random wander target patrol for the squad; delaySecs is the time in secs to pause at each random point

    Parameters

    • pEncounter: AIEncounterID
    • pSquad: SquadID
    • delaySecs: number
    • radiusMode: number
    • radiusOverride: number
    • overrideCenter: boolean
    • centerOverride: Position

    Returns void

  • Sets the target for an encounter to a provided marker, position, sgroup, egroup, squad, or entity When you specify a group as the target, it chooses a single squad or entity - if you pass something for the closestTo parameter it will choose the closest one to that, otherwise it will just choose the first

    Parameters

    Returns void

  • AIEncounter_TargetGuidance_SetTargetArea(pEncounter: AIEncounterID, radius: number): void
  • AIEncounter_TargetGuidance_SetTargetLeash(pEncounter: AIEncounterID, radius: number): void
  • AIFormationAttackGoal_AdjustDefaultGoalData(additionalDefaultGoalData: any): any
  • Adjust default goal data for attack goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter attack goal values.

    Parameters

    • additionalDefaultGoalData: any

    Returns any

  • AIFormationAttackGoal_SetDefaultGoalData(defaultGoalData: any): void
  • Set default goal data for attack goals. defaultGoalData is cloned; any values specified are used for unspecified encounter attack goal values.

    Parameters

    • defaultGoalData: any

    Returns void

  • AIFormationAttackGoal_SetModifyGoalData(modifyGoalData: any): void
  • Set modify goal data for attack goals. modifyGoalData is cloned; values specified via keyname_Multiplier are used for the numeric keyname encounter attack goal value.

    Parameters

    • modifyGoalData: any

    Returns void

  • AIFormationAttackGoal_SetOverrideGoalData(overrideGoalData: any): void
  • Set override goal data for attack goals. overrideGoalData is cloned; any values specified are used for encounter attack goal values.

    Parameters

    • overrideGoalData: any

    Returns void

  • AIFormationDefendAreaGoal_AdjustDefaultGoalData(additionalDefaultGoalData: any): any
  • Adjust default goal data for DefendArea goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter DefendArea goal values.

    Parameters

    • additionalDefaultGoalData: any

    Returns any

  • AIFormationDefendAreaGoal_SetDefaultGoalData(defaultGoalData: any): void
  • Set default goal data for DefendArea goals. defaultGoalData is cloned; any values specified are used for unspecified encounter DefendArea goal values.

    Parameters

    • defaultGoalData: any

    Returns void

  • AIFormationDefendAreaGoal_SetModifyGoalData(modifyGoalData: any): void
  • Set modify goal data for DefendArea goals. modifyGoalData is cloned; values specified via keyname_Multiplier are used for the numeric keyname encounter DefendArea goal value.

    Parameters

    • modifyGoalData: any

    Returns void

  • AIFormationDefendAreaGoal_SetOverrideGoalData(overrideGoalData: any): void
  • Set override goal data for DefendArea goals. overrideGoalData is cloned; any values specified are used for encounter DefendArea goal values.

    Parameters

    • overrideGoalData: any

    Returns void

  • AIMoveGoal_AdjustDefaultGoalData(additionalDefaultGoalData: any): any
  • Adjust default goal data for move goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter move goal values.

    Parameters

    • additionalDefaultGoalData: any

    Returns any

  • AIMoveGoal_SetDefaultGoalData(defaultGoalData: any): void
  • Set default goal data for move goals. defaultGoalData is cloned; any values specified are used for unspecified encounter move goal values.

    Parameters

    • defaultGoalData: any

    Returns void

  • AIMoveGoal_SetModifyGoalData(modifyGoalData: any): void
  • Set modify goal data for move goals. modifyGoalData is cloned; values specified via keyname_Multiply are used for the numeric keyname encounter move goal value.

    Parameters

    • modifyGoalData: any

    Returns void

  • AIMoveGoal_SetOverrideGoalData(overrideGoalData: any): void
  • Set override goal data for move goals. overrideGoalData is cloned; any values specified are used for encounter move goal values.

    Parameters

    • overrideGoalData: any

    Returns void

  • AIPlayer_CachedPathCrossesEnemyTerritory(aiPlayer: PlayerID, requestingID: number, minDistToEnemyTerritory: number, unused: boolean): any
  • Checks if the cached path crosses known enemy territory

    Parameters

    • aiPlayer: PlayerID
    • requestingID: number
    • minDistToEnemyTerritory: number
    • unused: boolean

    Returns any

  • AIPlayer_CanAISquadLockTacticItem(tacticItemEntity: EntityID, lockingAISquad: SquadID): any
  • AIPlayer_ClearCachedPath(player: PlayerID, requestingID: number): any
  • AIPlayer_EnemyTerritoryDetected(player: PlayerID): any
  • AIPlayer_FindClosestSiegeTarget(player: PlayerID, eGroup: EGroupID, minSections: number, unbreached: boolean, refPosition: Position): any
  • Tests to see if any entity in the group is part of a wall that matches the supplied conditions eGroup contains list of entities to test, minSections is minimum number of connected wall sections, unbreached means all sections must be unbroken. Returns closest entity to refPosition

    Parameters

    Returns any

  • AIPlayer_FindClumpContainingPosition(aiPlayer: PlayerID, pos: Position, targetFilterFlags: number): any
  • AIPlayer_GetAnchorPosition(aiPlayer: PlayerID): any
  • AIPlayer_GetBestClumpForPositionIdx(pPlayer: PlayerID, position: Position, pAbilityPBG: PropertyBagGroup, minRange: number, maxRange: number, targetFilterFlags: number, minNumSquads: number): any
  • returns a 0-based index of the best clump of enemy squads within the given tolerance to the position passed in

    Parameters

    Returns any

  • AIPlayer_GetBestClumpForSquadIdx(pPlayer: PlayerID, pSquad: SquadID, pAbilityPBG: PropertyBagGroup, minRange: number, maxRange: number, targetFilterFlags: number, minNumSquads: number): any
  • returns a 0-based index of the best clump of enemy squads within the given tolerance to the AI squad

    Parameters

    Returns any

  • AIPlayer_GetBestClumpIdx(pPlayer: PlayerID, minRange: number, maxRange: number, clumpSelectionGlobalBestMinRatio: number, targetFilterFlags: number, minNumSquads: number): any
  • returns a 0-based index of the best clump of allied or enemy squads within the given tolerance to the AI player

    Parameters

    • pPlayer: PlayerID
    • minRange: number
    • maxRange: number
    • clumpSelectionGlobalBestMinRatio: number
    • targetFilterFlags: number
    • minNumSquads: number

    Returns any

  • AIPlayer_GetBestClumpIdxForAbility(pPlayer: PlayerID, pAbilityPBG: PropertyBagGroup, minRange: number, maxRange: number, clumpSelectionGlobalBestMinRatio: number, targetFilterFlags: number, minNumSquads: number): any
  • returns a 0-based index of the best clump of allied or enemy squads within the given tolerance to the AI player

    Parameters

    • pPlayer: PlayerID
    • pAbilityPBG: PropertyBagGroup
    • minRange: number
    • maxRange: number
    • clumpSelectionGlobalBestMinRatio: number
    • targetFilterFlags: number
    • minNumSquads: number

    Returns any

  • AIPlayer_GetBestOwnTrafficPos(aiPlayer: PlayerID, minNumSquads: number): any
  • Returns a position that has the highest decayed traffic of either allies or enemies

    Parameters

    Returns any

  • AIPlayer_GetBestOwnedClumpIdx(pPlayer: PlayerID, minRange: number, maxRange: number, clumpSelectionGlobalBestMinRatio: number, targetFilterFlags: number, minNumSquads: number): any
  • returns a 0-based index of the best clump of owned squads within the given tolerance to the AI player

    Parameters

    • pPlayer: PlayerID
    • minRange: number
    • maxRange: number
    • clumpSelectionGlobalBestMinRatio: number
    • targetFilterFlags: number
    • minNumSquads: number

    Returns any

  • AIPlayer_GetBestOwnedClumpIdxForAbility(pPlayer: PlayerID, pAbilityPBG: PropertyBagGroup, minRange: number, maxRange: number, clumpSelectionGlobalBestMinRatio: number, targetFilterFlags: number, minNumSquads: number): any
  • returns a 0-based index of the best clump of owned squads within the given tolerance to the AI player

    Parameters

    • pPlayer: PlayerID
    • pAbilityPBG: PropertyBagGroup
    • minRange: number
    • maxRange: number
    • clumpSelectionGlobalBestMinRatio: number
    • targetFilterFlags: number
    • minNumSquads: number

    Returns any

  • AIPlayer_GetBestTrafficPos(aiPlayer: PlayerID, relationshipEnum: StackVar, minNumSquads: number): any
  • Returns a position that has the highest decayed traffic of either allies or enemies

    Parameters

    Returns any

  • AIPlayer_GetCachedPathLength(player: PlayerID, requestingID: number): any
  • Get the distance of the path requested with the given ID. < 0 means invalid request.

    Parameters

    Returns any

  • AIPlayer_GetCachedPathPoints(player: PlayerID, requestingID: number): any
  • Return the path points of the calculated path from a previous pathfinding request if the result was successful and the path has at least two points.

    Parameters

    Returns any

  • AIPlayer_GetCapturePoints(aiPlayer: PlayerID, relationshipEnum: StackVar, onlyCanPlaceSecuringStructure: boolean, egroupOut: EGroupID): any
  • Returns an EGroup containing all capture points on the map owned by a player with the specified

    Parameters

    Returns any

  • AIPlayer_GetClumpPosition(pPlayer: PlayerID, clumpIndex: number, targetFilterFlags: number): any
  • Used for tactics; returns a "special error position" on failure that's nowhere inside the world

    Parameters

    • pPlayer: PlayerID
    • clumpIndex: number
    • targetFilterFlags: number

    Returns any

  • AIPlayer_GetDynamicMultiplier(aiPlayer: PlayerID, tableName: Key): any
  • Calculate product of all multipliers in tableName The result is intended to be applied to the tuning value corresponding to tableName, for use in the AI military target scoring function Allowable strings for tableName: front_line

    Parameters

    Returns any

  • AIPlayer_GetDynamicUnitTypeMultipliersForEntity(aiPlayer: PlayerID, targetEntity: EntityID): any
  • Calculate product of all unit type multipliers that match the entity's unit types The result is intended to be used in the AI military target scoring function

    Parameters

    Returns any

  • AIPlayer_GetDynamicUnitTypeMultipliersForSquad(aiPlayer: PlayerID, targetSquad: Squad): any
  • Calculate product of all unit type multipliers that match a unit type of an entity in the squad The result is intended to be used in the AI military target scoring function

    Parameters

    Returns any

  • AIPlayer_GetKnownResourceDeposits(aiPlayer: PlayerID, resourceType: string, includeDepleted: boolean): any
  • Returns a list of all resource deposit entities seen by the AI player

    Parameters

    • aiPlayer: PlayerID
    • resourceType: string
    • includeDepleted: boolean

    Returns any

  • AIPlayer_GetLocal(playerId: number): any
  • Returns the local AIPlayer given a PlayerId (1000 and up)

    Parameters

    • playerId: number

    Returns any

  • AIPlayer_GetLocalFromPlayer(pPlayerIn: PlayerID): any
  • AIPlayer_GetOpponentPlayerAtIndex(aiPlayer: PlayerID, index: number): any
  • Returns the Player at specified index out of all opponent players. Use in conjunction with AIPlayer_GetOpponentPlayerCount.

    Parameters

    Returns any

  • AIPlayer_GetOpponentPlayerCount(aiPlayer: PlayerID): any
  • AIPlayer_GetOwnedClumpPosition(pPlayer: PlayerID, clumpIndex: number): any
  • Used for tactics; returns a "special error position" on failure that's nowhere inside the world

    Parameters

    Returns any

  • AIPlayer_GetOwnedMilitaryPointEntitiesInRange(militaryPointPBG: EntityPBG, position: Position, range: number): any
  • Returns an EGroup listing all military points owned by a player within a certain range of the position passed in that match a certain type

    Parameters

    Returns any

  • AIPlayer_GetPositionsOfMilitaryPointsWithRelation(aiPlayer: PlayerID, relationshipEnum: StackVar): any
  • AIPlayer_GetStateModelAISquadListEntries(aiPlayer: PlayerID, key: string): any
  • Returns a table of squad ids from the AIPlayer's state model corresponding to the given key.

    Parameters

    Returns any

  • AIPlayer_GetStateModelBool(aiPlayer: PlayerID, key: string): any
  • Returns a boolean value from the AIPlayer's state model corresponding to the given key.

    Parameters

    Returns any

  • AIPlayer_GetStateModelFloat(aiPlayer: PlayerID, key: string): any
  • Returns a float value from the AIPlayer's state model corresponding to the given key.

    Parameters

    Returns any

  • AIPlayer_GetStateModelInt(aiPlayer: PlayerID, key: string): any
  • Returns an integer value from the AIPlayer's state model corresponding to the given key.

    Parameters

    Returns any

  • AIPlayer_GetStateModelPBG(aiPlayer: PlayerID, key: string): any
  • Returns a PropertyBagGroup value from the AIPlayer's state model corresponding to the given key.

    Parameters

    Returns any

  • AIPlayer_GetStateModelTargetListEntries(aiPlayer: PlayerID, key: string): any
  • Returns a table of targets from the AIPlayer's state model corresponding to the given key.

    Parameters

    Returns any

  • AIPlayer_IsOnAnIsland(): any
  • AIPlayer_IsPathProcessed(aiPlayer: PlayerID, requestedPathRequestID: number): any
  • AIPlayer_IsPointThreatened(aiPlayer: PlayerID, pos: Position, filterEnemyBuildings: boolean, thresholdFitness: number): any
  • Returns whether or not a point is threatened (from the perspective of the player passed in) If enemy builds are not filtered, allied will be. ThresholdFitness is from allied perspective. Typically you want to filter enemy buildings when defending, allied when attacking

    Parameters

    • aiPlayer: PlayerID
    • pos: Position
    • filterEnemyBuildings: boolean
    • thresholdFitness: number

    Returns any

  • AIPlayer_IsTacticItemLockedByAISquad(tacticItemEntity: EntityID, lockingAISquad: SquadID): any
  • AIPlayer_LockTacticItemForAISquad(tacticItemEntity: EntityID, lockingAISquad: SquadID): any
  • Remove a multiplier previously applied to change the weight of a criteria in target scoring The multiplier will be removed from the table for the given tuningValueName. Pass in the multiplier id returned from AIPlayer_PushScoreMultiplier. Allowable strings for tuningValueName: front_line

    Parameters

    Returns any

  • Remove a multiplier previously applied to a unit type for target scoring The multiplier will be removed from the table for the given unitTypeName. Pass in the multiplier id used earlier with AIPlayer_PushScoreMultiplier.

    Parameters

    Returns any

  • AIPlayer_ProcessedPathSuccessful(aiPlayer: PlayerID, processedPathRequestID: number): any
  • Was the processed path successful? Only supply requestID for a processed path

    Parameters

    • aiPlayer: PlayerID
    • processedPathRequestID: number

    Returns any

  • Add a multiplier to change the weight of a criteria in target scoring The multiplier will be pushed to a table for the given tuningValueName. All multipliers in the table will be multiplied together and applied to the corresponding static tuning value. The multiplierID passed in can be passed to AIPlayer_PopScoreMultiplier to remove it. Allowable strings for tuningValueName: front_line DefendStructure AttackStructure EnemyClump

    Parameters

    Returns any

  • Add a multiplier to give weight to a unit type in target scoring The multiplier will be pushed to a table for the given unitTypeName. All multipliers in the table will be multiplied together and applied to targets with the corresponding unit type. multiplierId identifies the

    Parameters

    Returns any

  • Request a high path between the start and destination, supply a unique ID and the PBG of the largest entity that will be following the path.

    Parameters

    Returns any

  • AIPlayer_ResetEnemySquadsVisibility(player: PlayerID, enemyPlayer: PlayerID): any
  • Sets the ability priority override for all the abilities contained in the AIAbilityBag for all the AISquads owned by the player. -1 to disable the ability. NOTE: Encounter overrides have higher priority.

    Parameters

    Returns void

  • Sets the ability priority override for all the AISquads owned by the player. -1 to disable the ability. NOTE: Encounter overrides have higher priority.

    Parameters

    Returns void

  • AIPlayer_SetEntityHomebase(aiPlayer: PlayerID, eGroup: EGroupID, homeBaseID: number): void
  • AIPlayer_SetGathererDistributionOverride(aiPlayer: PlayerID, luaGatherDistro: number): void
  • Set the target distribution of how the ai player should use their units for gathering Second argument is a map of resource type names to weights ex: { ['wood'] = 5, ... }

    Parameters

    • aiPlayer: PlayerID
    • luaGatherDistro: number

    Returns void

  • AIPlayer_SetRequiresStatsUpdate(player: PlayerID): void
  • AIPlayer_SetSquadHomebase(aiPlayer: PlayerID, sGroup: SGroupID, homeBaseID: number): void
  • AIPlayer_SetStrategicBaseIntention(player: PlayerID, intentionName: string, value: number): void
  • AIPlayer_ToggleDrawCachedPath(requestingID: number, on: boolean): any
  • Toggle debug draw for the specified path, -1 will draw all of them

    Parameters

    • requestingID: number
    • on: boolean

    Returns any

  • AIPlayer_UnLockTacticItemForAISquad(tacticItemEntity: EntityID, lockingAISquad: SquadID): any
  • AIPlayer_UpdateGathering(pPlayer: PlayerID): any
  • AIPlayer_UpdateSkirmishAttackAndCaptureTasks(pPlayer: PlayerID): any
  • AIPlayer_UpdateSkirmishPlayerAbilities(pPlayer: PlayerID): any
  • AIPlayer_UpdateSkirmishProduction(pPlayer: PlayerID): any
  • AIPlayer_UpdateSkirmishScoutingTasks(pPlayer: PlayerID): any
  • AIProductionScoring_AlliedCombatFitness(aiPlayer: PlayerID, minFitness: number, maxFitness: number, aiArmyType: number, highFitnessIsGood: boolean): any
  • Create a AlliedCombatFitness scoring function. Returns 1.0 to 0.0, based on how the allied combat fitness is. 1.0 if the allied fitness is at or below minFitness, 0.0 if fitness is above the maxFitness, smooth transition in between. If highFitnessIsGood, returns 0.0 to 1.0 instead. 0.0 if at or below minFitness and 1.0 if at or above maxFitness.

    Parameters

    • aiPlayer: PlayerID
    • minFitness: number
    • maxFitness: number
    • aiArmyType: number
    • highFitnessIsGood: boolean

    Returns any

  • AIProductionScoring_AlliedCombatFitnessVsStrongestEnemy(aiPlayer: PlayerID, minFitness: number, maxFitness: number, aiArmyType: number, highFitnessIsGood: boolean): any
  • Create a AlliedCombatFitness scoring function (versus strongest enemy). Returns 1.0 to 0.0, based on how the allied combat fitness is. 1.0 if the fitness is at or below minFitness, 0.0 if fitness is above the maxFitness, smooth transition in between. If highFitnessIsGood, returns 0.0 to 1.0 instead. 0.0 if at or below minFitness and 1.0 if at or above maxFitness.

    Parameters

    • aiPlayer: PlayerID
    • minFitness: number
    • maxFitness: number
    • aiArmyType: number
    • highFitnessIsGood: boolean

    Returns any

  • AIProductionScoring_AlliedCombatFitnessVsWeakestEnemy(aiPlayer: PlayerID, minFitness: number, maxFitness: number, aiArmyType: number, highFitnessIsGood: boolean): any
  • Create a AlliedCombatFitness scoring function (versus the weakest enemy). Returns 1.0 to 0.0, based on how the allied combat fitness is. 1.0 if the fitness is at or below minFitness, 0.0 if fitness is above the maxFitness, smooth transition in between. If highFitnessIsGood, returns 0.0 to 1.0 instead. 0.0 if at or below minFitness and 1.0 if at or above maxFitness.

    Parameters

    • aiPlayer: PlayerID
    • minFitness: number
    • maxFitness: number
    • aiArmyType: number
    • highFitnessIsGood: boolean

    Returns any

  • AIProductionScoring_CanPushProductionScoringFunction(aiPlayer: PlayerID): any
  • Check if now is an appropriate time to be making scoring functions. Score functions should only be made within functions referenced by ProductionGroups

    Parameters

    Returns any

  • AIProductionScoring_ClampedScoringFunction(aiPlayer: PlayerID, min: number, max: number, innerScoringFunction: any): any
  • Create a ClampedScoringFunction scoring function. Clamps the returned value of the inner scoring function

    Parameters

    • aiPlayer: PlayerID
    • min: number
    • max: number
    • innerScoringFunction: any

    Returns any

  • AIProductionScoring_CounterScore(aiPlayer: PlayerID, baseScoreContributuion: number): any
  • Create a CounterScore scoring function If a item is a chosen counter it will get the score = (baseScoreContributuion + (1 - baseScoreContributuion) * counter score)

    Parameters

    • aiPlayer: PlayerID
    • baseScoreContributuion: number

    Returns any

  • AIProductionScoring_DropOffScore(aiPlayer: PlayerID): any
  • Create a DropOffScore scoring function. Returns positive score if drop off is required to either serve gathering of a resource or improve existing gathering

    Parameters

    Returns any

  • AIProductionScoring_EntityCombatUpgrade(aiPlayer: PlayerID): any
  • Create a EntityCombatUpgrade scoring function. Returns positive score if entity's combat fitness is improved. The aforementioned entity is the entity that the upgrade is being produce on.

    Parameters

    Returns any

  • AIProductionScoring_IslandNeedingExpansionBase(aiPlayer: PlayerID): any
  • Create an IslandNeedingExpansionBase scoring function. Returns 1.0f if there is an island requiring an expansion base

    Parameters

    Returns any

  • AIProductionScoring_LackOfSecuredResourceDeposits(aiPlayer: PlayerID, resourceType: number, scarceAmount: number, wellOffAmount: number): any
  • Create a LackOfSecuredResourceDeposits scoring function. Returns between 0 and 1, 1 if the total sum of secured resource deposits is less or equal to scarce amount, 0 if the amount is equal to or greater than well off amount, lerps in between

    Parameters

    • aiPlayer: PlayerID
    • resourceType: number
    • scarceAmount: number
    • wellOffAmount: number

    Returns any

  • AIProductionScoring_LuaScoringFunction(aiPlayer: PlayerID, scoringFunction: any): any
  • Create a LuaScoringFunction scoring function. Takes a reference to a lua function. Lua function will be called and passed AIPlayer and Pbg. Lua function is expected to return a value >= 0.0 DO NOT call any methods that do stuff to the AIPlayer in your referenced lua function. The referenced lua function must exist within the player's lua context

    Parameters

    Returns any

  • AIProductionScoring_MaxPopCapPercentage(aiPlayer: PlayerID, targetPopulationPercentageAlive: number, groupPopulation: boolean): any
  • Create a MaxPopCapPercentage scoring function targetPopulationPercentageAlive should be in range 0.0 -> 1.0. Return 1.0f as long as the combined population of the production item /group does not exceed a percentage of the player's max pop cap. If groupPopulation == true then all members of the item's Production Group are counted towards the current population to be compared against the target population.

    Parameters

    • aiPlayer: PlayerID
    • targetPopulationPercentageAlive: number
    • groupPopulation: boolean

    Returns any

  • AIProductionScoring_MaxScoringFunction(aiPlayer: PlayerID, innerScoringFunction: Vector): any
  • Create a MaxScoringFunction scoring function. Returns the max value of the inner scoring functions

    Parameters

    Returns any

  • AIProductionScoring_MaxWeaponDamage(aiPlayer: PlayerID, maxDamage: number): any
  • Create a MaxWeaponDamage scoring function. Units max weapon damage is normalized by max damage. (returns between 0.0 and 1.0)

    Parameters

    Returns any

  • AIProductionScoring_MilitaryPlayerUpgrade(aiPlayer: PlayerID, upgradeExponent: number): any
  • Create a MilitaryPlayerUpgrade scoring function. Quantifies how a player upgrade will improve the current army's combat fitness. Result = 1 - (1 - combat_fitness_improvment)^upgradeExponent

    Parameters

    • aiPlayer: PlayerID
    • upgradeExponent: number

    Returns any

  • AIProductionScoring_MinimumGameTime(aiPlayer: PlayerID, minGameTime: number): any
  • Create a MinimumGameTime scoring function. minGameTime is time from start in seconds. Returns 0.0 until minGameTime has passed, 1.0f after.

    Parameters

    Returns any

  • AIProductionScoring_MultipleProduced(aiPlayer: PlayerID, additionalFactor: number): any
  • Create a MultipleProduced scoring function Item will get a score of 1 +(additionalFactor * number of additional produced)

    Parameters

    • aiPlayer: PlayerID
    • additionalFactor: number

    Returns any

  • AIProductionScoring_MultiplyListScoringFunction(aiPlayer: PlayerID, innerScoringFunction: Vector): any
  • Create a MultiplyListScoringFunction scoring function. Takes a list of scoring functions and multiplies them together. This scoring function can be paired with MaxScoringFunction to generate OR scoring expressions, such as Max(IslandNeedingExpansionBase, (ProductionQueueContention * TimeToAcquire))

    Parameters

    Returns any

  • AIProductionScoring_NavalTransportRequired(aiPlayer: PlayerID): any
  • Create a NavalTransportRequired scoring function. Returns 0.0 -> 1.0, depending on strategic island decisions that would require transport

    Parameters

    Returns any

  • AIProductionScoring_NotProducedRecently(aiPlayer: PlayerID, timePeriodSeconds: number): any
  • Create an NotProducedRecently scoring function. Returns 1.0f if the item was not produced within the time period supplied, 0.0f otherwise

    Parameters

    • aiPlayer: PlayerID
    • timePeriodSeconds: number

    Returns any

  • AIProductionScoring_OnlyProduceOneAtATime(aiPlayer: PlayerID): any
  • Create a OnlyProduceOneAtATime scoring function. Returns 0.0 while another item of the same type is being produced

    Parameters

    Returns any

  • AIProductionScoring_PlannedPlacementScore(aiPlayer: PlayerID, minPlacementScore: number): any
  • Create a PlannedPlacementScore scoring function. Returns the value of the planned placement, returns 0.0 if no planned placement Will return 0.0 if placement score is below minPlacementScore. Set minPlacementScore < 0.0 to ignore this minimum filtering.

    Parameters

    • aiPlayer: PlayerID
    • minPlacementScore: number

    Returns any

  • AIProductionScoring_PlayerGatheringUpgrade(aiPlayer: PlayerID, improvementScalingFactor: number, approxDistToDeposit: number): any
  • Create a PlayerGatheringUpgrade scoring function Result is gatheringImprovment * improvementScalingFactor

    Parameters

    • aiPlayer: PlayerID
    • improvementScalingFactor: number
    • approxDistToDeposit: number

    Returns any

  • AIProductionScoring_PlayersOnDifferentIslands(aiPlayer: PlayerID): any
  • Create an AIPlayersOnDifferentIslands scoring function. Returns 1.0 if any players are on different pathfinding islands, 0 if they are all on the same island

    Parameters

    Returns any

  • AIProductionScoring_PopCapGenerator(aiPlayer: PlayerID): any
  • Create a PopCapGenerator scoring function. Returns 1.0 score if the item generates required pop cap

    Parameters

    Returns any

  • AIProductionScoring_PopulationPercentage(aiPlayer: PlayerID, targetPopulationPercentageAlive: number, scoreDropOffFactor: number, groupPopulation: boolean, useSquadPopulation: boolean): any
  • Create a PopulationPercentage scoring function targetPopulationPercentageAlive should be in range 0.0 -> 1.0. Score will approach zero as an item's population (as a percentage of the global population) approaches the target, i.e. score = 1.0f - (currentPercentage / target)^dropOffFactor; The global population is number of squads or structures belonging to the player alive. If groupPopulation == true then all members of the item's Production Group are counted towards the current population to be compared against the global population. if useSquadPopulation == true, number of squads will be used in calculation instead of checking if the item pbg corresponds to a squad or building

    Parameters

    • aiPlayer: PlayerID
    • targetPopulationPercentageAlive: number
    • scoreDropOffFactor: number
    • groupPopulation: boolean
    • useSquadPopulation: boolean

    Returns any

  • AIProductionScoring_PresenceOfEnemyTypes(aiPlayer: PlayerID, weights: number, squadTypes: boolean): any
  • Create a PresenceOfEnemyTypes scoring function Every time a unit type is observed it's weight is added to the return value of this scoring function. if squadTypes == false, then entity types assumed. Max return value is 1.0

    Parameters

    • aiPlayer: PlayerID
    • weights: number
    • squadTypes: boolean

    Returns any

  • AIProductionScoring_PresenceOfMyTypes(aiPlayer: PlayerID, weights: number, squadTypes: boolean): any
  • Create a PresenceOfMyTypes scoring function Every time a unit type is observed it's weight is added to the return value of this scoring function. if squadTypes == false, then entity types assumed. Max return value is 1.0

    Parameters

    • aiPlayer: PlayerID
    • weights: number
    • squadTypes: boolean

    Returns any

  • AIProductionScoring_ProductionQueueContention(aiPlayer: PlayerID, contentionThreshold: number, normalFactor: number): any
  • Create a ProductionQueueContention scoring function. Returns a score of productionQueueContention / normalFactor. productionQueueContention is the number of contentions recorded for the associated item (which is a production building), normalFactor is clamped >= 1

    Parameters

    • aiPlayer: PlayerID
    • contentionThreshold: number
    • normalFactor: number

    Returns any

  • AIProductionScoring_RemainingPersonnelPopCap(aiPlayer: PlayerID, requiredRemainingPop: number): any
  • Create an RemainingPersonnelPopCap scoring function. Returns 1.0f if there is enough remaining personnel pop cap, 0.0f otherwise

    Parameters

    • aiPlayer: PlayerID
    • requiredRemainingPop: number

    Returns any

  • AIProductionScoring_ResourceGeneratorScore(aiPlayer: PlayerID): any
  • Create a ResourceGeneratorScore scoring function. Gives positive score if the item produces required resources

    Parameters

    Returns any

  • AIProductionScoring_ShouldConsiderNaval(aiPlayer: PlayerID): any
  • Create an AIShouldConsiderNaval scoring function. Returns 1.0 if players start on different islands or there are large bodies of water on the map

    Parameters

    Returns any

  • AIProductionScoring_StrategicIntention(aiPlayer: PlayerID, weights: number): any
  • Create a StrategicIntention scoring function Weights table format: { ["weight name"] = weight, } The score is the sum of current intention values * weight, divided by the sum of weights Ex: (currentSiegeIntention* siegeIntentionWeight)/siegeIntentionWeight

    Parameters

    Returns any

  • AIProductionScoring_TierUpgrade(aiPlayer: PlayerID): any
  • Create a TierUpgrade scoring function. Returns 1.0f if the given BuildInfo is a Player Upgrade that unlocks higher tier of existing units

    Parameters

    Returns any

  • AIProductionScoring_TimeToAcquire(aiPlayer: PlayerID, maxTimeSeconds: number, includeTimeToGather: boolean, includeTimeToBuildThis: boolean, includeTimeToBuildRequirements: boolean): any
  • Create a TimeToAcquire scoring function TimeToAcquire returns values between 0 and 1 and penalizes things that need lots of resources or prerequisites to be produced. Score will approach 0.01 as the time to build something approaches maxTimeSeconds. Time to build something is the sum of the time to gather the outstanding resources, time to build the item, and time to build the requirements of the item

    Parameters

    • aiPlayer: PlayerID
    • maxTimeSeconds: number
    • includeTimeToGather: boolean
    • includeTimeToBuildThis: boolean
    • includeTimeToBuildRequirements: boolean

    Returns any

  • AIProductionScoring_TradeRouteExistsScore(aiPlayer: PlayerID, landRoute: boolean): any
  • Create a ResourceDesireVsIncome scoring function. Returns 0.0 if no safe trade routes exist, 1.0 otherwise.

    Parameters

    Returns any

  • AIProductionScoring_UnderCountLimit(aiPlayer: PlayerID, maxAlive: number, maxEverProduced: number, groupPopulation: boolean): any
  • Create a UnderCountLimit scoring function Keeps an item within limits. If groupPopulation == true then all members of the item's Production Group are counted towards the current population to be compared against the limit.

    Parameters

    • aiPlayer: PlayerID
    • maxAlive: number
    • maxEverProduced: number
    • groupPopulation: boolean

    Returns any

  • AISquad_ClearStateModelEnumTableTarget(aiSquad: SquadID, key: string, tableRowIndex: number): any
  • Clears a TargetHandle value in the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • aiSquad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • AISquad_ClearStateModelTarget(aiSquad: SquadID, key: string): any
  • Clears a TargetHandle value in the AISquad's state model corresponding to the given key.

    Parameters

    Returns any

  • returns the best squad target in the sgroup based on the passed tacticTargetPolicy policy is one of: AITacticTargetPreference_None, AITacticTargetPreference_Near,

    Parameters

    Returns any

  • AISquad_FindFilteredCoverCompareCurrent(player: PlayerID, aiSquad: SquadID, maxPathDistanceFromGoal: number, compareToCurrentCover: boolean): any
  • Tries to find cover within a certain radius of a position, traveling a max distance to get there, and possibly comparing against current position's cover. If no cover is found, it returns an invalid position

    Parameters

    • player: PlayerID
    • aiSquad: SquadID
    • maxPathDistanceFromGoal: number
    • compareToCurrentCover: boolean

    Returns any

  • AISquad_FindSafePositionInEncounterLeash(aiSquad: SquadID, maxRadius: number): any
  • returns the safest position for the AISquad in the current encounter leash area

    Parameters

    Returns any

  • AISquad_GetClosestCuttableObstruction(pSquad: SquadID, radius: number): any
  • AISquad_GetClosestObstruction(pSquad: SquadID, radius: number, bFilterAllied: boolean): any
  • Returns the closest obstruction entity to the given squad

    Parameters

    • pSquad: SquadID
    • radius: number
    • bFilterAllied: boolean

    Returns any

  • AISquad_GetClumpFarBound(aiSquad: SquadID, clumpIndex: number, targetFilterFlags: number): any
  • Get the position on the far side of the given clump relative to the given squad.

    Parameters

    • aiSquad: SquadID
    • clumpIndex: number
    • targetFilterFlags: number

    Returns any

  • AISquad_GetCurrentFallBackPosition(aiSquad: SquadID): any
  • AISquad_GetStateModelBool(aiSquad: SquadID, key: string): any
  • Returns a boolean value from the AISquad's state model corresponding to the given key.

    Parameters

    Returns any

  • AISquad_GetStateModelEntityTarget(aiSquad: SquadID, key: string): any
  • Returns an Entity value from the AISquad's state model corresponding to the given key.

    Parameters

    Returns any

  • AISquad_GetStateModelEnumTableBool(aiSquad: SquadID, key: string, tableRowIndex: number): any
  • Returns a boolean value from the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • aiSquad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • AISquad_GetStateModelEnumTableEntityTarget(aiSquad: SquadID, key: string, tableRowIndex: number): any
  • Returns an Entity value from the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • aiSquad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • AISquad_GetStateModelEnumTableFloat(aiSquad: SquadID, key: string, tableRowIndex: number): any
  • Returns a float value from the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • aiSquad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • AISquad_GetStateModelEnumTableInt(aiSquad: SquadID, key: string, tableRowIndex: number): any
  • Returns an integer value from the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • aiSquad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • AISquad_GetStateModelEnumTablePBG(aiSquad: SquadID, key: string, tableRowIndex: number): any
  • Returns a pbg value from the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • aiSquad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • AISquad_GetStateModelEnumTablePlayerTarget(aiSquad: SquadID, key: string, tableRowIndex: number): any
  • Returns a Player value from the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • aiSquad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • AISquad_GetStateModelEnumTableSquadTarget(aiSquad: SquadID, key: string, tableRowIndex: number): any
  • Returns a Squad value from the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • aiSquad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • AISquad_GetStateModelEnumTableVector3f(aiSquad: SquadID, key: string, tableRowIndex: number): any
  • Returns a Vector3f value from the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • aiSquad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • AISquad_GetStateModelFloat(aiSquad: SquadID, key: string): any
  • Returns a float value from the AISquad's state model corresponding to the given key.

    Parameters

    Returns any

  • AISquad_GetStateModelInt(aiSquad: SquadID, key: string): any
  • Returns an integer value from the AISquad's state model corresponding to the given key.

    Parameters

    Returns any

  • AISquad_GetStateModelPBG(aiSquad: SquadID, key: string): any
  • Returns a pbg value from the AISquad's state model corresponding to the given key.

    Parameters

    Returns any

  • AISquad_GetStateModelPlayerTarget(aiSquad: SquadID, key: string): any
  • Returns a Player value from the AISquad's state model corresponding to the given key.

    Parameters

    Returns any

  • AISquad_GetStateModelSquadTarget(aiSquad: SquadID, key: string): any
  • Returns a Squad value from the AISquad's state model corresponding to the given key.

    Parameters

    Returns any

  • AISquad_GetStateModelVector3f(aiSquad: SquadID, key: string): any
  • Returns a Vector3f value from the AISquad's state model corresponding to the given key.

    Parameters

    Returns any

  • AISquad_HasBeenAttacked(pAISquad: SquadID, historyTicks: number): any
  • AISquad_HasFiredWeapon(pAISquad: SquadID, historyTicks: number): any
  • AISquad_HasPathWithinDistance(aiSquad: SquadID, targetPosition: Position, maxDistance: number): any
  • Returns true if a path shorter than maxDistance between the AISquad and the target exists

    Parameters

    Returns any

  • AISquad_SetStateModelBool(aiSquad: SquadID, key: string, value: boolean): void
  • Sets a boolean value in the AISquad's state model corresponding to the given key.

    Parameters

    • aiSquad: SquadID
    • key: string
    • value: boolean

    Returns void

  • AISquad_SetStateModelEntityTarget(aiSquad: SquadID, key: string, value: EntityID): void
  • Sets an Entity TargetHandle value in the AISquad's state model corresponding to the given key.

    Parameters

    Returns void

  • AISquad_SetStateModelEnumTableBool(aiSquad: SquadID, key: string, tableRowIndex: number, value: boolean): void
  • Sets a boolean value in the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • aiSquad: SquadID
    • key: string
    • tableRowIndex: number
    • value: boolean

    Returns void

  • AISquad_SetStateModelEnumTableEntityTarget(aiSquad: SquadID, key: string, tableRowIndex: number, value: EntityID): void
  • Sets an Entity TargetHandle value in the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • AISquad_SetStateModelEnumTableFloat(aiSquad: SquadID, key: string, tableRowIndex: number, value: number): void
  • Sets a float value in the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • aiSquad: SquadID
    • key: string
    • tableRowIndex: number
    • value: number

    Returns void

  • AISquad_SetStateModelEnumTableInt(aiSquad: SquadID, key: string, tableRowIndex: number, value: number): void
  • Sets an integer value in the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • aiSquad: SquadID
    • key: string
    • tableRowIndex: number
    • value: number

    Returns void

  • AISquad_SetStateModelEnumTablePBG(aiSquad: SquadID, key: string, tableRowIndex: number, value: PropertyBagGroup): void
  • Sets a pbg value in the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • AISquad_SetStateModelEnumTablePlayerTarget(aiSquad: SquadID, key: string, tableRowIndex: number, value: PlayerID): void
  • Sets a Player TargetHandle value in the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • AISquad_SetStateModelEnumTableSquadTarget(aiSquad: SquadID, key: string, tableRowIndex: number, value: SquadID): void
  • Sets a Squad TargetHandle value in the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • AISquad_SetStateModelEnumTableVector3f(aiSquad: SquadID, key: string, tableRowIndex: number, value: Position): void
  • Sets a Vector3f value in the AISquad's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • AISquad_SetStateModelFloat(aiSquad: SquadID, key: string, value: number): void
  • Sets a float value in the AISquad's state model corresponding to the given key.

    Parameters

    • aiSquad: SquadID
    • key: string
    • value: number

    Returns void

  • AISquad_SetStateModelInt(aiSquad: SquadID, key: string, value: number): void
  • Sets an integer value in the AISquad's state model corresponding to the given key.

    Parameters

    • aiSquad: SquadID
    • key: string
    • value: number

    Returns void

  • AISquad_SetStateModelPlayerTarget(aiSquad: SquadID, key: string, value: PlayerID): void
  • Sets a Player TargetHandle value in the AISquad's state model corresponding to the given key.

    Parameters

    Returns void

  • AISquad_SetStateModelSquadTarget(aiSquad: SquadID, key: string, value: SquadID): void
  • Sets a Squad TargetHandle value in the AISquad's state model corresponding to the given key.

    Parameters

    Returns void

  • AISquad_SetStateModelVector3f(aiSquad: SquadID, key: string, value: Position): void
  • AISquad_ShouldFallBackOrBraceSelf(pAISquad: SquadID): any
  • Checks if the squad should fall back or brace itself given the current situation.

    Parameters

    Returns any

  • AIStateTree_SpawnRootControllerWithStateModelTunings(pPlayer: PlayerID, openingBranchName: string, keepAlive: boolean, stateModelTuningsScarPBG: ScarAIStateModelTuningsPBG, stateModelSGroupListTunings: SGroupID, stateModelEGroupListTunings: EGroupID, stateModelPositionTargetListTunings: Position, stateModelMarkerTargetListTunings: MarkerID, stateModelEntityTypeListTunings: string, stateModelCoordinatorPBGListTunings: LuaMap, stateModelBoolTunings: boolean, stateModelFloatTunings: number, stateModelIntTunings: number): any
  • On the AIPlayer statetree, spawn a Root Controller with tunings that can be pushed onto the Root Controller's StateModel.

    Parameters

    • pPlayer: PlayerID
    • openingBranchName: string
    • keepAlive: boolean
    • stateModelTuningsScarPBG: ScarAIStateModelTuningsPBG
    • stateModelSGroupListTunings: SGroupID
    • stateModelEGroupListTunings: EGroupID
    • stateModelPositionTargetListTunings: Position
    • stateModelMarkerTargetListTunings: MarkerID
    • stateModelEntityTypeListTunings: string
    • stateModelCoordinatorPBGListTunings: LuaMap
    • stateModelBoolTunings: boolean
    • stateModelFloatTunings: number
    • stateModelIntTunings: number

    Returns any

  • AITactic_AICommandSquadMove(aiSquad: SquadID, target: Position, acceptableProximity: number, reverseMove: boolean): any
  • AITownLifeGoal_AdjustDefaultGoalData(additionalDefaultGoalData: any): any
  • Adjust default goal data for TownLife goals. Sets the default GoalData to the current defaults plus additionalDefaultGoalData; any values specified are used for unspecified encounter TownLife goal values.

    Parameters

    • additionalDefaultGoalData: any

    Returns any

  • AITownLifeGoal_SetDefaultGoalData(defaultGoalData: any): void
  • Set default goal data for TownLife goals. defaultGoalData is cloned; any values specified are used for unspecified encounter TownLife goal values.

    Parameters

    • defaultGoalData: any

    Returns void

  • AITownLifeGoal_SetModifyGoalData(modifyGoalData: any): void
  • Set modify goal data for TownLife goals. modifyGoalData is cloned; values specified via keyname_Multiply are used for the numeric keyname encounter TownLife goal value.

    Parameters

    • modifyGoalData: any

    Returns void

  • AITownLifeGoal_SetOverrideGoalData(overrideGoalData: any): void
  • Set override goal data for TownLife goals. overrideGoalData is cloned; any values specified are used for encounter TownLife goal values.

    Parameters

    • overrideGoalData: any

    Returns void

  • AI_AddHeavyCoverEbpOccupancyOverride(pPlayer: PlayerID, ebp: ScarEntityPBG, occupancyOverride: number): any
  • AI_AddPrefab(player: PlayerID, name: string, behaviourName: string, radius: number, minDifficulty: number, maxDifficulty: number, canReassign: boolean, active: boolean): any
  • Adds a prefab to the AIPrefab system. Target must be set up in a follow up call with returned ID

    Parameters

    • player: PlayerID
    • name: string
    • behaviourName: string
    • radius: number
    • minDifficulty: number
    • maxDifficulty: number
    • canReassign: boolean
    • active: boolean

    Returns any

  • AI_CacheCombatFeatureTrainingData(conflictID: number, playerA: PlayerID, playerB: PlayerID): any
  • AI_CanLoadSquadAndAttackCurrentTarget(entity: EntityID, squad: SquadID, bCheckSquadState: boolean, bOverload: boolean): any
  • Check if the entity can load squad and shoot its target after loading (This function should only be called by AI)

    Parameters

    Returns any

  • AI_CanSquadDecrew(pDriverSquad: SquadID, pDecrewTargetEntity: EntityID): any
  • AI_ClearCombatTrainingCacheEntry(conflictID: number): any
  • Clear a combat entry from the cache, typically done instead of logging it

    Parameters

    • conflictID: number

    Returns any

  • AI_ClearPBGRepairPriority(pPlayer: PlayerID, pbgShortname: string): any
  • This clears the repair priority value for a given squad or building PBG. pbgShortname is the PBG of the squad or building to clear its priority value.

    Parameters

    Returns any

  • AI_CombatFitnessGetDefensiveUpgradesForStructureArchetypeMember(memberPBG: PropertyBagGroup): any
  • AI_CombatFitnessGetHealerPBGs(): any
  • AI_CombatFitnessGetOffensiveUpgradesForStructureArchetypeMember(memberPBG: PropertyBagGroup): any
  • AI_CombatFitnessGetPlayerUpgrades(): any
  • Returns the player upgrades configured in the player upgrade input calculator

    Returns any

  • AI_CombatFitnessGetSquadArchetypeNames(): any
  • AI_CombatFitnessGetSquadArchetypePBGs(archtypeNameStr: string): any
  • Returns squad pbgs for a given archetype (assuming that archetype is composed of squad pbgs)

    Parameters

    • archtypeNameStr: string

    Returns any

  • AI_CombatFitnessGetStructureArchetypePBGs(archtypeNameStr: string): any
  • Returns entity pbgs for a given archetype (assuming that archetype is composed of entity pbgs)

    Parameters

    • archtypeNameStr: string

    Returns any

  • AI_ConvertToSimEntity(pAIEntity: EntityID): any
  • AI_ConvertToSimPlayer(pAIPlayer: PlayerID): any
  • AI_ConvertToSimSquad(pAISquad: SquadID): any
  • AI_CreateAICombatFitnessLogs(): any
  • AI_CreateEncounter(pPlayer: PlayerID, encounterType: number): any
  • Create a new encounter for player EncounterType is one of: AIEncounterType_DefendArea, AIEncounterType_AttackArea, AIEncounterType_Move, AIEncounterType_Ability,

    Parameters

    Returns any

  • AI_DebugAttackEncounterPositionScoringEnable(enable: boolean): any
  • Enables/disables debugging of AI Attack Encounter Encounter Position Scoring

    Parameters

    • enable: boolean

    Returns any

  • AI_DebugAttackEncounterPositionScoringIsEnabled(): any
  • AI_DebugLuaEnable(enable: boolean): any
  • AI_DebugLuaIsEnabled(): any
  • AI_DebugRatingEnable(enable: boolean): any
  • AI_DebugRatingIsEnabled(): any
  • AI_DebugRenderAllTaskChildrenEnable(enable: boolean): any
  • Enables/disables AI Rendering of All Task Children

    Parameters

    • enable: boolean

    Returns any

  • AI_DebugRenderAllTaskChildrenIsEnabled(): any
  • AI_DebugSkirmishForwardDeployEnable(enable: boolean): any
  • Enables/disables AI Skirmish ForwardDeploy Debugging

    Parameters

    • enable: boolean

    Returns any

  • AI_DebugSkirmishForwardDeployIsEnabled(): any
  • AI_DisableAllEconomyOverrides(pPlayer: PlayerID): any
  • AI_DisableAllEncounters(): void
  • AI_DoString(pPlayer: PlayerID, s: string): void
  • AI_Enable(pPlayer: PlayerID, enable: boolean): void
  • AI_EnableAll(enable: boolean): void
  • AI_EnableAllEncounters(): void
  • AI_EnableEconomyOverride(pPlayer: PlayerID, overrideName: string, enable: boolean): any
  • Enable or disable the economy override for the AI player

    Parameters

    • pPlayer: PlayerID
    • overrideName: string
    • enable: boolean

    Returns any

  • AI_FindAISquadByID(pPlayer: PlayerID, UID: number): any
  • AI_FindBestProducibleEntityPBGforEntityTypes(player: PlayerID, entityTypeNames: string): any
  • Find the current best producible Entity PBG corresponding to the specified Entity Types.

    Parameters

    Returns any

  • AI_FindBestProducibleSquadPBGforSquadTypes(player: PlayerID, squadTypeNames: string): any
  • Find the current best producible Squad PBG corresponding to the specified Squad Types.

    Parameters

    Returns any

  • AI_GetActiveEncounters(): any
  • AI_GetAndReserveNextTaskID(player: PlayerID): any
  • Get and reserve the next available AITaskID (which can be used to create an AIEncounter from SCAR).

    Parameters

    Returns any

  • AI_GetAnySquadCombatTarget(pSquad: SquadID): any
  • Returns the current squad target for the given squad (null if no target, or target is non-squad entity)

    Parameters

    Returns any

  • AI_GetDebugAIPlayerID(): any
  • AI_GetDifficulty(pPlayer: PlayerID): number
  • Gets the difficulty level of this AI player Levels can be one of: AD_Easy, AD_Standard, AD_Hard, AD_Hardest

    Parameters

    Returns number

  • AI_GetNumEncounters(): number
  • Returns the number of alive encounters currently managed by the AI manager.

    Returns number

  • AI_GetPersonality(pPlayer: PlayerID): any
  • AI_GetPersonalityLuaFileName(pPlayer: PlayerID): any
  • AI_IsAIPlayer(pPlayer: PlayerID): boolean
  • AI_IsAITargetable(pPlayer: PlayerID): any
  • AI_IsDebugDisplay(pPlayer: PlayerID): any
  • AI_IsEnabled(pPlayer: PlayerID): boolean
  • AI_IsLocalAIPlayer(pPlayer: PlayerID): any
  • AI_IsMatchingDifficulty(difficultyList: any): boolean
  • Returns True if the current AI_Manager difficulty matches any in a given list.

    Parameters

    • difficultyList: any

    Returns boolean

  • AI_IsSquadValid(pSquadAI: SquadID): any
  • AI_LogCombatTrainingData(conflictID: number, playerA: PlayerID, playerB: PlayerID, score: number): any
  • Log the combat input features of all squads owned by two players for a given conflict

    Parameters

    Returns any

  • Takes a target, fallback, or spawnLocation, which can come in many formats, and converts it to a combatArea.

    Parameters

    Returns any

  • AI_OverrideDifficulty(level: number): void
  • Overrides the current difficulty setting (only for the AI Manager). Pass 'nil' to reset to Game_GetSPDifficulty() value

    Parameters

    • level: number

    Returns void

  • AI_PauseCurrentTasks(pPlayer: PlayerID, pause: boolean): any
  • AI_PlayerAddExclusionArea(pPlayer: PlayerID, position: Position, noPathRadius: number, noTargetRadius: number): any
  • AI_PlayerDataDictionarySetBool(player: PlayerID, varName: string, value: boolean): void
  • AI_PlayerDataDictionarySetNumber(player: PlayerID, varName: string, value: number): void
  • AI_PlayerRemoveExclusionArea(pPlayer: PlayerID, position: Position, noPathRadius: number, noTargetRadius: number): any
  • AI_PushPrefabAIIntent(prefabId: UniqueID, player: PlayerID, aiPrefabIntentBagName: string): any
  • Push an ai intent to an existing AIPrefab. Requires an ai_prefab_intent pbg name

    Parameters

    Returns any

  • AI_RemoveAllEncounters(stopAll: boolean): void
  • Clears goals on all encounters, then empties the encounter list. Can also issue a stop command to all units.

    Parameters

    • stopAll: boolean

    Returns void

  • AI_RestoreDefaultPersonalitySettings(pPlayer: PlayerID): any
  • Set Combat Range Policy for the AISquad, overrides the one set at Encounter/task level policy is one of: AICombatRangePolicy_Default, AICombatRangePolicy_Ranged_MinRange, AICombatRangePolicy_Ranged_MaxRange, AICombatRangePolicy_MeleeRange

    Parameters

    Returns void

  • AI_SetAITargetable(pPlayer: PlayerID, targetable: boolean): void
  • Enables or Disables an AI player to be targetable by other AI players.

    Parameters

    Returns void

  • AI_SetDebugDisplay(pPlayer: PlayerID, enable: boolean): void
  • AI_SetDebugLevel(num: any): void
  • Set the level of debug information shown but Ai:Print().

    Parameters

    • num: any

    Returns void

  • AI_SetDefaultEnemyPlayer(player: PlayerID): void
  • AI_SetDifficulty(pPlayer: PlayerID, difficultyLevel: number): void
  • Set the difficulty level of this AI player Levels ca be one of: AD_Easy, AD_Standard, AD_Hard, AD_Hardest

    Parameters

    • pPlayer: PlayerID
    • difficultyLevel: number

    Returns void

  • AI_SetPBGRepairPriority(pPlayer: PlayerID, pbgShortname: string, priorityValue: number): void
  • This sets the repair priority value for a given squad or building PBG. pbgShortname is the PBG of the squad or building to change its priority value. priorityValue must be within range [0, 1], with higher value being more desirable to repair.

    Parameters

    • pPlayer: PlayerID
    • pbgShortname: string
    • priorityValue: number

    Returns void

  • AI_SetPersonality(pPlayer: PlayerID, personalityName: string): void
  • AI_SetPrefabCanReassign(prefabId: UniqueID, player: PlayerID, canReassign: boolean): void
  • AI_SetPrefabTarget_Waypoints(prefabId: UniqueID, player: PlayerID, waypointName: string): void
  • AI_SetResourceIncomeDesire(player: PlayerID, resourceType: number, desiredIncome: number): void
  • Set an AI Player's desired income of specified resource type at specified value. This will affect the AI resource gathering, building construction and production priority in trying to achieve the specified resource income.

    Parameters

    • player: PlayerID
    • resourceType: number
    • desiredIncome: number

    Returns void

  • AI_SquadDataDictionaryClearSquad(squad: SquadID, varName: string): any
  • AI_SquadDataDictionaryGetBool(squad: SquadID, varName: string): any
  • Get a named bool value in the AISquad DataDictionary, returns false if the value doesn't exist

    Parameters

    Returns any

  • AI_SquadDataDictionaryGetNumber(squad: SquadID, varName: string): any
  • Get a named number value in the AISquad DataDictionary, returns 0 if the value doesn't exist

    Parameters

    Returns any

  • AI_SquadDataDictionaryGetSquad(squad: SquadID, varName: string): any
  • Get a named Squad in the AISquad DataDictionary, returns null if the entry doesn't exist

    Parameters

    Returns any

  • AI_SquadDataDictionarySetBool(squad: SquadID, varName: string, value: boolean): void
  • AI_SquadDataDictionarySetNumber(squad: SquadID, varName: string, value: number): void
  • Set a named number value in the AISquad DataDictionary

    Parameters

    • squad: SquadID
    • varName: string
    • value: number

    Returns void

  • AI_SquadDataDictionarySetSquad(squad: SquadID, varName: string, targetSquad: SquadID): void
  • AI_ToggleDebugAIPlayer(): any
  • AI_ToggleDebugData(): void
  • AI_ToggleDebugDisplay(pPlayer: PlayerID): any
  • AI_ToggleDebugPrint(): void
  • AI_UpdateStatics(pPlayer: PlayerID): void
  • Re-updates the AI in regards to all the static objects in the world (if SCAR creates new strategic points dynamically this will need to be called)

    Parameters

    Returns void

  • ActionMarker_SetVisible(name: string, visible: boolean): void
  • Set whether or not an action marker is visible.

    Parameters

    • name: string
    • visible: boolean

    Returns void

  • ActionMarker_StartAction(name: string): any
  • ActionMarker_StopAction(name: string): any
  • Action_AddBattalionToModule_Do(): any
  • Action_AddResources_Do(): any
  • Action_DissolveModuleIntoModule_Do(): any
  • Action_DissolveModule_Do(): any
  • Action_MoveUnits_Do(): any
  • Action_NotifyPlayer_Do(): any
  • Action_SkipNIS(data: any, enable: boolean): undefined
  • Enable or diable a group of abilities for one or more players; useful for hiding glows. data can be a string (ability short name), a table of such strings. To deactivate for a player other than Player 1, pass in a table or tables as such: {player = playerID, abilities = {"name","name"}} Triggers the mission start title card (as long as it is properly defined in mission recipe)

    Parameters

    • data: any
    • enable: boolean

    Returns undefined

  • Action_SpawnBuilding_Do(): any
  • Spawns a new entity at a given location (only once, since many entities don't like overlapping)

    Returns any

  • Action_SpawnUnitsToModule_Do(): any
  • Action_SpawnUnits_Do(): any
  • Actor_PlaySpeech(actor: ActorTable, locID: number, speechbubble?: any, audioCtrlEvent?: string): void
  • Plays a speech event for a given actor WITH a portrait and subtitle If the speech file is not available, a placeholder time will be calculated for the message using the number of words and the message will be displayed for that length of time.\n speechbubble: Who a speech bubble should appear over ingame. Can be a squadID or an SGroup (where it appears over the first guy in the group) \n It can also be a table in the format {sgroup = sg_orkboys, closest_to = sg_gorgutz} where it finds the squad in the group closest to the reference point. It can also be in the format {sbp = SBP.ORKS.ORK_BOY, closest_to = mkr_orkIdol} to find the closest unit of the specified type, and you can also add a player entry to that table to specify which player (default is the local player)\n You can also specify just an SBP, in which case it will play on the first SBP found owned - use this for elite units who may or may not be on the map audioCtrlEvent: is a wwise event name. This parameter is used to apply an effect on the line of speech. Ex. "Comm_on" plays speech through a comm effect. Work with an audio designer to get more effects.

    Parameters

    • actor: ActorTable
    • locID: number
    • Optional speechbubble: any
    • Optional audioCtrlEvent: string

    Returns void

  • Actor_PlaySpeechWithoutPortrait(actor: ActorTable, locID: number, speechbubble?: any, audioCtrlEvent?: string): void
  • Plays a speech event for a given actor WITHOUT a portrait or subtitle. See Actor_PlaySpeech for more details

    Parameters

    • actor: ActorTable
    • locID: number
    • Optional speechbubble: any
    • Optional audioCtrlEvent: string

    Returns void

  • AllMarkersFromName(name: string, type: string): any
  • Returns all ScarMarkers from the Mission Editor with the given name. If you don't care about the type, pass in an empty string ( "" ) The type is defined in the markers list of the mission editor when placing markers.\n

    Parameters

    • name: string
    • type: string

    Returns any

  • AllMarkers_FromName(name: string, type: string): any
  • Returns all ScarMarkers from the Scenario Editor with the given name. If you don't care about the type, pass in an empty string ( "" ) The type is defined on the ScarMarkerBlueprint in the Scenario Editor\n

    Parameters

    • name: string
    • type: string

    Returns any

  • AngleToCardinalDirection(angle: number): string
  • Converts an angle in degrees (0-360) to a short string representing a compass heading. 0 degrees is north; 90 degrees is east.

    Parameters

    • angle: number

    Returns string

  • App_ClearMovieModeFramerate(): any
  • App_SetMovieModeFramerate(frameRate: number): void
  • Run the game at specified frame rate (for capturing movies). Only works with 60 or 120, other rates are defaulted to 60. Setting it to 0 disables movie mode

    Parameters

    • frameRate: number

    Returns void

  • AppendString(a: any, b: any): any
  • Predicate testing if a value is of specific type Performs basic type-checking on [value] Makes an assertion. If the assertion turns out to be false, raises an error. e.g. foo = 7; assert(foo ~= nil, 'foo should not be nil!', 'If foo is nil we don't know how many bars to spawn!'') This is intended to be a more scripter friendly version of LUA assert. e.g. foo = 7; std.Validate(foo, 'foo', T_NUMBER, false) e.g. f = std.TypePredicate(); f() => 1; f() => 2 ...

    Parameters

    • a: any
    • b: any

    Returns any

  • Are_Resources_Disabled(): any
  • Are_Resources_Disabled(): any
  • AssignTradecartsToTrade(): any
  • AssignVillagersToBushes(): any
  • AssignVillagersToDeer(): any
  • AssignVillagersToFarms(): any
  • AssignVillagersToFish(): any
  • AssignVillagersToGold(): any
  • AssignVillagersToSheep(): any
  • AssignVillagersToStone(): any
  • AssignVillagersToWood(): any
  • Attack_ConnectSupportModules(): any
  • Support modules may not exist yet, so let's delay this until we've initialized everything

    Returns any

  • Attack_Disband(moduleData: any, OPT_returned_sgroup?: SGroupID): any
  • Stops the Attack module entirely and returns the units it contained

    Parameters

    • moduleData: any
    • Optional OPT_returned_sgroup: SGroupID

    Returns any

  • Attack_FindModuleByEncounterID(): any
  • Attack_GetHighestUnitCount(): any
  • Attack_GetRemainingUnitRatio(): any
  • Returns the units currently in the module as a percentage of the unit count the module started with

    Returns any

  • Attack_GetSGroup(): any
  • Attack_GetUnitChangeFromStart(): any
  • Returns the difference between the current amound of units and the starting unit count

    Returns any

  • Attack_IsDefeated(): any
  • Attack_OnSuccess(): any
  • Callback function that signals to a module that its current encounter is completed

    Returns any

  • Attack_UpdateTargetLocation(attackModule: any, newTarget: string, OPT_attackMove?: boolean): any
  • Updates the target of an Attack module. newTarget can be a Location (either as a String or a LocationTable), or a MarkerID or Position

    Parameters

    • attackModule: any
    • newTarget: string
    • Optional OPT_attackMove: boolean

    Returns any

  • AudioTrigger_Activate(leader: any): any
  • AudioTrigger_CanPlay(leader: any): any
  • Verifies whether an audio trigger can start playing

    Parameters

    • leader: any

    Returns any

  • AudioTrigger_CheckArea(leader: any): any
  • Regularly check an Audio Trigger's conditions and update accordingly

    Parameters

    • leader: any

    Returns any

  • AudioTrigger_CheckConditional(leader: any): any
  • Regularly check an Audio Trigger's conditions and update accordingly

    Parameters

    • leader: any

    Returns any

  • AudioTrigger_Deactivate(leader: any): any
  • AudioTrigger_InitAreaTrigger(bare: any): any
  • Sets up a Leader unit's custom Leader behaviour for use in a campaign mission

    Parameters

    • bare: any

    Returns any

  • AudioTrigger_InitConditionalTrigger(bare: any): any
  • Sets up a Leader unit's custom Leader behaviour for use in a campaign mission

    Parameters

    • bare: any

    Returns any

  • AudioTrigger_Remove(): any
  • BP_GetAIAbilityBlueprint(pbgShortname: string): any
  • BP_GetAIAbilityBlueprintByPbgID(pbgID: number): any
  • BP_GetAIFormationCoordinatorBlueprint(pbgShortname: string): any
  • Returns an AIFormationCoordinator property bag group.

    Parameters

    • pbgShortname: string

    Returns any

  • BP_GetAIFormationCoordinatorBlueprintByPbgID(pbgID: number): any
  • Returns an AIFormationCoordinator property bag group.

    Parameters

    • pbgID: number

    Returns any

  • BP_GetAIFormationTargetPriorityBlueprint(pbgShortname: string): any
  • Returns an AIFormationTargetPriority property bag group.

    Parameters

    • pbgShortname: string

    Returns any

  • BP_GetAIFormationTargetPriorityBlueprintByPbgID(pbgID: number): any
  • Returns an AIFormationTargetPriority property bag group.

    Parameters

    • pbgID: number

    Returns any

  • BP_GetAIStateModelTuningsBlueprint(pbgShortname: string): any
  • Returns an AIStateModelTunings property bag group.

    Parameters

    • pbgShortname: string

    Returns any

  • BP_GetAIStateModelTuningsBlueprintByPbgID(pbgID: number): any
  • Returns an AIStateModelTunings property bag group.

    Parameters

    • pbgID: number

    Returns any

  • BP_GetAbilityBlueprintByPbgID(pbgID: number): any
  • BP_GetEntityBlueprintByPbgID(pbgID: number): any
  • BP_GetEntityBlueprintsWithType(types: any): TableOfEBPs
  • Get a table of all of the EBPs that match a particular EntityType. You can pass in a table of multiple EntityTypes to get a list EBPs that match ANY of the types listed. If you want a blueprint to match a bunch of EntityTypes at the same time (i.e. AND instead of OR) then those types should be listed together in a sub-table. This function can potentially be quite slow as it has to parse every EBP in the game, so be careful about how you use it.

    Parameters

    • types: any

    Returns TableOfEBPs

  • BP_GetEntityChildBlueprintAtIndex(pbgShortname: string, index: number): any
  • Returns the child blueprint of the specified entity blueprint at specified index.

    Parameters

    • pbgShortname: string
    • index: number

    Returns any

  • BP_GetEntityChildBlueprintCount(pbgShortname: string): any
  • Returns the number of child blueprints of the specified entity blueprint.

    Parameters

    • pbgShortname: string

    Returns any

  • BP_GetEntityParentBlueprintAtIndex(pbgShortname: string, index: number): any
  • Returns the parent blueprint of the specified entity blueprint at specified index

    Parameters

    • pbgShortname: string
    • index: number

    Returns any

  • BP_GetEntityParentBlueprintCount(pbgShortname: string): any
  • Returns the number of parent blueprints of the specified entity blueprint.

    Parameters

    • pbgShortname: string

    Returns any

  • BP_GetEntityTypeExtRaceBlueprintAtIndex(pbgShortname: string, index: number): any
  • Returns race blueprint associated with an entity blueprint type_ext at specified index.

    Parameters

    • pbgShortname: string
    • index: number

    Returns any

  • BP_GetEntityTypeExtRaceCount(pbgShortname: string): any
  • Returns the number of race blueprints associated with an entity blueprint type_ext.

    Parameters

    • pbgShortname: string

    Returns any

  • BP_GetMapPoolBlueprint(pbgShortname: string): any
  • BP_GetMapPoolBlueprintByPbgID(pbgID: number): any
  • BP_GetMoveTypeBlueprintByPbgID(pbgID: number): any
  • Return the path name of the group Example name would be "abilities\ally_mad_minute_ability"

    Parameters

    Returns string

  • BP_GetPassTypeBlueprint(pbgShortname: string): any
  • BP_GetPassTypeBlueprintByPbgID(pbgID: number): any
  • BP_GetPropertyBagGroupCount(type: number): number
  • Return the number of property bag groups of the same type Example type would be PBG_Critical

    Parameters

    • type: number

    Returns number

  • BP_GetPropertyBagGroupPathName(type: number, id: number): string
  • Return the path name of the group Example name would be "abilities\ally_mad_minute_ability"

    Parameters

    • type: number
    • id: number

    Returns string

  • BP_GetReticuleBlueprint(pbgShortname: string): any
  • Returns a UIReticuleBag property bag group.

    Parameters

    • pbgShortname: string

    Returns any

  • BP_GetSlotItemBlueprintByPbgID(pbgID: number): any
  • BP_GetSquadBlueprintByPbgID(pbgID: string): any
  • Get a table of all of the SBPs that match a particular SquadType. You can pass in a table of multiple SquadTypes to get a list SBPs that match ANY of the types listed. If you want a blueprint to match a bunch of SquadTypes at the same time (i.e. AND instead of OR) then those types should be listed together in a sub-table. This function can potentially be quite slow as it has to parse every SBP in the game, so be careful about how you use it.

    Parameters

    • types: any

    Returns TableOfSBPs

  • BP_GetSquadChildBlueprintAtIndex(pbgShortname: string, index: number): any
  • Returns the child blueprint of the specified squad blueprint at specified index.

    Parameters

    • pbgShortname: string
    • index: number

    Returns any

  • BP_GetSquadChildBlueprintCount(pbgShortname: string): any
  • Returns the number of child blueprints of the specified squad blueprint.

    Parameters

    • pbgShortname: string

    Returns any

  • BP_GetSquadParentBlueprintAtIndex(pbgShortname: string, index: number): any
  • Returns the parent blueprint of the specified squad blueprint at specified index

    Parameters

    • pbgShortname: string
    • index: number

    Returns any

  • BP_GetSquadParentBlueprintCount(pbgShortname: string): any
  • Returns the number of parent blueprints of the specified squad blueprint.

    Parameters

    • pbgShortname: string

    Returns any

  • BP_GetSquadTypeExtRaceBlueprintAtIndex(pbgShortname: string, index: number): any
  • Returns race blueprint associated with a squad blueprint squad_type_ext at specified index.

    Parameters

    • pbgShortname: string
    • index: number

    Returns any

  • BP_GetSquadTypeExtRaceCount(pbgShortname: string): any
  • Returns the number of race blueprints associated with a squad blueprint squad_type_ext.

    Parameters

    • pbgShortname: string

    Returns any

  • BP_GetUpgradeBlueprintByPbgID(pbgID: number): any
  • BP_GetWeaponBlueprintByPbgID(pbgID: number): any
  • Camera_CatromSplinePanOverTime(var_: any, seconds: number, keepQueue: boolean, controlRotation: boolean): void
  • Queue moving the camera along a spline consisting of entity/marker/pos/egroup/sgroup/squad objects within seconds. The camera will move from the position that was in front of it in the pan queue along the positions provided. Catmull-Rom interpolation between points is used

    Parameters

    • var_: any
    • seconds: number
    • keepQueue: boolean
    • controlRotation: boolean

    Returns void

  • Camera_ClampToMarker(marker: MarkerID): void
  • Camera_CyclePositions(list: any, pan?: boolean, panRate?: number, callback?: any): void
  • Moves the camera through a list of positions.

    Parameters

    • list: any
    • Optional pan: boolean
    • Optional panRate: number
    • Optional callback: any

    Returns void

  • Camera_ExecuteBSplinePan(totalT: number, controlRotation: boolean): any
  • Execute spline pan based on queued control points. Use B-Spline interpolation of points

    Parameters

    • totalT: number
    • controlRotation: boolean

    Returns any

  • Camera_ExecuteCaptureCameraPan(cameraPanTable: StackVarTable): any
  • Executes a camera pan that was captured using the Capture Tool. Expects that the "camera_spline" Camera set was pushed to the CameraSwitchboard, using Camera_Push("camera_spline") Returns the duration of the spline, so that the user can call Camera_Pop()

    Parameters

    Returns any

  • Camera_ExecuteCatromSplinePan(totalT: number, controlRotation: boolean): any
  • Execute spline pan based on queued control points. Use Catmull-Rom interpolation of points

    Parameters

    • totalT: number
    • controlRotation: boolean

    Returns any

  • Camera_ExecuteLinearSplinePan(totalT: number, controlRotation: boolean): any
  • Execute spline pan based on queued control points. Use linear interpolation between points

    Parameters

    • totalT: number
    • controlRotation: boolean

    Returns any

  • Camera_FocusOnPosition(pos: Position, bPan: boolean): void
  • Camera would move to the specified position. bPan is a boolean flag that pans the camera if set to true

    Parameters

    Returns void

  • Camera_Follow(var_: any): void
  • Set the camera to follow an sgroup/squad/egroup/entity. The camera will follow them until the player takes control again.

    Parameters

    • var_: any

    Returns void

  • Camera_FollowEntity(entity: EntityID): void
  • Camera_FollowSelection(): void
  • Camera_FollowSquad(pSquad: SquadID): void
  • Camera_GetCurrentPos(): any
  • Get the current position for the camera. (Where the the camera currently is.)

    Returns any

  • Camera_GetCurrentTargetPos(): any
  • Get the current target position for the camera. (Where the the camera currently is.)

    Returns any

  • Camera_GetDeclination(): number
  • Camera_GetDefaultOrbit(): any
  • Camera_GetOrbit(): number
  • Camera_GetPivot(): any
  • Get the pivot of the camera. (The position about which the camera is pivoting). For autodeclinate camera, this is the lookat position.

    Returns any

  • Camera_GetPos(): any
  • Get the current position for the camera. (Where the the camera currently is.)

    Returns any

  • Camera_GetZoomDist(): number
  • Camera_HideMesh(): any
  • Camera_IsInputEnabled(): boolean
  • Camera_IsMeshShown(): any
  • Camera_LinearSplinePanOverTime(var_: any, seconds: number, keepQueue: boolean, controlRotation: boolean): void
  • Queue moving the camera along a spline consisting of entity/marker/pos/egroup/sgroup/squad objects within seconds. The camera will move from the position that was in front of it in the pan queue along the positions provided. Linear interpolation between points is used

    Parameters

    • var_: any
    • seconds: number
    • keepQueue: boolean
    • controlRotation: boolean

    Returns void

  • Camera_MoveTo(var_: any, pan: boolean, panRate: number, keepInputLocked: boolean, resetToDefault: boolean): void
  • Move the camera to an entity/marker/pos/egroup/sgroup/squad at a given speed

    Parameters

    • var_: any
    • pan: boolean
    • panRate: number
    • keepInputLocked: boolean
    • resetToDefault: boolean

    Returns void

  • Camera_MoveToIfClose(var_: any): void
  • Slightly refocus the camera to rest on an entity/squad/squad/sgroup/egroup/pos/marker if it's close by. This function can be called through a CTRL object in NISlets.

    Parameters

    • var_: any

    Returns void

  • Camera_PanOverTimeRelative(delta: Position, seconds: number, keepQueue: boolean): void
  • Queue moving the camera a certain distance from the position of the camera in a specified amount of time. The position used is the position the camera will be in after completing the movement(s) queued in front.

    Parameters

    • delta: Position
    • seconds: number
    • keepQueue: boolean

    Returns void

  • Camera_PanOverTimeTo(var_: any, seconds: number, keepQueue: boolean): void
  • Queue moving the camera to an entity/marker/pos/egroup/sgroup/squad within seconds. The camera will move from the position that was in front of it in the queue.

    Parameters

    • var_: any
    • seconds: number
    • keepQueue: boolean

    Returns void

  • Camera_QueueRelativeSplinePanPos(deltaPos: Position): any
  • Queue a spline control point by position relative to the last queued position. Pan is deferred until requested by an execution function

    Parameters

    Returns any

  • Camera_QueueSplinePanPos(pos: Position): any
  • Queue a spline control point by absolute position. Pan is deferred until requested by an execution function

    Parameters

    Returns any

  • Camera_ResetFocus(): void
  • Camera_ResetOrbit(): any
  • Set the current camera orbit relative to the current orbit (relative rotation).

    Returns any

  • Camera_ResetRotation(): void
  • Camera_ResetToDefault(): void
  • Camera_RotateRelative(angle: number): void
  • Rotate the camera relative to its current rotation in degrees.

    Parameters

    • angle: number

    Returns void

  • Camera_RotateTo(angle: number): void
  • Camera_SetDeclination(dec: number): void
  • Camera_SetDefaultDeclination(declination: number): void
  • Set the default camera declination (tilt).

    Parameters

    • declination: number

    Returns void

  • Camera_SetDefaultOrbit(orbit: number): void
  • Camera_SetDefaultZoomDist(distance: number): void
  • Set the default zoom distance for the camera.

    Parameters

    • distance: number

    Returns void

  • Camera_SetInputEnabled(enabled: boolean): void
  • Camera_SetOrbit(orbit: number): void
  • Camera_SetOrbitRelative(deltaOrbit: number): void
  • Set the current camera orbit relative to the current orbit (relative rotation).

    Parameters

    • deltaOrbit: number

    Returns void

  • Camera_SetZoomDist(distance: number): void
  • Set the current zoom distance for the camera.

    Parameters

    • distance: number

    Returns void

  • Camera_ShowMesh(): any
  • Camera_StartDeltaOrbit(deltaOrbit: number, totalT: number): any
  • Orbit the camera a given number of degrees clockwise from the current orbit position in a given amount of time.

    Parameters

    • deltaOrbit: number
    • totalT: number

    Returns any

  • Camera_StartOrbit(endOrbit: number, totalT: number): any
  • Orbit the camera to an end orbit position from the current orbit position in a given amount of time. Will choose shortest rotational direction.

    Parameters

    • endOrbit: number
    • totalT: number

    Returns any

  • Camera_StartPan(startPos: Position, endPos: Position, totalT: number, zoomDistance: number): any
  • Pan the camera between two positions in a given amount of time. Interpolates the camera to the given zoom.

    Parameters

    Returns any

  • Camera_StartPanTo(endPos: Position, totalT: number, zoomDistance: number): any
  • Pan the camera to a position in a given amount of time from the position in front of the queue.

    Parameters

    • endPos: Position
    • totalT: number
    • zoomDistance: number

    Returns any

  • Camera_StartRelativePan(deltaPos: Position, totalT: number, zoomDistance: number): any
  • Pan the camera by some amount in a given amount of time. This is relative to the position in front of the queue.

    Parameters

    • deltaPos: Position
    • totalT: number
    • zoomDistance: number

    Returns any

  • Camera_StartRelativeZoomDist(deltaZoomDist: number, totalT: number): any
  • Start a transition to a relative zoom distance over a certain amount of time.

    Parameters

    • deltaZoomDist: number
    • totalT: number

    Returns any

  • Camera_StartZoomDist(startZoomDist: number, endZoomDist: number, totalT: number): any
  • Start a transition from one zoom distance to another over a certain amount of time.

    Parameters

    • startZoomDist: number
    • endZoomDist: number
    • totalT: number

    Returns any

  • Camera_StartZoomDistTo(endZoomDist: number, totalT: number): any
  • Start a transition to a zoom distance over a certain amount of time.

    Parameters

    • endZoomDist: number
    • totalT: number

    Returns any

  • Camera_StopPan(): any
  • Camera_ToggleDebugCamera(): any
  • Camera_ToggleMeshShown(show: boolean): any
  • Camera_Unclamp(): void
  • Converts an entity type (or set of types) into a suitable entity blueprint The types listed are used to track down a specific blueprint, and the list can be augmented with information from the provided player if it isn't specified directly (for things like civilization)

    Parameters

    • typeList: any
    • player: PlayerID
    • Optional returnAsTable: boolean

    Returns EntityBlueprint

  • Cardinal_ConvertTypeToSquadBlueprint(typeList: any, player: PlayerID, returnAsTable?: boolean): SquadBlueprint
  • Converts a squad type (or set of types) into a suitable squad blueprint The types listed are used to track down a specific blueprint, and the list can be augmented with information from the provided player if it isn't specified directly (for things like civilization)

    Parameters

    • typeList: any
    • player: PlayerID
    • Optional returnAsTable: boolean

    Returns SquadBlueprint

  • CheatMenu_RegisterCheatFunction(cheatFunction: any, title: string, OPT_restartMission?: boolean): any
  • CheatMenu_RegisterCheatFunction(cheat_function: any, title: string): any
  • Adds a function to the Mission Cheat menu, under the title you provide. These should be registered in the Mission_Preset function. If the restartMission flag is set, when the cheat is activated the mission will be restarted. Most of the startup script happens as normal: Mission_SetupVariables, Mission_SetDifficulty, Mission_SetupRestrictions and Mission_Preset are all called as normal, but the supplied function is called INSTEAD OF the regular Mission_Start function.

    Parameters

    • cheatFunction: any
    • title: string
    • Optional OPT_restartMission: boolean

    Returns any

  • Adds a function to the Mission Cheat menu, under the title you provide. These should be registered in the Mission_Preset function. When activated, the mission is restarted. Most of the startup script happens as normal: Mission_SetupVariables, Mission_SetDifficulty, Mission_SetupRestrictions and Mission_Preset are all called as normal, but the supplied function is called INSTEAD OF the regular Mission_Start function.

    Parameters

    • cheat_function: any
    • title: string

    Returns any

  • Cheat_GrantAllRibbonsAndMedals(): any
  • Cheat_ResetAchievementProgress(): any
  • Clone(data: any, recursive?: boolean): any
  • Clones a table allowing for unadulterated use of the data. By default this cloning is done recursively, but that can be changed with the optional recursive flag.

    Parameters

    • data: any
    • Optional recursive: boolean

    Returns any

  • Cmd_AbandonTeamWeapon(sgroupid: SGroupID, preserveCrew?: boolean, queued?: boolean): void
  • Order a squad group to abandon their current team weapon if they have it and they could (tuning value in attribute editor)

    Parameters

    • sgroupid: SGroupID
    • Optional preserveCrew: boolean
    • Optional queued: boolean

    Returns void

  • Cmd_AttackMove(sgroup: SGroupID, targetposition: Position, queued?: boolean, plan?: string, coverSearchRadius?: number, deleteWhenNearMarker?: MarkerID, splitCmd?: boolean): void
  • Order a squad group to attack move to a position (anything whose position can be queried). can be queued, can follow a plan, can search for cover within a radius

    Parameters

    • sgroup: SGroupID
    • targetposition: Position
    • Optional queued: boolean
    • Optional plan: string
    • Optional coverSearchRadius: number
    • Optional deleteWhenNearMarker: MarkerID
    • Optional splitCmd: boolean

    Returns void

  • Cmd_AttackMoveThenCapture(attacker: SGroupID, target: EGroupID, queued?: boolean): void
  • Command attacker sgroup to attack move to strategic point target; when it is capturable, the sgroup would capture it

    Parameters

    Returns void

  • Cmd_CaptureTeamWeapon(sgroupid: SGroupID, targetid: EGroupID, queued: boolean): void
  • Orders a squad to contruct a building at specified position, or to continue construction on an existing building. The command also checks to see if a building already exists at the location, and the squad will continue building it, if it is of the correct type.

    Parameters

    Returns void

  • Cmd_DetonateDemolitions(player: PlayerID, target: EGroupID, queued?: boolean): void
  • Cmd_EjectOccupants(fromgroupid: EGroupID, OPT_destination?: Position, OPT_queued?: boolean): any
  • Orders an EGroup or SGroup to kick out its occupants. If no position is specified, the occupants stay at the exit.

    Parameters

    • fromgroupid: EGroupID
    • Optional OPT_destination: Position
    • Optional OPT_queued: boolean

    Returns any

  • Cmd_FormationStop(sgroup: SGroupID): void
  • Order a squad group to load at a random entity or squad of the group overload is a flag that will allow the hold entity to ignore maximum slot check

    Parameters

    • fromsgroupid: SGroupID
    • togroupid: SGroupID | EGroupID
    • Optional overload: boolean
    • Optional queued: boolean
    • Optional instant: boolean

    Returns EntityID

  • Cmd_HoldPosition(sgroup: SGroupID, OPT_location?: boolean, OPT_queued?: boolean): any
  • Order a squad group to hold position at a given location (or just it's current location) The location parameter can be a position (to hold position at that location), or a Boolean to enable/disable HoldPosition at the current location. If it's omitted entirely, it defaults to true.

    Parameters

    • sgroup: SGroupID
    • Optional OPT_location: boolean
    • Optional OPT_queued: boolean

    Returns any

  • Cmd_InstantReinforceUnit(sgroup: SGroupID, count: number): void
  • Sends a instant reinforce command to all squads in a group. count represents the number of commands to send. Note: This function bypasses pre-reqs, costs and the production queue

    Parameters

    Returns void

  • Cmd_InstantSetupTeamWeapon(sgroupid: SGroupID, queued: boolean): void
  • Sends an instant upgrade command to a player, egroup or sgroup. accepts a single upgrade or table of upgrades.

    Parameters

    Returns void

  • Move a squad group to a given position. Supports facing, 'offset' movement, and can find cover. The sgroup can be deleted when in proximity of a marker (it assumes a proximity of 5 if you forget to set one on the marker)

    Parameters

    Returns void

  • Cmd_MoveAwayFromPos(sgroup: SGroupID, position: Position, radius: number, queued?: boolean): void
  • Move a squad group out of a position to a certain radius All squads in the group will move away from the centre position from its current position

    Parameters

    Returns void

  • Move a squad group to a given position, attack-moving once close enough Squad will move to a position, once they're within 'distance', they will attack-move the rest of the way.

    Parameters

    Returns void

  • Cmd_MoveToThenCapture(attacker: SGroupID, target: EGroupID, queued?: boolean): void
  • Command attacker sgroup to attack move to strategic point target; when it is capturable, the sgroup would capture it

    Parameters

    Returns void

  • Cmd_RecrewVehicle(sgroupid: SGroupID, targetid: EGroupID, OPT_queued?: boolean): any
  • Cmd_ReinforceUnit(sgroup: SGroupID, count: number): void
  • Sends a reinforce command to all squads in a group. count represents the number of commands to send. Note: To reinforce squad bypassing the pre-reqs and costs use Cmd_InstantReinforceUnit.

    Parameters

    Returns void

  • Cmd_Retreat(sgroup: SGroupID, location?: Position, deleteWhenNearMarker?: boolean | Position | MarkerID, queued?: boolean, saveEncounters?: boolean, vulnerableRetreat?: boolean): void
  • Order a squad group to retreat, optionally to a specific location. The sgroup can be deleted when in proximity of a marker (it assumes a proximity of 5 if you forget to set one on the marker) vulnerableRetreat will make retreating squads take more damage

    Parameters

    • sgroup: SGroupID
    • Optional location: Position
    • Optional deleteWhenNearMarker: boolean | Position | MarkerID
    • Optional queued: boolean
    • Optional saveEncounters: boolean
    • Optional vulnerableRetreat: boolean

    Returns void

  • Cmd_RevertOccupiedBuilding(sgroupid: SGroupID, targetid: EGroupID, queued: boolean): void
  • Cmd_SetDemolitions(sgroupid: SGroupID, targetid: EGroupID, skipCostPrereq?: boolean, queued?: boolean): void
  • Orders a squad group to place demolition charges on a building (egroup). Function does nothing if egroup cannot be detonated, or player can't afford the demolitions

    Parameters

    • sgroupid: SGroupID
    • targetid: EGroupID
    • Optional skipCostPrereq: boolean
    • Optional queued: boolean

    Returns void

  • Cmd_SetupTeamWeapon(sgroupid: SGroupID, OPT_queued?: boolean): any
  • Order a squad group to setup their team weapon with animation

    Parameters

    • sgroupid: SGroupID
    • Optional OPT_queued: boolean

    Returns any

  • Cmd_SquadPath(sgroup: SGroupID, pathName: string, bFromClosest: boolean, loop: number, bAttackMove: boolean, pauseTime: number, deleteWhenNearMarker?: MarkerID, queued?: boolean, bMoveForward?: boolean): void
  • Send a command to the squad to follow a path. Can wait at each waypoint. The sgroup can be deleted when in proximity of a marker if you pass in the marker as the 7th argument (it assumes a proximity of 5 if you forget to set one on the marker) loop can be: LOOP_NONE, LOOP_NORMAL, LOOP_TOGGLE_DIRECTION

    Parameters

    • sgroup: SGroupID
    • pathName: string
    • bFromClosest: boolean
    • loop: number
    • bAttackMove: boolean
    • pauseTime: number
    • Optional deleteWhenNearMarker: MarkerID
    • Optional queued: boolean
    • Optional bMoveForward: boolean

    Returns void

  • Causes a squad to patrol a marker attacking any enemies that come within its radius. If used on circular markers, the radius must be at least 5. To stop the squad from patrolling the marker, use Cmd_Stop.

    Parameters

    Returns void

  • Cmd_StaggeredRetreat(sgroup: SGroupID, markers: any, maxTries?: number, vulnerableRetreat?: boolean): void
  • Retreats large numbers of units in a staggered, realistic manner. vulnerableRetreat will make retreating squads take more damage Each Squad in the sgroup will have a 1 in 3 chance to retreat. After 10 seconds (or maxTries), all squads will be forced to retreat. Squads will delete on arrival at their retreat point.

    Parameters

    • sgroup: SGroupID
    • markers: any
    • Optional maxTries: number
    • Optional vulnerableRetreat: boolean

    Returns void

  • Cmd_StopSquadsExcept(sgroup1: SGroupID, stopCapture?: boolean, stopBuild?: boolean): void
  • Pass in a group to command to 'stop'. Pass in booleans for capturing and building

    Parameters

    • sgroup1: SGroupID
    • Optional stopCapture: boolean
    • Optional stopBuild: boolean

    Returns void

  • Cmd_Surrender(sgroupid: SGROUP, actionpoints?: number, exitpos?: Position, deleteAtExit?: boolean, removeWeapon?: boolean): void
  • Orders a squad to surrender and awards the local player with an appropriate number of action points The command will also overwrite the exit position as well, if you do not want the squads to exit at the map entry point. Use the optional parameter to assign action points to override the default number. The function automatically addresses squads that are in buildings or vehicles by ordering them out of the vehicle.

    Parameters

    • sgroupid: SGROUP
    • Optional actionpoints: number
    • Optional exitpos: Position
    • Optional deleteAtExit: boolean
    • Optional removeWeapon: boolean

    Returns void

  • Cmd_UngarrisonSquad(sgroupid: SGroupID, destination?: Position, queued?: boolean): void
  • Orders an sgroup to exit the building or vehicle that it's in. If no position is specified, the sgroup stays at the exit.

    Parameters

    Returns void

  • Sends an upgrade command to a player, egroup or sgroup. accepts a single upgrade or table of upgrades.

    Parameters

    Returns void

  • CombatTest_BasicBuildingDamage(): any
  • CombatTest_BasicDamage(): any
  • CombatTest_DealDamage(): any
  • CombatTest_EntityTakeDamage(): any
  • Test whether blueprint_name (entity/building) can be killed by a trebuchet

    Returns any

  • CombatTest_NavalDealDamage(): any
  • Test whether blueprint_name (squad) can kill a villager. This test works better for naval attackers

    Returns any

  • CombatTest_NavalTakeDamage(): any
  • Test whether blueprint_name (squad) can be killed by a combat unit. This test is specifically adjusted for naval units.

    Returns any

  • CombatTest_TakeDamage(): any
  • Command_PlayerBroadcastMessage(player: PlayerID, dest: PlayerID, messageType: number, message: string): any
  • Condition_BuildingsSpotted_Check(): any
  • Returns true if a given player has spotted a given set of buildings, either any or all

    Returns any

  • Condition_EGroupEmpty_Check(condition: any, context: any): TRUE
  • Condition_HasUnits_Check(): any
  • Checks whether a player has a certain number of units, optionally of a certain type

    Returns any

  • Condition_TaggedUnitAtLocation_Check(condition: any, context: any): TRUE
  • Checks if a unit with the condition's tag is at the given marker

    Parameters

    • condition: any
    • context: any

    Returns TRUE

  • Condition_UnitAtLocation_Check(condition: any, context: any): TRUE
  • Checks if all units belonging to a player are close enough to a given marker

    Parameters

    • condition: any
    • context: any

    Returns TRUE

  • Core_AddPlayerToTeam(player: PlayerID, teams_table: Team): void
  • Has a player join a specific team Will remove the player from his previous team. If you pass in nil for newTeam, will add to a new empty team

    Parameters

    Returns void

  • Core_Compare(value1: number, value2: number, comparator: Comparison): boolean
  • Core_GetActiveTeamCount(): number
  • Core_GetPlayersTableEntryFromIndex(playerIndex: number): Players_table
  • Core_GetTeamsEntryFromIndex(index: number): Teams_table
  • Returns the entry in the Teams table that corresponds to the given teamIndex. NOTE: Use the teams table's .id entry - not the actual index of the table.

    Parameters

    • index: number

    Returns Teams_table

  • Core_IsModuleRegistered(name: string): boolean
  • Returns true if a module is registered for delegate invocation, false if delegate invocation is disabled, nil if module not in module registry.

    Parameters

    • name: string

    Returns boolean

  • Core_IsPlayerEliminated(player: PlayerID): boolean
  • Core_IsPlayerOnPlayerTeam(playerID1: any, playerID2: any): boolean
  • Returns true if the two given players are on the same team.

    Parameters

    • playerID1: any
    • playerID2: any

    Returns boolean

  • Core_IsPlayersTableEntryValid(player: PlayerID): boolean
  • Core_IsTeamEliminated(teams_table: Team): boolean
  • Returns true if a team is eliminated from the game. A team is considered eliminated when all of its players are eliminated.

    Parameters

    Returns boolean

  • Core_IsTeamsEntryIndexValid(index: number): boolean
  • Returns true if teamIndex is a valid index in the Teams table. NOTE: Use the teams table's .id entry - not the actual index of the table.

    Parameters

    • index: number

    Returns boolean

  • Core_OnGameOver(): void
  • Call this function to notify other modules (via their ***_OnGameOver() callback) that the match is about to end. Modules typically implement this for cleanup purposes (i.e. remove rules and UI elements) prior to the match end UI.

    Returns void

  • Core_RegisterModule(name: string): any
  • Registers a script module for delegate invocation. The name should be the prefix used by all of the delegate functions in this module. This needs to be called in global scope of a module script with the prefix name of that module; use this instead of Scar_AddInit. For example, if you call Core_RegisterModule("MySystem") then any delegate functions in your script such as "MySystem_OnGameSetup" or "MySystem_OnInit" will be called at the appropriate time during the game initialization process (after the Project delegates but before the Mission delegates).

    Parameters

    • name: string

    Returns any

  • Core_RemovePlayerFromPlayersTable(player: PlayerID): void
  • Core_RevealFOWOnEliminationEnabled(): any
  • Core_SetDefaultDefeatPresentation(presentationTable: any): void
  • Sets the default presentation table for defeated players.

    Parameters

    • presentationTable: any

    Returns void

  • Core_SetDefaultVictoriousPresentation(presentationFunction: any): void
  • Sets the default presentation function for victorious players.

    Parameters

    • presentationFunction: any

    Returns void

  • Core_SetMutualPlayerRelationship(player1: PlayerID, player2: PlayerID, relationship: number): void
  • Core_SetMutualRelationship(player: any, player2: any, relationship: Relationship): void
  • Sets the relationship between two entries Valid Relationships: R_NEUTRAL, R_ALLY, R_ENEMY, R_UNDEFINED NOTE: You should generally be setting Team to Team only.

    Parameters

    Returns void

  • Core_SetPlayerDefeated(player: PlayerID, presentationFunction: any, reason: number): void
  • Core_SetPlayerVictorious(player: PlayerID, presentationFunction: any, reason: number): void
  • Core_SetTeamDefeated(teams_table: Team, presentationTable: any): void
  • Core_SetTeamVictorious(teams_table: Team, presentationFunction: any, reason: number): void
  • Sets a team as the match winner.

    Parameters

    • teams_table: Team
    • presentationFunction: any
    • reason: number

    Returns void

  • Core_UnregisterModule(name: string): any
  • Removes a script module from the delegate invocation system. This is usually used for a module to remove itself if it decided it isn't needed (i.e. a game mode that isn't relevant given the map). Please don't have modules removing each other!

    Parameters

    • name: string

    Returns any

  • Core_WinnerlessGameOver(presentationFunction: any, reason: number): void
  • Set the game to a GameOver state without an explicit winner

    Parameters

    • presentationFunction: any
    • reason: number

    Returns void

  • Cursor_Distance(): any
  • Cursor_GetClearWeaponShotHistory(): any
  • Toggle clearing of cursor over entity weapon shot history debug display

    Returns any

  • Cursor_GetDrawWeaponShotHistory(): any
  • Cursor_Info(): any
  • Cursor_WeaponInfo(): any
  • Cursor_WeaponRanges(): any
  • Debug_IgnoreMouseOverCheck(): any
  • Toggles on or off under mouse check. If ignoring mouse check, all entities will have the enabled debug info displayed

    Returns any

  • Debug_ScartypeToString(): any
  • Debug_ScartypeToString(): any
  • Debug_ToggleControlAll(): any
  • Allows the local player to issue commands to any unit regardless of ownership.

    Returns any

  • Debug_ToggleDebugTest(): any
  • Decal_Create(decalName: string, position: Position, xScale: number, yScale: number, zScale: number, rotationDegrees: number, r: number, g: number, b: number, a: number): any
  • Add a decal to the terrain. Returns a unique decal id allow for future removal via Decal_Destroy

    Parameters

    • decalName: string
    • position: Position
    • xScale: number
    • yScale: number
    • zScale: number
    • rotationDegrees: number
    • r: number
    • g: number
    • b: number
    • a: number

    Returns any

  • Decal_Destroy(decalID: number): any
  • Decal_GetInvalidID(): any
  • Get the Decal ID that represents an invalid decal (useful to check if creation failed)

    Returns any

  • Decal_GetNextDecalId(): any
  • Returns the current decal id in use; used in conjunction with Decal_RemoveAllDecalsAfterId

    Returns any

  • Decal_RemoveAllDecalsAfterId(id: number): any
  • Erases all placed decals after id (inclusive); used in conjunction with Decal_GetNextDecalId

    Parameters

    • id: number

    Returns any

  • Defend_AddSGroup(): any
  • Defend_CreateEncounter(): any
  • Defend_Disband(moduleData: any, OPT_returned_sgroup?: SGroupID): any
  • Stops the Defend module entirely, optionally returns the units it contained to an SGroup, which is NOT cleared

    Parameters

    • moduleData: any
    • Optional OPT_returned_sgroup: SGroupID

    Returns any

  • Defend_FindModuleByEncounterID(): any
  • Defend_GetHighestUnitCount(): any
  • Defend_GetRemainingUnitRatio(): any
  • Returns the units currently in the module as a percentage of the unit count the module started with

    Returns any

  • Defend_GetSGroup(): any
  • Defend_GetUnitChangeFromStart(): any
  • Returns the difference between the current amound of units and the starting unit count

    Returns any

  • Defend_Init(): any
  • Defend_IsDefeated(): any
  • Defend_Monitor(): any
  • Defend_RemoveSGroup(moduleData: any, sgroup: SGroupID, OPT_updateComposition?: boolean): any
  • Removes an SGroup from this module's existing SGroup

    Parameters

    • moduleData: any
    • sgroup: SGroupID
    • Optional OPT_updateComposition: boolean

    Returns any

  • Defend_RequestUnits(): any
  • Defend_Stop(): any
  • Defend_UpdateTargetLocation(moduleData: any, newTarget: string): any
  • Updates the target of a Defend module. newTarget can be a Location (either as a String or a LocationTable), or a Marker or Position

    Parameters

    • moduleData: any
    • newTarget: string

    Returns any

  • DisplayAdapterDatabase_CheckBoolOverride(setting: string): any
  • Query the display adapter database for a boolean setting override.

    Parameters

    • setting: string

    Returns any

  • DisplayAdapterDatabase_CheckFloatOverride(setting: string): any
  • Query the display adapter database for a floating-point setting override.

    Parameters

    • setting: string

    Returns any

  • DisplayAdapterDatabase_CheckIntOverride(setting: string): any
  • Query the display adapter database for an integer setting override.

    Parameters

    • setting: string

    Returns any

  • DisplayAdapterDatabase_CheckMinimumDriverVersion(): any
  • Output the installed display adapter driver version, the required version for the current adapter, and whether or not the installed version is equal to or greater than the required one.

    Returns any

  • DisplayAdapterDatabase_CheckUint16Override(setting: string): any
  • Query the display adapter database for a uint16 setting override.

    Parameters

    • setting: string

    Returns any

  • DisplayAdapterDatabase_CheckUint8Override(setting: string): any
  • Query the display adapter database for a uint8 setting override.

    Parameters

    • setting: string

    Returns any

  • DisplayAdapterDatabase_CheckUintOverride(setting: string): any
  • Query the display adapter database for a uint32 setting override.

    Parameters

    • setting: string

    Returns any

  • DisplayAdapterDatabase_GetAdapterFromID(vendor: string, device: string, subsystem: string, revision: string): any
  • Query the display adapter database for information about a specified adapter.

    Parameters

    • vendor: string
    • device: string
    • subsystem: string
    • revision: string

    Returns any

  • DisplayAdapterDatabase_GetAdapterID(): any
  • DisplayAdapterDatabase_GetAdapterMinimumDriverVersion(vendor: string, device: string, subsystem: string, revision: string): any
  • Query the display adapter database for the minimum required driver version for a specified adapter.

    Parameters

    • vendor: string
    • device: string
    • subsystem: string
    • revision: string

    Returns any

  • DisplayAdapterDatabase_GetCurrentAdapterPerformanceClass(): any
  • Query the display adapter database for the performance class of the currently-installed display adapter.

    Returns any

  • DisplayAdapterDatabase_GetDriverInfo(): any
  • Output basic information about the currently installed display adapter driver.

    Returns any

  • DisplayAdapterDatabase_GetPerformanceClass(relativePerformance: number): any
  • Query the display adapter database for the performance class given a relative performance percentage.

    Parameters

    • relativePerformance: number

    Returns any

  • DissolveModuleIntoModule(): any
  • EBP_Exists(name: string): boolean
  • Returns true if an entity blueprint exists with the given name.

    Parameters

    • name: string

    Returns boolean

  • EBP_IsOfRace(pbgShortname: string, race: ScarRacePBG): any
  • Appends the entities in one group to another group. All entities from 'grouptoadd' will be added to 'group'. If 'group' already contains an entity from 'grouptoadd' it will not be added. This function does not clear the contents of 'grouptoadd'. Example: Add group2 (0, 10, 11, 22) to group1 (1, 11, 20) --> group1 would now be (1, 11, 20, 0, 10, 22)

    Parameters

    Returns void

  • EGroup_CallEntityFunction(egroup: EGroupID, entityFunction: any, list: any): void
  • Calls an Entity_ function on every entity in an egroup The first parameter of the supplied function must be EntityID

    Parameters

    • egroup: EGroupID
    • entityFunction: any
    • list: any

    Returns void

  • EGroup_CallEntityFunctionAllOrAny(egroup: EGroupID, all: boolean, entityFunction: any, list: any): void
  • Returns whether ALL or ANY entities in an egroup satisfy a condition, using an Entity_ function to perform the query on each entity The first parameter of the supplied function must be EntityID

    Parameters

    • egroup: EGroupID
    • all: boolean
    • entityFunction: any
    • list: any

    Returns void

  • EGroup_CanSeeEGroup(egroup: EGroupID, targetegroup: EGroupID, all: boolean): boolean
  • Returns true if ALL or ANY entities in a group can see ALL or ANY entities in a given egroup.

    Parameters

    Returns boolean

  • EGroup_CanSeeSGroup(egroup: EGroupID, targetsgroup: SGroupID, all: boolean): boolean
  • Returns true if ALL or ANY entities in a group can see ALL or ANY squads in a given sgroup.

    Parameters

    Returns boolean

  • EGroup_CompleteUpgrade(egroup: EGroupID, upgrade: number): any
  • EGroup_ContainsBlueprints(egroup: EGroupID, blueprint: any, all: boolean): boolean
  • EGroup_ContainsEGroup(egroup1: EGroupID, egroup2: EGroupID, all: boolean): boolean
  • EGroup_CountAlive(egroup: EGroupID): number
  • EGroup_CountBlueprints(sgroup: EGroupID, ebp: any): number
  • Returns the total count of all entities in a given EGroup with the provided blueprint

    Parameters

    Returns number

  • EGroup_CountDeSpawned(egroup: EGroupID): number
  • EGroup_CountSpawned(egroup: EGroupID): number
  • Returns a new entity group with the given name. Entity groups are used for buildings and objects such as rocks and trees. If you need to issue orders to a group vehicles or units you must use a SquadGroupObs.

    Parameters

    • name: string

    Returns EGroupID

  • EGroup_CreateIfNotFound(egroupname: string): EGroupID
  • Find a entity group from name. Creates a new one with given name if it doesnt exist.

    Parameters

    • egroupname: string

    Returns EGroupID

  • EGroup_CreateKickerMessage(group: EGroupID, textid: string): void
  • Create and display kicker message on the each entity in the egroup to the player

    Parameters

    Returns void

  • EGroup_CreateTable(format: string, size: number): any
  • Returns a table of egroups NOT in the world builder See Marker_GetTable for more info on format parameter

    Parameters

    • format: string
    • size: number

    Returns any

  • EGroup_CreateUnique(prefix?: string): EGroup
  • Returns an EGroup with a unique name, prefixed by the 'prefix' parameter.

    Parameters

    • Optional prefix: string

    Returns EGroup

  • EGroup_CreateUniqueWithPrefix(prefix: string): any
  • Returns a new entity group with an autogenerated unique name, optionally prefixed by the string passed in. Use this if you want to create a new EGroup but don't necessarily care about the name.\n Entity groups are used for buildings and objects such as rocks and trees.\n

    Parameters

    • prefix: string

    Returns any

  • EGroup_DestroyAllEntities(egroup: EGroupID): void
  • Destroys all spawned and despawned entities in a group.

    extdesc

    Be careful not to confuse this with EGroup_Destroy which destroys the group and NOT the items it contains. This function will destroy spawned and despawned items in a group

    Parameters

    Returns void

  • Duplicates an EGroup. Creates a copy of egroup1 in egroup2. The function will clear egroup2 beforehand if necessary.

    Parameters

    Returns void

  • EGroup_EnableMinimapIndicator(egroup: EGroupID, enable: boolean): void
  • EGroup_EnableUIDecorator(group: SGroupID, enable: boolean, enableSelection: boolean): void
  • Enable or disable decorators on all entities in the egroup. Sets selection visuals as well unless enableSelection is specified.

    Parameters

    • group: SGroupID
    • enable: boolean
    • enableSelection: boolean

    Returns void

  • EGroup_Exists(name: string): boolean
  • Returns true if the entity group with the given name exists

    Parameters

    • name: string

    Returns boolean

  • EGroup_Filter(egroup: EGroupID, blueprint: any, filtertype: number, splitGroup?: EGroupID): void
  • Filters an EGroup by blueprint or type.

    extdesc

    Blueprints can be provided by name or by ID, and in a table if you want to filter on more than one type. Setting filtertype to FILTER_KEEP results in the group only containing entities of the types listed in the blueprint table. Setting filtertype to FILTER_REMOVE will strip those same entities out and leave those that aren't of the types listed.

    Parameters

    Returns void

  • EGroup_FilterCamouflaged(sgroup: EGroupID, filtertype: number, splitEGroup?: EGroupID): void
  • Filters an EGroup to either FILTER_REMOVE or FILTER_KEEP entities that are currently camouflaged (stealthed included)

    extdesc

    Parameters

    Returns void

  • EGroup_FilterOnScreen(egroup: EGroupID, percent: number, filtertype: number): void
  • Filters an EGroup by whether units are on screen or not. Percent refers to the screen area you are considering (0.8 is a good value to use - it won't include things that are right at the screen edge). Setting filtertype to FILTER_KEEP results in the group only containing those entities that are on screen.

    Parameters

    • egroup: EGroupID
    • percent: number
    • filtertype: number

    Returns void

  • EGroup_FilterUnderConstruction(egroup: EGroupID, filtertype: number): void
  • Filters an EGroup by construction status. Set the filtertype to FILTER_REMOVE to remove buildings under construction. Setting filtertype to FILTER_KEEP results in the group only containing those entities that are in the process of being built.

    Parameters

    Returns void

  • Call a lua function for each item in a group. Function will recieve (groupid, itemindex, itemid) and should return true to break or false to continue. function Rule_Test( )  local DespawnEntity = function( egroupid, itemindex, entityID )   Entity_Despawn( entityID )  end  EGroup_ForEach( EGroup_FromName("eg_PlayersHQ"), DespawnEntity ) end Note: This function iterates over SPAWNED ENTITIES ONLY.

    Parameters

    Returns boolean

  • Call a lua function for each item in a group. Function will recieve (groupid, itemindex, itemid) and should return a bool. Only use this to TEST conditions on entities. DO NOT use this to perform operations on all entities, since it may not call your function on all entities (due to short circuit evaluation). This is used for checking if ALL or ANY items in a group match a given predicate. (eg. Are all items in a group choas marines) Note: This function iterates over SPAWNED ENTITIES ONLY.

    Parameters

    Returns boolean

  • EGroup_ForEachAllOrAnyEx(egroup: EGroupID, all: boolean, f: LuaBinding, spawned: boolean, despawned: boolean): boolean
  • Same as EGroup_ForEachAllOrAny except you have a choice to iterate over spawned entities, despawned entities, or both.

    Parameters

    Returns boolean

  • EGroup_ForEachEx(egroup: EGroupID, f: LuaBinding, spawned: boolean, despawned: boolean): boolean
  • Same as EGroup_ForEach except you have a choice to iterate over spawned entities, despawned entities, or both.

    Parameters

    Returns boolean

  • EGroup_GetAvgHealth(egroup: EGroupID): number
  • Returns the average health ratio of all units in a entity group. This uses the "proper" measure of health for panel buildings, so should accurately reflect what the user sees.

    Parameters

    Returns number

  • Returns the despawned entity at the given index. Use EGroup_GetSpawnedEntityAt if you want the spawned items in the group Use index 1 to get the first entity in the group. It is an error if index > EGroup_GetCountDeSpawned()

    Parameters

    Returns EntityID

  • EGroup_GetEntityAt(group: EGroupID, int: number): any
  • Returns the entity at the given index. Use EGroup_GetSpawnedEntityAt or EGroup_GetDeSpawnedEntityAt if you want the spawned/despawned items in the group\n Use index 1 to get the first entity in the group.\n It is an error if index > EGroup_GetCount()\n

    Parameters

    Returns any

  • EGroup_GetInvulnerable(egroup: EGroupID, all: boolean): boolean
  • EGroup_GetLastAttacker(EGroupVictim: EGroup, SGroupAttacker: SGROUP): void
  • Gets the last attacker(s) for all the entities in an EGroup Gets the last attacker for all the squads in an SGroup and stores that in SGroupAttacker

    Parameters

    Returns void

  • EGroup_GetName(egroup: EGroupID): string
  • EGroup_GetOffsetPosition(egroup: EGroupID, offset: number, value: number): Position
  • Returns a position (a certain distance away) relative to an entity's current position/orientation. see ScarUtil.scar for explanation of 'offset' parameter

    Parameters

    • egroup: EGroupID
    • offset: number
    • value: number

    Returns Position

  • EGroup_GetSequence(name: string): any
  • Builds a table of EGroupIDs that are named in a sequence. i.e. a name of "eg_building" will find groups "eg_building1", "eg_building2" and so on, up until it looks for a group that isn't there.

    Parameters

    • name: string

    Returns any

  • Returns the spawned entity at the given index. Use EGroup_GetDeSpawnedEntityAt if you want the despawned items in the group Use index 1 to get the first entity in the group. It is an error if index > EGroup_GetCountSpawned()

    Parameters

    Returns EntityID

  • Get the closest entity in an egroup to a given position Get the first spawned entity from egroup that meets the condition (a function that takes an entity)

    Parameters

    Returns EntityID

  • EGroup_GetSpread(egroup: EGroupID): number
  • EGroup_GetTotalHealth(egroup: EGroupID): number
  • Returns the total health of all units in a entity group. This uses the "proper" measure of health for panel buildings, so should accurately reflect what the user sees.

    Parameters

    Returns number

  • EGroup_GetTotalHealthFromCanBeDamagedOnly(egroup: EGroupID): number
  • Returns the total health of all units in a entity group, excluding entities that currently cannot be damaged. This uses the "proper" measure of health for panel buildings, so should accurately reflect what the user sees.

    Parameters

    Returns number

  • EGroup_GetWBTable(format: string): any
  • Returns a table of egroups from the world builder See Marker_GetTable for more info on format parameter

    Parameters

    • format: string

    Returns any

  • EGroup_HasBlueprint(egroup: EGroupID, blueprint: any, all: boolean): boolean
  • Check if ANY or ALL of the entities in a group match the blueprint specified. The blueprint can be a table of blueprints or types (see Entity_HasBlueprint() for details)

    Parameters

    • egroup: EGroupID
    • blueprint: any
    • all: boolean

    Returns boolean

  • EGroup_Hide(egroup: EGroupID, hide: boolean): void
  • Hide or show all entities in an EGroup Bool should be true to hide, false to show

    Parameters

    Returns void

  • EGroup_InstantRevertOccupiedBuilding(egroup: EGroupID): void
  • Performs a group intersection. Only entities that are in both groups will be added to 'group'. The contents of 'grouptointersect' will not be changed. Example: group = (1,2,3,4,5,6) grouptointersect = (2,4,6,8,10) --> group will now equal (2,4,6)

    Parameters

    Returns void

  • EGroup_IsBurning(egroup: EGroupID, ALL: boolean): boolean
  • Checks if ANY or ALL entities in an egroup are on fire (ignition threshold exceeded)

    Parameters

    Returns boolean

  • EGroup_IsCapturedByPlayer(egroup: EGroupID, playerId: PlayerID, all: boolean): boolean
  • Returns true if all or any strategic points in a group have been captured. Use ANY or ALL. This function will ignore all entities that cannot be captured and will return false if no entities in the group can be captured.

    Parameters

    Returns boolean

  • EGroup_IsCapturedByTeam(egroup: EGroupID, teamId: TeamID, all: boolean): boolean
  • Returns true if all or any strategic points in a group have been captured. Use ANY or ALL. This function will ignore all entities that cannot be captured and will return false if no entities in the group can be captured.

    Parameters

    Returns boolean

  • EGroup_IsDoingAttack(egroup: EGroupID, all: boolean, time: number): boolean
  • Returns true if ALL or ANY entities are attacking within the time

    Parameters

    • egroup: EGroupID
    • all: boolean
    • time: number

    Returns boolean

  • EGroup_IsEmpty(egroup: EGroupID): boolean
  • EGroup_IsHoldingAny(egroup: EGroupID): void
  • EGroup_IsInCover(egroup: EGroupID, all: boolean): boolean
  • EGroup_IsMoving(egroupid: EGroupID, all: boolean): boolean
  • EGroup_IsOnScreen(player: PlayerID, group: EGroupID, all: boolean, percent?: number): boolean
  • Returns true if ANY or ALL (use those keywords) of the enities in the group are present onscreen. You can pass in a percentage of the screen to check, so 0.8 would be a centered rectangle occupying 80% of the screen.

    Parameters

    Returns boolean

  • EGroup_IsProducingSquads(egroup: EGroupID, all: boolean): boolean
  • Returns true if ALL or ANY entities in a group are currently producing squads Set all to true to check for ALL or set to false to check for ANY

    Parameters

    Returns boolean

  • EGroup_IsSpawned(egroup: EGroupID, ALL: boolean): boolean
  • Checks if ANY or ALL entities in an group are currently spawned or not.

    Parameters

    Returns boolean

  • EGroup_IsUnderAttack(egroup: EGroupID, all: boolean, time: number): boolean
  • Returns true if ALL or ANY entities are under attack within the time

    Parameters

    • egroup: EGroupID
    • all: boolean
    • time: number

    Returns boolean

  • EGroup_IsUnderAttackByPlayer(group: EGroupID, attackerplayer: PlayerID, duration: number): boolean
  • EGroup_IsUnderAttackFromDirection(egroup: EGroupID, all: boolean, offset: any, time: number): boolean
  • Returns true if ALL or ANY entities are under attack from a direction within the time. see ScarUtil.scar for types of directions. you can pass in a table of offsets

    Parameters

    • egroup: EGroupID
    • all: boolean
    • offset: any
    • time: number

    Returns boolean

  • EGroup_IsUsingAbility(egroup: EGroupID, ALL: boolean): boolean
  • Checks if ANY or ALL squads within an EGroup are using an ability also used for emplacements/entities that are built but function through the use of squads. Does not check WHAT ability a squad is using.

    Parameters

    Returns boolean

  • EGroup_IsValid(egroupID: number): any
  • Check to see if an egroup still exists without needing the name.

    Parameters

    • egroupID: number

    Returns any

  • EGroup_NotifyOnPlayerDemolition(id: EGroupID, function_: any): void
  • Calls a function when any entity in an EGroup gets destroyed by the player clicking the "Detonate me" button

    Parameters

    Returns void

  • EGroup_RemoveDemolitions(egroup: EGroupID): void
  • EGroup_RemoveNonHoldEntities(egroup: EGroupID): any
  • EGroup_RemoveUpgrade(egroup: EGroupID, upgrade: any): void
  • EGroup_RestoreTargetingType(egroup: EGroupID): any
  • Restore the targeting type of the entities in this EGroup to their respective defaults (as found in their EBPs)

    Parameters

    Returns any

  • EGroup_SetAnimatorAction(egroup: EGroupID, actionName: string): void
  • Trigger animation action for an EGroup. Please only use this for simple animations

    Parameters

    Returns void

  • EGroup_SetAnimatorEvent(egroup: EGroupID, eventName: string): void
  • Set animation event for an EGroup. Please only use this for simple animations

    Parameters

    Returns void

  • EGroup_SetAnimatorState(egroup: EGroupID, stateMachineName: string, stateName: string): void
  • Set animation state of a state machine for an EGroup. Please only use this for simple animations

    Parameters

    • egroup: EGroupID
    • stateMachineName: string
    • stateName: string

    Returns void

  • EGroup_SetAnimatorVariable(egroup: EGroupID, variableName: string, value: number): void
  • Set animation variable value for an EGroup. Please only use this for simple animations

    Parameters

    • egroup: EGroupID
    • variableName: string
    • value: number

    Returns void

  • EGroup_SetAutoTargetting(group: EGroupID, hardpoint: string, enable: boolean): void
  • EGroup_SetAvgHealth(egroup: EGroupID, healthPercent: number): number
  • Sets the health of each unit in an entity group to a given percent [0.0, 1.0].

    Parameters

    Returns number

  • EGroup_SetBurnExtEnabled(egroup: EGroupID, enabled: boolean): void
  • EGroup_SetCrushable(egroup: EGroupID, crushable: boolean): void
  • EGroup_SetDemolitions(player: PlayerID, egroupid: EGroupID, numcharges?: number): void
  • EGroup_SetHealthMinCap(egroup: EGroupID, minhealth: number): void
  • Set the minimum health for this entity This is usually set to zero, any higher value prevents the entity from having its health reduced below this given value

    Parameters

    Returns void

  • EGroup_SetInvulnerable(egroup: EGroupID, enabled: boolean, reset_time?: number): void
  • Enable/Disable invulnerablity for an entire entity group. Use true and false for simple on/off, or use a number between 0.0 and 1.0 for more precise control on how much damage an entity can take before it takes no more. The optional reset_time is used to automatically remove invulnerability after a set time. If invulnerable, health damage is disabled.

    Parameters

    • egroup: EGroupID
    • enabled: boolean
    • Optional reset_time: number

    Returns void

  • EGroup_SetOnFire(egroup: EGroupID): void
  • Changes the player owner for all spawned and despawned entities of an EGroup. Strategic/capturable point does not support setting player owner directly

    Parameters

    Returns void

  • Set the rally point for this entity This is usually set to zero, any higher value prevents the entity from having its health reduced below this given value

    Parameters

    Returns void

  • EGroup_SetRecrewable(sgroup: EGroupID, recrewable: boolean): void
  • Sets all entities in an egroup to be recrewable or not when abandoned

    Parameters

    Returns void

  • EGroup_SetSelectable(egroup: EGroupID, selectable: boolean): void
  • EGroup_SetSharedProductionQueue(egroup: EGroupID, enable: boolean): void
  • Enables shared team production on a building (teammates can build using THEIR resources)

    Parameters

    Returns void

  • EGroup_SetStayBurningWhileInvulnerable(egroup: EGroupID, stayBurning: boolean): void
  • Sets whether or not Entities in an EGroup should continue burning while invulnerable

    Parameters

    Returns void

  • EGroup_SetStrategicPointNeutral(egroup: EGroupID): void
  • EGroup_SetWorldOwned(egroup: EGroupID): void
  • Creates an entity group containing a single entity

    extdesc

    Creates an EGroup containing just one entity, creating the group if it doesn't exist and clearing it if it does. It returns the name of the EGroup.

    Parameters

    Returns EGroupID

  • EGroup_SortBasedOnHealth(egroup: EGroupID, ascending: boolean): any
  • Add a squad to an existing SCAR encounter You can also force the encounter to restart if necessary (i.e. it had previously finished)

    Parameters

    Returns any

  • Encounter_Create(player: PlayerID, group: EGroupID, goal: any, OPT_debugName?: string): any
  • Retrieve the goal data from a given encounter This returns the original data as originally passed in. Internally it may have been augmented with default values and/or preprocessed in other ways, but this returns the original.

    Parameters

    Returns any

  • Encounter_Stop(encounter: EncounterTable, OPT_giveStopCommandToUnits?: boolean): any
  • Entity_AdjustAbilityCooldown(entity: EntityID, tickAmount: number): any
  • Entity_BuildCycleList(): any
  • pass in a entity and position to resolve the position into a open space position, if the position is not free, position returned will try to be the closest position near the original position

    Parameters

    Returns any

  • Entity_CanCurrentlyBeDamaged(entity: EntityID): any
  • Entity_CanLoadSGroup(entity: EntityID, loadthis: SGroupID, bCheckSquadState: boolean, bOverload: boolean): boolean
  • Entity_CanLoadSquad(entity: EntityID, squad: SquadID, bCheckSquadState: boolean, bOverload: boolean): boolean
  • Entity_CanTargetEntity(entity: EntityID, target: EntityID, checkFOW: boolean): any
  • Entity_CancelProductionQueueItem(entity: EntityID, index: number): any
  • Cancels an item in a production queue. Index 0 is the currently producing item.

    Parameters

    Returns any

  • Entity_ClearPendingDeathFlag(entity: EntityID): any
  • Clear the pending death flag manually. Should be used when campaign leaders are revived.

    Parameters

    Returns any

  • Entity_ClearPostureSuggestion(entity: EntityID): void
  • Entity_ClearStateModelEnumTableTarget(entity: EntityID, key: string, tableRowIndex: number): any
  • Clears a TargetHandle value in the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    • entity: EntityID
    • key: string
    • tableRowIndex: number

    Returns any

  • Entity_ClearStateModelTarget(entity: EntityID, key: string): any
  • Clears a TargetHandle value in the entity's state model corresponding to the given key.

    Parameters

    Returns any

  • Entity_ClearTagDebug(): any
  • Creates an entity at a given position and assigns it to a given player. 'blueprint' is a string value containing the name of the entity blueprint. This function does not spawn the entity so you will need to call Entity_Spawn to see this entity

    Parameters

    Returns EntityID

  • Creates an entity at a given position and assigns it to a given player. 'blueprint' is a string value containing the name of the entity blueprint. This function spawns the entity so there is no need to call Entity_Spawn

    Parameters

    Returns EntityID

  • Entity_CycleDebug(): any
  • Entity_DisableBuildingDeath(pEntity: EntityID, bDisableDeath: boolean): boolean
  • Disables the death of the given entity building, only works for panel based destructible buldings

    Parameters

    Returns boolean

  • Entity_DisableCancelConstructionCommand(entity: EntityID, disable: boolean): any
  • Forces the cancel construction command to be disabled, meaning you can't cancel construction for this

    Parameters

    Returns any

  • Damages this entity but only if its a destructible building dmgType of 0 is damage accessory, 1 is damage panel, 2 is destroy panel and 3 is destroy radius

    Parameters

    Returns void

  • Entity_DoBurnDamage(entity: EntityID, val: number, ignoreMaxDamagePerSecond: boolean): any
  • Entity_EnableAttention(entity: EntityID, attentive: boolean): void
  • Entity_EnableProductionQueue(entity: EntityID, enable: boolean): void
  • Entity_EnableStrategicPoint(entity: EntityID, enable: boolean): any
  • Entity_ExtensionCount(): any
  • Entity_ForceConstruct(e: EntityID): void
  • Entity_ForceSelfConstruct(e: EntityID): any
  • Entity_FromID(id: number): any
  • Entity_FromWorldID(id: number): EntityID
  • Entity_GetActiveCommand(entity: EntityID): number
  • Returns the active entity command. Some valid entity commands: STATEID_StructureBuilding, STATEID_Dead, STATEID_Idle, STATEID_Pause

    Parameters

    Returns number

  • Find the entity target. If found, the target squad is added to the sgroup. Entity targets like buildings are ignored.

    Parameters

    Returns any

  • Entity_GetAttackTargetEntity(entity: EntityID): any
  • Entity_GetAttackTargetSquad(entity: EntityID): any
  • Entity_GetBuildingProgress(pEntity: EntityID): number
  • Returns the construction progress (with range [0.0, 1.0] for a given entity. Returns 0.0 if the entity is not a building.

    Parameters

    Returns number

  • Entity_GetCoverValue(entity: EntityID): number
  • Get cover safety value from the where the entity is standing. The safety value is number from -.5 to .5. Higher value means better cover. If the entity doesn't have cover_ext, value of 0 would be returned

    Parameters

    Returns number

  • Entity_GetDebugEntity(): any
  • Entity_GetFilledHoldSquadSlots(entity: EntityID): any
  • Entity_GetGameID(entity: EntityID): number
  • Entity_GetHealth(entity: EntityID): number
  • Returns the health of an entity. Health will be zero for entities with no health extension.

    Parameters

    Returns number

  • Entity_GetHealthMax(entity: EntityID): number
  • Returns the max health of an entity. Max health will be zero for entities with no health extension.

    Parameters

    Returns number

  • Entity_GetHealthPercentage(entity: EntityID): number
  • Returns the percentage health, taking into account destructible buildings Health will be zero for entities with no health extension nor building destruction

    Parameters

    Returns number

  • Entity_GetInvulnerable(squad: SquadID): boolean
  • Entity_GetInvulnerableMinCap(entity: EntityID): number
  • Returns the invulnerable point in terms of percentage For buildings, retrieve the percentage value of healthy below which no more panels could be destroyed

    Parameters

    Returns number

  • Entity_GetKillCount(pEntity: EntityID, killType: number): number
  • Get the unit kill count for entities. Possible kill types are VS_Infantry, VS_LightArmor, VS_HeavyArmor, VS_Building

    Parameters

    Returns number

  • Entity_GetLastAttackers(entity: EntityID, group: SGroupID, timeSeconds: number): void
  • Find the squad attackers on this entity from the last seconds specified. If found, the squads are added to the sgroup. Building attackers are ignored

    Parameters

    Returns void

  • Entity_GetLastEntityAttackers(entity: EntityID, group: EGroupID, timeSeconds: number): any
  • Find the entity attackers on this entity from the last seconds specified. The sgroup is cleared, then any squads found are added to the sgroup. Building attackers are ignored.

    Parameters

    Returns any

  • Entity_GetMaxCaptureCrewSize(entity: EntityID): any
  • Entity_GetMaxHoldSquadSlots(entity: EntityID): any
  • Entity_GetMeleeBlocksPerAttacks(entity: EntityID): any
  • Returns the number of blocks the entity will perform per number of attacks For each numAttacks melee attacks the entity receives, it will block a random numBlocks of them. Block rate is numBlocks / numAttacks

    Parameters

    Returns any

  • Entity_GetNumCombatSlots(entity: EntityID, holdTypeName: string): number
  • Returns the number of combat slots in total of a certain hold-able type

    Parameters

    Returns number

  • Entity_GetNumInteractors(entity: EntityID, interactionType: string): any
  • Returns the number of entities connected to an entity via the interaction system. interactionType should match one of the values defined in the interaction_type attribute enum

    Parameters

    Returns any

  • Entity_GetOffsetPosition(entity: EntityID, offset: number, distance: number): Position
  • Returns a position relative to an entity's current position and orientation. see ScarUtil.scar for explanation of 'offset' parameter.

    Parameters

    • entity: EntityID
    • offset: number
    • distance: number

    Returns Position

  • Returns the Player owner of the given entity. Entity MUST NOT be owned by the world. Use World_OwnsEntity to make sure entity is not owned by the world before calling this function

    Parameters

    Returns PlayerID

  • Entity_GetProductionQueueItemType(entity: EntityID, index: number): number
  • Returns the production type (PITEM_Upgrade, PITEM_Spawn, PITEM_SquadUpgrade, PITEM_SquadReinforce, PITEM_PlayerUpgrade) for a production queue item with index.

    Parameters

    Returns number

  • Entity_GetProductionQueueSize(entity: EntityID): number
  • Returns the number of items in the entities production queue. It is an error to call this function on an entity that does not have a production queue. Use Entity_HasProductionQueue to check that the entity has a queue.

    Parameters

    Returns number

  • Entity_GetProjectileBlocksPerAttacks(entity: EntityID): any
  • Returns the number of blocks the entity will perform per number of attacks For each numAttacks projectile attacks the entity receives, it will block a random numBlocks of them. Block rate is numBlocks / numAttacks

    Parameters

    Returns any

  • Entity_GetRangedBlocksPerAttacks(entity: EntityID): any
  • Returns the number of blocks the entity will perform per number of attacks For each numAttacks ranged attacks the entity receives, it will block a random numBlocks of them. Block rate is numBlocks / numAttacks

    Parameters

    Returns any

  • Entity_GetRemainingResourceDepositAmount(entity: EntityID): any
  • Entity_GetSightInnerHeight(entity: EntityID): number
  • Returns the inner sight radius for this entity Radius will be zero for entities without a sight extension

    Parameters

    Returns number

  • Entity_GetSightInnerRadius(entity: EntityID): number
  • Returns the inner sight radius for this entity Radius will be zero for entities without a sight extension

    Parameters

    Returns number

  • Entity_GetSightOuterHeight(entity: EntityID): number
  • Returns the outer sight radius for this entity Radius will be zero for entities without a sight extension

    Parameters

    Returns number

  • Entity_GetSightOuterRadius(entity: EntityID): number
  • Returns the outer sight radius for this entity Radius will be zero for entities without a sight extension

    Parameters

    Returns number

  • Entity_GetStateModelBool(entity: EntityID, key: string): any
  • Returns a boolean value from the entity's state model corresponding to the given key.

    Parameters

    Returns any

  • Entity_GetStateModelEntityTarget(entity: EntityID, key: string): any
  • Returns an Entity value from the entity's state model corresponding to the given key.

    Parameters

    Returns any

  • Entity_GetStateModelEnumTableBool(entity: EntityID, key: string, tableRowIndex: number): any
  • Returns a boolean value from the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    • entity: EntityID
    • key: string
    • tableRowIndex: number

    Returns any

  • Entity_GetStateModelEnumTableEntityTarget(entity: EntityID, key: string, tableRowIndex: number): any
  • Returns an Entity value from the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    • entity: EntityID
    • key: string
    • tableRowIndex: number

    Returns any

  • Entity_GetStateModelEnumTableFloat(entity: EntityID, key: string, tableRowIndex: number): any
  • Returns a float value from the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    • entity: EntityID
    • key: string
    • tableRowIndex: number

    Returns any

  • Entity_GetStateModelEnumTableInt(entity: EntityID, key: string, tableRowIndex: number): any
  • Returns an integer value from the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    • entity: EntityID
    • key: string
    • tableRowIndex: number

    Returns any

  • Entity_GetStateModelEnumTablePlayerTarget(entity: EntityID, key: string, tableRowIndex: number): any
  • Returns a Player value from the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    • entity: EntityID
    • key: string
    • tableRowIndex: number

    Returns any

  • Entity_GetStateModelEnumTableSquadTarget(entity: EntityID, key: string, tableRowIndex: number): any
  • Returns a Squad value from the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    • entity: EntityID
    • key: string
    • tableRowIndex: number

    Returns any

  • Entity_GetStateModelEnumTableVector3f(entity: EntityID, key: string, tableRowIndex: number): any
  • Returns a Vector3f value from the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    • entity: EntityID
    • key: string
    • tableRowIndex: number

    Returns any

  • Entity_GetStateModelFloat(entity: EntityID, key: string): any
  • Returns a float value from the entity's state model corresponding to the given key.

    Parameters

    Returns any

  • Entity_GetStateModelInt(entity: EntityID, key: string): any
  • Returns an integer value from the entity's state model corresponding to the given key.

    Parameters

    Returns any

  • Entity_GetStateModelPlayerTarget(entity: EntityID, key: string): any
  • Returns a Player value from the entity's state model corresponding to the given key.

    Parameters

    Returns any

  • Entity_GetStateModelSquadTarget(entity: EntityID, key: string): any
  • Returns a Squad value from the entity's state model corresponding to the given key.

    Parameters

    Returns any

  • Entity_GetStateModelVector3f(entity: EntityID, key: string): any
  • Returns a Vector3f value from the entity's state model corresponding to the given key.

    Parameters

    Returns any

  • Entity_GetStateTreeTargeting_EntityTarget(entity: EntityID, type: string, key: string): any
  • Returns an Entity value from the entity's StateTree EntityTargetingExt with the given type and key.

    Parameters

    Returns any

  • Entity_GetStateTreeTargeting_PlayerTarget(entity: EntityID, type: string, key: string): any
  • Returns an Player value from the entity's StateTree EntityTargetingExt with the given type and key.

    Parameters

    Returns any

  • Entity_GetStateTreeTargeting_SquadTarget(entity: EntityID, type: string, key: string): any
  • Returns an Squad value from the entity's StateTree EntityTargetingExt with the given type and key.

    Parameters

    Returns any

  • Entity_GetStateTreeTargeting_Vector3f(entity: EntityID, type: string, key: string): any
  • Returns an Vector3f value from the entity's StateTree EntityTargetingExt with the given type and key.

    Parameters

    Returns any

  • Entity_GetStrategicPointSecureCount(entity: EntityID): any
  • Entity_GetTargetingType(entity: EntityID): any
  • Entity_GetTotalPanelCount(pEntity: EntityID): number
  • Gets the total number of panels in a building (returns 0 for anything but panel based destructible buldings)

    Parameters

    Returns number

  • Entity_GetUndestroyedPanelCount(pEntity: EntityID): number
  • Gets the current number of undestroyed panels in a building (returns 0 for anything but panel based destructible buldings)

    Parameters

    Returns number

  • Entity_GetWeaponHardpointCount(entity: EntityID): number
  • Entity_HandleAllAsserts(): any
  • Entity_HasBlueprint(entity: EntityID, blueprints: any): boolean
  • Checks whether an entity is of any of the Blueprints or EntityTypes specified. Blueprint can be a single Blueprint, a single EntityType, or a table of multiple Blueprints or EntityTypes. If you want to see if an entity has ALL of a set of EntityTypes, then wrap them all in a sub-table.

    Parameters

    Returns boolean

  • Entity_HasProductionQueue(entity: EntityID): boolean
  • Entity_InstantConvertBuildingToFieldSupport(building: EntityID, owner: PlayerID): any
  • Entity_InstantRevertOccupiedBuilding(entity: EntityID): void
  • Entity_IsAlive(pEntity: EntityID): number
  • Entity_IsAttacking(entity: EntityID, time: number): boolean
  • Returns true if the entity is attacking within the time Time is in seconds

    Parameters

    Returns boolean

  • Returns true if the given entity is burning (buildings on fire or non-buildings with burn_exts)

    Parameters

    Returns any

  • Entity_IsCamouflaged(entity: EntityID): boolean
  • Entity_IsCapturableBuilding(entity: EntityID): boolean
  • Entity_IsCasualty(entity: EntityID): boolean
  • Entity_IsCuttable(entity: EntityID): any
  • Entity_IsDemolitionReady(entity: EntityID): boolean
  • Returns true if the given blueprint is of the given type. Types are defined in type_ext/unit_type_list

    Parameters

    Returns any

  • Entity_IsHardpointActive(entity: EntityID, hardPointIndex: number): boolean
  • Entity_IsHoldingAny(entity: EntityID): boolean
  • Entity_IsInBackground(pEntity: EntityID): any
  • Entity_IsInCover(entityId: EntityID): boolean
  • Entity_IsInfantry(pEntity: EntityID): any
  • Entity_IsInvulnerable(entity: EntityID): any
  • Entity_IsMoving(pEntity: EntityID): boolean
  • Entity_IsOfType(entity: EntityID, type: string): boolean
  • Determines if this entity is of the given type. Types are defined in type_ext/unit_type_list

    Parameters

    Returns boolean

  • Entity_IsOnWalkableWall(entity: EntityID): any
  • Entity_IsPartOfSquad(pEntity: EntityID): boolean
  • Entity_IsPlannedStructure(entity: EntityID): any
  • Entity_IsProductionQueueAvailable(entity: EntityID): any
  • Entity_IsResourceGenerator(entity: EntityID): any
  • Entity_IsSlotItem(entity: EntityID): any
  • Entity_IsSoldier(pEntity: EntityID): boolean
  • Entity_IsSpawned(entity: EntityID): boolean
  • Entity_IsStartingPosition(entity: EntityID): boolean
  • Entity_IsStrategicPoint(entity: EntityID): boolean
  • Entity_IsSyncWeapon(entity: EntityID): boolean
  • Entity_IsUnderAttack(entity: EntityID, time: number): boolean
  • Entity_IsUnderAttackByPlayer(entity: EntityID, pAttackerOwner: PlayerID, time: number): boolean
  • Entity_IsUnderAttackFromDirection(entity: EntityID, offset: number, timeSeconds: number): boolean
  • Returns true if the entity was under attack from a certain direction (8 offset types, see LuaConsts.scar)

    Parameters

    • entity: EntityID
    • offset: number
    • timeSeconds: number

    Returns boolean

  • Entity_IsUnderRepair(entity: EntityID): any
  • Entity_IsValid(id: number): boolean
  • Check if an entity with the given ID can be found in the world

    Parameters

    • id: number

    Returns boolean

  • Entity_IsVaultable(pEntity: EntityID): any
  • Entity_IsVehicle(pEntity: EntityID): boolean
  • Entity_IsVictoryPoint(pEntity: EntityID): boolean
  • Entity_NotifyOnPlayerDemolition(entity: EntityID, function_: any): void
  • Calls a function when an entity gets destroyed by the player clicking the "Detonate me" button next to an entity.

    Parameters

    Returns void

  • Entity_OverrideCriticalDisplay(entity: EntityID, type: number, override: boolean, on: boolean): void
  • Overrides whether to display a critical or not. types are: CT_VehicleFront, CT_VehicleBack, CT_VehicleLeft, CT_VehicleRight, CT_VehicleEngineGreen, CT_VehicleEngineYellow, CT_VehicleEngineRed, CT_VehiclePrimaryWeapon, CT_VehicleSecondaryWeapon

    Parameters

    • entity: EntityID
    • type: number
    • override: boolean
    • on: boolean

    Returns void

  • Entity_Precache(ebp: ScarEntityPBG, skinItemDefinitionID: number, player: PlayerID, resourceContainerCacheName: string, source: string, id: string): any
  • Precache entity resources and listen for event GE_EntityPrecached that it is done callback example: Rule_AddGlobalEvent(EntityPrecacheComplete, GE_EntityPrecached) Params: ebp - entity blueprint skinID - this is the server item id for a skin, it will precache and equip it player - the player that we want to precache the entity or squad for cacheName - name of cache where resource will be loaded into source - helps identify who requested the precaching id - id to table of data that will be used once entity/squad is loaded

    Parameters

    • ebp: ScarEntityPBG
    • skinItemDefinitionID: number
    • player: PlayerID
    • resourceContainerCacheName: string
    • source: string
    • id: string

    Returns any

  • Entity_RemoveBoobyTraps(pEntityTarget: EntityID): void
  • Entity_RemoveDemolitions(entity: EntityID): void
  • Entity_RequiresSlottedSplineUpdateAfterBlueprintConversion(entity: EntityID): any
  • Returns true if you should call Misc_UpdateSlottedSplinesContainingEGroupAfterBlueprintConversion with an egroup containing this entity after blueprint converting it. Make sure to batch together all your entities when using that function to reduce duplicated work.

    Parameters

    Returns any

  • Entity_ResetMeleeBlocksPerAttacks(entity: EntityID): any
  • Entity_ResetProjectileBlocksPerAttacks(entity: EntityID): any
  • Entity_ResetRangedBlocksPerAttacks(entity: EntityID): any
  • Entity_RestoreTargetingType(entity: EntityID): any
  • Entity_SetAnimatorAction(pEntity: EntityID, actionName: string): void
  • Trigger animation action for an entity. Please only use this for simple animations

    Parameters

    Returns void

  • Entity_SetAnimatorActionParameter(pEntity: EntityID, actionParameterName: string, actionParameterValue: string): void
  • Set animation action parameter for an entity. Please only use this for simple animations

    Parameters

    • pEntity: EntityID
    • actionParameterName: string
    • actionParameterValue: string

    Returns void

  • Entity_SetAnimatorEvent(pEntity: EntityID, eventName: string): void
  • Set animation event for an entity. Please only use this for simple animations

    Parameters

    Returns void

  • Entity_SetAnimatorState(pEntity: EntityID, stateMachineName: string, stateName: string): void
  • Set animation state of a state machine for an entity. Please only use this for simple animations

    Parameters

    • pEntity: EntityID
    • stateMachineName: string
    • stateName: string

    Returns void

  • Entity_SetAnimatorVariable(pEntity: EntityID, variableName: string, value: number): void
  • Set animation variable value for an entity. Please only use this for simple animations

    Parameters

    • pEntity: EntityID
    • variableName: string
    • value: number

    Returns void

  • Entity_SetBackground(pEntity: EntityID, isInBackground: boolean): void
  • Sets the entity to be in the background or foreground. By default, all entities are in the foreground

    Parameters

    • pEntity: EntityID
    • isInBackground: boolean

    Returns void

  • Entity_SetBurnExtEnabled(unit: EntityID | EGroup, enabled: boolean): void
  • Entity_SetCrushable(entity: EntityID, crushable: boolean): void
  • Entity_SetDemolitions(player: PlayerID, entity: EntityID, numcharges: number): boolean
  • Fully wires this entity for demolitions, if it's set up to be demolishable. 'player' is the one that owns the demolitions and can detonate them.

    Parameters

    Returns boolean

  • Entity_SetEnableCasualty(enable: boolean, entity: EntityID): void
  • Entity_SetExtEnabled(entity: EntityID, extID: string, enabled: boolean): void
  • Sets the heading of the entity. The position is currently a lua table with three entries (x, y, z)

    Parameters

    Returns void

  • Entity_SetHeadingGroundSnapOptional(entity: EntityID, pos: Position, bSnapToGround: boolean, bInterpolate: boolean): void
  • Sets the heading of the entity. The position is currently a lua table with three entries (x, y, z)

    Parameters

    Returns void

  • Entity_SetHealth(entity: EntityID, healthPercent: number): void
  • Set the health of an entity. healthPercent must be in the range [0.0, 1.0].

    Parameters

    Returns void

  • Entity_SetInvulnerable(entity: EntityID, enable: boolean, reset_time: number): void
  • Set invulnerability on the entity. Reset time is in seconds. If it it set, the invulnerability will expire after this time.

    Parameters

    • entity: EntityID
    • enable: boolean
    • reset_time: number

    Returns void

  • Entity_SetInvulnerableMinCap(entity: EntityID, minHealthPercentage: number, resetTime: number): void
  • Make an entity invulnerable to physical damage when health is below the minimum health percentage resetTime is the time in seconds that vulnerability will be restored.; zero time for reset time means the buff will last forever

    Parameters

    • entity: EntityID
    • minHealthPercentage: number
    • resetTime: number

    Returns void

  • Entity_SetMeleeBlocksPerAttacks(entity: EntityID, blocks: number, attacks: number): void
  • Set the number of blocks the entity will perform per number of attacks For each numAttacks melee attacks the entity receives, it will block a random numBlocks of them. Block rate is numBlocks / numAttacks

    Parameters

    • entity: EntityID
    • blocks: number
    • attacks: number

    Returns void

  • Entity_SetOnFire(entity: EntityID): void
  • If the entity is at the same cell as desiredPosition, try to set the entity position to it. If the cell is next to impass, set it to the center of the cell.

    Parameters

    Returns void

  • Entity_SetProjectileBlocksPerAttacks(entity: EntityID, blocks: number, attacks: number): void
  • Set the number of blocks the entity will perform per number of attacks For each numAttacks projectile attacks the entity receives, it will block a random numBlocks of them. Block rate is numBlocks / numAttacks

    Parameters

    • entity: EntityID
    • blocks: number
    • attacks: number

    Returns void

  • Entity_SetProjectileCanExplode(projectile: EntityID, canExplode: boolean): void
  • Entity_SetRangedBlocksPerAttacks(entity: EntityID, blocks: number, attacks: number): void
  • Set the number of blocks the entity will perform per number of attacks For each numAttacks ranged attacks the entity receives, it will block a random numBlocks of them. Block rate is numBlocks / numAttacks

    Parameters

    • entity: EntityID
    • blocks: number
    • attacks: number

    Returns void

  • Entity_SetRecrewable(entity: EntityID, capturable: boolean): void
  • Entity_SetRemainingResourceDepositAmount(entity: EntityID, amount: number): void
  • Entity_SetSharedProductionQueue(entity: EntityID, shared: boolean): void
  • Enables shared team production on a building (teammates can build using THEIR resources)

    Parameters

    Returns void

  • Entity_SetShowSilhouette(entity: EntityID, show: boolean): void
  • Entity_SetStateModelBool(entity: EntityID, key: string, value: boolean): void
  • Sets a boolean value in the entity's state model corresponding to the given key.

    Parameters

    • entity: EntityID
    • key: string
    • value: boolean

    Returns void

  • Entity_SetStateModelEntityTarget(entity: EntityID, key: string, value: EntityID): void
  • Entity_SetStateModelEnumTableBool(entity: EntityID, key: string, tableRowIndex: number, value: boolean): void
  • Sets a boolean value in the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    • entity: EntityID
    • key: string
    • tableRowIndex: number
    • value: boolean

    Returns void

  • Entity_SetStateModelEnumTableEntityTarget(entity: EntityID, key: string, tableRowIndex: number, value: EntityID): void
  • Sets an Entity TargetHandle value in the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • Entity_SetStateModelEnumTableFloat(entity: EntityID, key: string, tableRowIndex: number, value: number): void
  • Sets a float value in the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    • entity: EntityID
    • key: string
    • tableRowIndex: number
    • value: number

    Returns void

  • Entity_SetStateModelEnumTableInt(entity: EntityID, key: string, tableRowIndex: number, value: number): void
  • Sets an integer value in the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    • entity: EntityID
    • key: string
    • tableRowIndex: number
    • value: number

    Returns void

  • Entity_SetStateModelEnumTablePlayerTarget(entity: EntityID, key: string, tableRowIndex: number, value: PlayerID): void
  • Sets a Player TargetHandle value in the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • Entity_SetStateModelEnumTableSquadTarget(entity: EntityID, key: string, tableRowIndex: number, value: SquadID): void
  • Sets a Squad TargetHandle value in the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • Entity_SetStateModelEnumTableVector3f(entity: EntityID, key: string, tableRowIndex: number, value: Position): void
  • Sets a Vector3f value in the entity's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • Entity_SetStateModelFloat(entity: EntityID, key: string, value: number): void
  • Sets a float value in the entity's state model corresponding to the given key.

    Parameters

    • entity: EntityID
    • key: string
    • value: number

    Returns void

  • Entity_SetStateModelInt(entity: EntityID, key: string, value: number): void
  • Sets an integer value in the entity's state model corresponding to the given key.

    Parameters

    • entity: EntityID
    • key: string
    • value: number

    Returns void

  • Entity_SetStateModelPlayerTarget(entity: EntityID, key: string, value: PlayerID): void
  • Entity_SetStateModelSquadTarget(entity: EntityID, key: string, value: SquadID): void
  • Entity_SetStateModelVector3f(entity: EntityID, key: string, value: Position): void
  • Entity_SetStayBurningWhileInvulnerable(entity: EntityID, shouldStayBurning: boolean): void
  • Sets a flag that tells a building to keep burning while invulnerable (for atmosphere).

    Parameters

    • entity: EntityID
    • shouldStayBurning: boolean

    Returns void

  • Entity_SetStrategicPointNeutral(entity: EntityID): void
  • Entity_SetStrategicPointReticuleVisible(entity: EntityID, visible: boolean): void
  • Set the allowable methods of targeting this entity Targeting_Automatic: allow auto and manual targeting Targeting_Manual: only allow manual targeting Targeting_None: do not allow targeting

    Parameters

    Returns void

  • Entity_SetWorldOwned(entity: EntityID): void
  • Entity_SimHide(entity: EntityID, hide: boolean): void
  • Entity_SnapToGridAndGround(entity: EntityID, interpolate: boolean): any
  • Entity_SpawnDoNotAddPathfindingAndCollision(entity: EntityID): any
  • Entity_SuggestPosture(entity: EntityID, posture: number, duration: number): void
  • Suggests a posture to an entity, lasting the passed duration Posture of 0 is prone, 1 is kneel/crouch, and 2 is standing. Duration is in seconds, negative means indefinate.

    Parameters

    • entity: EntityID
    • posture: number
    • duration: number

    Returns void

  • Entity_SupportsDemolition(entity: EntityID): boolean
  • Entity_VisHide(pEntity: EntityID, bHide: boolean): void
  • EventCues_CallToAction(text: string, cta_type: string, OPT_onTriggerIntel?: any, OPT_onClickFunction?: any, OPT_pos?: Position | MARKER | Group, OPT_duration?: number, OPT_customImage?: string, OPT_customStinger?: string): any
  • Creates a Call to Action UI event. cta_type can be CTA_ALARM, CTA_CELEBRATE, CTA_UNIQUE_STAKES, or CTA_UNIQUE_CHANGE. onTriggerIntel plays when the Call appears and must be an Intel Event; onClickFunction plays when the Call is clicked and can be a standard function or an Intel Event. Pass in a postition, marker, or group to move the camera when user clicks on CTA

    Parameters

    • text: string
    • cta_type: string
    • Optional OPT_onTriggerIntel: any
    • Optional OPT_onClickFunction: any
    • Optional OPT_pos: Position | MARKER | Group
    • Optional OPT_duration: number
    • Optional OPT_customImage: string
    • Optional OPT_customStinger: string

    Returns any

  • EventCues_ClearCallToAction(): any
  • EventCues_HighPriority(text: string, description: string): any
  • Creates a center screen high priority player cue

    Parameters

    • text: string
    • description: string

    Returns any

  • EventHandler_RelocateGoal(data: any): any
  • Callback helper function for relocate an Encounter goal. Name of parameters: 'encounter'. Example usage: Event_*(EventHandler_ResetGoalRelocation, {encounter = }, ...)

    Parameters

    • data: any

    Returns any

  • EventHandler_ResetGoalRelocation(data: any): any
  • Callback helper function for relocate an Encounter goal to the original location. Name of parameters: 'encounter'. Example usage: Event_*(EventHandler_ResetGoalRelocation, {encounter = }, ...)

    Parameters

    • data: any

    Returns any

  • EventHandler_TriggerEncounterGoal(data: any): any
  • Callback helper function for triggering an Encounter goal. Name of parameters: 'encounter'. Invokes Encounter:TriggerGoal() for data.encounter Example usage: Event_*(EventHandler_TriggerEncounterGoal, {encounter = }, ...)

    Parameters

    • data: any

    Returns any

  • Event_CreateAND(callback: any, data: any, events: any, delay: number): any
  • Creates a Callback Event that triggers when ALL of the specified events are triggered.

    Parameters

    • callback: any
    • data: any
    • events: any
    • delay: number

    Returns any

  • Event_Delay(seconds: number): void
  • Pauses for a given amount of time. This function MUST be called from a CTRL object in NISlet events only! See Event_Start for more information on NISlet events.

    Parameters

    • seconds: number

    Returns void

  • Event_EncounterCanSeePlayerSquads(callback: any, data: any, encounter: SGroupID, player: PlayerID, delay: number): any
  • Callback given callback function with data, when any squad in the encounter can see any squad owned by the player

    Parameters

    Returns any

  • Event_EnterProximity(callback: any, data: any, target: ConstTargetHandle, arequireAll: boolean, location: MARKER, range: number, repeat: boolean, triggerOnEnter: boolean): any
  • Callback given callback function with data when target enters range

    Parameters

    • callback: any
    • data: any
    • target: ConstTargetHandle
    • arequireAll: boolean
    • location: MARKER
    • range: number
    • repeat: boolean
    • triggerOnEnter: boolean

    Returns any

  • Event_ExitProximity(callback: any, data: any, target: ConstTargetHandle, arequireAll: boolean, location: MARKER, range: number, repeat: boolean, triggerOnEnter: boolean): any
  • Callback given callback function with data when target exits range

    Parameters

    • callback: any
    • data: any
    • target: ConstTargetHandle
    • arequireAll: boolean
    • location: MARKER
    • range: number
    • repeat: boolean
    • triggerOnEnter: boolean

    Returns any

  • Event_GroupCount(callback: any, data: any, SGroup: EGroupID, amount: number, repeat: boolean): any
  • Callback given callback function with data, when the amount of objects matches the requested conditions - Note: Does not count team weapons

    Parameters

    • callback: any
    • data: any
    • SGroup: EGroupID
    • amount: number
    • repeat: boolean

    Returns any

  • Event_GroupIsDeadOrRetreating(callback: any, data: any, SGroup: EGroupID, delay: number): any
  • Callback given callback function with data, when group is dead(empty).

    Parameters

    • callback: any
    • data: any
    • SGroup: EGroupID
    • delay: number

    Returns any

  • Event_GroupLeftAlive(callback: any, data: any, SGroup: EGroupID, amount: number, delay: number): any
  • Callback given callback function with data, when the amount of entities left in a group drops below amount.

    Parameters

    • callback: any
    • data: any
    • SGroup: EGroupID
    • amount: number
    • delay: number

    Returns any

  • Event_IsAnyRunning(): boolean
  • Returns true if any standard (non-save) event has been queued to run. TODO: This function name is misleading. We should maybe change it, but this is being called in many mission scripts so we are leaving it for later.

    Returns boolean

  • Event_IsBeingSkipped(): any
  • Event_IsEngaged(callback: any, data: any, attackTime: number, delay: number): any
  • Callback given callback function with data, when group is doing an attack or is under attack in the last attackTime seconds.

    Parameters

    • callback: any
    • data: any
    • attackTime: number
    • delay: number

    Returns any

  • Event_IsOutOfCombat(callback: any, data: any, SGroup: EGroupID, attackTime: number, delay: number): any
  • Callback given callback function with data, when group is out of combat in the last attackTime seconds.

    Parameters

    • callback: any
    • data: any
    • SGroup: EGroupID
    • attackTime: number
    • delay: number

    Returns any

  • Event_IsSelected(callback: any, data: any): any
  • Callback when a target element is selected.

    Parameters

    • callback: any
    • data: any

    Returns any

  • Event_IsUnderAttack(callback: any, data: any, SGroup: SGroupID, EGroup: EGroupID, attackTime: number, player: PlayerID, delay: number): any
  • Callback given callback function with data, when sgroup or egroup are under attack in the last attackTime seconds.

    Parameters

    Returns any

  • Event_PlayerCanSeeElement(callback: any, data: any, team: PlayerID, element: SGroupID): any
  • Event_Proximity(callback: any, data: any, target: ConstTargetHandle, location: MARKER, range: number, delay: number): any
  • Event_SGroupCountMember(callback: any, data: any, group: SGroupID, amount: number, repeat: boolean): any
  • Callback given callback function with data, when the amount of members left in a squad matches the requested conditions

    Parameters

    • callback: any
    • data: any
    • group: SGroupID
    • amount: number
    • repeat: boolean

    Returns any

  • Starts a save event the same way as Event_Start, but automatically sets highest priority and promotes the request up the queue automatically. It waits for the existing event to finish, and does not cancel the existing event. STT_Quick: Saves the game by user request. Name is generated from campaign mission or skirmish preset name. STT_Auto: Campaign only. Saves the game by script request. Name is generated from campaign mission. STT_Standard: Saves the game using the name provided, overwriting if necessary - a suitable filename will be generated - saves to Campaign or Skirmish folder depending on currently running scenario STT_Dev: Saves the game using the filename provided - for development and testing only

    Parameters

    Returns any

  • Starts a save event the same way as Event_Save, but with a filename specified. STT_Quick: Saves the game by user request. Name is generated from campaign mission or skirmish preset name. Supplied filename is ignored. STT_Auto: Campaign only. Saves the game by script request. Name is generated from campaign mission. Supplied filename is ignored. STT_Standard: Saves the game using the name provided, overwriting if necessary - a suitable filename will be generated - saves to Campaign or Skirmish folder depending on currently running scenario STT_Dev: Saves the game using the filename provided - for development and testing only

    Parameters

    Returns any

  • Event_Skip(): void
  • Completes execution of the event immediatley (all calls to Wait() are ignored)

    Returns void

  • Event_Start(eventFunction: any, priority: number): void
  • Starts event. Event will not start until all rules are evaluated for this frame! We allow saving events in multiplayer so please don't put any non-UI events in multiplayer Running events are not saved at all.

    Parameters

    • eventFunction: any
    • priority: number

    Returns void

  • Event_StartEx(eventFunction: any, priority: number, onComplete: any): void
  • Starts an event the same way as Event_Start, but calls a user defined function when the event is over

    Parameters

    • eventFunction: any
    • priority: number
    • onComplete: any

    Returns void

  • Event_WhileInProximity(callback: any, data: any, target: ConstTargetHandle, arequireAll: boolean, location: MARKER, range: number, repeat: boolean, triggerOnEnter: boolean): any
  • Callback given callback function with data when target remains in range (called every interval seconds)

    Parameters

    • callback: any
    • data: any
    • target: ConstTargetHandle
    • arequireAll: boolean
    • location: MARKER
    • range: number
    • repeat: boolean
    • triggerOnEnter: boolean

    Returns any

  • FOW_Blockers(): any
  • FOW_Enable(enable: boolean): void
  • Enables or disables the FOW, including out of bound areas and all entities on the map

    Parameters

    • enable: boolean

    Returns void

  • FOW_ExploreAll(): any
  • Explores entire map for all players. (Careful where this is used. For example, if used before the first tick, a statetree may change an entity's visual on the first tick, so the ghost's visual will not reflect the entity's.)

    Returns any

  • FOW_ForceRevealAllUnblockedAreas(): any
  • Reveal FOW except blockers for all players. Does not create ghosts and ghosts will not be present if undone.

    Returns any

  • FOW_PlayerExploreAll(player: PlayerID): any
  • Explores entire map for one player. (Careful where this is used. For example, if used before the first tick, a statetree may change an entity's visual on the first tick, so the ghost's visual will not reflect the entity's.)

    Parameters

    Returns any

  • FOW_PlayerRevealAll(player: PlayerID): any
  • FOW_PlayerRevealArea(player: PlayerID, pos: Position, radius: number, durationSecs: number): any
  • Reveals a circular area for the given player over a given duration. Pass in a duration of -1 for indefinite duration ( or until unreveal is called on the same position )

    Parameters

    Returns any

  • FOW_PlayerRevealSGroup(player: PlayerID, group: SGroupID, radius: number, durationSecs: number): any
  • Reveals a SGroup in the Fog of War for a player over a given duration. Pass in a duration of -1 for indefinite duration ( until the squads are dead or UnReveal is called )

    Parameters

    Returns any

  • FOW_PlayerUnExploreAll(player: PlayerID): any
  • FOW_PlayerUnRevealAll(player: PlayerID): any
  • FOW_RevealAll(): void
  • FOW_RevealArea(pos: Position, radius: number, durationSecs: number): void
  • Reveals a circular area for all alive players over a given duration. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. Pass in a duration of -1 for indefinite duration ( until unreveal is called )

    Parameters

    • pos: Position
    • radius: number
    • durationSecs: number

    Returns void

  • FOW_RevealEGroup(group: EGroupID, durationSecs: number): void
  • Reveals an entity groups line of sight(LOS) for all alive players over a given duration. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. Pass in a duration of -1 for indefinite duration ( until the entities are dead )

    Parameters

    Returns void

  • FOW_RevealEGroupOnly(group: EGroup, durationSeconds: number): void
  • Reveals an entity group in the FOW for alive players for a duration. Pass in a duration of -1 for an indefinite duration.

    Parameters

    • group: EGroup
    • durationSeconds: number

    Returns void

  • FOW_RevealEntity(entity: EntityID, durationSecs: number): void
  • Reveals an entities line of sight (LOS) for all alive players over a given duration. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. Pass in a duration of -1 for indefinite duration ( until the entity is dead )

    Parameters

    Returns void

  • FOW_RevealMarker(marker: MarkerID, duration: number): void
  • Reveals an area the size of a given markers proximity at that markers position for a given amount of time. Pass in a duration of -1 for indefinite duration. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. This function will reveal the FOW for ALL alive players. This does not work with markers with rectangular proximity type

    Parameters

    Returns void

  • FOW_RevealSGroup(group: SGroupID, durationSecs: number): void
  • Reveals a squad groups line of sight(LOS) for all alive players over a given duration. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. Pass in a duration of -1 for indefinite duration ( until the squads are dead )

    Parameters

    Returns void

  • FOW_RevealSGroupOnly(group: SGROUP, durationSeconds: number): void
  • Reveals a squad group in the FOW for alive players for a duration. Pass in a duration of -1 for an indefinite duration.

    Parameters

    • group: SGROUP
    • durationSeconds: number

    Returns void

  • FOW_RevealSquad(squad: SquadID, durationSecs: number): void
  • Reveals a squads line if sight(LOS) for all alive players over a given duration. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. Pass in a duration of -1 for indefinite duration ( until the entity is dead )

    Parameters

    Returns void

  • FOW_RevealTerritory(player: PlayerID, sectorID: number, durationSecs: number, mustOwn: boolean): void
  • FOW_UIRevealAll(): any
  • Reveal FOW for all players by disabling rendering of FOW without triggering a FOW in the game simulation

    Returns any

  • FOW_UIRevealAllEntities(): any
  • FOW_UIRevealAll_Transition(duration: number): any
  • FOW_UIUnRevealAll(): any
  • FOW_UIUnRevealAllEntities(): any
  • FOW_UIUnRevealAll_Transition(duration: number): any
  • FOW_UnExploreAll(): any
  • FOW_UnRevealAll(): void
  • FOW_UnRevealArea(pos: Position, radius: number): void
  • UnReveals a circular area for all alive players. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA.

    Parameters

    Returns void

  • FOW_UnRevealMarker(marker: MarkerID): void
  • Unreveals an area the size of a given markers proximity at that markers position. YOU SHOULD ONLY CALL THIS ONCE FOR EACH AREA. This does not work with markers with rectangular proximity type

    Parameters

    Returns void

  • FOW_UnRevealTerritory(player: PlayerID, sectorID: number): void
  • FOW_UndoForceRevealAllUnblockedAreas(): any
  • FindDecorableFoodDepositInSight(): EntityID
  • Find a food deposit on screen that has visible UI decorators Returns a food deposit entity and a boolean indicating if the entity itself has visible decorators. If not, the squad has visible decorators.

    Returns EntityID

  • Formation_GetDimensionsAndOffset(sgroup: SGroupID): any
  • Calculate the dimensions and centre offset of a formation for given squads. Returns as a ScarPosition {x = Width, y = Height, z = centre offset along forward (Height) direction}. Returns a zero vector if error.

    Parameters

    Returns any

  • Game_AIControlLocalPlayer(): any
  • Game_DefaultGameRestore(): void
  • Restores various aspects of the single player game after loading a mission from a save game

    Returns void

  • Game_DeleteSaveGameDev(filename: string): any
  • deletes save game(s), even if it is not loadable with the current version of the game

    Parameters

    • filename: string

    Returns any

  • Game_EnableInput(enabled: boolean): void
  • Enables/Disables all input EXCEPT for ESC and F10.

    Parameters

    • enabled: boolean

    Returns void

  • Game_EndSP(win: boolean, winReason?: number, nis?: boolean, sandmap?: boolean): void
  • Ends the single player game (win/lose).

    Parameters

    • win: boolean
    • Optional winReason: number
    • Optional nis: boolean
    • Optional sandmap: boolean

    Returns void

  • Game_EndSubTextFade(): any
  • Game_EndTextTitleFade(): any
  • Game_FadeToBlack(direction: boolean, length: number): void
  • Fades the screen to black - FADE_OUT to fade to black, FADE_IN to fade back in

    Parameters

    • direction: boolean
    • length: number

    Returns void

  • Game_FastForwardProduction(secondsForward: number): any
  • Fast forward all production queues as if x seconds passed, returns info about what has been produced Returns a lua table of the format { (string)PlayerID : { (string)EntityProducerName : { "research" : { (string)researchedItemName : (int)number of times researched }, "production" : { (string)producedItemName : (int)number of items produced }, }, }, } for each player present, for each entity that produced after fast forwarding, for each item researched and produced

    Parameters

    • secondsForward: number

    Returns any

  • Game_FastForwardResourceIncome(secondsForward: number): any
  • For all players fast forwards their resource income as if x seconds passed

    Parameters

    • secondsForward: number

    Returns any

  • Game_GetGameRestoreCallbackExists(callback: any): void
  • Game_GetInputEnabledFlag(): any
  • Game_GetLocalPlayerID(): any
  • Get the local player id. (should only be used for UI purpose) (not deterministic)

    Returns any

  • Game_GetSPDifficulty(): number
  • Returns current single player difficulty. Values are GD_EASY, GD_NORMAL, GD_HARD, GD_EXPERT.

    Returns number

  • Game_GetSimRate(): any
  • Game_GetVisibilityFlag(): any
  • Game_HasLocalPlayer(): boolean
  • Determine if there is a valid local player. (UI only -- nondeterminstic)

    Returns boolean

  • Game_IsDataLocked(dataID: string): any
  • Returns lock state of stored data at location named by dataID.

    Parameters

    • dataID: string

    Returns any

  • Game_IsFtue(): any
  • Game_IsPaused(): any
  • Game_IsPerformanceTest(): any
  • Game_IsRTM(): boolean
  • Use to test whether the game is running in RTM mode or not. Using -rtm from the command line will cause this function to also return true in non-RTM builds.

    Returns boolean

  • Game_IsSaving(): any
  • Game_LaunchSPGeneratedMap(biomePbgName: string, layoutPbgName: string, sizePbgName: string, difficulty: number, terrainResult: StackVarTable): any
  • load this scenario as an single player match

    Parameters

    • biomePbgName: string
    • layoutPbgName: string
    • sizePbgName: string
    • difficulty: number
    • terrainResult: StackVarTable

    Returns any

  • Game_LoadDataStore(id: string, path: string, binary: boolean): any
  • Game_LoadFromFileDev(filename: string): any
  • load this game as a single player match, full path is expected excluding extension

    Parameters

    • filename: string

    Returns any

  • Game_LoadGame(name: string): any
  • load the savegame with the given internal name from Campaign or Skirmish folder depending on currently running scenario

    Parameters

    • name: string

    Returns any

  • Game_LoadSP(scenarioName: string, difficulty: number): any
  • load this scenario as an single player match

    Parameters

    • scenarioName: string
    • difficulty: number

    Returns any

  • Game_LockRandom(): void
  • If you are running something that is non-deterministic like a getlocalplayer conditional, you can lock the random to make sure no one down the callstack will throw the game random index out of sync and cause a sync error. REMEMBER TO UNLOCK WHEN YOU ARE DONE

    Returns void

  • Game_QuitApp(): void
  • Game_QuitAppWithCode(exitCode: number): any
  • Quits the app immediately with the given exitCode

    Parameters

    • exitCode: number

    Returns any

  • Game_RemoveGameRestoreCallback(callback: any): void
  • Removes a callback from being called on game restore

    Parameters

    • callback: any

    Returns void

  • Game_RemoveTableData(path: string): any
  • Game_RequestSetLocalPlayer(player: PlayerID): void
  • Game_RetrieveTableData(dataID: string, clearFromStorage: boolean): any
  • Loads table data stored at datastore[dataID] into global lua table var named . Set clearFromStorage to true to clear data from store.

    Parameters

    • dataID: string
    • clearFromStorage: boolean

    Returns any

  • Game_SaveDataStore(id: string, path: string, binary: boolean): any
  • Game_SaveGameExistsDev(filename: string): any
  • checks if the save game exists in dev folder and is loadable, filename is expected excluding folder and extension

    Parameters

    • filename: string

    Returns any

  • Game_ScreenFade(r: number, g: number, b: number, a: number, timeSecs: number): void
  • Fades the screen to a given RGBA colour over a number of seconds

    Parameters

    • r: number
    • g: number
    • b: number
    • a: number
    • timeSecs: number

    Returns void

  • Game_SetDataLock(dataID: string, lock: boolean): void
  • sets lock state for stored data at location named by dataID.

    Parameters

    • dataID: string
    • lock: boolean

    Returns void

  • Game_SetGameRestoreCallback(callback: any): void
  • Adds a function and set of arguments to be automatically called during restore from a saved game. Maxiumum of 9 parameters. Callback will be called like this: Callback(arg[1], arg[2], ...)

    Parameters

    • callback: any

    Returns void

  • Game_SetInputEnabledFlag(flag: number): void
  • Game_SetPlayerColour(player: Target, Colour_Neutral: Or): void
  • Set the player color for the world visuals from preset colors defined in tuning_simulation\ui_team_colours.

    Parameters

    Returns void

  • Game_SetPlayerSlotColour(player: Target, based: _1): void
  • Set the player color for the world visuals by slot index from preset colors defined in tuning_simulation\ui_player_colours.

    Parameters

    Returns void

  • Game_SetPlayerUIColour(player: Target, Colour_Neutral: Or): void
  • Set the player color for the UI from preset colors defined in tuning_simulation\ui_team_colours. Does not affect world visuals.

    Parameters

    Returns void

  • Game_SetPlayerUISlotColour(player: Target, based: _1): void
  • Set the player color for the UI by slot index from preset colors defined in tuning_simulation\ui_player_colours. Does not affect world visuals.

    Parameters

    Returns void

  • Game_SetSimRate(rate: number): void
  • Game_SetVisibilityFlag(flag: number): void
  • Game_ShowPauseMenu(): void
  • Brings up the pause menu. The game does not get paused until the end of the current sim tick, so anything that comes after Game_ShowPauseMenu in your function will still get executed, as well as any rules set to run during that frame.

    Returns void

  • Game_SkipAllEvents(bDeleteQueued: boolean): void
  • Skips all events. Can either delete or skip queued events.

    Parameters

    • bDeleteQueued: boolean

    Returns void

  • Game_SkipEvent(): void
  • Game_StoreTableData(dataID: string, table: RefTable): any
  • Stores provided table into long-lived data store at location named by dataID.

    Parameters

    Returns any

  • Game_SubTextFade(location: string, time: string, detail: string, in_: number, lifetime: number, out: number): void
  • Fade in and out two or three lines of subtext. This function has to support two lines, for backwards compatibility. The 'detail' line is therefore optional.

    Parameters

    • location: string
    • time: string
    • detail: string
    • in_: number
    • lifetime: number
    • out: number

    Returns void

  • Game_SubTextFadeWithIcon(line: string, line2: string, line3: string, detail: string, in_: number, lifetime: number, out: number, icon: string): any
  • Fade in and out one, two or three lines of subtext with an icon

    Parameters

    • line: string
    • line2: string
    • line3: string
    • detail: string
    • in_: number
    • lifetime: number
    • out: number
    • icon: string

    Returns any

  • Game_TextTitleFade(text: string, fadeIn: number, duration: number, fadeOut: number): any
  • Shows title text that fades in and out over a specified durations Call UI_TitleDestroy to remove.

    Parameters

    • text: string
    • fadeIn: number
    • duration: number
    • fadeOut: number

    Returns any

  • Game_TransitionToState(stateName: string, transitionTimeSec: number): any
  • Transitions to another atmosphere. Overwrites current transitions. Uses predefined atmosphere settings (only compatible with EEditor maps).

    Parameters

    • stateName: string
    • transitionTimeSec: number

    Returns any

  • Game_UnLockRandom(): void
  • GetMarkerWithDirection(markerName: string, markerDir: number): MARKER
  • Finds a marker with a given core name and a cardinal heading

    Parameters

    • markerName: string
    • markerDir: number

    Returns MARKER

  • GetPhysicsDebug(): any
  • GetPhysicsRaycastAsCapsuleDebug(): any
  • Ghost_DisableSpotting(): void
  • Ghost_EnableSpotting(): void
  • HintMouseover_Add(hintText: string, hintTarget: Position | MARKER | EGroup | SGROUP, targetRadius: number, looping: boolean): void
  • HintPoint_Add(where: StackVar, bVisible: boolean, hintText: string, height?: number, actionType?: HintPointActionType, iconName?: string, priority?: number, visibleInFOW?: boolean, dataTemplate?: string): HintPointID
  • Creates a hintpoint attached to a Marker, EGroup, SGroup or position If range is set to 0, then the hintpoint is rangeless, see the design document for rangeless features. The following types of hintpoint actions are available. HPAT_Objective HPAT_Hint HPAT_Critical HPAT_Movement HPAT_Attack HPAT_FormationSetup HPAT_RallyPoint HPAT_DeepSnow HPAT_CoverGreen HPAT_CoverYellow HPAT_CoverRed HPAT_Detonation HPAT_Vaulting

    Parameters

    • where: StackVar
    • bVisible: boolean
    • hintText: string
    • Optional height: number
    • Optional actionType: HintPointActionType
    • Optional iconName: string
    • Optional priority: number
    • Optional visibleInFOW: boolean
    • Optional dataTemplate: string

    Returns HintPointID

  • HintPoint_AddToEGroup(egroup: EGroupID, priority: number, visible: boolean, function_: any, dataTemplate: string, hint: string, arrow: boolean, arrowOffset: Position, actionType: number, iconName: string, visibleInFOW: boolean): any
  • Deprecated.

    Parameters

    • egroup: EGroupID
    • priority: number
    • visible: boolean
    • function_: any
    • dataTemplate: string
    • hint: string
    • arrow: boolean
    • arrowOffset: Position
    • actionType: number
    • iconName: string
    • visibleInFOW: boolean

    Returns any

  • HintPoint_AddToEntity(entity: EntityID, priority: number, visible: boolean, function_: any, dataTemplate: string, hint: string, arrow: boolean, arrowOffset: Position, objectiveID: number, actionType: number, iconName: string, visibleInFOW: boolean): any
  • For internal use only.

    Parameters

    • entity: EntityID
    • priority: number
    • visible: boolean
    • function_: any
    • dataTemplate: string
    • hint: string
    • arrow: boolean
    • arrowOffset: Position
    • objectiveID: number
    • actionType: number
    • iconName: string
    • visibleInFOW: boolean

    Returns any

  • HintPoint_AddToPosition(position: Position, priority: number, visible: boolean, function_: any, dataTemplate: string, hint: string, arrow: boolean, arrowOffset: Position, objectiveID: number, actionType: number, iconName: string, visibleInFOW: boolean): any
  • For internal use only.

    Parameters

    • position: Position
    • priority: number
    • visible: boolean
    • function_: any
    • dataTemplate: string
    • hint: string
    • arrow: boolean
    • arrowOffset: Position
    • objectiveID: number
    • actionType: number
    • iconName: string
    • visibleInFOW: boolean

    Returns any

  • HintPoint_AddToSGroup(sgroup: SGroupID, priority: number, visible: boolean, function_: any, dataTemplate: string, hint: string, arrow: boolean, arrowOffset: Position, actionType: number, iconName: string, visibleInFOW: boolean): any
  • Deprecated.

    Parameters

    • sgroup: SGroupID
    • priority: number
    • visible: boolean
    • function_: any
    • dataTemplate: string
    • hint: string
    • arrow: boolean
    • arrowOffset: Position
    • actionType: number
    • iconName: string
    • visibleInFOW: boolean

    Returns any

  • HintPoint_AddToSquad(squad: SquadID, priority: number, visible: boolean, function_: any, dataTemplate: string, hint: string, arrow: boolean, arrowOffset: Position, objectiveID: number, actionType: number, iconName: string, visibleInFOW: boolean): any
  • For internal use only.

    Parameters

    • squad: SquadID
    • priority: number
    • visible: boolean
    • function_: any
    • dataTemplate: string
    • hint: string
    • arrow: boolean
    • arrowOffset: Position
    • objectiveID: number
    • actionType: number
    • iconName: string
    • visibleInFOW: boolean

    Returns any

  • HintPoint_ClearFacing(id: number): any
  • HintPoint_Remove(HintPointID: number): void
  • HintPoint_RemoveAll(): void
  • HintPoint_SetDisplayOffset(hintpointID: number, x: number, y: number, z?: number): void
  • Sets a hintpoint's display offset, which is 3D for world hintpoints and 2D for taskbar binding hintpoints (ignore z)

    Parameters

    • hintpointID: number
    • x: number
    • y: number
    • Optional z: number

    Returns void

  • HintPoint_SetDisplayOffsetInternal(id: number, offset: Position): void
  • HintPoint_SetFacingEntity(id: number, entity: EntityID): void
  • HintPoint_SetFacingPosition(id: number, position: Position): void
  • HintPoint_SetFacingSquad(id: number, squad: SquadID): void
  • HintPoint_SetVisible(HintPointID: number, bVisible: boolean): void
  • Sets a hintpoint's visibility. Currently, FOW is not accounted for.

    Parameters

    • HintPointID: number
    • bVisible: boolean

    Returns void

  • HintPoint_SetVisibleInternal(id: number, visible: boolean): void
  • Hold_Info(): any
  • IdleVillagers_MakeBusy(the: In, sgroup: And, egroup: And): any
  • Grabs villagers and gets them moving around to look busy. Meant for non-player/AI villagers only. Should be run as an Interval Rule. Example: Rule_AddInterval(IdleVillagers_MakeBusy, 5, {marker = mkr_town, player = player2, sgroup = sg_spare_villagers})

    Parameters

    Returns any

  • Import_Once(Path: string): undefined
  • Initialize(): any
  • A class-like object used as a Singleton to read and write a JSON file Initializes based on command line parameter -test_result_file alias:path. Checks for temporary logs on creation and inserts them into the result data. NOTE: A lot of information in the file is redundant to make it easier to process and easier to read for a human.

    Returns any

  • LCWatcher_Activate(on: boolean): any
  • turns on the watcher and displays the lists if any

    Parameters

    • on: boolean

    Returns any

  • LCWatcher_AddFilter(stateName: string, filter: string): any
  • Needs the proper luaConfig id, and looks through that list to add the filter.

    Parameters

    • stateName: string
    • filter: string

    Returns any

  • LCWatcher_FilterExists(stateName: string, filter: string): any
  • Needs the proper luaConfig id, returns true if filter exists.

    Parameters

    • stateName: string
    • filter: string

    Returns any

  • LCWatcher_IsActive(): any
  • LCWatcher_RemoveFilter(stateName: string, filter: string): any
  • Needs the proper luaConfig id, removes filter added by LCWatch_AddFilter.

    Parameters

    • stateName: string
    • filter: string

    Returns any

  • LCWatcher_SelectState(state: string): any
  • Selects a LuaConfig state to watch. Returns true if state is registered and false if it has not.

    Parameters

    • state: string

    Returns any

  • LOC(text: string): string
  • DEV ONLY: Converts ansi text to localized text. Your text will have to get localized properly at some point before final. When converting text with this function you will get LOC: prefixed to your text

    Parameters

    • text: string

    Returns string

  • LOCATION(identifier: any): any
  • Finds a location based on the identifier Locates locations based on identifier type: TABLE (location matching identifier), STRING (location with identifier as descriptor), ENTITY/EGROUP (location containing identifier), SCARPOS (closest location to identifier). Returns nil if nothing is found.

    Parameters

    • identifier: any

    Returns any

  • Loadout_GetEquippedArmyUnitAtIndex(player: PlayerID, index: number): any
  • Get the player's equipped elite at the specified index for their currently set race

    Parameters

    Returns any

  • Loadout_GetEquippedArmyUnitsCount(player: PlayerID): any
  • Loc_Empty(): string
  • Loc_FormatInteger(integer: number): any
  • Returns a localized string containing the integer.

    Parameters

    • integer: number

    Returns any

  • Loc_FormatNumber(number: number, numDecimalPlaces: number): any
  • Returns a localized string containing the number to the specified number of decimal places.

    Parameters

    • number: number
    • numDecimalPlaces: number

    Returns any

  • Loc_FormatText(FormatID: number, parameters?: Argc): string
  • Returns a formatted localized string. Use this function to format localized text. ie %1PLAYERNAME% is going to win. It accepts up to 9 additional values as parameters.

    Parameters

    • FormatID: number
    • Optional parameters: Argc

    Returns string

  • Loc_FormatTime_H_M_S(secs: number, leading_zeroes: boolean): any
  • Returns a formatted time string in hours, minutes, and seconds. can omit leading zeroes.

    Parameters

    • secs: number
    • leading_zeroes: boolean

    Returns any

  • Loc_FormatTime_M_S(secs: number, leading_zeroes: boolean): any
  • Returns a formatted time string in minutes and seconds. can omit leading zeroes.

    Parameters

    • secs: number
    • leading_zeroes: boolean

    Returns any

  • Loc_FormatTime_M_S_MS(secs: number, leading_zeroes: boolean): any
  • Returns a formatted time string in minutes, seconds, and milliseconds. can omit leading zeroes.

    Parameters

    • secs: number
    • leading_zeroes: boolean

    Returns any

  • Send a entity command to a entity group(CMD_DefaultAction, CMD_Stop, CMD_Destroy, CMD_BuildSquad, CMD_CancelProduction, CMD_RallyPoint, CMD_AttackForced) Entity commands are mostly used for buildings etc. If you need to issue commands to units, use the Squad_Command function.

    Parameters

    Returns any

  • Send a entity-based command to an entity group. Use this function to issue orders that require a entity to an entity group (eg. order a building to attack another building)\n See LocalCommand_Entity for a list of all the possible entityCommands.

    Parameters

    Returns any

  • Send a position command to an entity group. Use this function to issue orders that require a position to an entity group (eg. set a rally point for a building)\n See LocalCommand_Entity for a list of all the possible entityCommands.

    Parameters

    Returns any

  • Send a dual target (position and squad) command to an entity group. Use this function to issue orders that require a position and a squad to an entity group (eg. unloading squad from hold)\n See LocalCommand_Entity for a list of all the possible entityCommands.

    Parameters

    Returns any

  • Send a squad-based command to an entity group. Use this function to issue orders that require a squad to an entity group (eg. order a building to attack a squad)\n See LocalCommand_Entity for a list of all the possible entityCommands.

    Parameters

    Returns any

  • Send an entity-targeting ability command (CMD_Ability) to an entity Use this function to issue ability orders that require an entity target to an entity

    Parameters

    Returns any

  • Send an squad-targeting ability command (CMD_Ability) to an entity Use this function to issue ability orders that require an entity target to an entity

    Parameters

    Returns any

  • Send a position command to a player with extra info Use this function to issue orders that require a position to player\n See LocalCommand_Player for a list of all the possible playerCommands.

    Parameters

    Returns any

  • Send a player command to itself to order squads in the sgroup to construct the building at specific position and facing structureBlueprint must be a valid building that can be constructed by the sgroup. This building would cost nothing and does not effect population and availability This is a special command for SCAR use

    Parameters

    Returns any

  • Send a player command to itself to order squads in the sgroup to construct the building at specific position and facing structureBlueprint must be a valid building that can be constructed by the sgroup. This building would cost nothing and does not effect population and availability This is a special command for SCAR use

    Parameters

    Returns any

  • Send a player command to itself to order squads in the sgroup to construct fences from posStart to posEnd structureBlueprint must be a valid building that can be constructed by the sgroup. This building would cost nothing and does not effect population and availability This is a special command for SCAR use

    Parameters

    Returns any

  • Send a player command to itself to order squads in the sgroup to construct fences from posStart to posEnd structureBlueprint must be a valid building that can be constructed by the sgroup. This building would cost nothing and does not effect population and availability This is a special command for SCAR use

    Parameters

    Returns any

  • Send a player command to itself to order squads in the sgroup to construct a field ranging from posStart to posEnd structureBlueprint must be a valid building that can be constructed by the sgroup. This building would cost nothing and does not effect population and availability This is a special command for SCAR use

    Parameters

    Returns any

  • Send a player command to itself to order squads in the sgroup to construct a field ranging from posStart to posEnd structureBlueprint must be a valid building that can be constructed by the sgroup. This building would cost nothing and does not effect population and availability This is a special command for SCAR use

    Parameters

    Returns any

  • Send a command from player to sgroup to build ebp as a slotted spline from posStart to posEnd. structureBlueprint must be a valid building that can be constructed by the sgroup. This building costs nothing and does not effect population and availability This is a special command for SCAR use

    Parameters

    Returns any

  • Send a command from player to sgroup to build ebp as a slotted spline from posStart to posEnd. structureBlueprint must be a valid building that can be constructed by the sgroup. This building costs nothing and does not effect population and availability This is a special command for SCAR use

    Parameters

    Returns any

  • Send a command from player to sgroup to build ebp as a slotted spline dependent entity. structureBlueprint must be a valid building that can be constructed by the sgroup. This building costs nothing and does not effect population and availability This is a special command for SCAR use

    Parameters

    Returns any

  • Send a command from player to sgroup to build ebp as a slotted spline dependent entity. structureBlueprint must be a valid building that can be constructed by the sgroup. This building costs nothing and does not effect population and availability This is a special command for SCAR use

    Parameters

    Returns any

  • Send a command from player to sgroup to build ebp as a slotted spline replacer entity. structureBlueprint must be a valid building that can be constructed by the sgroup. This building costs nothing and does not effect population and availability This is a special command for SCAR use

    Parameters

    Returns any

  • Send a command from player to sgroup to build ebp as a slotted spline replacer entity. structureBlueprint must be a valid building that can be constructed by the sgroup. This building costs nothing and does not effect population and availability This is a special command for SCAR use

    Parameters

    Returns any

  • Send a squad command to a squad group SCMD_DefaultAction, SCMD_Move, SCMD_Stop, SCMD_Destroy, SCMD_BuildStructure, SCMD_Capture, SCMD_Attack, SCMD_ReinforceUnit, SCMD_Upgrade, SCMD_CancelProduction SCMD_AttackMove, SCMD_Ability SCMD_Load,SCMD_UnloadSquads, SCMD_DoPlan SCMD_SlotItemRemove, SCMD_InstantReinforceUnit, SCMD_InstantUpgrade

    Parameters

    Returns any

  • Send an entity command to a squad group. Use this function to isssue an entity-based command to a squad group.\n See LocalCommand_Squad for a list of all the possible squadCommands

    Parameters

    Returns any

  • LocalCommand_SquadEntityAttack(player: PlayerID, sgroup: SGroupID, target: EGroupID, bCheckFOW: boolean, bStationary: boolean, planName: string, queued: boolean): any
  • Send an entity command ATTACK to a squad group. Use this function to issue an entity-based command to a squad group with custom FOW check flag. (eg. order a squad to attack a building)\n planName is the name of the custom plan file to execute. Pass in empty string to use the default\n stationary flag uses SCMD_StationaryAttack instead where plan file is ignored and squad does not pursue its target See LocalCommand_Squad for a list of all the possible squadCommands WARNING: Element plans need to be reimplemented in state trees.

    Parameters

    Returns any

  • Send special squad command to a squad group with squad load parameters This is a special command for loading squads into building (entity) holds (SCMD_Load, SCMD_InstantLoad)

    Parameters

    Returns any

  • LocalCommand_SquadMovePos(player: PlayerID, sgroup: SGroupID, target: Position, queued: boolean, reverseMove: boolean, split: boolean, acceptableProximity: number): any
  • Send a move to position command for a squad group. Use this function to issue move orders that require a position to a squad group

    Parameters

    • player: PlayerID
    • sgroup: SGroupID
    • target: Position
    • queued: boolean
    • reverseMove: boolean
    • split: boolean
    • acceptableProximity: number

    Returns any

  • LocalCommand_SquadMovePosFacing(player: PlayerID, sgroup: SGroupID, target: Position, facing: Position, queued: boolean, reverseMove: boolean, split: boolean, acceptableProximity: number): any
  • LocalCommand_SquadMultiTargetAbility(caster: SquadID, targets: Vector, abilityPBG: ScarAbilityPBG, skipCostAndPrereq: boolean, queued: boolean): any
  • LocalCommand_SquadPath(pPlayer: PlayerID, pSGroup: SGroupID, pathName: string, pathIndex: number, bFromClosest: boolean, loopType: LoopType, bAttackMove: boolean, pauseTime: number, bMoveForward: boolean, queued: boolean): any
  • Send a squad patrol command (SCMD_Patrol) to a squad

    Parameters

    • pPlayer: PlayerID
    • pSGroup: SGroupID
    • pathName: string
    • pathIndex: number
    • bFromClosest: boolean
    • loopType: LoopType
    • bAttackMove: boolean
    • pauseTime: number
    • bMoveForward: boolean
    • queued: boolean

    Returns any

  • Send a position command to a squad group. Use this function to issue orders that require a position to a squad group (eg. order a squad to move to position, or attack position)\n See LocalCommand_Squad for a list of all the possible squadCommands.

    Parameters

    Returns any

  • LocalCommand_SquadPositionAttack(player: PlayerID, sgroup: SGroupID, target: Position, bCheckFOW: boolean, bStationary: boolean, planName: string, queued: boolean): any
  • Send an position command ATTACK to a squad group. Use this function to issue an position-based command to a squad group with custom FOW check flag. (eg. order a squad to attack a building)\n planName is the name of the custom plan file to execute. Pass in empty string to use the default\n stationary flag uses SCMD_StationaryAttack instead where plan file is ignored and squad does not pursue its target See LocalCommand_Squad for a list of all the possible squadCommands WARNING: Element plans need to be reimplemented in state trees.

    Parameters

    Returns any

  • LocalCommand_SquadRetreatPos(player: PlayerID, sgroup: SGroupID, target: Position, queued: boolean, allowNonInteractiveStages: boolean): any
  • Send a retreat position command to a squad group. Use this function to issue retreat order that require a position to a squad group

    Parameters

    Returns any

  • Send a set CombatStance command to the squads Set the CombatStance for all the Squads in the SGroup. StanceTypes: STANCE_CeaseFire (don't shoot), STANCE_StandGround (don't move, just shoot), STANCE_Attack (move and shoot)

    Parameters

    Returns void

  • Send a set Weapon Preference command to the squads Set the Weapon Preference for all the Squads in the SGroup. WeaponPreference: WP_Melee, WP_Ranged,

    Parameters

    Returns void

  • Send an squad-based command to a squad group. Use this function to issue a squad-based command to a squad group. \n See LocalCommand_Squad for a list of all the possible squadCommands

    Parameters

    Returns any

  • LocalCommand_SquadSquadAttack(player: PlayerID, sgroup: SGroupID, target: SGroupID, bCheckFOW: boolean, bStationary: boolean, planName: string, queued: boolean): any
  • Send an squad-based command to a squad group. Use this function to issue a squad-based command to a squad group with special boolean flag. (eg. order a squad to attack another squad)\n If bCheckFOW is set to false, the squad would be able to attack other squads hidden in FOW \n planName is the name of the custom plan file to execute. Pass in empty string to use the default\n stationary flag uses SCMD_StationaryAttack instead where plan file is ignored and squad does not pursue its target See LocalCommand_Squad for a list of all the possible squadCommands WARNING: Element plans need to be reimplemented in state trees.

    Parameters

    Returns any

  • Send special squad command to a squad group with squad load parameters This is a special command for loading squads into vehicle (squad) holds (SCMD_Load, SCMD_InstantLoad)

    Parameters

    Returns any

  • Location_AddSGroup(): any
  • Adds units to the appropriate modules associated with this location. Villagers are added to Townlife if there is one. Military units are added to defend if there is one. Left over units are added to the sgroup_unassigned sgroup instead.

    Returns any

  • Location_FromDescriptor(descriptor: string): any
  • Finds a location with the given descriptor. Returns nil if none exists.

    Parameters

    • descriptor: string

    Returns any

  • LogPrintTo(file: string, txt: string): any
  • MapIcon_ClearFacing(id: number): any
  • MapIcon_CreateArrow(position_from: Position | MARKER, position_to: Position | MARKER, red: number, green: number, blue: number, alpha: number): any
  • MapIcon_CreateEntity(entity: EntityID, icon: string, scale: number, red: number, green: number, blue: number, alpha: number): any
  • Create a map icon targetting an entity.

    Parameters

    • entity: EntityID
    • icon: string
    • scale: number
    • red: number
    • green: number
    • blue: number
    • alpha: number

    Returns any

  • MapIcon_CreatePosition(position: Position, icon: string, scale: number, red: number, green: number, blue: number, alpha: number): any
  • Create a map icon targetting a position.

    Parameters

    • position: Position
    • icon: string
    • scale: number
    • red: number
    • green: number
    • blue: number
    • alpha: number

    Returns any

  • MapIcon_CreateSquad(squad: SquadID, icon: string, scale: number, red: number, green: number, blue: number, alpha: number): any
  • Create a map icon targetting a squad.

    Parameters

    • squad: SquadID
    • icon: string
    • scale: number
    • red: number
    • green: number
    • blue: number
    • alpha: number

    Returns any

  • MapIcon_Destroy(id: number): any
  • MapIcon_DestroyAll(): any
  • MapIcon_SetFacingEntity(id: number, entity: EntityID): void
  • MapIcon_SetFacingPosition(id: number, position: Position): void
  • MapIcon_SetFacingSquad(id: number, squad: SquadID): void
  • MarkerCountFromName(name: string, type: string): any
  • Returns the number of ScarMarkers with the given name If you don't care about the type, pass in an empty string ( "" ) The type is defined in the markers list of the mission editor when placing markers.

    Parameters

    • name: string
    • type: string

    Returns any

  • MarkerPaths_AttackMoveSGroupAlongPath(sgroup: SGroupID, markerName: string, opt_markerType?: string): any
  • Gives the sgroup a series of queued orders to go to each marker with the same markerName.

    Parameters

    • sgroup: SGroupID
    • markerName: string
    • Optional opt_markerType: string

    Returns any

  • MarkerPaths_ClearIcons(pathName: string, removePath: boolean): any
  • Clears the minimap path with the given pathName string, if there is one. If removePath, that path is entirely deleted; otherwise it persists and can be used again

    Parameters

    • pathName: string
    • removePath: boolean

    Returns any

  • MarkerPaths_GenerateIcons(pathName: string, pointList: any, iconName: string, spacing: undefined | number): any
  • Follow-up gate locking function, because you can't call two commands on an Entity in the same frame

    Parameters

    • pathName: string
    • pointList: any
    • iconName: string
    • spacing: undefined | number

    Returns any

  • MarkerPaths_MoveSGroupAlongPath(sgroup: SGroupID, markerName: string, opt_markerType?: string, opt_startMarker?: number, opt_endMarker?: number): any
  • Gives the sgroup a series of queued orders to go to each marker with the same markerName.

    Parameters

    • sgroup: SGroupID
    • markerName: string
    • Optional opt_markerType: string
    • Optional opt_startMarker: number
    • Optional opt_endMarker: number

    Returns any

  • Marker_Create(name: string, type: string, pos: Position, direction: Position, radius: number): any
  • Returns a newly created marker with the given attributes [direction] is expecting a direction vector and not a position relative to [pos]

    Parameters

    Returns any

  • Marker_CreateMarkerFromEntityMarker(entity: EntityID, internalMarker: string, newMarker: string): any
  • Finds a marker in an entity, creates a SCAR marker there and returns the new marker's name. Uses the MarkerExt to find a marker inside an entity. Creates a SCAR marker at the internal marker's location. Returns the new SCAR marker's name.

    Parameters

    • entity: EntityID
    • internalMarker: string
    • newMarker: string

    Returns any

  • Marker_DoesNumberAttributeExist(marker: MarkerID, attrname: string): boolean
  • Returns true if a generic number attribute exists for the marker type.

    Parameters

    Returns boolean

  • Marker_DoesStringAttributeExist(marker: MarkerID, attrname: string): boolean
  • Returns true if a generic string attribute exists for the marker type.

    Parameters

    Returns boolean

  • Marker_Exists(name: string, type: string): boolean
  • Returns true if marker exists. If you don't care about the type, pass in an empty string ( "" )

    Parameters

    • name: string
    • type: string

    Returns boolean

  • Marker_FromName(name: string, type: string): MarkerID
  • Returns a ScarMarker from the Mission Editor. If you don't care about the type, pass in an empty string ( "" ) The type is defined in the markers list of the mission editor when placing markers. You will need the result of this function to call any functions that start with Marker_

    Parameters

    • name: string
    • type: string

    Returns MarkerID

  • Marker_GetName(marker: MarkerID): string
  • Marker_GetNonSequentialTable(format: string, size: number): any
  • Returns a fixed size table of markers from the world builder. Markers that do not exist in the WB, will be nil in the table. This is why we call it 'non-sequential'

    Parameters

    • format: string
    • size: number

    Returns any

  • Marker_GetNumberAttribute(marker: MarkerID, attrname: string): number
  • Returns a generic number attribute defined in a marker. Different marker types have different attributes. Note: All marker types have Name and Proximity. Do not use this function to retrieve these values, use Marker_GetName and Marker_GetProximity instead.

    Parameters

    Returns number

  • Marker_GetProximityDimensionsOrDefault(marker: MarkerID, defaultWidth: number, defaultHeight: number): any
  • Returns the proximity dimensions of a given marker. If non rectangular, default value is returned Dimensions are 2d but returned in 3d world space (terrain mapped to x,z) This value gets set in the Scenario Editor.

    Parameters

    • marker: MarkerID
    • defaultWidth: number
    • defaultHeight: number

    Returns any

  • Marker_GetProximityRadius(marker: MarkerID): number
  • Returns the proximity radius of a given marker. Only for marker with proximity type PT_Circle. This value gets set in the Mission Editor.

    Parameters

    Returns number

  • Marker_GetProximityRadiusOrDefault(marker: MarkerID, defaultValue: number): any
  • Returns the proximity radius of a given marker. If non circular, default value is returned This value gets set in the Scenario Editor.

    Parameters

    Returns any

  • Marker_GetSequence(name: string, type: string): any
  • Builds a table of MarkerIDs that are named in a sequence. i.e. a name of "spot" will find markers "spot1", "spot2" and so on, up until it looks for a marker that isn't there.

    Parameters

    • name: string
    • type: string

    Returns any

  • Marker_GetStringAttribute(marker: MarkerID, attrname: string): string
  • Marker_GetTable(format: string): any
  • Returns a table of markers from the world builder. Creates as many as it finds mkr_table = Marker_GetTable( 'mkr_%d' ) -- creates a table with 3 markers named 'mkr_1', 'mkr_2', and 'mkr_3' (and so on) from the WB\n\n mkr_table2 = Marker_GetTable( 'mkr_%02d' ) -- creates a table with 3 markers named 'mkr_01', 'mkr_02', 'mkr_03' (and so on) from the WB\n\n mkr_table3 = Marker_GetTable( 'mkr_%03d_patrol' ) -- creates a table with 3 markers named 'mkr_001_patrol', 'mkr_002_patrol' (and so on) from the WB\n\n

    Parameters

    • format: string

    Returns any

  • Marker_GetType(marker: MarkerID): string
  • Returns the typename of a given marker. This is the typename from the Mission Editor (name displayed when placing markers)

    Parameters

    Returns string

  • Marker_HasProximityRange(marker: MarkerID): any
  • Returns true if the given position is in the markers proximity radius or proximity rectangle (depending on the type).

    Parameters

    Returns boolean

  • Marker_SetProximityCircle(marker: MarkerID, radius: number): void
  • Marker_SetProximityPoint(marker: MarkerID): void
  • Marker_SetProximityRectangle(marker: MarkerID, width: number, height: number): void
  • Set the proximity shape of a marker to a rectangle with dimensions width and height

    Parameters

    • marker: MarkerID
    • width: number
    • height: number

    Returns void

  • MemoryStats_Disable(): any
  • MemoryStats_Enable(): any
  • MemoryStats_Toggle(): any
  • MergeClone(defaultTable: any, overrideTable: any): any
  • Merge clones two table (recursively) into a single table combining into a new table allowing for unadulterated use of the data

    Parameters

    • defaultTable: any
    • overrideTable: any

    Returns any

  • Misc_AIControlLocalPlayer(): boolean
  • Misc_AbortToFE(): void
  • Abort straight out of the game to the frontend, without asking the user

    Returns void

  • Misc_AddRestrictCommandsCircle(position: Position, radius: number): any
  • Misc_AddRestrictCommandsMarker(marker: MarkerID): any
  • Misc_AppendToFile(filename: string, text: string): any
  • Appends given string to a file expects to receive a filename with an alias conserves existing file content \return Number returned is # bytes successfully written

    Parameters

    • filename: string
    • text: string

    Returns any

  • Misc_AreDefaultCommandsEnabled(): boolean
  • Misc_ClearControlGroup(groupIndex: number): any
  • Misc_ClearSelection(): any
  • Misc_ClearSubselection(): any
  • Misc_DetectKeyboardInput(): boolean
  • Returns true if the app has had any keyboard input in the last second

    Returns boolean

  • Misc_DetectMouseInput(): boolean
  • Do weapon hit effect on the entity from the view camera origin WeaponID is the property bag group id; if penetrated is set to false, deflection effect would be played instead

    Parameters

    Returns void

  • Do weapon hit effect on the ground WeaponID is the property bag group id; if penetrated is set to false, deflection effect would be played instead

    Parameters

    Returns void

  • Misc_DoesPositionHaveAssociatedDistrict(pos: Position): any
  • Misc_EnablePerformanceTest(toEnable: boolean): void
  • Turn on or off the performance test monitoring

    Parameters

    • toEnable: boolean

    Returns void

  • Misc_FindDepositsCloseToSquad(group: EGroupID, squad: SquadID, searchRange: number): any
  • Misc_FindDepositsOfTypeCloseToPosition(resourceType: number, gathererEBP: EBP, position: Position, searchRange: number): any
  • Finds resource deposits of given type within the specified range of a position, that can be collected by the provided gathererEBP Returns an egroup of resource deposits named "eg_Misc_FindNearbyDepositOfType_result", sorted by proximity to the position

    Parameters

    • resourceType: number
    • gathererEBP: EBP
    • position: Position
    • searchRange: number

    Returns any

  • Misc_GetCommandLineString(option: string): string
  • Returns the string argument for a command line option. ex: for "-init test.lua" it would return "test.lua"

    Parameters

    • option: string

    Returns string

  • Misc_GetControlGroupContents(groupIndex: number, squads: SGroupID, nonSquadEntities: EGroupID): void
  • Returns contents of a control group (0 to 9). Squads are put into an sgroup, and non-squad entities are put into an egroup.

    Parameters

    Returns void

  • Misc_GetDistrictGeneratorFromPosition(pos: Position): any
  • Return the entity generating the district containing the given position. Use with Misc_DoesPositionHaveAssociatedDistrict

    Parameters

    Returns any

  • Misc_GetDistrictValueFromPosition(pos: Position): any
  • Return the district value of the district containing the given position. Use with Misc_DoesPositionHaveAssociatedDistrict

    Parameters

    Returns any

  • Misc_GetEntityControlGroup(entity: EntityID): number
  • Returns the control group index that this entity belongs to, from 0 to 9, or -1 if none

    Parameters

    Returns number

  • Misc_GetFileSize(filename: string): any
  • returns the size of the file expects to receive a filename with an alias \return file size OR 0 if the file can not be read

    Parameters

    • filename: string

    Returns any

  • Returns a hidden position on path from origin to destination. If there's none, it returns the origin position Possible check types are CheckHiddenFromCamera, CheckHiddenInFOW and CheckHiddenBothCameraFOW Camera check determined by the camera frustum. use cameraPadding to increase the area around the camera when doing the check FOW check requires a valid player ID passed in stepDistance is the interval along the path that the hidden points will be checked ( min is 1 metre ) If no hidden position is found, position ( 0, 0, 0 ) is returned Don't use this for multi-player SCAR script!!

    Parameters

    Returns Position

  • Misc_GetMouseOverSquad(): any
  • Misc_GetSelectedEntities(group: EGroupID, subSelection: boolean): void
  • Misc_GetSelectedSquads(group: SGroupID, subSelection: boolean): void
  • Misc_GetSquadControlGroup(squad: SquadID): number
  • Returns the control group index that this squad belongs to, from 0 to 9, or -1 if none

    Parameters

    Returns number

  • Misc_IsCommandLineOptionSet(option: string): boolean
  • Returns true if -option is specified on the command line

    Parameters

    • option: string

    Returns boolean

  • Misc_IsDevMode(): boolean
  • Returns whether the game is running in dev mode. The rules for dev mode are a bit complicated between builds, so we cannot simply check the command line.

    Returns boolean

  • Misc_IsEGroupOnScreen(group: EGroupID, percent: number, all: boolean): any
  • Test whether ANY or ALL of an EGroup is on screen currently (not strict)

    Parameters

    • group: EGroupID
    • percent: number
    • all: boolean

    Returns any

  • Misc_IsEGroupSelected(egroup: EGroupID, all: boolean): boolean
  • Misc_IsEntityOnScreen(entity: EntityID, pct: number): boolean
  • Misc_IsEntitySelected(entity: EntityID): boolean
  • Misc_IsMouseOverEntity(): boolean
  • Misc_IsMouseOverSquad(): any
  • Misc_IsPosOnScreen(pos: Position): boolean
  • Misc_IsSGroupOnScreen(group: SGroupID, percent: number, all: boolean): any
  • Test whether ANY or ALL of an SGroup is on screen currently (not strict)

    Parameters

    • group: SGroupID
    • percent: number
    • all: boolean

    Returns any

  • Misc_IsSGroupSelected(sgroup: SGroupID, all: boolean): boolean
  • Misc_IsSelectionInputEnabled(): boolean
  • Misc_IsSquadOnScreen(squad: SquadID, pct: number): boolean
  • Misc_IsSquadSelected(squad: SquadID): boolean
  • Misc_QueryDataDirectory(pathQuery: string, recursiveFind: boolean): any
  • Assumes 'data:' as root; Returns a table containing the names of files matching the supplied path. Wildcards are allowed.

    Parameters

    • pathQuery: string
    • recursiveFind: boolean

    Returns any

  • Misc_QueryDirectory(pathQuery: string, recursiveFind: boolean): any
  • Returns a table containing the names of files matching the supplied path. Wildcards are allowed.

    Parameters

    • pathQuery: string
    • recursiveFind: boolean

    Returns any

  • Misc_ReadFile(filename: string): any
  • Reads the file as string expects to receive a filename with an alias \return file content OR empty string if the file can not be read

    Parameters

    • filename: string

    Returns any

  • Misc_RemoveCommandRestriction(): void
  • Misc_RemoveFile(filename: string): any
  • Deletes the given file expects to receive a filename with an alias \return true if file was deleted or did not exist in the first place, false otherwise

    Parameters

    • filename: string

    Returns any

  • Misc_RestrictCommandsToMarker(marker: MarkerID): void
  • Misc_Screenshot(): any
  • Misc_ScreenshotExt(fileExtension: string): any
  • Set the graphic file type for screenshot (.jpg, .tga)

    Parameters

    • fileExtension: string

    Returns any

  • Misc_SelectEGroup(egroup: EGroupID): any
  • Misc_SelectEntity(pEntity: EntityID): void
  • Misc_SelectSGroup(sgroup: SGroupID, selected: boolean): any
  • Misc_SelectSquad(squad: SquadID, bSelected: boolean): void
  • Misc_SetCurrentAutotest(description: string): void
  • Sets the current autotest being used. Used to set default text in the crash reports

    Parameters

    • description: string

    Returns void

  • Misc_SetDefaultCommandsEnabled(enabled: boolean): void
  • Misc_SetDesignerSplatsVisibility(bVisible: boolean): void
  • Shows or hides designer splats, which are splats in the UI folder

    Parameters

    • bVisible: boolean

    Returns void

  • Misc_SetEGroupSelectable(egroup: EGroupID, selectable: boolean): void
  • Misc_SetEntityControlGroup(entity: EntityID, groupIndex: number): boolean
  • Makes a squad belong to a specific control group. If it already belongs to another control group, it's removed from that one before being added to the new one.

    Parameters

    Returns boolean

  • Misc_SetEntitySelectable(entity: EntityID, selectable: boolean): void
  • Misc_SetSGroupSelectable(sgroup: SGroupID, selectable: boolean): void
  • Misc_SetSelectionInputEnabled(enabled: boolean): void
  • Misc_SetSquadControlGroup(squad: SquadID, groupIndex: number): boolean
  • Makes a squad belong to a specific control group. If it already belongs to another control group, it's removed from that one before being added to the new one.

    Parameters

    Returns boolean

  • Misc_SetSquadSelectable(squad: SquadID, selectable: boolean): void
  • Misc_UpdateSlottedSplinesContainingEGroupAfterBlueprintConversion(egroup: EGroupID): any
  • Updates the slotted spline system to handle the fact that the entities in the given EGroup have done a blueprint conversion. This must be called after converting slotted spline entities from script.

    Parameters

    Returns any

  • Misc_WriteFile(filename: string, text: string): any
  • Writes the given string to a file expects to receive a filename with an alias overwrites any existing file content \return Number returned is # bytes successfully written

    Parameters

    • filename: string
    • text: string

    Returns any

  • Associate an entity with a suitable nearby location. The entity will be added to the location's egroup. If no suitable location is found, it is moved into the eg_orphanBuildings group, so it can be tried again later (maybe by then other buildings will connect it to a location)

    Parameters

    Returns LocationTable

  • MissionOMatic_Cheat_Complete_Obj(): any
  • MissionOMatic_Cheat_Fail_Obj(): any
  • MissionOMatic_Cheat_Lose(): any
  • MissionOMatic_Cheat_ViewRecipe(): any
  • MissionOMatic_Cheat_Win(): any
  • MissionOMatic_FindBattalion(): any
  • MissionOMatic_FindLocation(): any
  • MissionOMatic_FindModule(): any
  • Finds the player data table for one of the players in the mission, identifying them from a String ("descriptor"), PlayerID, Squad/SGroup or Entity/EGroup If you pass in a PlayerTable that has already been resolved it returns it straight back

    Parameters

    • identifier: any

    Returns PlayerTable

  • MissionOMatic_GetTypeForBlueprint(blueprint: SquadID | SBP): string
  • Returns a suitable SCAR squadType for a given blueprint Can also pass in a squadID and it will use that squad's blueprint

    Parameters

    Returns string

  • MissionOMatic_HintOnAbilityUsed(): any
  • Adds a training hint to a certain kind of squad that is resolved by selecting a squad of that type

    Returns any

  • MissionOMatic_HintOnHover(): any
  • Adds a training hint to a certain kind of squad that is resolved by selecting a squad of that type

    Returns any

  • MissionOMatic_HintOnSquadSelect(): any
  • Adds a training hint to a certain kind of squad that is resolved by selecting a squad of that type

    Returns any

  • MissionOMatic_RequestComplete(originalRequest: RequestData, unitsToFulfillRequest: SGroupID): any
  • MissionOMatic_RequestUnits(requestingModule: any, requestData: any, unitSources?: any): RequestData
  • Request to have units produced by available production means

    extdesc

    Parameters

    • requestingModule: any
    • requestData: any
    • Optional unitSources: any

    Returns RequestData

  • MissionOMatic_RevealMovingSGroup(): any
  • Function that reveals FOW on units in an SGroup in a way that follows them

    Returns any

  • MissionOMatic_SGroupCommandDelayed(sgroup: SGroupID, destination: SGroupID, attackMove: boolean, delay: number, destroyOnArrive: boolean, onDestroyCallback: any): any
  • Prepares a command to be issued in a second or so, once a sim frame has ticked; usually used when units were just spawned by a previous command

    Parameters

    • sgroup: SGroupID
    • destination: SGroupID
    • attackMove: boolean
    • delay: number
    • destroyOnArrive: boolean
    • onDestroyCallback: any

    Returns any

  • MissionOMatic_SGroupCommandDelayed_B(): any
  • Helper function that actually sends units somewhere once they're ready to go

    Returns any

  • MissionOMatic_ShowTitleCard(): any
  • Triggers the mission start title card (as long as it is properly defined in mission recipe)

    Returns any

  • Mission_Complete(): void
  • Mission_Complete(): void
  • Ends an SP scenario with a Victory. Waits for no intel events to be playing before it ends the mission. This will play any endNIS and endMovie specified in the g_missionData table. After this is called, the path is set and any subsequent calls to Mission_Complete() or Mission_Fail() are ignored.

    Returns void

  • Ends an SP scenario with a Victory. Waits for no intel events to be playing before it ends the mission. This will play any endNIS and endMovie specified in the g_missionData table. After this is called, the path is set and any subsequent calls to Mission_Complete() or Mission_Fail() are ignored.

    Returns void

  • Mission_EnableAbilities(data: string, enable: boolean): any
  • Enable or diable a group of abilities for one or more players; useful for hiding glows. data can be a string (ability short name), a table of such strings. To deactivate for a player other than Player 1, pass in a table or tables as such: {player = playerID, abilities = {"name","name"}}

    Parameters

    • data: string
    • enable: boolean

    Returns any

  • Mission_Fail(): void
  • Mission_Fail(): void
  • Ends an SP scenario with a Failure. Waits for no intel events to be playing before it ends the mission. After this is called, the path is set and any subsequent calls to Mission_Complete() or Mission_Fail() are ignored.

    Returns void

  • Ends an SP scenario with a Failure. Waits for no intel events to be playing before it ends the mission. After this is called, the path is set and any subsequent calls to Mission_Complete() or Mission_Fail() are ignored.

    Returns void

  • Missionomatic_ChallengeInit(playerSlot: number, playerData: any): any
  • Missionomatic_CheckLeader(leader: any): any
  • Regularly check on the Leader unit to see if it needs to surrender or do anything else; should only be called as a rule at a set interval

    Parameters

    • leader: any

    Returns any

  • Missionomatic_DisableTrainingByGoalKey(searchKey: VALUE, value: boolean): any
  • Finds any goal sequence that has a certain key, and toggles its state

    Parameters

    • searchKey: VALUE
    • value: boolean

    Returns any

  • Missionomatic_FlipLeader(): any
  • Missionomatic_InitPlayer(playerSlot: number, playerData: any): any
  • Initialize a player for use in campaign missions. Sets defaults for Player Names, Ages, and Colors, if not defined. Returns a World_GetPlayerAt value.

    Parameters

    • playerSlot: number
    • playerData: any

    Returns any

  • Missionomatic_InitializeLeader(bare: any): any
  • Sets up a Leader unit's custom Leader behaviour for use in a campaign mission

    Parameters

    • bare: any

    Returns any

  • Missionomatic_LeaderRecovery(leader: any): any
  • Recovers the Leader from surrender and returns it to player control

    Parameters

    • leader: any

    Returns any

  • Missionomatic_LeaderSurrender(leader: any): any
  • Initiates the surrender of a leader unit, temporarily removing it from player control

    Parameters

    • leader: any

    Returns any

  • Missionomatic_OnLeaderBridged(): any
  • Missionomatic_RespawnLeader(): any
  • Missionomatic_SetGateLock(egroup: EGroupID, locked: boolean): void
  • Missionomatic_SetGateLock_B(): void
  • Follow-up gate locking function, because you can't call two commands on an Entity in the same frame

    Returns void

  • Missionomatic_SpawnPickup(position: Position | MARKER, resource: string, amount: undefined | number): any
  • Modifier_Create(applicationType: number, modtype: string, usageType: number, exclusive: boolean, value: number, v: LuaBinding): ScarModifier
  • Returns a modifier that you can apply to stuff. applicationType : MAT_EntityType, MAT_Entity, MAT_Player, MAT_Squad, MAT_SquadType, or MAT_Weapon. modtype : Name of modifier from the modifiers table in the attribute editor. usageType : MUT_Addition, MUT_Multiplication, MUT_MultiplyAdd or MUT_Enable. exclusive : This field is not currently used for modifiers created through script. value : The value for the modifier. extname : The name of the entity/squad blueprint for when the applicationType is MAT_EntityType or MAT_SquadType.

    Parameters

    • applicationType: number
    • modtype: string
    • usageType: number
    • exclusive: boolean
    • value: number
    • v: LuaBinding

    Returns ScarModifier

  • Modifier_InitResourceBasedModifierTables(): any
  • Set up tables to track modifiers that are applied per resource The game specific /modifiers.scar file should define tables with an entry per resource and pass them as arguments

    Returns any

  • Modifier_IsEnabled(pEntity: EntityID, modtype: string, bEnabledByDefault: boolean): boolean
  • Checks whether the modifier is enabled (requires an Entity and an Entity enable/disable modifier)

    Parameters

    • pEntity: EntityID
    • modtype: string
    • bEnabledByDefault: boolean

    Returns boolean

  • Modifier_IsEnabledOnEGroup(egroup: EGroupID, modifier: string, modtype: string, all: boolean, bEnabledByDefault: boolean): void
  • Checks if a modifier is enabled on all or any entities in an egroup

    Parameters

    • egroup: EGroupID
    • modifier: string
    • modtype: string
    • all: boolean
    • bEnabledByDefault: boolean

    Returns void

  • Modifier_Remove(modifier: Modids): void
  • Set up tables to track modifiers that are applied per resource Remove an applied modifier. The game specific /modifiers.scar file should define tables with an entry per resource and pass them as arguments

    result

    Parameters

    Returns void

  • Modifier_RemoveAllFromEGroup(egroup: EGroupID): void
  • Modifier_RemoveAllFromSGroup(sgroup: SGroupID): void
  • Modifies the maximum casting range of an ability. NOTE: it assumes that the actions that the ability executes can also handle the modified range

    Parameters

    Returns Modids

  • Modifies the minimum casting range of an ability. NOTE: it assumes that the actions that the ability executes can also handle the modified range

    Parameters

    Returns Modids

  • Modify_CoverCaptureTime(egroup: EGroupID, scalefactor: number): Modids
  • Modify_EnableIsVisibleInFOW(group: EGroupID, enable: boolean, durationSeconds: number): any
  • Modify whether or not the group is revealed in the fog of war.

    Parameters

    • group: EGroupID
    • enable: boolean
    • durationSeconds: number

    Returns any

  • Modify_EntityBuildTime(playerId: PlayerID, ebp: string, scalefactor: number): Modids
  • Modifies the time taken to build a particular EBP. This only affects the given player.

    Parameters

    • playerId: PlayerID
    • ebp: string
    • scalefactor: number

    Returns Modids

  • Modify_EntityConstructionRate(group: EGroupID, Factor: number, Usage: MUT): any
  • Modifies an entity's construction rate Should only be used on entities, NOT squads

    Parameters

    Returns any

  • Modify_EntityCost(player: PlayerID, blueprint: string, resourcetype: number, addition: number): Modids
  • Modify_EntityHealthRegen(group: EGroupID, Factor: number, Usage: MUT): any
  • Modify_EntityMaxHealth(group: EGroupID, Factor: number, Usage: MUT): any
  • Modify_FoodCarryCapacity(group: SGroupID, scalefactor: number, Usage: MUT): any
  • Modify_FoodGatherRate(group: SGroupID, scalefactor: number, Usage: MUT): any
  • Modify_GoldCarryCapacity(group: SGroupID, scalefactor: number, Usage: MUT): any
  • Modify_GoldGatherRate(group: SGroupID, scalefactor: number, Usage: MUT): any
  • Modify_PlayerExperienceReceived(player: PlayerID, factor: number): Modids
  • Raise or lower the ceiling that a player's pop cap can reach. The does NOT change the current pop cap, use Modify_PlayerPopCap() for that. Usage types are MUT_Multiplication (default) or MUT_Addition.

    Parameters

    Returns any

  • Modify_PlayerProductionRate(sgroup: PlayerID, scalefactor: number): Modids
  • Modify_PlayerResourceCap(playerId: PlayerID, resourceType: number, scalefactor: number, mathtype?: number): Modids
  • Modifies a player's resource cap. Possible math types are MUT_Multiplication, MUT_Addition.

    Parameters

    • playerId: PlayerID
    • resourceType: number
    • scalefactor: number
    • Optional mathtype: number

    Returns Modids

  • Modify_PlayerResourceRate(playerId: PlayerID, resourceType: number, scalefactor: number, mathtype?: number): Modids
  • Modifies a player's incoming resource rate. Possible math types are MUT_Multiplication, MUT_Addition.

    Parameters

    • playerId: PlayerID
    • resourceType: number
    • scalefactor: number
    • Optional mathtype: number

    Returns Modids

  • Modify_PlayerSightRadius(player: PlayerID, scalefactor: number): Modids
  • Modify_PlayerUpkeep(playerId: PlayerID, resourceType: number, scalefactor: number, mathtype?: number): Modids
  • Modifies the upkeep for a player's resource. Possible math types are MUT_Multiplication, MUT_Addition.

    Parameters

    • playerId: PlayerID
    • resourceType: number
    • scalefactor: number
    • Optional mathtype: number

    Returns Modids

  • Modify_ReceivedSuppression(sgroup: SGroupID, scalefactor: number): Modids
  • Modify_SquadAvailability(player: PlayerID, blueprint: string, addition: number): Modids
  • Modify_SquadCost(player: PlayerID, blueprint: string, resourcetype: number, addition: number): Modids
  • Modify_SquadHealthRegen(group: SGroupID, Factor: number, Usage: MUT, OPT_exclusive?: boolean): any
  • Modify_SquadInvulnerableToKnockback(group: SGroupID, disable: boolean): Modids
  • Modify_SquadMaxHealth(group: SGroupID, Factor: number, Usage: MUT): any
  • Modify_SquadShieldRegen(group: SGroupID, Factor: number, Usage: MUT): any
  • Modify_SquadTypeSightRadius(player: PlayerID, blueprint: string, scalefactor: number): Modids
  • Modify_StoneCarryCapacity(group: SGroupID, scalefactor: number, Usage: MUT): any
  • Modify_StoneGatherRate(group: SGroupID, scalefactor: number, Usage: MUT): any
  • Modify_TeamWeapon(group: SGroupID | EGroupID, modifier: string, scalefactor: number, hardpoint?: string): Modids
  • Modify_UnitVeterancyValue(group: EGroup | SGROUP, scalefactor: number, mathtype?: number): ModID
  • Modifies the Veterancy Experience value of the target SGroup, EGroup, Entity, or Squad. Mathtype is Multiplication by default

    Parameters

    • group: EGroup | SGROUP
    • scalefactor: number
    • Optional mathtype: number

    Returns ModID

  • Modify_VehicleRepairRate(player: PlayerID, factor: number, engineer_entity_blueprint: string): Modids
  • Modifies the turret rotation speed of a vehicle squad The hardpoint should be specified as a string - i.e. "hardpoint_01"

    Parameters

    Returns Modids

  • Increases the received accuracy, penetration, and damage on a squad by the scalefactor. For example, a scalefactor of 2 means that the squad gets 2x the received accuracy, 2x the received penetration, and 2x the received damage.

    Parameters

    Returns Modids

  • Modifies a squad's weapon burst length (time). The hardpoint should be specified as a string - i.e. "hardpoint_01"

    Parameters

    Returns Modids

  • Modifies a squad's weapon rate of fire. The hardpoint should be specified as a string - i.e. "hardpoint_01"

    Parameters

    Returns Modids

  • Modifies a squad's weapon cooldown time. The hardpoint should be specified as a string - i.e. "hardpoint_01"

    Parameters

    Returns Modids

  • Modifies a squad's weapon penetration. Does not work on artillery (mortar, nebelwerfer, etc.) The hardpoint should be specified as a string - i.e. "hardpoint_01"

    Parameters

    Returns Modids

  • Modifies a squad's weapon range. Does not work on artillery (mortar, nebelwerfer, etc.) The hardpoint should be specified as a string - i.e. "hardpoint_01"

    Parameters

    Returns Modids

  • Modifies a squad's weapon suppression. Does not work on artillery (mortar, nebelwerfer, etc.) The hardpoint should be specified as a string - i.e. "hardpoint_01"

    Parameters

    Returns Modids

  • Modify_WoodCarryCapacity(group: SGroupID, scalefactor: number, Usage: MUT): any
  • Modify_WoodGatherRate(group: SGroupID, scalefactor: number, Usage: MUT): any
  • MovieCapture_Start(lowResolution: boolean): any
  • Start capturing a movie, optionally downscaling to low resolution.

    Parameters

    • lowResolution: boolean

    Returns any

  • MovieCapture_Stop(): any
  • Music_GetDefaultMovement(): string
  • Gets the 'default music movement'. This is the current default that can always be called

    Returns string

  • Music_GetMusicEventIntensityLevel(music: string): any
  • Translates the string music event level into the engine designated intensity value

    Parameters

    • music: string

    Returns any

  • Music_LockIntensity(level: number, OPT_duration?: number): any
  • Lock the music's intensity to a given level, for a given length of time (if you omit duration, the music plays indefinately until Music_UnlockIntensity is called) You can chain several level/duration pairs together to create a playlist of sorts. To do this, just use more parameters: Music_LockIntensity(level1, duration1, level2, duration2, ...)

    Parameters

    • level: number
    • Optional OPT_duration: number

    Returns any

  • Music_Outro_End(): any
  • Music_PlayDefaultMovement(): any
  • Play Music at the 'default music movement' Set current music movement with Music_SetDefaultMovement

    Returns any

  • Music_PlayMovement(movement: string): any
  • Plays a specific movement immediately - useful for things like NISes

    Parameters

    • movement: string

    Returns any

  • Music_PlayStinger(Stinger: string): any
  • Plays a stinger audio event. The wwise event should handle ducking, ending, etc.

    Parameters

    • Stinger: string

    Returns any

  • Music_PostCombat_End(): any
  • Plays the music short end outro segement after combat finishes and goes to silence for around 20 secs.

    Returns any

  • Music_RestartAfterObjective(duration: number): any
  • This restart the music after objective after certain

    Parameters

    • duration: number

    Returns any

  • Music_SetDefaultMovement(newMovement: string): void
  • Sets the 'default music movement'. This is the current default that can always be called

    Parameters

    • newMovement: string

    Returns void

  • Music_SetIntensityAfterObjective(delay: number, level: number, duration: number): void
  • This restart the music after objective after certain

    Parameters

    • delay: number
    • level: number
    • duration: number

    Returns void

  • Music_Stop(): any
  • Music_StopAfterObjective(delay: number): any
  • This stops music after objective and make sound go to silence

    Parameters

    • delay: number

    Returns any

  • Music_UnlockIntensity(): any
  • NIS_CameraCheckpoint(): any
  • ONLY USE THIS INSIDE AN NIS EVENT. Wait until the NIS camera hits its counterpart checkpoint. Makes the script pause and wait until the camera portion hits "nis_pause()" (the counterpart checkpoint) on it's timeline. With these two functions, you can have the event script and camera sync up - i.e. make one wait for the other - at various points in the NIS and avoid all sorts of timing issues.

    Returns any

  • NIS_END(details?: any): void
  • ONLY USE THIS INSIDE AN NIS EVENT. Transition from the NIS back to the game. You can safely do any cleanup after calling this, and it will occur once the screen is black.

    Parameters

    • Optional details: any

    Returns void

  • NIS_FadeCameraCut(): any
  • Used to create a fade cut in an NIS Call this in your NIS Event. This will require an nis_pause() frame in your NIS file in order to work.

    Returns any

  • NIS_PREAMBLE(details: any): void
  • ONLY USE THIS INSIDE AN NIS EVENT. Transition from the game into an NIS preamble - a quick section before the NIS proper. A preamble is totally optional, if you want to go straight into an NIS, skip this and use NIS_START instead. See NIS_START for information about the details table.

    Parameters

    • details: any

    Returns void

  • NIS_START(details?: any): void
  • ONLY USE THIS INSIDE AN NIS EVENT. Transition from the game (or a preamble) into an NIS. You can do any setup after calling this, as that will occur once the screen has faded to black on the transition in. The game will fade back in to the NIS over the next half second or so (apart from opening cinematics, which is two seconds), so you may want to delay your first action accordingly. The details table should include, at the very least, the following items: style (NIS_OPENING, NIS_MID, or NIS_CLOSING), revealFOW (a Boolean). If you included details in a preamble, you don't need to supply them again here.

    Parameters

    • Optional details: any

    Returns void

  • NIS_StartDrift(totalTime?: number, driftScale?: number): void
  • ONLY USE THIS INSIDE AN NIS EVENT with an NIS camera. Starts the NIS camera drifting. "Drifting" moves the camera around in the shape of an infinity symbol, so it doesn't look quite so static.

    Parameters

    • Optional totalTime: number
    • Optional driftScale: number

    Returns void

  • NIS_StopDrift(): void
  • ONLY USE THIS INSIDE AN NIS EVENT with an NIS camera. Stops the NIS camera drifting. "Drifting" moves the camera around in the shape of an infinity symbol, so it doesn't look quite so static.

    Returns void

  • NIS_StoreCurrentCameraPos(): any
  • Stores the current camera position as the NIS's end_camera position. Useful if you want the camera to always end where the player was last looking. If it does not return a position, nothing will be stored.

    Returns any

  • NormalizeTable(): any
  • Wraps the input in a table and returns it. Does nothing if it was already a table.

    Returns any

  • Obj_Create(player: PlayerID, title: string, desc: string, icon: string, type: number, medalPBG: MedalBlueprint): number
  • Create an objective and returns the unique ID for it type could either be OT_Primary, OT_Secondary or OT_Medal

    Parameters

    Returns number

  • Obj_Delete(objectiveID: number): any
  • Obj_DeleteAll(): any
  • Obj_GetCounterCount(objectiveID: number): any
  • Get the count of the counter on the objective.

    Parameters

    • objectiveID: number

    Returns any

  • Obj_GetCounterMax(objectiveID: number): any
  • Get the maximum count of the counter on the objective.

    Parameters

    • objectiveID: number

    Returns any

  • Obj_GetCounterType(objectiveID: number): any
  • Obj_GetProgress(objectiveID: number): any
  • Obj_GetProgressVisible(objectiveID: number): any
  • Get objective progress bar visibility (not deterministic)

    Parameters

    • objectiveID: number

    Returns any

  • Obj_GetState(objectiveID: number): number
  • Get objective state ( OS_Off, OS_Incomplete, OS_Complete, OS_Failed )

    Parameters

    • objectiveID: number

    Returns number

  • Obj_GetVisible(objectiveID: number): boolean
  • Obj_HideProgress(): any
  • Obj_HideProgressEx(progressBarIndex: number): any
  • Hide the specified objective progress panel.

    Parameters

    • progressBarIndex: number

    Returns any

  • Obj_SetColour(objectiveID: number, red: number, green: number, blue: number, alpha: number): void
  • Set colour of objective. In order red, green, blue, alpha.

    Parameters

    • objectiveID: number
    • red: number
    • green: number
    • blue: number
    • alpha: number

    Returns void

  • Obj_SetCounterCount(objectiveID: number, count: number): void
  • Set the count of the counter on the objective.

    Parameters

    • objectiveID: number
    • count: number

    Returns void

  • Obj_SetCounterMax(objectiveID: number, max: number): void
  • Set the maximum count of the counter on the objective.

    Parameters

    • objectiveID: number
    • max: number

    Returns void

  • Obj_SetCounterTimerSeconds(objectiveID: number, timerSeconds: number): void
  • Set the number of seconds on an objective with a timer. Only used to inform the UI.

    Parameters

    • objectiveID: number
    • timerSeconds: number

    Returns void

  • Obj_SetCounterType(objectiveID: number, counterType: number): void
  • Set the counter type of an objective.

    Parameters

    • objectiveID: number
    • counterType: number

    Returns void

  • Obj_SetDescription(objectiveID: number, desc: string): void
  • Set description text localization ID for the objective

    Parameters

    • objectiveID: number
    • desc: string

    Returns void

  • Obj_SetIcon(objectiveID: number, icon: string): void
  • Set icon path for the objective

    Parameters

    • objectiveID: number
    • icon: string

    Returns void

  • Obj_SetObjectiveFunction(id: number, fnType: number, f: any): void
  • Set callback functions for the objective. FN_OnActivate is for triggering situation report. FN_OnShow is used to assign UI element when tactical map is open. FN_OnSelect is used to assign UI element when the objective is highlighted

    Parameters

    • id: number
    • fnType: number
    • f: any

    Returns void

  • Obj_SetProgress(objectiveID: number, progress: number): void
  • Set objective progress bar value

    Parameters

    • objectiveID: number
    • progress: number

    Returns void

  • Obj_SetProgressBlinking(blinking: boolean): void
  • Make the objective progress bar blink or stop blinking.

    Parameters

    • blinking: boolean

    Returns void

  • Obj_SetProgressVisible(objectiveID: number, visible: boolean): void
  • Set objective progress bar visibility

    Parameters

    • objectiveID: number
    • visible: boolean

    Returns void

  • Obj_SetState(objectiveID: number, state: number): void
  • Set objective state ( OS_Off, OS_Incomplete, OS_Complete, OS_Failed )

    Parameters

    • objectiveID: number
    • state: number

    Returns void

  • Obj_SetTitle(objectiveID: number, title: string): void
  • Set title text localization ID for the objective

    Parameters

    • objectiveID: number
    • title: string

    Returns void

  • Obj_SetVisible(objectiveID: number, visible: boolean): void
  • Obj_ShowProgress(title: string, progress: number): any
  • Show the objective progress panel with a progress bar - call repeatedly to update progress. Value should be normalized between [0 - 1].

    Parameters

    • title: string
    • progress: number

    Returns any

  • Obj_ShowProgress2(title: string, progress: number): any
  • Show the objective progress panel with a progress bar - call repeatedly to update progress. Value should be normalized between [0 - 1]. Appears in center of screen.

    Parameters

    • title: string
    • progress: number

    Returns any

  • Obj_ShowProgressEx(progressBarIndex: number, title: string, progress: number, critical: boolean): any
  • Show the specified objective progress panel with a progress bar - call repeatedly to update progress. Value should be normalized between [0 - 1]. If critical, progress bar will pulse.

    Parameters

    • progressBarIndex: number
    • title: string
    • progress: number
    • critical: boolean

    Returns any

  • Obj_ShowProgressTimer(progress: number): any
  • Show the objective progress panel with a timer icon - call repeatedly to update progress. Value should be in seconds.

    Parameters

    • progress: number

    Returns any

  • Adds a map highlight around a specific point AreaType is AT_CIRCLE (the default) or AT_SQUARE. Color is a table with three values for red, green and blue - i.e. {255, 0, 0}.

    Parameters

    Returns ElementID

  • Adds a map highlight around a specific point AreaType is AT_CIRCLE (the default) or AT_SQUARE. Color is a table with three values for red, green and blue - i.e. {255, 0, 0}.

    Parameters

    Returns ElementID

  • Objective_AddGroundReticule(objTable: any, position: Position | MARKER, size?: number, reticuleBlueprint?: BP, hintpointTemplate?: string): ReticuleID
  • Objective_AddGroundReticule(objTable: any, position: Position | MARKER, size?: number, reticuleBlueprint?: BP, hintpointTemplate?: string): ReticuleID
  • Adds a visual splat on the ground in the world around a certain position, returning the ID The reticule blueprint (the circle on the ground) and the hintpoint template (the arrow) are by defualt taken from the objective type, but you can override them or set them to false to turn that element off.

    Parameters

    • objTable: any
    • position: Position | MARKER
    • Optional size: number
    • Optional reticuleBlueprint: BP
    • Optional hintpointTemplate: string

    Returns ReticuleID

  • Adds a visual splat on the ground in the world around a certain position, returning the ID The reticule blueprint (the circle on the ground) and the hintpoint template (the arrow) are by defualt taken from the objective type, but you can override them or set them to false to turn that element off.

    Parameters

    • objTable: any
    • position: Position | MARKER
    • Optional size: number
    • Optional reticuleBlueprint: BP
    • Optional hintpointTemplate: string

    Returns ReticuleID

  • Adds a Healthbar tied to a squad or entity at a location. Will update the health bar as the unit's health fluctuates. Can be removed with Objective_RemoveHealthBar or completing/failing the objective If you want to use one of the "global" progress bars (if your project supports them), supply the relevant barIndex value and text string to show alongside it.

    Parameters

    Returns ElementID

  • Adds a Healthbar tied to a squad or entity at a location. Will update the health bar as the unit's health fluctuates. Can be removed with Objective_RemoveHealthBar or completing/failing the objective If you want to use one of the "global" progress bars (if your project supports them), supply the relevant barIndex value and text string to show alongside it.

    Parameters

    Returns ElementID

  • Objective_AddTimerBar(objTable: any, barIndex?: number, text?: string | LocID): ElementID
  • Objective_AddTimerBar(objTable: any, barIndex?: number, text?: string | LocID): ElementID
  • Adds a Timer bar for objective timers, which is automatically updated. The bar can be removed with Objective_RemoveTimerBar or by completing/failing the objective. Requires a timer to have been started with Objective_StartTimer to work. If you want to use one of the "global" progress bars (if your project supports them), supply the relevant barIndex value and text string to show alongside it.

    Parameters

    • objTable: any
    • Optional barIndex: number
    • Optional text: string | LocID

    Returns ElementID

  • Adds a Timer bar for objective timers, which is automatically updated. The bar can be removed with Objective_RemoveTimerBar or by completing/failing the objective. Requires a timer to have been started with Objective_StartTimer to work. If you want to use one of the "global" progress bars (if your project supports them), supply the relevant barIndex value and text string to show alongside it.

    Parameters

    • objTable: any
    • Optional barIndex: number
    • Optional text: string | LocID

    Returns ElementID

  • Adds multiple UI elements on one position. 'pos' can be group/entity/squad/marker. worldArrow adds a 3D arrow which points to the thing in the world. hintpointText adds a hint point that appears on the thing when moused over. If you're adding an arrow or a hintpoint, this thing will be among those potentially pointed to by the 2D HUD arrow. objectiveArrowOffset is an offset applied to the arrow's position (you can specify a height offset or a 3D position offset).

    Parameters

    • objTable: any
    • pos: Position
    • Optional ping: boolean
    • Optional hintpointText: string
    • Optional worldArrow: boolean
    • Optional objectiveArrowOffset: number | Position
    • Optional objectiveArrowFacing: EntityID | Position | Squad
    • Optional actionType: HintPointActionType
    • Optional iconName: string
    • Optional templateName: string

    Returns ElementID

  • Adds multiple UI elements on one position. 'pos' can be group/entity/squad/marker. worldArrow adds a 3D arrow which points to the thing in the world. hintpointText adds a hint point that appears on the thing when moused over. If you're adding an arrow or a hintpoint, this thing will be among those potentially pointed to by the 2D HUD arrow. objectiveArrowOffset is an offset applied to the arrow's position (you can specify a height offset or a 3D position offset).

    Parameters

    • objTable: any
    • pos: Position
    • Optional ping: boolean
    • Optional hintpointText: string
    • Optional worldArrow: boolean
    • Optional objectiveArrowOffset: number | Position
    • Optional objectiveArrowFacing: EntityID | Position | Squad
    • Optional actionType: HintPointActionType
    • Optional iconName: string
    • Optional templateName: string

    Returns ElementID

  • Objective_AreAllPrimaryObjectivesComplete(): boolean
  • Objective_AreAllPrimaryObjectivesComplete(): boolean
  • Objective_AreSubObjectivesComplete(objTable: any, all: boolean): boolean
  • Objective_AreSubObjectivesComplete(objTable: any, all: boolean): boolean
  • Returns whether ALL or ANY sub-objectives of the given objective are complete

    Parameters

    • objTable: any
    • all: boolean

    Returns boolean

  • Returns whether ALL or ANY sub-objectives of the given objective are complete

    Parameters

    • objTable: any
    • all: boolean

    Returns boolean

  • Objective_AreSubObjectivesExpired(objTable: any, all: boolean): boolean
  • Returns whether ALL or ANY sub-objectives of the given objective are expired

    Parameters

    • objTable: any
    • all: boolean

    Returns boolean

  • Objective_AreSubObjectivesFailed(objTable: any, all: boolean): boolean
  • Objective_AreSubObjectivesFailed(objTable: any, all: boolean): boolean
  • Returns whether ALL or ANY sub-objectives of the given objective are failed

    Parameters

    • objTable: any
    • all: boolean

    Returns boolean

  • Returns whether ALL or ANY sub-objectives of the given objective are failed

    Parameters

    • objTable: any
    • all: boolean

    Returns boolean

  • Objective_BlinkUIElements(objTable: any, elementID: number): void
  • Objective_BlinkUIElements(objTable: any, elementID: number): void
  • Bring attention to some UI elements by blinking them. This causes the hintpoint and the off-screen arrow to blink, but leaves the minimap ping and other elements constant.

    Parameters

    • objTable: any
    • elementID: number

    Returns void

  • Bring attention to some UI elements by blinking them. This causes the hintpoint and the off-screen arrow to blink, but leaves the minimap ping and other elements constant.

    Parameters

    • objTable: any
    • elementID: number

    Returns void

  • Objective_Complete(objTable: any, showTitle?: boolean, playIntel?: boolean): void
  • Objective_Complete(objTable: any, showTitle?: boolean, playIntel?: boolean): void
  • Completes an objective and removes it from the list (unless it is a sub-objective, in which case it is marked as complete but stays visible until the parent objective is finished) Automatically removes any elements added with Objective_AddUIElements(). The showTitle and playIntel flags let you control whether the titlecard and Intel_Complete event are played (default: true).

    Parameters

    • objTable: any
    • Optional showTitle: boolean
    • Optional playIntel: boolean

    Returns void

  • Completes an objective and removes it from the list (unless it is a sub-objective, in which case it is marked as complete but stays visible until the parent objective is finished) Automatically removes any elements added with Objective_AddUIElements(). The showTitle and playIntel flags let you control whether the titlecard and Intel_Complete event are played (default: true).

    Parameters

    • objTable: any
    • Optional showTitle: boolean
    • Optional playIntel: boolean

    Returns void

  • Objective_Expire(objTable: any, showTitle?: boolean, playIntel?: boolean): void
  • Expires an objective and removes it from the list (unless it is a sub-objective, in which case it is marked as expired but stays visible until the parent objective is finished) Automatically removes any elements added with Objective_AddUIElements(). The showTitle and playIntel flags let you control whether the titlecard and Intel_Expire event are played (default: true).

    Parameters

    • objTable: any
    • Optional showTitle: boolean
    • Optional playIntel: boolean

    Returns void

  • Objective_Fail(objTable: any, showTitle?: boolean, playIntel?: boolean): void
  • Objective_Fail(objTable: any, showTitle?: boolean, playIntel?: boolean): void
  • Fails an objective and removes it from the list (unless it is a sub-objective, in which case it is marked as failed but stays visible until the parent objective is finished) Automatically removes any elements added with Objective_AddUIElements(). The showTitle and playIntel flags let you control whether the titlecard and Intel_Fail event are played (default: true).

    Parameters

    • objTable: any
    • Optional showTitle: boolean
    • Optional playIntel: boolean

    Returns void

  • Fails an objective and removes it from the list (unless it is a sub-objective, in which case it is marked as failed but stays visible until the parent objective is finished) Automatically removes any elements added with Objective_AddUIElements(). The showTitle and playIntel flags let you control whether the titlecard and Intel_Fail event are played (default: true).

    Parameters

    • objTable: any
    • Optional showTitle: boolean
    • Optional playIntel: boolean

    Returns void

  • Objective_GetCounter(objTable: any): number
  • Objective_GetCounter(objTable: any): number
  • Returns the current count associated with this objective.

    Parameters

    • objTable: any

    Returns number

  • Returns the current count associated with this objective.

    Parameters

    • objTable: any

    Returns number

  • Objective_GetSubObjectives(objTable: any): any
  • Objective_GetSubObjectives(objTable: any): any
  • Returns a table of all sub-objectives of the given objective

    Parameters

    • objTable: any

    Returns any

  • Returns a table of all sub-objectives of the given objective

    Parameters

    • objTable: any

    Returns any

  • Objective_GetTimerSeconds(objTable: any): number
  • Objective_GetTimerSeconds(objTable: any): number
  • Returns the amount of seconds on the timer (time remaining or time elapsed, based on the type of timer used)

    Parameters

    • objTable: any

    Returns number

  • Returns the amount of seconds on the timer (time remaining or time elapsed, based on the type of timer used)

    Parameters

    • objTable: any

    Returns number

  • Objective_IncreaseCounter(objTable: any, amount?: number): void
  • Objective_IncreaseCounter(objTable: any, amount?: number): void
  • Increases the counter that is associated with this objective in the UI. You can provide an amount to increase by.

    Parameters

    • objTable: any
    • Optional amount: number

    Returns void

  • Increases the counter that is associated with this objective in the UI. You can provide an amount to increase by.

    Parameters

    • objTable: any
    • Optional amount: number

    Returns void

  • Objective_IsComplete(objTable: any): boolean
  • Objective_IsComplete(objTable: any): boolean
  • Objective_IsCounterSet(objTable: any): boolean
  • Objective_IsCounterSet(objTable: any): boolean
  • Returns true if a counter has been set for this objective

    Parameters

    • objTable: any

    Returns boolean

  • Returns true if a counter has been set for this objective

    Parameters

    • objTable: any

    Returns boolean

  • Objective_IsExpired(objTable: any): boolean
  • Objective_IsFailed(objTable: any): boolean
  • Objective_IsFailed(objTable: any): boolean
  • Objective_IsStarted(objTable: any): boolean
  • Objective_IsStarted(objTable: any): boolean
  • Returns whether an objective has been started. Completed and failed / expired objectives will also return true.

    Parameters

    • objTable: any

    Returns boolean

  • Returns whether an objective has been started. Completed and failed / expired objectives will also return true.

    Parameters

    • objTable: any

    Returns boolean

  • Objective_IsTimerSet(objTable: any): boolean
  • Objective_IsTimerSet(objTable: any): boolean
  • Returns true if a timer has been set for this objective

    Parameters

    • objTable: any

    Returns boolean

  • Returns true if a timer has been set for this objective

    Parameters

    • objTable: any

    Returns boolean

  • Objective_IsVisible(objTable: any): boolean
  • Objective_IsVisible(objTable: any): boolean
  • Objective_PauseTimer(objTable: any): void
  • Objective_PauseTimer(objTable: any): void
  • Pauses the objective's timer. If a timer has not been set, it does nothing.

    Parameters

    • objTable: any

    Returns void

  • Pauses the objective's timer. If a timer has not been set, it does nothing.

    Parameters

    • objTable: any

    Returns void

  • 'Registers' an objective. Wrapper function for Objective_Create with a few other features. Includes pings as defined by the objective table created in the main scar file. You can pass in a team or player, so that the objective only applies to it.

    Parameters

    Returns ObjectiveID

  • 'Registers' an objective. Wrapper function for Objective_Create with a few other features. Includes pings as defined by the objective table created in the main scar file. You can pass in a team or player, so that the objective only applies to it.

    Parameters

    Returns ObjectiveID

  • Objective_RemoveGroundReticule(): any
  • Objective_RemoveGroundReticule(): any
  • Objective_RemoveHealthBar(objectiveTable: any, healthBarID: Element): void
  • Objective_RemoveHealthBar(objectiveTable: any, healthBarID: Element): void
  • Objective_RemovePing(objectiveTable: any, PingID: number): void
  • Objective_RemovePing(objectiveTable: any, PingID: number): void
  • Removes a tactical map ping from an objective

    Parameters

    • objectiveTable: any
    • PingID: number

    Returns void

  • Removes a tactical map ping from an objective

    Parameters

    • objectiveTable: any
    • PingID: number

    Returns void

  • Objective_RemoveProgressBar(objTable: any): any
  • Objective_RemoveTimerBar(objectiveTable: any, timerBarID: Element): void
  • Objective_RemoveTimerBar(objectiveTable: any, timerBarID: Element): void
  • Objective_RemoveUIElements(objTable: any, elementID: number): void
  • Objective_RemoveUIElements(objTable: any, elementID: number): void
  • Removes a group of UI elements that were added by Objective_AddUIElements

    Parameters

    • objTable: any
    • elementID: number

    Returns void

  • Removes a group of UI elements that were added by Objective_AddUIElements

    Parameters

    • objTable: any
    • elementID: number

    Returns void

  • Objective_ResumeTimer(objTable: any): void
  • Objective_ResumeTimer(objTable: any): void
  • Resume the objective's timer. If a timer has not been set, it does nothing.

    Parameters

    • objTable: any

    Returns void

  • Resume the objective's timer. If a timer has not been set, it does nothing.

    Parameters

    • objTable: any

    Returns void

  • Objective_SetAlwaysShowDetails(objTable: any, title: boolean, hud_arrow: boolean, hintpoints: boolean): void
  • Objective_SetAlwaysShowDetails(objTable: any, title: boolean, hud_arrow: boolean, hintpoints: boolean): void
  • Sets whether this objective always shows detailed text, the HUD arrow, or the hintpoints. There can only be one objective at a time that forces the HUD arrow to show up. If you pass in 'nil' for hud_arrow then its behavior is not affected.

    Parameters

    • objTable: any
    • title: boolean
    • hud_arrow: boolean
    • hintpoints: boolean

    Returns void

  • Sets whether this objective always shows detailed text, the HUD arrow, or the hintpoints. There can only be one objective at a time that forces the HUD arrow to show up. If you pass in 'nil' for hud_arrow then its behavior is not affected.

    Parameters

    • objTable: any
    • title: boolean
    • hud_arrow: boolean
    • hintpoints: boolean

    Returns void

  • Objective_SetCounter(objTable: any, current: number, maximum?: number): void
  • Objective_SetCounter(objTable: any, current: number, maximum?: number): void
  • Sets a counter that is associated with this objective in the UI. You can provide a 'maximum' so that it shows up as "1 of 5"

    Parameters

    • objTable: any
    • current: number
    • Optional maximum: number

    Returns void

  • Sets a counter that is associated with this objective in the UI. You can provide a 'maximum' so that it shows up as "1 of 5"

    Parameters

    • objTable: any
    • current: number
    • Optional maximum: number

    Returns void

  • Objective_SetProgressBar(objTable: any, value: number, OPT_flashing?: boolean, OPT_barIndex?: number, OPT_text?: string): void
  • Show a progress bar for this objective with the given value (which should be a percentage from 0.0 (empty) to 1.0 (full)). This bar can be removed with Objective_RemoveProgressBar or by completing or failing the mission. If you want to use one of the "global" progress bars (if your project supports them), supply the relevant barIndex value and text string to show alongside it.

    Parameters

    • objTable: any
    • value: number
    • Optional OPT_flashing: boolean
    • Optional OPT_barIndex: number
    • Optional OPT_text: string

    Returns void

  • Objective_Show(objective_table: any, on: boolean, ShowTitle: boolean): void
  • Objective_Show(objective_table: any, on: boolean, ShowTitle: boolean): void
  • Shows or hides an objective from the UI and tactical map

    Parameters

    • objective_table: any
    • on: boolean
    • ShowTitle: boolean

    Returns void

  • Shows or hides an objective from the UI and tactical map

    Parameters

    • objective_table: any
    • on: boolean
    • ShowTitle: boolean

    Returns void

  • Objective_Start(objTable: any, showTitle?: boolean, playIntel?: boolean): void
  • Objective_Start(objTable: any, showTitle?: boolean, playIntel?: boolean): void
  • Shows an objective to the player and activates it Includes pings and FOW as defined by the SetupUI() function. The showTitle and playIntel flags let you control whether the titlecard and Intel_Start event are played (default: true).

    Parameters

    • objTable: any
    • Optional showTitle: boolean
    • Optional playIntel: boolean

    Returns void

  • Shows an objective to the player and activates it Includes pings and FOW as defined by the SetupUI() function. The showTitle and playIntel flags let you control whether the titlecard and Intel_Start event are played (default: true).

    Parameters

    • objTable: any
    • Optional showTitle: boolean
    • Optional playIntel: boolean

    Returns void

  • Objective_StartTimer(objTable: any, direction: number, initialTime?: number, flashThreshold?: number): void
  • Objective_StartTimer(objTable: any, direction: number, initialTime?: number, flashThreshold?: number): void
  • Starts a timer that is associated with this objective in the UI. Use COUNT_DOWN or COUNT_UP for the 'direction' parameter

    Parameters

    • objTable: any
    • direction: number
    • Optional initialTime: number
    • Optional flashThreshold: number

    Returns void

  • Starts a timer that is associated with this objective in the UI. Use COUNT_DOWN or COUNT_UP for the 'direction' parameter

    Parameters

    • objTable: any
    • direction: number
    • Optional initialTime: number
    • Optional flashThreshold: number

    Returns void

  • Objective_Stop(objTable: any): void
  • Objective_Stop(objTable: any): void
  • Stops an objective that is in progress and puts it back into the waiting-to-start state

    extdesc

    Parameters

    • objTable: any

    Returns void

  • Stops an objective that is in progress and puts it back into the waiting-to-start state

    extdesc

    Parameters

    • objTable: any

    Returns void

  • Objective_StopCounter(objTable: any): void
  • Objective_StopCounter(objTable: any): void
  • Stops the objective's counter. If a counter has not been set, it does nothing.

    Parameters

    • objTable: any

    Returns void

  • Stops the objective's counter. If a counter has not been set, it does nothing.

    Parameters

    • objTable: any

    Returns void

  • Objective_StopTimer(objTable: any): void
  • Objective_StopTimer(objTable: any): void
  • Stops the objective's timer. If a timer has not been set, it does nothing.

    Parameters

    • objTable: any

    Returns void

  • Stops the objective's timer. If a timer has not been set, it does nothing.

    Parameters

    • objTable: any

    Returns void

  • Objective_TogglePings(objective_table: any, on: boolean): void
  • Objective_TogglePings(objective_table: any, on: boolean): void
  • Objective_TriggerTitleCard(): any
  • Objective_TriggerTitleCard(): any
  • ONLY CALL THIS FROM INSIDE AN OBJECTIVE'S INTEL START / COMPLETE / FAIL EVENT. The objective titlecard will present itself at this point inside the event. If you omit this call, the titlecard will appear at the end of the event by default. You also do not have to wrap this with CTRL and WAIT stuff - it does all of the internally.

    Returns any

  • ONLY CALL THIS FROM INSIDE AN OBJECTIVE'S INTEL START / COMPLETE / FAIL / EXPIRE EVENT. The objective titlecard will present itself at this point inside the event. If you omit this call, the titlecard will appear at the end of the event by default. You also do not have to wrap this with CTRL and WAIT stuff - it does all of the internally.

    Returns any

  • Objective_UpdateText(objTable: any, new_title: string, new_description: string, showTitle?: boolean, immediate?: boolean): void
  • Objective_UpdateText(objTable: any, new_title: string, new_description: string, showTitle?: boolean, immediate?: boolean): void
  • Updates the title and description for the objective. If you only want to set one of them, pass in nil for the other Use the immediate flag to make this change happen immediately, bypassing the queue that objective updates normally sit in (i.e. you're updating the objective's title in the middle of its PreStart() function!)

    Parameters

    • objTable: any
    • new_title: string
    • new_description: string
    • Optional showTitle: boolean
    • Optional immediate: boolean

    Returns void

  • Updates the title and description for the objective. If you only want to set one of them, pass in nil for the other Use the immediate flag to make this change happen immediately, bypassing the queue that objective updates normally sit in (i.e. you're updating the objective's title in the middle of its PreStart() function!)

    Parameters

    • objTable: any
    • new_title: string
    • new_description: string
    • Optional showTitle: boolean
    • Optional immediate: boolean

    Returns void

  • PBG_ReloadMouseOverEntity(): any
  • PBG_ReloadMouseOverSquad(): any
  • PBG_ReloadMouseOverWeapon(): any
  • Path_ClearCells(): any
  • Path_DrawImpass(): any
  • Path_DrawPath(): any
  • Path_DrawPathMap(onoff: boolean): any
  • Path_ShowCell(x: number, y: number): any
  • Path_ShowPreciseCell(x: number, y: number): any
  • Add pathfinding precise cell to draw cell list

    Parameters

    • x: number
    • y: number

    Returns any

  • Path_ToggleCollisionCircle(): any
  • PerfStats_Disable(): any
  • PerfStats_Dump(): any
  • PerfStats_Enable(): any
  • PerfStats_IsEnabled(): any
  • PerfStats_Toggle(): any
  • Physics_GetNumRBodies(): any
  • Physics_IsEnabled(): any
  • PlayerColour_ClearConfigChangedCallback(): any
  • PlayerColour_Disable(): any
  • PlayerColour_Enable(): any
  • Force enable player color that overrides the current "PlayerColour" setting.

    Returns any

  • PlayerColour_SetConfigChangedCallback(function_: any): void
  • Sets a callback firing when user changes the config for player colour

    Parameters

    • function_: any

    Returns void

  • PlayerUpgrades_Auto(playerID: PlayerID, includeCurrentAge: boolean, OPT_exceptions?: any, OPT_race?: string): any
  • Learns and hides upgrades for each player in mission based on individual CurrentAge and MaxAge.

    Parameters

    • playerID: PlayerID
    • includeCurrentAge: boolean
    • Optional OPT_exceptions: any
    • Optional OPT_race: string

    Returns any

  • PlayerUpgrades_HideAllUpgrades(playerID: PlayerID, desiredAge: number, race: string): any
  • PlayerUpgrades_LearnAllResearch(playerID: PlayerID, desiredAge: number, OPT_exceptions?: any, OPT_race?: string): any
  • Learns all research upgrades for player up to and including desiredAge.

    Parameters

    • playerID: PlayerID
    • desiredAge: number
    • Optional OPT_exceptions: any
    • Optional OPT_race: string

    Returns any

  • PlayerUpgrades_LearnAllUnits(playerID: PlayerID, desiredAge: number, OPT_exceptions?: any, OPT_race?: string): any
  • Learns all unit upgrades for player up to and including desiredAge.

    Parameters

    • playerID: PlayerID
    • desiredAge: number
    • Optional OPT_exceptions: any
    • Optional OPT_race: string

    Returns any

  • PlayerUpgrades_LockAllUpgrades(playerID: PlayerID, desiredAge: number, race: string): any
  • Specifies a marker where an ability cannot be used. This only applies to abilities where you use the cursor to pick a location in the world (like a location to paradrop at).

    Parameters

    Returns void

  • Player_AddResource(playerId: PlayerID, resourceType: number, value: number): void
  • Add resource to player, as opposed to just setting it. Player::AddResourceReason, the resource add reason enum, can be nil, RES_Other, RES_Gift, RES_Resourcing, RES_Refund, RES_RefundOnDeath

    Parameters

    • playerId: PlayerID
    • resourceType: number
    • value: number

    Returns void

  • Player_AddResources(playerId: PlayerID, resources: any): void
  • For the given player, get all of the squads gathered into a squadgroup of your naming. Squads will be added to given squad group. If the given squad group does not exist it will be created.

    Parameters

    • playerId: PlayerID
    • squadgroupName: string

    Returns SGroupID

  • Player_AddUnspentCommandPoints(player: PlayerID, points: number): void
  • Player_CanSeeEGroup(playerid: PlayerID, egroup: EGroupID, all: boolean): boolean
  • Player_CanSeeSGroup(playerid: PlayerID, sgroup: SGroupID, all: boolean): boolean
  • Player_CanSeeSquad(player: PlayerID, squad: SquadID, all: boolean): boolean
  • Returns true if a player can see ALL or ANY units in a given squad Set all to true to check that ALL units are visible or set to false to check for ANY.

    Parameters

    Returns boolean

  • Player_ClearArea(player: PlayerID, marker: MarkerID, invulnerable: boolean): void
  • Any of the player's units in the marker area move out of the area, and can be made invulnerable for a bit whilst they do it You can replace the marker with a position and a range - i.e. Player_ClearArea(player, pos, range, invulnerable)

    Parameters

    Returns void

  • Player_ClearAvailabilities(player: PlayerID): void
  • Player_ClearPopCapOverride(player: PlayerID): void
  • Player_ClearStateModelEnumTableTarget(player: Player, key: string, tableRowIndex: number): any
  • Clears a TargetHandle value in the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    • player: Player
    • key: string
    • tableRowIndex: number

    Returns any

  • Player_ClearStateModelTarget(player: Player, key: string): any
  • Clears a TargetHandle value in the Player's state model corresponding to the given key.

    Parameters

    Returns any

  • Player_FindFirstNeutralPlayer(player: PlayerID): any
  • Returns a player given a player id from the ME. NOTE: this is a temp function, and will be replaced with Player_FromName

    Parameters

    • id: number

    Returns PlayerID

  • Player_GetAIType(pPlayer: PlayerID): number
  • Returns the type of the given player if it is an AI. Possible types are: AII_None, AII_Normal, AII_LocalHumanTakeover, AII_RemoteAITakeover, AII_RemoteHumanTakeover (-1 if the player does not exist)

    Parameters

    Returns number

  • Creates/Clears groups that contain all of a player's units and buildings. Defaults - sg_allsquads and eg_allentities Fills an SGroup with all of the given player's squads, and an EGroup with all the player's entities. If you don't provide and groups, then it defaults to using sg_allsquads and eg_allentities.

    Parameters

    Returns void

  • Player_GetAllEntities(player: Player): any
  • Returns an sim::EntityGroupObs containing all the players entities including ones in squad. This function returns a 'global' entity group with the name '__Player%dEntities', where %d is the player ID. This means that you should never need to destroy it./n However, if you do destroy it, it will be recreated the next time this function is called.

    Parameters

    Returns any

  • Player_GetAllEntitiesFromType(player: PlayerID, unitType: string): EGroup
  • Returns an EGroup containing all of the players entities(including non_squad entities) of a specific unit_type (as defined by the type_ext on the entity) This function returns a new EGroup to allow tracking of different types.

    Parameters

    Returns EGroup

  • Gather together all of a player's entities that are in proximity to a marker, a position, or within a territory sector into an EGroup. The EGroup is cleared beforehand. You can override a marker's normal proximity by specifying a range.

    Parameters

    Returns void

  • Gather together all of a player's squads that are in proximity to a marker, a position, or within a territory sector into an SGroup. The SGroup is cleared beforehand. You can override a marker's normal proximity by specifying a range.

    Parameters

    Returns void

  • Player_GetBuildingsCount(playerId: PlayerID): number
  • Player_GetCurrentAge(player: PlayerID): number
  • Returns a number corresponding to the player's latest age upgrade. The result is a number from 1 to 4, but they are also mapped onto these constants: AGE_DARK, AGE_FEUDAL, AGE_CASTLE or AGE_IMPERIAL

    Parameters

    Returns number

  • Player_GetCurrentPopulation(player: PlayerID, capType: number): number
  • Use capType CT_Personnel to get current squad cap, CT_Vehicle to get current vehicle cap, CT_Medic to get current medic cap

    Parameters

    Returns number

  • Player_GetDisplayName(player: PlayerID): string
  • Returns an EntityGroupObs containing all the players entities. This function returns a 'global' entity group with the name '__Player%dEntities', where %d is the player ID. This means that you should never need to destroy it./n However, if you do destroy it, it will be recreated the next time this function is called.

    Parameters

    Returns EGroupID

  • Gets all the player's current entities and loads them into the specified egroup. Gets all the player's current entities and loads them into the specified egroup. The egroup is cleared before being loaded.

    Parameters

    Returns any

  • Player_GetEntitiesFromType(player: PlayerID, unitType: string): EGroup
  • Returns an EGroup containing all of the players entities(excluding non_squad entities) of a specific unit_type (as defined by the type_ext on the entity) This function returns a new EGroup to allow tracking of different types.

    Parameters

    Returns EGroup

  • Player_GetEntityConcentration(player: PlayerID, popcapOnly?: boolean, includeBlueprints?: any, excludeBlueprints?: any, bLeastConcentrated?: boolean, onlyInThisMarker?: any): EGroup
  • Finds the greatest (or least) concentration of entities owned by a player. This function is slow, so don't call it very often

    Parameters

    • player: PlayerID
    • Optional popcapOnly: boolean
    • Optional includeBlueprints: any
    • Optional excludeBlueprints: any
    • Optional bLeastConcentrated: boolean
    • Optional onlyInThisMarker: any

    Returns EGroup

  • Player_GetEntityCount(player: PlayerID): number
  • Player_GetEntityCountByUnitType(player: Player, unitTypeString: string): any
  • Player_GetEntityName(player: PlayerID, index: number): string
  • Player_GetMaxPopulation(player: PlayerID, capType: number): number
  • Use capType CT_Personnel to get max squad cap or CT_VehicleCap to get max vehicle cap.

    Parameters

    Returns number

  • Player_GetMaximumAge(player: PlayerID): number
  • Returns a number corresponding to the maximum age a player can reach The result is a number from 1 to 4, but they are also mapped onto these constants: AGE_DARK, AGE_FEUDAL, AGE_CASTLE or AGE_IMPERIAL

    Parameters

    Returns number

  • Player_GetNumGatheringSquads(player: Player, type: number): any
  • Returns the number of squads currently gathering resources of a given type

    Parameters

    Returns any

  • Player_GetNumStrategicPoints(p: PlayerID): number
  • Player_GetNumVictoryPoints(p: PlayerID): number
  • Player_GetPopulationPercentage(playerid: PlayerID, captype?: number): number
  • Gets the current personnel or vehicle population as a percetange of the current max-cap. The captype is either CT_Personnel or CT_Vehicle. captype is CT_Personnel by default. If MaxPopulation is 0, returns 1.0

    Parameters

    • playerid: PlayerID
    • Optional captype: number

    Returns number

  • Player_GetRace(player: PlayerID): number
  • Player_GetRaceName(player: PlayerID): string
  • Returns the name of the race for a given player (eg. allies, allies_commonwealth, axis, axis_panzerelite) and always in english

    Parameters

    Returns string

  • Returns the relationship between 2 players. Possible relationships are R_ENEMY, R_ALLY, R_NEUTRAL, R_UNDEFINED.

    Parameters

    Returns number

  • Player_GetResource(player: PlayerID, resourceType: number): number
  • Returns the amount of resources a given player has. Possible resource types are RT_Manpower, RT_Fuel, RT_Munition, RT_Action, RT_Command

    Parameters

    Returns number

  • Player_GetResourceRate(player: PlayerID, resourceType: number): number
  • Returns the amount of resources a given player is getting per second. Possible resource types are RT_Manpower, RT_Fuel, RT_Munition, RT_Action, RT_Command

    Parameters

    Returns number

  • Player_GetResources(player: Player): any
  • Player_GetSlotIndex(player: Player): any
  • Player_GetSquadConcentration(player: PlayerID, popcapOnly?: boolean, includeBlueprints?: any, excludeBlueprints?: any, bLeastConcentrated?: boolean, onlyInThisMarker?: any): SGROUP
  • Finds the greatest (or least) concentration of squads owned by a player. This function is slow, so don't call it very often

    Parameters

    • player: PlayerID
    • Optional popcapOnly: boolean
    • Optional includeBlueprints: any
    • Optional excludeBlueprints: any
    • Optional bLeastConcentrated: boolean
    • Optional onlyInThisMarker: any

    Returns SGROUP

  • Player_GetSquadCount(player: PlayerID): number
  • Returns a SquadGroupObs containing all the players units. This function returns a 'global' squad group with the name '__Player%dSquads', where %d is the player ID. This means that you should never need to destroy it./n However, if you do destroy it, it will be recreated the next time this function is called.

    Parameters

    Returns SGroupID

  • Returns an SGroup containing all of the players squads of a specific unit_type (as defined by the type_ext on the squad) This function returns a new SGroup.

    Parameters

    Returns SGROUP

  • Player_GetSquadsOnscreen(player: Player, sgroup: SGROUP): void
  • Finds all on-screen squads for the passed player, clearing and filling the sgroup with those squads

    Parameters

    Returns void

  • Player_GetStateModelBool(player: Player, key: string): any
  • Returns a boolean value from the Player's state model corresponding to the given key.

    Parameters

    Returns any

  • Player_GetStateModelEntityTarget(player: Player, key: string): any
  • Returns an Entity value from the Player's state model corresponding to the given key.

    Parameters

    Returns any

  • Player_GetStateModelEnumTableBool(player: Player, key: string, tableRowIndex: number): any
  • Returns a boolean value from the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    • player: Player
    • key: string
    • tableRowIndex: number

    Returns any

  • Player_GetStateModelEnumTableEntityTarget(player: Player, key: string, tableRowIndex: number): any
  • Returns an Entity value from the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    • player: Player
    • key: string
    • tableRowIndex: number

    Returns any

  • Player_GetStateModelEnumTableFloat(player: Player, key: string, tableRowIndex: number): any
  • Returns a float value from the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    • player: Player
    • key: string
    • tableRowIndex: number

    Returns any

  • Player_GetStateModelEnumTableInt(player: Player, key: string, tableRowIndex: number): any
  • Returns an integer value from the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    • player: Player
    • key: string
    • tableRowIndex: number

    Returns any

  • Player_GetStateModelEnumTablePlayerTarget(player: Player, key: string, tableRowIndex: number): any
  • Returns a Player value from the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    • player: Player
    • key: string
    • tableRowIndex: number

    Returns any

  • Player_GetStateModelEnumTableSquadTarget(player: Player, key: string, tableRowIndex: number): any
  • Returns a Squad value from the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    • player: Player
    • key: string
    • tableRowIndex: number

    Returns any

  • Player_GetStateModelEnumTableVector3f(player: Player, key: string, tableRowIndex: number): any
  • Returns a Vector3f value from the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    • player: Player
    • key: string
    • tableRowIndex: number

    Returns any

  • Player_GetStateModelFloat(player: Player, key: string): any
  • Returns a float value from the Player's state model corresponding to the given key.

    Parameters

    Returns any

  • Player_GetStateModelInt(player: Player, key: string): any
  • Returns an integer value from the Player's state model corresponding to the given key.

    Parameters

    Returns any

  • Player_GetStateModelPlayerTarget(player: Player, key: string): any
  • Returns a Player value from the Player's state model corresponding to the given key.

    Parameters

    Returns any

  • Player_GetStateModelSquadTarget(player: Player, key: string): any
  • Returns a Squad value from the Player's state model corresponding to the given key.

    Parameters

    Returns any

  • Player_GetStateModelVector3f(player: Player, key: string): any
  • Returns a Vector3f value from the Player's state model corresponding to the given key.

    Parameters

    Returns any

  • Player_GetStrategicPointCaptureProgress(player: PlayerID, strategicPoint: EntityID): any
  • Returns a value (-1.0 to 1.0) of how close a point is to being controlled by the team of the player provided Progress between -1.0 and 0 means an enemy has progress toward owning a point. Values between 0 and 1.0 represent progress being made toward capture. 1.0 is a team controlled point. -1.0 is an enemy controlled point.

    Parameters

    Returns any

  • Player_GetTotalPopulation(player: Player): any
  • Gets the toal population including Personnel, Vehicle and Medic Directly uses the C++ API Player_GetCurrentPopulation to get the current population for CT_Personnel, CT_Vehicle and CT_Medic.

    Parameters

    Returns any

  • Player_GetUIColour(player: Player): any
  • Returns the UI colour of a player with respect to the local machine. Access with .r .g .b .a. Values are in the range 0-255.

    Parameters

    Returns any

  • Player_GetUnitCount(player: PlayerID): number
  • Player_GiftResource(player: Player, type: number, amount: number): any
  • Set the gifted resource amount for a given player A positive resource amount means the player receives the resources A negative resource amount means the player sends the resources Ignores income cap and resource sharing.

    Parameters

    • player: Player
    • type: number
    • amount: number

    Returns any

  • Returns true if this player owns any buildings listed in the table. This only looks at completed buildings - use Player_HasBuildingUnderConstruction to see if the player is building something

    Parameters

    Returns boolean

  • Player_HasCapturingSquadNearStrategicPoint(player: PlayerID, strategicPoint: EntityID): any
  • Returns true if the given player has units that are able to capture in the capturable area of the given strategic point

    Parameters

    Returns any

  • Player_HasMapEntryPosition(player: PlayerID): boolean
  • Player_IsAlive(player: PlayerID): boolean
  • Returns true if player is still alive and false if player is dead. Will error if playerIdx is an invalid index.

    Parameters

    Returns boolean

  • Player_IsHuman(pPlayer: PlayerID): boolean
  • Returns whether a player is human controlled (local or remote), not dead, and not replaced by an AI

    Parameters

    Returns boolean

  • Player_IsSurrendered(player: Player): any
  • Returns true if player has surrendered and false if not. Will error if playerIdx is an invalid index.

    Parameters

    Returns any

  • Player_IsValid(id: number): any
  • Player_NumUpgradeComplete(player: PlayerID, upgradeName: string): number
  • Returns the number of upgrades that this player has. The upgradeName should be a relative filename (eg. upgrade/allies/research/phase_2.lua)

    Parameters

    Returns number

  • Player_OwnsEGroup(player: Player, egroup: EGroupID, all?: boolean): boolean
  • Player_OwnsSGroup(player: Player, sgroup: SGroupID, all?: boolean): boolean
  • Player_RemoveAllUpgrades(player: Player): any
  • Player_ResetResource(player: PlayerID, resourceType: number): void
  • Reset the resource amount for a given player to zero. Also reset team weapon Possible resource types are RT_Manpower, RT_Fuel, RT_Munition, RT_Action, RT_Command.

    Parameters

    Returns void

  • Player_RestrictAddOnList(playerid: PlayerID, addonlist: any): void
  • Restrict a list of addons. list should contain an array of strings to restrict.

    Parameters

    Returns void

  • Player_RestrictBuildingList(playerid: PlayerID, blueprintlist: any): void
  • Restrict a list of buildings. list should contain an array of strings to restrict.

    Parameters

    Returns void

  • Player_RestrictResearchList(playerid: Player, list: string[]): void
  • Restrict a list of research items. list should contain an array of strings to restrict.

    Parameters

    • playerid: Player
    • list: string[]

    Returns void

  • Player_SetAbilityAvailability(player: PlayerID, bp: any, availability: number): void
  • Sets the availability of an ability. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT

    Parameters

    • player: PlayerID
    • bp: any
    • availability: number

    Returns void

  • Player_SetAllCommandAvailabilityInternal(player: Player, availability: Availability, reason: string): void
  • Player_SetCommandAvailability(player: PlayerID, command: any, availability: number): void
  • Sets the availability of entity, squad and player commands. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT

    Parameters

    • player: PlayerID
    • command: any
    • availability: number

    Returns void

  • Player_SetConstructionMenuAvailability(player: PlayerID, menuname: any, availability: number): void
  • Sets the availability of a construction menu. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT

    Parameters

    • player: PlayerID
    • menuname: any
    • availability: number

    Returns void

  • Player_SetCurrentAge(player: PlayerID, age: number): void
  • Sets the current age of a player Age can be a number from 1 to 4, or any one of these: AGE_DARK, AGE_FEUDAL, AGE_CASTLE or AGE_IMPERIAL

    Parameters

    Returns void

  • Player_SetDefaultSquadMoodMode(pPlayer: PlayerID, mode: number): void
  • Set default squad mood mode which can be overrided by squad level mood mode settings

    Parameters

    Returns void

  • Player_SetEntityProductionAvailability(player: PlayerID, bp: any, availability: number): void
  • Sets the availability of an entity production item. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT

    Parameters

    • player: PlayerID
    • bp: any
    • availability: number

    Returns void

  • Player_SetMaxCapPopulation(playerid: PlayerID, captype: number, newcap: number): void
  • Sets the current personnel or vehicle max-cap for a player. The captype is either CT_Personnel or CT_Vehicle (you can't adjust Medic caps just yet). you will have to call Player_SetMaxPopulation to adjust the current max population to do this. Note that any modifiers that adjust the current max cap will be applied on top of this. Also note, this is only adjusting the max cap, not the current cap,

    Parameters

    • playerid: PlayerID
    • captype: number
    • newcap: number

    Returns void

  • Player_SetMaxPopulation(playerid: PlayerID, captype: number, newcap: number): void
  • Sets the current personnel or vehicle cap for a player. The captype is either CT_Personnel or CT_Vehicle (you can't adjust Medic caps just yet). Note that any modifiers that adjust the current cap will be applied on top of this. Also note, the current cap cannot go higher than the max cap.

    Parameters

    • playerid: PlayerID
    • captype: number
    • newcap: number

    Returns void

  • Player_SetMaximumAge(player: PlayerID, age: number): void
  • Sets the maximum age a player can progress to Age can be a number from 1 to 4, or any one of these: AGE_DARK, AGE_FEUDAL, AGE_CASTLE or AGE_IMPERIAL. You cannot build the landmark building at the end of the maximum age.

    Parameters

    Returns void

  • Player_SetPopCapOverride(player: PlayerID, personnel: number): void
  • Set the relationship that observer has to target. If the relationship does not match the current reputation, the reputation will be changed to match it.

    Parameters

    Returns void

  • Set the reputation that observer has to target. If the reputation does not match the current relationship, the relationship will be changed to match it.

    Parameters

    Returns void

  • Player_SetResource(player: PlayerID, resourceType: number, amt: number): void
  • Set the resource amount for a given player. Ignores income cap and resource sharing. Possible resource types are RT_Manpower, RT_Fuel, RT_Munition, RT_Action, RT_Command.

    Parameters

    • player: PlayerID
    • resourceType: number
    • amt: number

    Returns void

  • Player_SetResources(player: Player, resourceAmount: Record<number, number>): void
  • Set all the resource amount for a given player. Ignores income cap and resource sharing.

    Parameters

    • player: Player
    • resourceAmount: Record<number, number>

    Returns void

  • Player_SetSquadProductionAvailability(player: PlayerID, bp: any, availability: number): void
  • Sets the availability of a squad production item. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT

    Parameters

    • player: PlayerID
    • bp: any
    • availability: number

    Returns void

  • Player_SetStateModelBool(player: Player, key: string, value: boolean): void
  • Sets a boolean value in the Player's state model corresponding to the given key.

    Parameters

    • player: Player
    • key: string
    • value: boolean

    Returns void

  • Player_SetStateModelEntityTarget(player: Player, key: string, value: EntityID): void
  • Player_SetStateModelEnumTableBool(player: Player, key: string, tableRowIndex: number, value: boolean): void
  • Sets a boolean value in the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    • player: Player
    • key: string
    • tableRowIndex: number
    • value: boolean

    Returns void

  • Player_SetStateModelEnumTableEntityTarget(player: Player, key: string, tableRowIndex: number, value: EntityID): void
  • Sets an Entity TargetHandle value in the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • Player_SetStateModelEnumTableFloat(player: Player, key: string, tableRowIndex: number, value: number): void
  • Sets a float value in the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    • player: Player
    • key: string
    • tableRowIndex: number
    • value: number

    Returns void

  • Player_SetStateModelEnumTableInt(player: Player, key: string, tableRowIndex: number, value: number): void
  • Sets an integer value in the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    • player: Player
    • key: string
    • tableRowIndex: number
    • value: number

    Returns void

  • Player_SetStateModelEnumTablePlayerTarget(player: Player, key: string, tableRowIndex: number, value: PlayerID): void
  • Sets a Player TargetHandle value in the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • Player_SetStateModelEnumTableSquadTarget(player: Player, key: string, tableRowIndex: number, value: SquadID): void
  • Sets a Squad TargetHandle value in the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • Player_SetStateModelEnumTableVector3f(player: Player, key: string, tableRowIndex: number, value: Position): void
  • Sets a Vector3f value in the player's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • Player_SetStateModelFloat(player: Player, key: string, value: number): void
  • Sets a float value in the Player's state model corresponding to the given key.

    Parameters

    • player: Player
    • key: string
    • value: number

    Returns void

  • Player_SetStateModelInt(player: Player, key: string, value: number): void
  • Sets an integer value in the Player's state model corresponding to the given key.

    Parameters

    • player: Player
    • key: string
    • value: number

    Returns void

  • Player_SetStateModelPlayerTarget(player: Player, key: string, value: PlayerID): void
  • Player_SetStateModelSquadTarget(player: Player, key: string, value: SquadID): void
  • Sets a Squad TargetHandle value in the Player's state model corresponding to the given key.

    Parameters

    Returns void

  • Player_SetStateModelVector3f(player: Player, key: string, value: Position): void
  • Player_SetUpgradeAvailability(player: PlayerID, bp: any, availability: number): void
  • Sets the availability of an upgrade. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT

    Parameters

    • player: PlayerID
    • bp: any
    • availability: number

    Returns void

  • Player_StopEarningActionPoints(player: PlayerID): void
  • Position_GetAverage(): any
  • PrefabHelper_StandardTriggerSystem(instance_data: string, action_name: string, trigger_parameters: any): any
  • Add this helper function to your prefab's Init function to cover standard trigger zone functionality. It will call a Trigger function in your prefab when appropriate. Your schema needs to include the standard elements: trigger_enable, ignore_planes, trigger_player, trigger_zone and delay

    Parameters

    • instance_data: string
    • action_name: string
    • trigger_parameters: any

    Returns any

  • Prefab_ApplyDefaults(instance_data: string, prefab_schema: any): any
  • Applies the defaults listed in the prefab schema to the instance data. Any items NOT included explicitly in the instance data will have default values pulled from the schema.

    Parameters

    • instance_data: string
    • prefab_schema: any

    Returns any

  • Prefab_DoAction(instance_data: string, actionName: string, OPT_param1?: any, OPT_param2?: any): any
  • Calls an action function with a given name on an instance, making sure it calls the right version for the type of Prefab. Instance can be a string, this will convert it. Example: Calling the "Trigger" action on an instance that is a PlaneCrash prefab will look for a function called "PlaneCrash_Trigger"

    Parameters

    • instance_data: string
    • actionName: string
    • Optional OPT_param1: any
    • Optional OPT_param2: any

    Returns any

  • Prefab_ForcePostInit(): any
  • Finalize the initialization of any prefab instances that have been run through Prefab_Init(). This is automatically called one frame after a prefab is initialized, but you can force it early if necessary. If you are creating prefabs and using them in the same frame, call this function once, after all the Prefab_Inits, but before you start using them. This will force the post-initialization to occur early.

    Returns any

  • Prefab_GetAllOfType(instance_data: string, prefab_schema: any): any
  • Returns a table of all current prefabs matching the instance type

    Parameters

    • instance_data: string
    • prefab_schema: any

    Returns any

  • Returns the instance data for a given instance, specified by a number of methods. This normalizes your instance data. You can pass in the instance name as a string, a data table with an instance subtable (i.e. the input params from an event function) or a real instance data table, and it normalizes the format and returns you the instance data table.

    Parameters

    • instance: any

    Returns InstanceData

  • Prefab_Init(instance_data: any): string
  • Initialize a specific prefab instance. In many cases, this is all you need to do (see the documentation for the specific prefab for details)

    Parameters

    • instance_data: any

    Returns string

  • Prefab_IsValid(instance: string): boolean
  • Prefab_Reset(instance_data: string): any
  • Stop and restart a prefab instance, pulling a fresh set of the instance data from the WB-exported prefabs. This is meant for testing and debug purposes, rather than use in mission scripts.

    Parameters

    • instance_data: string

    Returns any

  • Prefab_Stop(instance_data: string): any
  • Stops a prefab instance from continuing to run. If the prefab has a prefabName_Stop() function, that will be called. Also, all events with the instance as the data parameter will be removed.

    Parameters

    • instance_data: string

    Returns any

  • Prefab_Trigger(instance_data: string): any
  • PrintOnScreen(text: string): void
  • Prints a message on the screen

    extdesc

    Prints the given message on the screen. It will stay there until you call PrintOnScreen_RemoveFromScreen() or print another message on the screen to replace it.

    Parameters

    • text: string

    Returns void

  • PrintOnScreen_Add(object: any, id: string, style?: string): PrintOnScreenID
  • Prints the lua content of an object on the screen

    extdesc

    Prints the given message on the screen. If you would like to print multiple messages without clearing them you can assign them unique ID's. Must use PrintOnScreen_Remove(id) to remove each instance

    Parameters

    • object: any
    • id: string
    • Optional style: string

    Returns PrintOnScreenID

  • PrintOnScreen_Remove(id: string): void
  • PrintOnScreen_RemoveFromScreen(): void
  • Remove any messages from the screen Removes from the screen any messages put there with PrintOnScreen()

    Returns void

  • Returns true if ANY or ALL entities from a group are in range of a given position, marker, or territory sector. Markers with proximity type rectangle will use circular proximity check if custom range is supplied\n You MUST specify a range if you are using a position rather than a marker.

    Parameters

    Returns boolean

  • Prox_ArePlayerEntitiesNearMarker(player: PlayerID, position: Position | MarkerID | SectorID, all: boolean, range?: number, filterlist?: any, filtertype?: number, ignore_camouflage?: boolean): boolean
  • Returns true if ANY or ALL of a player's entities are in range of a given position, marker, or territory sector. THIS FUNCTION IS VERY SLOW. DO NOT USE THIS UNLESS ABSOLUTELY NECESSARY. Markers with proximity type rectangle will use circular proximity check if custom range is supplied\n You MUST specify a range if you are using a position rather than a marker.\n

    Parameters

    • player: PlayerID
    • position: Position | MarkerID | SectorID
    • all: boolean
    • Optional range: number
    • Optional filterlist: any
    • Optional filtertype: number
    • Optional ignore_camouflage: boolean

    Returns boolean

  • Prox_ArePlayerMembersNearMarker(player: PlayerID, position: Position | MarkerID | SectorID, all: boolean, range?: number, filterlist?: any, filtertype?: number, ignore_camouflage?: boolean): boolean
  • Returns true if ANY or ALL of a player's members (i.e. individual guys, not squads as a whole) are in range of a given position, marker, or territory sector. DO NOT USE THIS FUNCTION UNLESS YOU ABSOLUTELY HAVE TO!! You MUST specify a range if you are using a position rather than a marker.

    Parameters

    • player: PlayerID
    • position: Position | MarkerID | SectorID
    • all: boolean
    • Optional range: number
    • Optional filterlist: any
    • Optional filtertype: number
    • Optional ignore_camouflage: boolean

    Returns boolean

  • Prox_ArePlayersNearMarker(player: PlayerID, position: Position | MarkerID | SectorID, all: boolean, range?: number, filterlist?: any, filtertype?: number, ignore_camouflage?: boolean): boolean
  • Returns true if ANY or ALL of a player's squads are in range of a given position, marker, or territory sector. THIS FUNCTION IS VERY SLOW. DO NOT USE THIS UNLESS ABSOLUTELY NECESSARY. Markers with proximity type rectangle will use circular proximity check if custom range is supplied\n You MUST specify a range if you are using a position rather than a marker.\n

    Parameters

    • player: PlayerID
    • position: Position | MarkerID | SectorID
    • all: boolean
    • Optional range: number
    • Optional filterlist: any
    • Optional filtertype: number
    • Optional ignore_camouflage: boolean

    Returns boolean

  • Returns true if ANY or ALL squad members (i.e. individual guys, not squads as a whole) from a group are in range of a given position, marker, or territory sector. DO NOT USE THIS FUNCTION UNLESS YOU ABSOLUTELY HAVE TO!! Markers with proximity type rectangle will use circular proximity check if custom range is supplied\n You MUST specify a range if you are using a position rather than a marker.\n

    Parameters

    Returns boolean

  • Returns true if ANY or ALL squads from a group are in range of a given position, marker, or territory sector Markers with proximity type rectangle will use circular proximity check if custom range is supplied\n You MUST specify a range if you are using a position rather than a marker.\n

    Parameters

    Returns boolean

  • Prox_AreTeamsNearMarker(team: TeamID, position: Position | MarkerID | SectorID, all: boolean, range?: number, filterlist?: any, filtertype?: number, ignore_camouflage?: boolean): boolean
  • Returns true if ANY or ALL of a teams's squads are in range of a given position, marker, or territory sector. THIS FUNCTION IS VERY SLOW. DO NOT USE THIS UNLESS ABSOLUTELY NECESSARY. Markers with proximity type rectangle will use circular proximity check if custom range is supplied\n You MUST specify a range if you are using a position rather than a marker.\n

    Parameters

    • team: TeamID
    • position: Position | MarkerID | SectorID
    • all: boolean
    • Optional range: number
    • Optional filterlist: any
    • Optional filtertype: number
    • Optional ignore_camouflage: boolean

    Returns boolean

  • Returns the distance between two entity groups. use checktype PROX_SHORTEST, PROX_LONGEST, or PROX_CENTER.

    extdesc

    If check is PROX_SHORTEST this will return the shortest distance between the two groups.\n If check is PROX_LONGEST this will return the longest distance between the two groups.\n If check is PROX_CENTER this will return the distance between the two groups centers.\n

    Parameters

    Returns number

  • Returns the distance between an entity group and a squad group. use checktype PROX_SHORTEST, PROX_LONGEST, or PROX_CENTER.

    extdesc

    If check is PROX_SHORTEST this will return the shortest distance between the two groups.\n If check is PROX_LONGEST this will return the longest distance between the two groups.\n If check is PROX_CENTER this will return the distance between the two groups centers.\n

    Parameters

    Returns number

  • Prox_EntitiesInProximityOfEntities(egroup1: EGroupID, egroup2: EGroupID, proximity: number, all: boolean): boolean
  • Checks if ALL or ANY entities are in proximity of a given entity group. Set "all" to true to check that ALL entities are in proximity, or set "all" to false to check for ANY.

    Parameters

    Returns boolean

  • Prox_GetRandomPosition(item: any, radius: number, minimum: number): Position
  • Takes something (Entity, Squad, SGroup, EGroup, Position) in, then returns a random position Minimum is ignored if it is greater than the radius Minimum is the distance from the origin point that is guaranteed to have a return greater than

    Parameters

    • item: any
    • radius: number
    • minimum: number

    Returns Position

  • Returns the distance between a marker and an entity group. use checktype PROX_SHORTEST, PROX_LONGEST, or PROX_CENTER.

    extdesc

    If check is PROX_SHORTEST this will return the shortest distance between the two groups.\n If check is PROX_LONGEST this will return the longest distance between the two groups.\n If check is PROX_CENTER this will return the distance between the two groups centers.\n

    Parameters

    Returns number

  • Returns the distance between a marker and a squad group. use checktype PROX_SHORTEST, PROX_LONGEST, or PROX_CENTER.

    extdesc

    If check is PROX_SHORTEST this will return the shortest distance between the two groups.\n If check is PROX_LONGEST this will return the longest distance between the two groups.\n If check is PROX_CENTER this will return the distance between the two groups centers.\n

    Parameters

    Returns number

  • Prox_PlayerEntitiesInProximityOfEntities(playerid: PlayerID, egroup: EGroupID, proximity: number, all: boolean, exclude: EntityID): boolean
  • Checks if ALL or ANY players squads are in proximity of a given entity group. Set "all" to true to check that ALL entities are in proximity, or set "all" to false to check for ANY.

    Parameters

    Returns boolean

  • Prox_PlayerEntitiesInProximityOfPlayerSquads(playerentities: PlayerID, playersquads: PlayerID, proximity: number, all: boolean): boolean
  • Checks if ALL or ANY players entities are in proximity of a given squad group. Set "all" to true to check that ALL entities are in proximity, or set "all" to false to check for ANY.

    Parameters

    Returns boolean

  • Prox_PlayerEntitiesInProximityOfSquads(playerid: PlayerID, sgroup: SGroupID, proximity: number, all: boolean): boolean
  • Checks if ALL or ANY players entities are in proximity of a given squad group. Set "all" to true to check that ALL entities are in proximity, or set "all" to false to check for ANY.

    Parameters

    Returns boolean

  • Prox_PlayerSquadsInProximityOfEntities(playerid: PlayerID, egroup: EGroupID, proximity: number, all: boolean, filterlist: any, filtertype: number, ignore_camouflage: boolean): boolean
  • Checks if ALL or ANY players squads are in proximity of a given entity group. Set "all" to true to check that ALL squads are in proximity, or set "all" to false to check for ANY.

    Parameters

    • playerid: PlayerID
    • egroup: EGroupID
    • proximity: number
    • all: boolean
    • filterlist: any
    • filtertype: number
    • ignore_camouflage: boolean

    Returns boolean

  • Prox_PlayerSquadsInProximityOfPlayerEntities(playersquads: PlayerID, playerentities: PlayerID, proximity: number, all: boolean): boolean
  • Checks if ALL or ANY players squads are in proximity of a given players entities. Set "all" to true to check that ALL squads are in proximity, or set "all" to false to check for ANY.

    Parameters

    Returns boolean

  • Prox_PlayerSquadsInProximityOfPlayerSquads(playerid1: PlayerID, playerid2: PlayerID, proximity: number, all: boolean): boolean
  • Checks if ALL or ANY players squads are in proximity of a given players squads. Set "all" to true to check that ALL squads are in proximity, or set "all" to false to check for ANY.

    Parameters

    Returns boolean

  • Prox_PlayerSquadsInProximityOfSquads(playerid: PlayerID, sgroup: SGroupID, proximity: number, all: boolean, exclude: SquadID, filterlist: any, filtertype: number, ignore_camouflage: boolean): boolean
  • Checks if ALL or ANY players squads are in proximity of a given squad group. Set "all" to true to check that ALL squads are in proximity, or set "all" to false to check for ANY.

    Parameters

    • playerid: PlayerID
    • sgroup: SGroupID
    • proximity: number
    • all: boolean
    • exclude: SquadID
    • filterlist: any
    • filtertype: number
    • ignore_camouflage: boolean

    Returns boolean

  • Returns the distance between two squad groups. use checktype PROX_SHORTEST, PROX_LONGEST, or PROX_CENTER.

    extdesc

    If check is PROX_SHORTEST this will return the shortest distance between the two groups.\n If check is PROX_LONGEST this will return the longest distance between the two groups.\n If check is PROX_CENTER this will return the distance between the two groups centers.\n

    Parameters

    Returns number

  • Prox_SquadsInProximityOfEntities(sgroup: SGroupID, egroup: EGroupID, proximity: number, all: boolean): boolean
  • Checks if ALL or ANY squads are in proximity of a given entity group. Set "all" to true to check that ALL squads are in proximity, or set "all" to false to check for ANY.

    Parameters

    Returns boolean

  • Prox_SquadsInProximityOfSquads(sgroup1: SGroupID, sgroup2: SGroupID, proximity: number, all: boolean): boolean
  • Checks if ALL or ANY squads are in proximity of a given squad group. Set "all" to true to check that ALL squads are in proximity, or set "all" to false to check for ANY.

    Parameters

    Returns boolean

  • Raiding_Activate(): any
  • Raiding_AddSpawnLocation(): any
  • Raiding_CountIdleRaiders(): any
  • Raiding_CountParties(): any
  • Raiding_Dectivate(): any
  • Raiding_ExtractAllSquads(): any
  • Raiding_Init(): any
  • Raiding_IsTimerValid(): any
  • Raiding_PruneParties(): any
  • Raiding_RemoveParty(): any
  • Raiding_SetPartyLimit(): void
  • Raiding_SetScouting(): void
  • Raiding_TriggerProbe(): any
  • Spawns an extremely basic, small probe attack meant to alert the player more than anything

    Returns any

  • Raiding_UpdateComposition(): any
  • Reinforcement_AreReinforcementsNeeded(module: ModuleTable): boolean
  • Reinforcement_GenerateReplacementUnitList(module: any, idealComposition: UnitTable): UnitTable
  • Generates a unit table of "missing units" that a module can then request to be provided. This takes the module's "ideal composition" and creates a unit list to fill the current composition back up to a portion of that ideal, as directed by the reinforcement settings.

    Parameters

    Returns UnitTable

  • Reinforcement_GetAllUnitsInRequestQueue(module: any): UnitTable
  • Return a UnitTable of all the units currently in the request queue for a module. This helps to avoid double-ordering reinforcements - you can add the units requested to the units present when considering whether to reinforce

    Parameters

    • module: any

    Returns UnitTable

  • Reinforcement_RequestHasBeenTriggered(module: ModuleTable, successfulRequestData: RequestData, skipAdjustments: boolean): any
  • Once a reinforcement request has been made, this should be called in order to update tracking This also makes any threshold adjustements, etc, specified in the reinforcements table. You need to pass in the requestData so it can be tracked, too, and counted in further reinforcement requests. The skipAdjustments flag lets you force-skip the adjustments step (i.e. you're backfilling after giving up units to supply another request)

    Parameters

    Returns any

  • Reinforcement_SetIdealComposition(module: any, units: UnitTable): void
  • Sets a module's "ideal composition" to a given unit table, overriding what was there before

    Parameters

    Returns void

  • Reinforcement_SubtractSGroupFromIdealComposition(module: any, sgroup: SGroupID): any
  • Updates a module's "ideal composition" to subtract an sgroup's units from the high water mark (used when those units are removed from an SGroup)

    Parameters

    Returns any

  • Reinforcement_UpdateIdealComposition(module: any): any
  • Updates a module's "ideal composition" to the high water mark of units it has or has previously had

    Parameters

    • module: any

    Returns any

  • RenderStats_Disable(): any
  • RenderStats_DumpToLogFile(): any
  • RenderStats_Enable(): any
  • RenderStats_SetUpdateTime(time: number): void
  • Set the render stats refresh update interval (seconds)

    Parameters

    • time: number

    Returns void

  • RenderStats_SortInstances(): any
  • RenderStats_SortRenderCalls(): any
  • RenderStats_SortShaderChanges(): any
  • RenderStats_SortTris(): any
  • RenderStats_Toggle(): any
  • ReplayStatViewer_PopulateReplayStatTabs(table: A): any
  • Populate stat tabs in the replay stat viewer. Refer the following xaml for template details: //cardinal/Mainline/assets/cardinal/ui/HUD/Controls/ReplayStatViewer.xaml

    Parameters

    • table: A

    Returns any

  • ReplayStatViewer_RegisterDataContextUpdater(with_: any): any
  • Register a callback fired right before the data contexts are set to all players In the callback, manually iterate through all players and pass in the necessary data to the scarModel table of each player

    Parameters

    • with_: any

    Returns any

  • ReplayStatViewer_RegisterPlayerDataContextUpdater(with_: any): any
  • Register a callback fired right before the data context is set to each player In the callback, pass in the data for each player

    Parameters

    • with_: any

    Returns any

  • ResolveSpawnLocation(): any
  • takes a marker or locationName, and returns a marker. If it's a scarPos, return it

    Returns any

  • ResourceContainer_ClearCache(cacheName: string): any
  • Cleanup resources in cache. Only for debug purposes, not in RTM.

    Parameters

    • cacheName: string

    Returns any

  • ResourceContainer_CreateCache(cacheName: string, cacheSize: number): any
  • Create a cache to load resources into giving its name and number of resources to hold Once cache is full, the oldest resource will get removed and clean itself up

    Parameters

    • cacheName: string
    • cacheSize: number

    Returns any

  • ResourceContainer_LogRefs(): any
  • Log resource references to log. Only for debug purposes, not in RTM. dumps inventory information to ResourceContainerLog file

    Returns any

  • Resources_Disable(): void
  • Resources_Disable(): void
  • Disables any resource income - useful to stop resources accruing during the opening movie

    Returns void

  • Disables any resource income - useful to stop resources accruing during the opening movie

    Returns void

  • Resources_Enable(): void
  • Resources_Enable(): void
  • RovingArmy_AddSGroup(moduleData: Module, sgroup: SGroupID, OPT_updateComposition?: boolean): any
  • RovingArmy_AddTarget(moduleData: Module, target: string, OPT_combatRange?: number, OPT_leashRange?: number, OPT_skipTransition?: boolean): any
  • Adds a target to the target list. Skip transition means it wont start attacking the new target, and should usually be false.

    Parameters

    • moduleData: Module
    • target: string
    • Optional OPT_combatRange: number
    • Optional OPT_leashRange: number
    • Optional OPT_skipTransition: boolean

    Returns any

  • RovingArmy_AddTargets(moduleData: Module, targets: any): any
  • RovingArmy_ClearTargets(moduleData: any): any
  • RovingArmy_CountUnvisitedTargets(): any
  • RovingArmy_Disband(moduleData: any, OPT_returned_sgroup?: SGroupID): any
  • Disbands the RovingArmy module entirely, optionally returning the module's units in the passed SGroup (which is NOT cleared)

    Parameters

    • moduleData: any
    • Optional OPT_returned_sgroup: SGroupID

    Returns any

  • RovingArmy_ForceStart(): any
  • Orders the module to attack it's next target, and disables withdraw behaviour

    Returns any

  • RovingArmy_GetRemainingUnitRatio(): any
  • Returns the units currently in the module as a percentage of the unit count the module started with

    Returns any

  • RovingArmy_GetRendezvousPosition(moduleData: Module): any
  • Returns the position that the module wants reinforcements to head towards.

    Parameters

    Returns any

  • RovingArmy_GetSGroup(moduleData: any): any
  • RovingArmy_GetTarget(moduleData: Module): any
  • RovingArmy_GetTargets(moduleData: Module): any
  • RovingArmy_GetUnitChangeFromStart(): any
  • Returns the difference between the current amound of units and the starting unit count

    Returns any

  • RovingArmy_HasUnits(): any
  • RovingArmy_Init(moduleData: any): any
  • RovingArmy_IsDead(moduleData: Module): any
  • RovingArmy_IsDefeated(): any
  • RovingArmy_IsEmpty(moduleData: Module): any
  • RovingArmy_RemoveSGroup(moduleData: any, sgroup: SGroupID, OPT_updateComposition?: boolean): any
  • Removes an SGroup from the module

    Parameters

    • moduleData: any
    • sgroup: SGroupID
    • Optional OPT_updateComposition: boolean

    Returns any

  • RovingArmy_RequestUnits(moduleData: RovingArmy, units: any, unitSources?: any, priority?: string): undefined
  • Instructs the rovingArmy to send out a reinforcement request.

    Parameters

    • moduleData: RovingArmy
    • units: any
    • Optional unitSources: any
    • Optional priority: string

    Returns undefined

  • RovingArmy_Reset(moduleData: any): any
  • Resets a module to start at the begining of its target list

    Parameters

    • moduleData: any

    Returns any

  • RovingArmy_SetTarget(moduleData: Module, target: string, OPT_combatRange?: number, OPT_leashRange?: number, OPT_skipTransition?: boolean): void
  • Sets the modules target, removing any previous targets in the process. Skip transition means it wont start attacking the new target, and should usually be false.

    Parameters

    • moduleData: Module
    • target: string
    • Optional OPT_combatRange: number
    • Optional OPT_leashRange: number
    • Optional OPT_skipTransition: boolean

    Returns void

  • RovingArmy_SetTargets(moduleData: Module, targets: any): void
  • RovingArmy_SetWithdrawThreshold(): void
  • RovingArmy_Start(): any
  • Orders the module to attack it's next target. Call this if the modules was previously given a pause command. Calling this on a module that has withdrawn will only result in it withdrawing again. Call RovingArmy_ForceStart if you want to override withdraw behaviour.

    Returns any

  • RovingArmy_UnitRequest_Start(moduleData: Module, requestData: Request): any
  • Rule_Add(f: any, data?: any, group?: RuleGroup): number
  • Add a rule to be executed every frame. Returns the ID of the rule just added.

    Parameters

    • f: any
    • Optional data: any
    • Optional group: RuleGroup

    Returns number

  • Rule_AddEGroupEvent(rule: any, egroup: EGroupID, eventtype: number): void
  • Add a rule to be executed when the event of 'eventType' has happened on entities in the 'egroup' Event types are: GE_EntityKilled, GE_EntityParadropComplete, GE_EntityCommandIssued, GE_ProjectileFired, GE_AbilityExecuted, GE_SpawnActionComplete

    Parameters

    • rule: any
    • egroup: EGroupID
    • eventtype: number

    Returns void

  • Rule_AddEntityEvent(rule: any, entity: EntityID, eventtype: number): void
  • Add a rule to be executed when the event of 'eventType' has happened on the 'entity' Event types are: GE_EntityKilled, GE_EntityParadropComplete, GE_EntityCommandIssued, GE_ProjectileFired, GE_AbilityExecuted, GE_SpawnActionComplete

    Parameters

    • rule: any
    • entity: EntityID
    • eventtype: number

    Returns void

  • Rule_AddGlobalEvent(rule: any, eventtype: number): void
  • Add a rule to be executed when the event of 'eventType' has happened, regardless of source Event types are: GE_PlayerBeingAttacked

    Parameters

    • rule: any
    • eventtype: number

    Returns void

  • Rule_AddInterval(f: any, interval: any, data?: any, group?: RuleGroup): number
  • Add a rule to be executed. Can include a start delay, an interval between rule calls and a count of how many times the rule is called. interval can be a number (the interval between subsequent rule calls) or a table with the keys: "delay", "interval" and "count". Returns the ID of the rule just added.

    Parameters

    • f: any
    • interval: any
    • Optional data: any
    • Optional group: RuleGroup

    Returns number

  • Rule_AddOneShot(rule: any, delay?: number, data?: any, group?: RuleGroup): number
  • Add a rule to be executed once, after 'delay' seconds. Returns the ID of the rule just added.

    Parameters

    • rule: any
    • Optional delay: number
    • Optional data: any
    • Optional group: RuleGroup

    Returns number

  • Rule_AddPlayerEvent(rule: any, player: PlayerID, eventtype: number): void
  • Add a rule to be executed when the event of 'eventType' has happened on the 'player' Event types are: GE_PlayerBeingAttacked, GE_PlayerCommandIssued, GE_AbilityExecuted, GE_UpgradeComplete, GE_ConstructionComplete, GE_BuildItemComplete, GE_PlayerKilled, GE_SpawnActionComplete, GE_AIPlayer_EncounterNotification

    Parameters

    • rule: any
    • player: PlayerID
    • eventtype: number

    Returns void

  • Rule_AddSGroupEvent(rule: any, sgroup: SGroupID, eventtype: number): void
  • Add a rule to be executed when the event of 'eventType' has happened on squads in the 'sgroup' Event types are: GE_SquadKilled, GE_SquadPinned, GE_SquadParadropComplete, GE_SquadCommandIssued, GE_AbilityExecuted, GE_SpawnActionComplete

    Parameters

    • rule: any
    • sgroup: SGroupID
    • eventtype: number

    Returns void

  • Rule_AddSquadEvent(rule: any, squad: SquadID, eventtype: number): void
  • Add a rule to be executed when the event of 'eventType' has happened on the 'squad' Event types are: GE_SquadKilled, GE_SquadPinned, GE_SquadParadropComplete, GE_SquadCommandIssued, GE_AbilityExecuted, GE_SpawnActionComplete

    Parameters

    • rule: any
    • squad: SquadID
    • eventtype: number

    Returns void

  • Rule_ChangeInterval(rule: any, interval: number): void
  • Change 'interval' seconds of all rules with LuaFunction f

    Parameters

    • rule: any
    • interval: number

    Returns void

  • Rule_ChangeIntervalWithID(id: number, interval: number): void
  • Change 'interval' seconds of an existing rule with id

    Parameters

    • id: number
    • interval: number

    Returns void

  • Rule_EnterProximity(f: any, all: boolean, who: EGroup | SGROUP, where: MARKER, range?: number, recur?: boolean, data?: any): void
  • Triggers when a group (SGroup/EGroup) gets close enough to a location

    Parameters

    • f: any
    • all: boolean
    • who: EGroup | SGROUP
    • where: MARKER
    • Optional range: number
    • Optional recur: boolean
    • Optional data: any

    Returns void

  • Rule_Exists(rule: any): boolean
  • Test if a rule with LuaFunction f is currently active

    Parameters

    • rule: any

    Returns boolean

  • Rule_ExistsWithID(id: number): boolean
  • Test if a rule with id is currently active. Only for TimeRules

    Parameters

    • id: number

    Returns boolean

  • Rule_ExitProximity(f: any, all: boolean, who: EGroup | SGROUP, where: MARKER, range?: number, recur?: boolean, data?: any): void
  • Triggers when a group (SGroup/EGroup) gets far enough from a location (the group must enter the range before this can trigger)

    Parameters

    • f: any
    • all: boolean
    • who: EGroup | SGROUP
    • where: MARKER
    • Optional range: number
    • Optional recur: boolean
    • Optional data: any

    Returns void

  • Rule_GroupCount(f: any, group: EGroup | SGROUP, comparison: Comparison, value: number, recur: boolean, data: any): void
  • Comparison is one of IS_LESS_THAN; IS_LESS_THAN_OR_EQUAL; IS_EQUAL; IS_NOT_EQUAL; IS_GREATER_THAN; IS_GREATER_THAN_OR_EQUAL. Triggers when the number of objects in the group, when compared to value by comparison, is true

    Parameters

    Returns void

  • Rule_Pause(f: any): void
  • Rule_PauseAll(Table: number): void
  • Pause all currently active rules. Ignores Unpauseable rules.

    Parameters

    • Table: number

    Returns void

  • Rule_PauseWithID(id: number): void
  • Rule_Refresh(): any
  • Rule_Remove(rule: any): void
  • Remove all currently active rules with LuaFunction f (this does not remove any event rules)

    Parameters

    • rule: any

    Returns void

  • Rule_RemoveAll(max_priority: number): void
  • Kills all rules below a certain priority. The default is to remove ALL rules.

    Parameters

    • max_priority: number

    Returns void

  • Rule_RemoveEGroupEvent(rule: any, egroup: EGroupID): void
  • Rule_RemoveEntityEvent(rule: any, entity: EntityID): void
  • Rule_RemoveGlobalEvent(rule: any): void
  • Remove an active event rule that's been applied 'globally'

    Parameters

    • rule: any

    Returns void

  • Rule_RemoveMe(): void
  • Rule_RemovePlayerEvent(rule: any, player: PlayerID): void
  • Rule_RemoveSGroupEvent(rule: any, sgroup: SGroupID): void
  • Rule_RemoveSquadEvent(rule: any, squad: SquadID): void
  • Rule_RemoveWithID(id: number): void
  • Remove a currently active rule with id (this does not remove any event rules)

    Parameters

    • id: number

    Returns void

  • Rule_Replace(oldf: any, newf: any): void
  • Replaces the function callback for all currently active rules with LuaFunction f (This only applies to TimeRules)

    Parameters

    • oldf: any
    • newf: any

    Returns void

  • Rule_ReplaceWithID(id: number, newf: any): void
  • Replaces the function callback for all currently active rules with an id (This only applies to TimeRules)

    Parameters

    • id: number
    • newf: any

    Returns void

  • Rule_Unpause(f: any): void
  • Rule_UnpauseAll(): any
  • Rule_UnpauseWithID(id: number): void
  • Rule_WhileInProximity(f: any, all: boolean, who: EGroup | SGROUP, where: MARKER, range?: number, interval?: number, recur?: boolean, data?: any): void
  • Triggers every interval seconds that the group is within range of the location

    Parameters

    • f: any
    • all: boolean
    • who: EGroup | SGROUP
    • where: MARKER
    • Optional range: number
    • Optional interval: number
    • Optional recur: boolean
    • Optional data: any

    Returns void

  • RulesProfiler_Activate(on: boolean): any
  • RulesProfiler_Enable(on: boolean): any
  • Enable the scar RulesProfiler so it runs in the background. Call this before RulesProfiler_Activate

    Parameters

    • on: boolean

    Returns any

  • RulesProfiler_IsActive(): any
  • RulesProfiler_ResetTypeFilter(): any
  • RulesProfiler_SetTypeFilter(filter: string): void
  • Filter the RulesProfiler to filter displayed rules to given type. E.g., "SCAR", "AI"

    Parameters

    • filter: string

    Returns void

  • SBP_Exists(name: string): boolean
  • Returns true if a squad blueprint exists with the given name.

    Parameters

    • name: string

    Returns boolean

  • SBP_IsOfRace(pbgShortname: string, race: ScarRacePBG): any
  • SGroup_AddGroups(sgroup: SGroupID, groupList: any): void
  • SGroup_AddLeaders(sgroup: SGroupID): void
  • Adds a leader to all squads in a group that can take a leader. This function will bypass all cost and queue prereqs

    Parameters

    Returns void

  • SGroup_AddResource(sgroup: SGroupID, resource: number, amount: number): void
  • Adds the amount of resource type for a squad. If SGroup contains multiple squads, it will add for all

    Parameters

    • sgroup: SGroupID
    • resource: number
    • amount: number

    Returns void

  • SGroup_AddSlotItemToDropOnDeath(groupid: SGroupID, itemid: number, drop_chance: number, exclusive: boolean): void
  • Add to the list of slot items to drop when any one of the squads is wiped out example: local item = Util_GetSlotItemID( "slot_item/allies_m9bazooka.lua" )

    extdesc

    SGroup_AddSlotItemToDropOnDeath( squadid, item, false ) exlusive means the squad would only drop this item, thus erasing all previous items in list Drop chance is percentage chance the item will drop (0.0-1.0)

    Parameters

    • groupid: SGroupID
    • itemid: number
    • drop_chance: number
    • exclusive: boolean

    Returns void

  • SGroup_CalculateClusterSeparation(sgroup: SGroupID, spawnedOnly: boolean, numClusters: number): any
  • Try group the given list of squads into clusters and returns the average distance between these clusters. Returns -1 if any error occurs.

    Parameters

    • sgroup: SGroupID
    • spawnedOnly: boolean
    • numClusters: number

    Returns any

  • SGroup_CallEntityFunction(sgroup: SGroupID, entityFunction: any): void
  • Calls an Entity_ function on every entity in an sgroup The first parameter of the supplied function must be EntityID

    Parameters

    Returns void

  • SGroup_CallSquadFunction(sgroup: SGroupID, squadFunction: any, list: any): void
  • Calls a Squad_ function on every squad in an sgroup The first parameter of the supplied function must be SquadID

    Parameters

    • sgroup: SGroupID
    • squadFunction: any
    • list: any

    Returns void

  • SGroup_CallSquadFunctionAllOrAny(sgroup: SGroupID, all: boolean, squadFunction: any, list: any): void
  • Returns whether ALL or ANY squads in an sgroup satisfy a condition, using a Squad_ function to perform the query on each squad The first parameter of the supplied function must be SquadID

    Parameters

    • sgroup: SGroupID
    • all: boolean
    • squadFunction: any
    • list: any

    Returns void

  • SGroup_CanCastAbilityOnEntity(caster: SGroupID, ability: number, target_entity: EntityID, all: boolean): any
  • Test whether ANY or ALL of a group can be ordered to do this ability on the target squad

    Parameters

    Returns any

  • SGroup_CanCastAbilityOnPosition(caster: SGroupID, ability: number, position: Position, all: boolean): any
  • Test whether ANY or ALL of a group can be ordered to do this ability on the target position

    Parameters

    Returns any

  • SGroup_CanCastAbilityOnSquad(caster: SGroupID, ability: number, target_squad: SquadID, all: boolean): any
  • Test whether ANY or ALL of a group can be ordered to do this ability on the target entity

    Parameters

    Returns any

  • SGroup_CanInstantReinforceNow(group: SGroupID, all: boolean): boolean
  • SGroup_CanSeeEGroup(sgroup: SGroupID, targetegroup: EGroupID, all: boolean): boolean
  • Returns true if ALL or ANY entities in a group can see ALL or ANY entities in a given egroup.

    Parameters

    Returns boolean

  • SGroup_CanSeeSGroup(sgroup: SGroupID, targetsgroup: SGroupID, all: boolean): boolean
  • SGroup_ClearPostureSuggestion(sgroup: SGroupID): void
  • SGroup_CompleteUpgrade(sgroup: SGroupID, upgrade: number): any
  • SGroup_ContainsBlueprints(sgroup: SGroupID, blueprints: any, all: boolean): boolean
  • SGroup_ContainsSGroup(group1: SGroupID, group2: SGroupID, all: boolean): boolean
  • SGroup_ContainsSquad(group: SGroupID, SquadID: number): boolean
  • Returns the total number of spawned and despawned squads in a group. NOTE: SGroup_Count does not count the individiual soldiers in an SGroup. For that, use SGroup_TotalMembersCount

    Parameters

    Returns number

  • SGroup_CountBlueprints(sgroup: SGroupID, sbp: any): number
  • Returns the total count of all squads in a given SGroup with the provided blueprint or type

    Parameters

    Returns number

  • SGroup_CountDeSpawned(sgroup: SGroupID): number
  • SGroup_CountPopulation(sgroup: SGroupID): number
  • SGroup_CountSpawned(sgroup: SGroupID): number
  • Returns a new squadron group with the given name. Squad groups are used for all units and vehicles. You can issue orders such as move and attack to an entire squad group. If you want a group for buildings or objects such as trees, use an EntityGroupObs instead. Note that you are allowed to have unamed squadgroups or squadgroups with the samename. Be careful not to create duplicates of your squad group when you dont intend to. To be safe, you can check if the SquadGroupObs you want to create exists using SGroup_Exists( )

    Parameters

    • name: string

    Returns SGroupID

  • SGroup_CreateIfNotFound(name: string): SGroupID
  • SGroup_CreateKickerMessage(group: SGroupID, player: PlayerID, textid: string): void
  • SGroup_CreateTable(format: string, size: number): any
  • Returns a table of sgroups NOT in the world builder See Marker_GetTable for more info on format parameter

    Parameters

    • format: string
    • size: number

    Returns any

  • SGroup_CreateUnique(prefix?: string): SGROUP
  • Returns an SGroup with a unique name, prefixed by the 'prefix' parameter.

    Parameters

    • Optional prefix: string

    Returns SGROUP

  • SGroup_CreateUniqueWithPrefix(prefix: string): any
  • Returns a new squad group with an autogenerated unique name, optionally prefixed by the string passed in. Use this if you want to create a new SGroup but don't necessarily care about the name.\n Squad groups are used for all units and vehicles. You can issue orders such as move and attack to an entire squad group.\n

    Parameters

    • prefix: string

    Returns any

  • SGroup_DestroyAllSquads(sgroup: SGroupID): void
  • Destroys all spawned and despawned squads in a group.

    extdesc

    Be careful not to confuse this with SGroup_Destroy which destroys the group and NOT the squads it contains. This function will destroy spawned and despawned items in a group

    Parameters

    Returns void

  • SGroup_DisableCombatPlans(groupID: SGroupID): void
  • Duplicates an SGroup. Creates a copy of sgroup1 in sgroup2. The function will clear sgroup2 beforehand if necessary.

    Parameters

    Returns void

  • SGroup_EnableAttention(sgroup: SGroupID, attentive: boolean): void
  • SGroup_EnableCheering(sgroup: SGroupID, enable: boolean, OPT_duration?: number, OPT_walla?: string, OPT_audioDelay?: number): any
  • Enables or disables cheering on an Sgroup. Defaults to 60 second duration; pass in -1 for infinite. Defaults to short celebrate walla. WARNING: Units cannot move while cheering. Only works on bipeds. audioDelay delays audio but not animation.

    Parameters

    • sgroup: SGroupID
    • enable: boolean
    • Optional OPT_duration: number
    • Optional OPT_walla: string
    • Optional OPT_audioDelay: number

    Returns any

  • SGroup_EnableLeaderCrown(sgroup: SGroupID, enable: boolean): any
  • Enable or disable the crown over leader units. The Leader must be the first squad in the sgroup.

    Parameters

    Returns any

  • SGroup_EnableMinimapIndicator(group: SGroupID, enable: boolean): void
  • SGroup_EnableSurprise(groupid: SGroupID, enable: boolean): void
  • SGroup_EnableUIDecorator(group: SGroupID, enable: boolean): void
  • SGroup_Exists(name: string): boolean
  • Returns true if the squad group with the given name exists

    Parameters

    • name: string

    Returns boolean

  • Works like Squad_FacePosition. All Squads will face the same direction, with the squad the closest to the center determining the direction. This function works on spawned squads only.

    Parameters

    Returns void

  • SGroup_Filter(sgroup: SGroupID, blueprint: any, filtertype: number, splitSGroup?: SGroupID): void
  • Filters an SGroup by blueprint. A table of blueprints can be specified if you want to filter on more than one type. Setting filtertype to FILTER_KEEP results in the group only containing squads of the types listed in the blueprint table. Setting filtertype to FILTER_REMOVE will strip those same squads out and leave those that aren't of the types listed. Setting splitSGroup will move any squads being KEEP or REMOVE to it. This SGroup will NOT be cleared beforehand. SquadTypes can also be used in place of Blueprints. If you want a squad to match a bunch of SquadTypes at the same time (i.e. AND instead of OR) then they can be listed together in a sub-table.

    Parameters

    Returns void

  • SGroup_FilterByProximity(sgroup: SGroupID, position: Position, filtertype: number, OPT_OPT_range?: number, OPT_OPT_splitSGroup?: SGroupID): any
  • Filters an sgroup base on proximity. Use FILTER_KEEP to keep the affected units, or FILTER_REMOVE to remove them. Set invertPosition to TRUE to affect the units outside the position.

    Parameters

    • sgroup: SGroupID
    • position: Position
    • filtertype: number
    • Optional OPT_OPT_range: number
    • Optional OPT_OPT_splitSGroup: SGroupID

    Returns any

  • SGroup_FilterCamouflaged(sgroup: SGroupID, filtertype: number, splitSGroup?: SGroupID): void
  • Filters an SGroup to either FILTER_REMOVE or FILTER_KEEP units that are currently camouflaged (stealthed included)

    extdesc

    Parameters

    Returns void

  • SGroup_FilterCount(sgroup1: SGroupID, groupSize: number, splitSGroup?: SGroupID): void
  • SGroup_FilterOnScreen(egroup: SGroupID, percent: number, filtertype: number): void
  • Filters an SGroup by whether units are on screen or not. Percent refers to the screen area you are considering (0.8 is a good value to use - it won't include things that are right at the screen edge). Setting filtertype to FILTER_KEEP results in the group only containing those squads that are on screen.

    Parameters

    • egroup: SGroupID
    • percent: number
    • filtertype: number

    Returns void

  • SGroup_FilterSpawned(sgroup: SGroupID, filtertype: number, OPT_splitSGroup?: SGroupID): any
  • Filters an sgroup on spawned/despawned status. Use FILTER_KEEP to keep the spawned units (therefore removing the despawned), or FILTER_REMOVE to remove the spawned units (and keep the despawned).

    Parameters

    Returns any

  • SGroup_FilterThreat(sgroup: SGroupID, tableSBPs: any, bEmpty?: boolean): void
  • Searches an SGroup and finds the first threat within the table (searching first to last) and removes all other SBPs.

    extdesc

    Optional parameter bEmpty can be set to true, will clear the SGroup if none of the SBPS in the table are found.

    Parameters

    • sgroup: SGroupID
    • tableSBPs: any
    • Optional bEmpty: boolean

    Returns void

  • Call a lua function for each item in a group. Function will recieve (groupid, itemindex, itemid) and should return true to break or false to continue. function Rule_Test( )  local DespawnSquad = function( sgroupid, itemindex, squadID )   Squad_Despawn( squadID )  end  SGroup_ForEach( SGroup_FromName("sg_Squads"), DespawnSquad ) end This functions iterates over spawned squads only.

    Parameters

    Returns boolean

  • Call a lua function for each item in a group. Function will recieve (groupid, itemindex, itemid) and should return a bool. Only use this to TEST conditions on squads. DO NOT use this to perform operations on all squads, since it may not call your function on all squads (due to short circuit evaluation). This is used for checking if ALL or ANY items in a group match a given predicate. (eg. Are all items in a group choas marines) This functions iterates over spawned squads only.

    Parameters

    Returns boolean

  • SGroup_ForEachAllOrAnyEx(sgroup: SGroupID, all: boolean, f: LuaBinding, spawned: boolean, despawned: boolean): boolean
  • Same as SGroup_ForEachAllOrAny except you have a choice to iterate over spawned squads, despawned squads, or both.

    Parameters

    Returns boolean

  • SGroup_ForEachEx(sgroup: SGroupID, f: LuaBinding, spawned: boolean, despawned: boolean): boolean
  • Same as SGroup_ForEach except you have a choice to iterate over spawned squads, despawned squads, or both.

    Parameters

    Returns boolean

  • SGroup_GetAvgHealth(sgroup: SGroupID): number
  • Returns the average health ratio of all units in a squad group. It now uses the same health measure that's used by the UI, so it does take into account fallen members of a squad

    Parameters

    Returns number

  • SGroup_GetAvgHealthPercentageWithShields(sgroup: SGroupID, includeBonuses: boolean): any
  • Return the average health ratio, including shield strengths, of the squads in the SGroup

    Parameters

    Returns any

  • SGroup_GetAvgLoadout(sgroup: SGROUP): number
  • Returns the average loadout of all squads in a group as a percent [0.0, 1.0]. Example: A group of squads with loadouts of 4/8 and 1/1 would return 0.75

    Parameters

    Returns number

  • SGroup_GetAvgShieldPercentage(sgroup: SGroupID): any
  • SGroup_GetClosestSquads(): any
  • Gets the COUNT closest squads to POSITION from SGROUP. Does NOT remove squads from the source SGroup

    Returns any

  • Returns the despawned squad at a certain position in the group. This is a one-based index (use index 1 to get the first squad in the group.) It is an error if index > SGroup_GetDeSpawnedCount().

    Parameters

    Returns SquadID

  • SGroup_GetInvulnerable(sgroup: SGroupID, all: boolean): boolean
  • SGroup_GetLastAttacker(SGroupVictim: SGROUP, SGroupAttacker: SGROUP, seconds?: number): void
  • Gets the last attacker(s) for all the squads in an SGroup Gets the last attacker for all the squads in an SGroup and stores that in SGroupAttacker

    Parameters

    • SGroupVictim: SGROUP
    • SGroupAttacker: SGROUP
    • Optional seconds: number

    Returns void

  • SGroup_GetName(sgroup: SGroupID): string
  • SGroup_GetNumSlotItem(group: SGroupID, itemID: number): number
  • Get the number of slot items with the same ID that the squads in the sgroup own

    Parameters

    Returns number

  • SGroup_GetOffsetPosition(sgroup: SGroupID, offset: number, value: number): Position
  • Returns a position (a certain distance away) relative to a squad's current position/orientation. see ScarUtil.scar for explanation of 'offset' parameter

    Parameters

    • sgroup: SGroupID
    • offset: number
    • value: number

    Returns Position

  • SGroup_GetResource(sgroup: SGroupID, resource: number): number
  • Gets the amount of resource type for a squad. If SGroup contains multiple squads, it will be the total of all

    Parameters

    Returns number

  • SGroup_GetSequence(name: string): any
  • Builds a table of SGroupIDs that are named in a sequence. i.e. a name of "sg_killer" will find groups "sg_killer1", "sg_killer2" and so on, up until it looks for a group that isn't there.

    Parameters

    • name: string

    Returns any

  • Returns the spawned squad at a certain position in the group. This is a one-based index (use index 1 to get the first squad in the group.) It is an error if index > SGroup_GetSpawnedCount().

    Parameters

    Returns SquadID

  • SGroup_GetSpread(sgroup: SGroupID): number
  • SGroup_GetSquadAt(group: SGroupID, int: number): any
  • Returns the squad at a certain position in the group. This is a one-based index (use index 1 to get the first squad in the group.) It is an error if index > SGroup_Count().

    Parameters

    Returns any

  • SGroup_GetSuppression(groupid: SGroupID): number
  • SGroup_GetTotalHealth(sgroup: SGroupID): number
  • SGroup_GetVeterancyExperience(groupid: SGroupID): number
  • SGroup_GetVeterancyRank(groupid: SGroupID): number
  • SGroup_GetWBTable(format: string): any
  • Returns a table of sgroups from the world builder See Marker_GetTable for more info on format parameter

    Parameters

    • format: string

    Returns any

  • SGroup_HasLeader(sgroup: SGroupID, all: boolean): boolean
  • SGroup_HasSquadBlueprint(sgroup: SGroupID, blueprint: any, all: boolean): boolean
  • Check if ALL or ANY of the squads in a group have a specific blueprint. The blueprint can be a table of blueprints or types (see Squad_HasBlueprint() for details)

    Parameters

    • sgroup: SGroupID
    • blueprint: any
    • all: boolean

    Returns boolean

  • SGroup_HasTeamWeapon(sgroup: SGroupID, all: boolean): boolean
  • Returns true if ANY or ALL of the squads in an SGroup are carrying some kind of team weapon

    Parameters

    Returns boolean

  • SGroup_Hide(sgroup: SGroupID, hide: boolean): void
  • Hide or show all entities in all squads in an SGroup Bool should be true to hide, false to show

    Parameters

    Returns void

  • SGroup_IncreaseVeterancyExperience(groupid: SGroupID, experience: number, silent?: boolean, applyModifiers?: boolean): void
  • Increase squad veterancy experience for all squads in the sgroup. Can do silent promotion (no sound/UI). Can skip modifiers, giving you direct control of experience gained.

    Parameters

    • groupid: SGroupID
    • experience: number
    • Optional silent: boolean
    • Optional applyModifiers: boolean

    Returns void

  • SGroup_IncreaseVeterancyRank(groupid: SGroupID, numranks?: number, silent?: boolean): void
  • Increase squad veterancy rank for all squads in the sgroup. By default, increases rank by 1. Can do silent promotion (no sound/UI. ex: mass rank insrease at mission start)

    Parameters

    • groupid: SGroupID
    • Optional numranks: number
    • Optional silent: boolean

    Returns void

  • Same as EGroup_Intersection. Note: You cannot mix squad groups and entity groups. Only squads that are in both groups will be added to 'group'. The contents of 'grouptointersect' will not be changed. Example: group = (1,2,3,4,5,6) grouptointersect = (2,4,6,8,10) --> group will now equal (2,4,6)

    Parameters

    Returns void

  • SGroup_IsAlive(sgroup: SGroupID): boolean
  • SGroup_IsAttackMoving(sgroup: SGroupID, all: boolean): boolean
  • SGroup_IsCamouflaged(sgroup: SGroupID, all: boolean): boolean
  • SGroup_IsCapturing(sgroup: SGroupID, ALL: boolean): boolean
  • SGroup_IsConstructingBuilding(sgroup: SGROUP, all: boolean): boolean
  • Returns true if ALL or ANY squads in a group are currently constructing a building. Set all to true to check for ALL or set to false to check for ANY

    Parameters

    Returns boolean

  • SGroup_IsDoingAttack(sgroup: SGroupID, all: boolean, time: number): boolean
  • Returns true if ALL or ANY squads are attacking within the time.

    Parameters

    • sgroup: SGroupID
    • all: boolean
    • time: number

    Returns boolean

  • SGroup_IsDugIn(group: SGroupID, all: boolean): boolean
  • Returns true if ANY or ALL of the squads in the SGroup is dug in (or in the process of digging in)

    Parameters

    Returns boolean

  • SGroup_IsEmpty(sgroup: SGroupID): boolean
  • SGroup_IsFemale(sgroup: SGroupID, all: boolean): boolean
  • SGroup_IsHoldingAny(sgroup: SGroupID): void
  • SGroup_IsIdle(sgroup: SGroupID, ALL: boolean): boolean
  • SGroup_IsInCover(sgroup: SGroupID, all?: boolean): number
  • Returns the percentage of the SGroup members that are in cover. Alternatively, specify ANY or ALL as a second parameter to return true/false.

    Parameters

    Returns number

  • SGroup_IsInHoldEntity(sgroup: SGroupID, ALL: boolean): boolean
  • Checks if ANY or ALL squads in an SGroup are garrisoned in an entity (building)

    Parameters

    Returns boolean

  • SGroup_IsInHoldSquad(sgroup: SGroupID, ALL: boolean): boolean
  • Checks if ANY or ALL squads in an SGroup are garrisoned in a squad (transport vehicle)

    Parameters

    Returns boolean

  • SGroup_IsInfiltrated(sgroup: SGroupID, all: boolean): boolean
  • SGroup_IsMoving(sgroup: SGroupID, all: boolean): boolean
  • SGroup_IsOnScreen(player: PlayerID, group: SGroupID, all: boolean, percent?: number): boolean
  • Returns true if ANY or ALL (use those keywords) of the squads in the group are present onscreen. You can pass in a percentage of the screen to check, so 0.8 would be a centered rectangle occupying 80% of the screen.

    Parameters

    Returns boolean

  • SGroup_IsPinned(group: SGroupID, all: boolean): boolean
  • SGroup_IsReinforcing(sgroup: SGroupID, all: boolean): boolean
  • Returns true if ALL or ANY squads in a group are currently calling for reinforcments. Set all to true to check for ALL or set to false to check for ANY

    Parameters

    Returns boolean

  • SGroup_IsRetreating(sgroup: SGroupID, all: boolean): boolean
  • Returns true if ANY or ALL of the squads in an SGroup are currently retreating

    Parameters

    Returns boolean

  • SGroup_IsSettingDemolitions(sgroup: SGroupID, all: boolean): boolean
  • SGroup_IsSuppressed(group: SGroupID, all: boolean): boolean
  • SGroup_IsUnderAttack(sgroup: SGroupID, all: boolean, time: number): boolean
  • Returns true if ALL or ANY squads are under attack within the time.

    Parameters

    • sgroup: SGroupID
    • all: boolean
    • time: number

    Returns boolean

  • SGroup_IsUnderAttackByPlayer(group: SGroupID, attackerplayer: PlayerID, duration: number): boolean
  • SGroup_IsUnderAttackFromDirection(sgroup: SGroupID, all: boolean, offset: number, time: number): boolean
  • Returns true if ALL or ANY squads are under attack from a direction within the time. see ScarUtil.scar for types of directions. you can pass in a table of directions

    Parameters

    • sgroup: SGroupID
    • all: boolean
    • offset: number
    • time: number

    Returns boolean

  • Returns true if ALL or ANY squads in a group are currently upgrading. You can pass in nil for upgradeid if it doesn't matter what is being upgraded. Set all to true to check for ALL or set to false to check for ANY

    Parameters

    Returns boolean

  • SGroup_IsUsingAbility(sgroup: SGroupID, ALL: boolean): boolean
  • Checks if ANY or ALL squads in an SGroup are using an ability Does not check WHAT ability a squad is using.

    Parameters

    Returns boolean

  • SGroup_IsValid(sgroupID: number): any
  • Check to see if an sgroup still exists without needing the name.

    Parameters

    • sgroupID: number

    Returns any

  • Kills all squads in an SGroup. This kills them 'naturally', as opposed to SGroup_DestroyAllSquads() which makes them blink out of existance.

    Parameters

    Returns void

  • SGroup_PlaySpeech(sgroup: SGroupID, filepath: string): any
  • Plays a speech file on the first squad in an sgroup. Pass in a string with the filepath of the audio file under Cardinal_Speech_Sources e.g. "Civ_Rus/rus_manatarms/rus_manatarms_attack_iHigh_cHigh_03"

    Parameters

    Returns any

  • SGroup_RemoveUpgrade(sgroup: SGroupID, upgrade: any): void
  • SGroup_RestoreCombatPlans(sgroupID: SGroupID): void
  • SGroup_RewardActionPoints(sgroup: SGroupID, actionpoint: number): void
  • SGroup_SetAnimatorAction(sgroupid: SGroupID, actionName: string): void
  • Trigger animation action for an SGroup. Please only use this for simple animations

    Parameters

    Returns void

  • SGroup_SetAnimatorEvent(sgroupid: SGroupID, eventName: string): void
  • Trigger animation event for an SGroup. Please only use this for simple animations

    Parameters

    Returns void

  • SGroup_SetAnimatorState(sgroupid: SGroupID, stateMachineName: string, stateName: string): void
  • Set animation state of a state machine for an SGroup. Please only use this for simple animations

    Parameters

    • sgroupid: SGroupID
    • stateMachineName: string
    • stateName: string

    Returns void

  • SGroup_SetAutoTargetting(group: SGroupID, hardpoint: string | number, enable: boolean): void
  • Sets whether a weapon will auto-target things or not

    Parameters

    • group: SGroupID
    • hardpoint: string | number
    • enable: boolean

    Returns void

  • SGroup_SetAvgHealth(sgroup: SGroupID, healthpercent: number): number
  • Sets the health of each squad in a squad group to a given percent [0.0, 1.0].

    Parameters

    Returns number

  • SGroup_SetAvgMorale(sgroup: SGROUP, moralepercent: number): number
  • Sets the moral of each squad in a squad group to a given percent [0.0, 1.0].

    Parameters

    • sgroup: SGROUP
    • moralepercent: number

    Returns number

  • SGroup_SetCrushable(sgroup: SGroupID, crushable: boolean): void
  • SGroup_SetInvulnerable(sgroup: SGroupID, enabled: number | boolean, reset_time?: number): void
  • Enable/Disable invulnerablity for an entire SGroup. Use true and false for simple on/off, or use a number between 0.0 and 1.0 for more precise control on how much damage a squad can take before it takes no more. The optional reset_time is used to automatically remove invulnerability after a set time. If invulnerable, both health damage is disabled.

    Parameters

    • sgroup: SGroupID
    • enabled: number | boolean
    • Optional reset_time: number

    Returns void

  • SGroup_SetMoodMode(group: SGroupID, mode: number): void
  • SGroup_SetRecrewable(sgroup: SGroupID, recrewable: boolean): void
  • SGroup_SetResource(sgroup: SGroupID, resource: number, amount: number): void
  • Sets the amount of resource type for a squad. If SGroup contains multiple squads, it will set for all

    Parameters

    • sgroup: SGroupID
    • resource: number
    • amount: number

    Returns void

  • SGroup_SetSelectable(sgroupid: SGROUP, selectable: boolean): void
  • SGroup_SetSharedProductionQueue(egroup: SGroupID, enable: boolean): void
  • Enables shared team production on a building (teammates can build using THEIR resources)

    Parameters

    Returns void

  • SGroup_SetSuppression(groupid: SGroupID, suppression: number): void
  • SGroup_SetTargetingType(): void
  • SGroup_SetTeamWeaponCapturable(group: SGroupID, enable: boolean): void
  • SGroup_SetVeterancyDisplayVisibility(groupid: SGroupID, visible: boolean): void
  • Sets the visibility of in-game veterancy art for the squads in given SGroup

    Parameters

    Returns void

  • SGroup_SetWorldOwned(sgroup: SGroupID): void
  • Creates a squad group containing a single squad

    extdesc

    Creates an SGroup containing just one squad, creating the group if it doesn't exist and clearing it if it does. It returns the name of the SGroup.

    Parameters

    Returns SGroupID

  • Works like SGroup_FacePosition except with no interpolation. All Squads will face the same direction, with the squad the closest to the center determining the direction. This function works on spawned squads only.

    Parameters

    Returns void

  • SGroup_Split(sgroup: SGroupID, numNewSGroups: number): any
  • Splits an SGroup as cleanly as possible into X new SGroups, returning a table of the SGroups in question

    Parameters

    Returns any

  • SGroup_SplitIntoExistingSGroups(sourceSGroup: SGroupID, sgroupTable: any, clearSGroups: boolean): any
  • Splits an SGroup as cleanly as possible into multiple SGroups.

    Parameters

    • sourceSGroup: SGroupID
    • sgroupTable: any
    • clearSGroups: boolean

    Returns any

  • SGroup_SplitUnderCap(sgroup: SGroupID, maxSGroupSize: number): any
  • Splits an SGroup enough even-sized groups that none is larger than the max size indicated

    Parameters

    Returns any

  • SGroup_SuggestPosture(sgroup: SGroupID, posture: number, duration: number): void
  • Suggests a posture to an SGroup, lasting the passed duration Posture of 0 is prone, 1 is kneel/crouch, and 2 is standing. Duration is in seconds, negative means indefinate.

    Parameters

    • sgroup: SGroupID
    • posture: number
    • duration: number

    Returns void

  • SGroup_TotalMembersCount(sgroup: SGroupID, dontCountTeamWeapons: boolean): number
  • Returns the total count of all members of all the squads in a given SGroup.

    Parameters

    • sgroup: SGroupID
    • dontCountTeamWeapons: boolean

    Returns number

  • Scar_AddInit(f: any): void
  • Register an init function with the scar system. This init function will be called when scar is started up. **Important: Make sure you do not register two functions with the same name; the init function names should be unique.

    Parameters

    • f: any

    Returns void

  • Scar_DebugCheatMenuExecute(command: string): any
  • execute command string in cheat menu domain. Will only work if dev mode is enabled! (it's OFF by default in RTM builds)

    Parameters

    • command: string

    Returns any

  • Scar_DebugConsoleExecute(command: string): void
  • execute console command string. Will only work if dev mode is enabled! (it's OFF by default in RTM builds)

    Parameters

    • command: string

    Returns void

  • Scar_DoFile(scriptName: string): any
  • Scar_DoString(str: string): any
  • Scar_DrawMarkers(): any
  • Scar_GroupInfo(): any
  • Scar_GroupList(): any
  • Scar_InitComplete(): any
  • Scar_InitExists(f: any): boolean
  • Scar_Reload(): any
  • Scar_RemoveInit(f: any): void
  • Unregister an init function that was registered from Scar_AddInit

    Parameters

    • f: any

    Returns void

  • Setup_SetPlayerName(player: PlayerID, name: string): void
  • Setup_SetPlayerRace(player: PlayerID, raceIndex: number): void
  • Set the race for a given player. Use World_GetRaceIndex() to get the race index from the ME name.

    Parameters

    Returns void

  • Setup_SetPlayerTeam(p: PlayerID, team_id: number): void
  • Put a player in a team. Use TEAM_NEUTRAL as the team_id to set the player as neutral

    Parameters

    Returns void

  • ShaderStats_Disable(): any
  • ShaderStats_DumpToLogFile(): any
  • ShaderStats_Enable(): any
  • ShaderStats_SetUpdateTime(time: number): void
  • Set the render stats refresh update interval (seconds)

    Parameters

    • time: number

    Returns void

  • ShaderStats_SortPixelCount(): any
  • ShaderStats_SortShaderNames(): any
  • ShaderStats_Toggle(): any
  • Create a shield wall stretching from posA to posB, using the units in the sgroup. Units stand in a line shoulder to shoulder, and excess units are used as backfill. PosA should be the left end (as you look at the line), PosB the right, so if the units are facing the wrong way then flip the two positions. If immediate is set to true, units start in wall formation, otherwise they move into position.

    Parameters

    Returns ShieldWallID

  • Siege_AddSGroup(): any
  • Adds units to the internal SGroups - siege weapons go into the engines group, everything else goes into crew

    Returns any

  • Siege_CanAid(): any
  • Siege_Disband(moduleData: any): SGROUP
  • Siege_GetSGroup(): any
  • Returns the siege CREW only! We need this for interface reasons, but it doesn't play nicely with how Siege modules work

    Returns any

  • Siege_IsDefeated(): any
  • Siege_RenderAid(): any
  • Siege_RequestAid(): any
  • Pings all nearby modules to see if they can come help - stops when it finds one that can

    Returns any

  • Siege_RequestReinforcements(): any
  • Attempts to acquire a group of units matching the given scar types; Siege modules do not yield their siege engines

    Returns any

  • Sim_CheckRequirements(): any
  • Sim_DebugDrawSimTick(): any
  • Sim_DrawAttention(): any
  • Sim_DrawEntityCrusherOBB(): any
  • Sim_DrawEntityExtensions(): any
  • Sim_DrawEntityStateMove(): any
  • Sim_EntityAbility(): any
  • Sim_EntityDelay(): any
  • Sim_EntityDrawPosture(): any
  • Sim_EntityHistory(): any
  • Sim_EntityInfo(): any
  • Sim_EntityModifier(): any
  • Sim_EntityOBB(): any
  • Sim_EntityOOCTarget(): any
  • Sim_EntityUpgrades(): any
  • Sim_GetDrawMarketInfo(): any
  • Clears the egroup, then finds and adds all trade entities registered with an entity endpoint Returns the number of entities found

    Parameters

    Returns any

  • Sim_MarketAddSettlement(settlement: EntityID): any
  • Add a settlement to the market trade manager with specified ID. Settlement will be marked 'not trading' with all players.

    Parameters

    Returns any

  • Sim_MarketExecuteTrade(player: PlayerID, resourceName: string, tradeTypeString: string): any
  • Attempts to execute a trade on behalf of the specified player, for the specified resource, of the specified type.

    Parameters

    • player: PlayerID
    • resourceName: string
    • tradeTypeString: string

    Returns any

  • Sim_MarketSetTradeStatusPlayer(firstPlayer: PlayerID, secondPlayer: PlayerID, status: boolean): void
  • Sets market trade status between two players, using the array index they appear at in PlayerManager::GetPlayers_CS()

    Parameters

    Returns void

  • Sim_MarketSetTradeStatusSettlement(player: PlayerID, settlement: EntityID, status: boolean): void
  • Sim_PlayerInfo(): any
  • Sim_PlayerModifiers(): any
  • Sim_SetDrawMarketInfo(bEnable: boolean): void
  • Sim_ShotBlockers(): any
  • Sim_SimBox(): any
  • Sim_SquadHistory(): any
  • Sim_SquadInfo(): any
  • Sim_SquadSuppression(): any
  • SitRep_PlayMovie(url: string): any
  • SitRep_StopMovie(): any
  • Sound_Debug_ShowAudioRegions(enable: boolean): any
  • Toggles the display of the terrain audio environment zones on/off.

    Parameters

    • enable: boolean

    Returns any

  • Sound_ForceMusicEnabled(): any
  • Sound_ForceSetMinimumMusicCombatIntensity(combatIntensity: number, durationSeconds: number): void
  • Force set the combat intensity to be at least combatIntensity for a duration. Use a duration of -1 for an indefinite override. Use a duration of 0 to cancel the override. Does not trigger any music events.

    Parameters

    • combatIntensity: number
    • durationSeconds: number

    Returns void

  • Sound_ForceSilenceEnabled(): any
  • Sound_IsPlaying(handle: number): any
  • Returns true if the sound associated with the handle is currently playing.

    Parameters

    • handle: number

    Returns any

  • Sound_MusicStop(): any
  • Sound_Play2D(name: string): number
  • Plays a 2D sound from the Data:Sound folder. Use the path relative to Sound folder without the file extension. Returns handle to the sound container The sound needs to be 2D Example:  Sound_Play( "Blah/Mysound" )

    Parameters

    • name: string

    Returns number

  • Sound_Play3D(name: string, actor: EntityID): number
  • Plays a 3D sound from the Data:Sound folder on the entity. Use the path relative to Sound folder without the file extension. Returns handle to the sound container The sound needs to be 3D Example:  Sound_Play( "Speech/SpaceMarine/AddOnComplete", TheActor )

    Parameters

    Returns number

  • Sound_PlayOnSquad(soundpathname: string, sgroupid: SGroupID | Squad): number
  • Sound_PlaySpeech(eventName: string, eventArgs: number): any
  • Play a speech event based on the local player's race.

    Parameters

    • eventName: string
    • eventArgs: number

    Returns any

  • Sound_PlaySpeechForPlayer(player: PlayerID, eventName: string, eventArgs: number): any
  • Sound_PlayWallaCelebrateOnSGroup(sgroup: SGroupID): any
  • Sound_PlayWallaChargeOnSGroup(sgroup: SGroupID): any
  • Sound_PlayWallaEngageOnSGroup(sgroup: SGroupID): any
  • Sound_PlayWallaFearOnSGroup(sgroup: SGroupID): any
  • Sound_PlayWallaSpearwallOnSGroup(sgroup: SGroupID): any
  • Sound_PostEvent(eventName: string, handle: number): any
  • Posts an event on an already playing sound. Returns a handle to the new sound event. Can be used to e.g. call a stop event or enable/disable effects on playing sounds. \Sound_PostEvent( "VictoryEvent", handle )\n

    Parameters

    • eventName: string
    • handle: number

    Returns any

  • Sound_SetForceMusic(value: boolean): void
  • tells the music system if it should be trying to enter/stay in the playing music state

    Parameters

    • value: boolean

    Returns void

  • Sound_SetForceSilence(value: boolean): void
  • tells the music system if it should be trying to enter/stay in the silent state

    Parameters

    • value: boolean

    Returns void

  • Sound_SetManualMusicSelectDuration(durationSecs: number): void
  • Prevents the music system from automatically switching between layers and stopping for the duration.

    Parameters

    • durationSecs: number

    Returns void

  • Sound_SetMinimumMusicCombatIntensity(combatIntensity: number, durationSeconds: number): void
  • Set the target combat intensity to at least the value of value combatIntensity for a duration. Use a duration of -1 for an indefinite override. Use a duration of 0 to cancel the override.

    Parameters

    • combatIntensity: number
    • durationSeconds: number

    Returns void

  • Sound_SetMusicIntensityScaling(scale: number): void
  • sets the scaling multiplier for the music intensity value

    Parameters

    • scale: number

    Returns void

  • Sound_SetMusicRaceCode(raceCode: string): void
  • sets the race rtpc for controlling what race's music gets played

    Parameters

    • raceCode: string

    Returns void

  • Sound_StartMusicOutro(outroEvent: string): any
  • stops the music immediately and go into silence.

    Parameters

    • outroEvent: string

    Returns any

  • Sound_Stop(handle: number): void
  • Stops sound associated with the container handle

    Parameters

    • handle: number

    Returns void

  • SpawnGarrisonsIntoEGroup(egroup: EGroupID, player: Player, opt_scarType?: string, opt_count?: number): any
  • Will spawn and garrison (default: 3) units into every entity of the provided egroup. Useful for filling outposts.

    Parameters

    • egroup: EGroupID
    • player: Player
    • Optional opt_scarType: string
    • Optional opt_count: number

    Returns any

  • SpawnUnitGroups(): any
  • SpawnUnitsToModule(units: any, module: Module, spawnLocation: string | MarkerID, pause?: boolean): SGROUP
  • Splat_Create(splatName: string, position: Position, xScale: number, zScale: number, rotationDegrees: number, r: number, g: number, b: number, a: number, mirrorX: boolean, mirrorZ: boolean): any
  • Add a splat to the terrain. Returns a unique decal id allow for future removal via Splat_Destroy

    Parameters

    • splatName: string
    • position: Position
    • xScale: number
    • zScale: number
    • rotationDegrees: number
    • r: number
    • g: number
    • b: number
    • a: number
    • mirrorX: boolean
    • mirrorZ: boolean

    Returns any

  • Splat_GetInvalidID(): any
  • Get the Splat ID that represents an invalid splat (useful to check if creation failed)

    Returns any

  • SquadGroup_CountSpawnedAndStatsInitialized(sgroup: SGroupID, player: PlayerID): any
  • Squad_AddAllResources(squad: SquadID, amount: number): any
  • Add resources of all types to the specified squad by the specified amount, specifically to the SquadResourceExt.

    Parameters

    Returns any

  • Add to the list of slot items to drop when this squad is wiped out Squad_AddSlotItemToDropOnDeath( squadid, item, false )

    Parameters

    Returns void

  • Squad_AdjustAbilityCooldown(squad: SquadID, tickAmount: number): any
  • Squad_CanAttackEntity(attacker: SquadID, target: EntityID, checkFOW: boolean, checkVis: boolean): any
  • Squad_CanCastAbilityOnEGroup(caster: SquadID, ability: number, target_egroup: EGroupID): any
  • Test whether a squad can be ordered to do this ability on any member of the target EGroup

    Parameters

    Returns any

  • Squad_CanCastAbilityOnSGroup(caster: SquadID, ability: number, target_sgroup: SGroupID): any
  • Test whether a squad can be ordered to do this ability on any member of the target SGroup

    Parameters

    Returns any

  • Squad_CanHold(squad: SquadID): boolean
  • Squad_CanInstantReinforceNow(squad: SquadID): boolean
  • Squad_CanLoadSquad(squad: SquadID, loadthis: SquadID, bCheckSquadState: boolean, bOverload: boolean): boolean
  • Squad_CanTargetEntity(squad: Squad, target: EntityID, checkFOW: boolean): any
  • Squad_CanTargetSquad(squad: Squad, target: Squad, checkFOW: boolean): any
  • Check if a squad can target and attack at least one entity in the given target squad.

    Parameters

    Returns any

  • Squad_CancelProductionQueueItem(squad: SquadID, index: number): any
  • Cancels an item in a production queue. Index 0 is the currently producing item.

    Parameters

    Returns any

  • Squad_ClearPostureSuggestion(squad: SquadID): void
  • Squad_ClearStateModelEnumTableTarget(squad: SquadID, key: string, tableRowIndex: number): any
  • Clears a TargetHandle value in the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • squad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • Squad_ClearStateModelTarget(squad: SquadID, key: string): any
  • Clears a TargetHandle value in the squad's state model corresponding to the given key.

    Parameters

    Returns any

  • Squad_Count(squad: SquadID): number
  • Create a squad, spawn it and assign it to a player. This will create a squad of size 'loadoutCount' and of unit type 'unit_base' (from squad blueprint) Note: loadoutCount will be clipped to loadoutMin and loadoutMax from the squad blueprint. A loudoutCount of zero means create the whole squad as is.

    Parameters

    Returns SquadID

  • Squad_DeSpawn(squad: SquadID): void
  • Squad_Destroy(squad: SquadID): void
  • Squad_EnableProductionQueue(squad: SquadID, enable: boolean): void
  • Squad_EnableSurprise(squad: SquadID, enable: boolean): void
  • Squad_EntityAt(squad: SquadID, index: number): any
  • Squad_ExtensionCount(): any
  • Set the rotation of all troopers in a squad to face the position. The center of the squad will face the position and all other troops will use the same rotation as the from center vector. This function works on spawned squads only.

    Parameters

    Returns void

  • Tries to find cover within a certain radius of a position. If no cover is found, it returns the position used for the search.

    Parameters

    Returns Position

  • Squad_FindCoverCompareCurrent(squad: SquadID, pos: Position, coverSearchRadius: number, maxPathDistanceFromGoal: number, compareToCurrentCover: boolean): Position
  • Tries to find cover within a certain radius of a position, traveling a max distance to get there, and possibly comparing against current position's cover. If no cover is found, it returns the position used for the search.

    Parameters

    • squad: SquadID
    • pos: Position
    • coverSearchRadius: number
    • maxPathDistanceFromGoal: number
    • compareToCurrentCover: boolean

    Returns Position

  • Squad_FromID(id: number): any
  • Squad_GetActiveUpgrades(squad: Squad): any
  • Find the squad member current or forced targets. If found, the targets squads are added to the sgroup. Entity targets like buildings are ignored

    Parameters

    Returns void

  • Squad_GetCoverLevel(squad: SquadID): any
  • Returns a number representing how good squad cover is -1 for awful, 0 for none, 1 for light, 2 for heavy

    Parameters

    Returns any

  • Returns the squad's destination, if it's moving. IMPORTANT: you must only call this function if Squad_HasDestination has returned true.

    Parameters

    Returns Position

  • Returns the average heading of the spawned units in the squad. The heading is currently a lua table with three entries (x, y, z)

    Parameters

    Returns Position

  • Squad_GetHealth(squad: SquadID): number
  • Returns the current health of a squad. The current health of the squad is the total health of each entity in that squad.

    Parameters

    Returns number

  • Squad_GetHealthMax(squad: SquadID): number
  • Returns the max health of the squad. The max health of a squad is the max health of each entity in that squad. This means that the max health of a squad may change when entities are added or removed from the squad.

    Parameters

    Returns number

  • Squad_GetHealthPercentage(squad: SquadID): number
  • Returns how much of an original squad's health is left, accounting for deaths (ex: a squad of 3 riflemen would be at 50% health, since they started with 6 members) Note: This is the same percentage that the UI uses.

    Parameters

    Returns number

  • Squad_GetHealthPercentageWithShields(squad: SquadID, includeBonuses: boolean): any
  • Squad_GetInternalAIEncounterPtr(squad: SquadID): any
  • Squad_GetInvulnerable(squad: SquadID): boolean
  • Squad_GetInvulnerableEntityCount(squad: SquadID): any
  • Squad_GetInvulnerableMinCap(squad: SquadID): number
  • Squad_GetLastAttackers(squad: SquadID, group: SGroupID, timeSeconds: number): void
  • Find the squad attackers on this squad from the last seconds specified. If found, the squads are added to the sgroup. Building attackers are ignored

    Parameters

    Returns void

  • Squad_GetMax(squad: SquadID): number
  • Squad_GetMaxEntityDropOffDistance(targetSquad: SquadID): any
  • Returns the sum of all entities in a squad's resourceDropOffDistance state model value if it exists and the entities have a state model ext. Otherwise it will return 0.0f

    Parameters

    Returns any

  • Squad_GetMinArmor(squad: SquadID): any
  • Returns the current minimum armor of a squad. The current armor of the squad is the minimum armor amongst all entities in that squad.

    Parameters

    Returns any

  • Squad_GetMostRecentQueuedCommandID(squad: SquadID): any
  • Squad_GetOffsetPosition(squad: SquadID, offset: number, distance: number): Position
  • Returns a position relative to a squad's current position and orientation. see ScarUtil.scar for explanation of 'offset' parameter.

    Parameters

    • squad: SquadID
    • offset: number
    • distance: number

    Returns Position

  • Returns the average position of the spawned units in the squad. The position is currently a lua table with three entries (x, y, z)

    Parameters

    Returns Position

  • Squad_GetProductionQueueItemType(squad: SquadID, index: number): number
  • Returns the production type (PITEM_Upgrade, PITEM_Spawn, PITEM_SquadUpgrade, PITEM_SquadReinforce, PITEM_PlayerUpgrade) for a production queue item with index.

    Parameters

    Returns number

  • Squad_GetProductionQueueSize(squad: SquadID): number
  • Returns the number of items in the squad's production queue. It is an error to call this function on a squad that does not have a production queue. Use Squad_HasProductionQueue to check that the squad has a queue.

    Parameters

    Returns number

  • Squad_GetShieldPercentage(squad: SquadID): any
  • Squad_GetSlotItemAt(squad: SquadID, index: number): number
  • Returns the ID of the slot item. Use Squad_GetSlotItemCount to determine how many slot items the squad has. The first index is 1

    Parameters

    Returns number

  • Squad_GetSlotItemCount(squad: SquadID): number
  • Squad_GetSlotItemsTable(squadid: SquadID): any
  • Squad_GetSquadDoingDisableOnSquad(pSquad: SquadID): any
  • returns the Squad that sent the passed squad in a disable state Disable states are: knocked back, stunned, levitate, stasis

    Parameters

    Returns any

  • Squad_GetStateModelBool(squad: SquadID, key: string): any
  • Returns a boolean value from the squad's state model corresponding to the given key.

    Parameters

    Returns any

  • Squad_GetStateModelEntityTarget(squad: SquadID, key: string): any
  • Returns an Entity value from the squad's state model corresponding to the given key.

    Parameters

    Returns any

  • Squad_GetStateModelEnumTableBool(squad: SquadID, key: string, tableRowIndex: number): any
  • Returns a boolean value from the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • squad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • Squad_GetStateModelEnumTableEntityTarget(squad: SquadID, key: string, tableRowIndex: number): any
  • Returns an Entity value from the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • squad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • Squad_GetStateModelEnumTableFloat(squad: SquadID, key: string, tableRowIndex: number): any
  • Returns a float value from the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • squad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • Squad_GetStateModelEnumTableInt(squad: SquadID, key: string, tableRowIndex: number): any
  • Returns an integer value from the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • squad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • Squad_GetStateModelEnumTablePlayerTarget(squad: SquadID, key: string, tableRowIndex: number): any
  • Returns a Player value from the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • squad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • Squad_GetStateModelEnumTableSquadTarget(squad: SquadID, key: string, tableRowIndex: number): any
  • Returns a Squad value from the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • squad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • Squad_GetStateModelEnumTableVector3f(squad: SquadID, key: string, tableRowIndex: number): any
  • Returns a Vector3f value from the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • squad: SquadID
    • key: string
    • tableRowIndex: number

    Returns any

  • Squad_GetStateModelFloat(squad: SquadID, key: string): any
  • Returns a float value from the squad's state model corresponding to the given key.

    Parameters

    Returns any

  • Squad_GetStateModelInt(squad: SquadID, key: string): any
  • Returns an integer value from the squad's state model corresponding to the given key.

    Parameters

    Returns any

  • Squad_GetStateModelPlayerTarget(squad: SquadID, key: string): any
  • Returns a Player value from the squad's state model corresponding to the given key.

    Parameters

    Returns any

  • Squad_GetStateModelSquadTarget(squad: SquadID, key: string): any
  • Returns a Squad value from the squad's state model corresponding to the given key.

    Parameters

    Returns any

  • Squad_GetStateModelVector3f(squad: SquadID, key: string): any
  • Returns a Vector3f value from the squad's state model corresponding to the given key.

    Parameters

    Returns any

  • Squad_GetSuppression(squad: SquadID): number
  • Squad_GetVehicleMobileDriverSquad(pSquad: SquadID): any
  • Squad_GetVeterancy(squad: SquadID): any
  • Squad_GetVeterancyRank(squad: SquadID): number
  • Squad_GiveSlotItemsFromTable(squadid: SquadID, itemTable: any): void
  • Gives all slot items in a table to the squad. The table should come from Squad_GetSlotItemsTable

    Parameters

    Returns void

  • Squad_HasActiveCommand(squad: SquadID): boolean
  • Squad_HasBlueprint(squad: SquadID, blueprints: any): boolean
  • Checks whether a squad is of any of the Blueprints or SquadTypes specified. Blueprint can be a single Blueprint, a single SquadType, or a table of multiple Blueprints or SquadTypes. If you want to see if a squad has ALL of a set of SquadTypes, then wrap them all in a sub-table.

    Parameters

    Returns boolean

  • Squad_HasBuilding(pSquad: SquadID): any
  • Squad_HasDestination(squad: SquadID): boolean
  • Squad_HasEntityWithNInteractors(targetSquad: SquadID, interactionTypeName: string, minAttachedCount: number): any
  • Returns if squad contains an entity with at least minAttachedCount attached interactibles of interactionTypeName type

    Parameters

    • targetSquad: SquadID
    • interactionTypeName: string
    • minAttachedCount: number

    Returns any

  • Squad_HasHeavyWeapon(pSquad: SquadID): any
  • Squad_HasInfantry(pSquad: SquadID): any
  • Returns true if the given squad has at least one infantry unit in it (includes team weapons)

    Parameters

    Returns any

  • Squad_HasProductionQueue(squad: SquadID): boolean
  • Squad_HasSetupTeamWeapon(pSquad: SquadID): any
  • Squad_HasTeamWeapon(squad: SquadID): boolean
  • Squad_HasVehicle(pSquad: SquadID): any
  • Squad_HasWeaponHardpoint(pSquad: SquadID, hardPointName: string): any
  • Returns true if the given squad has at least one Entity who has the specified weapon hardpoint.

    Parameters

    • pSquad: SquadID
    • hardPointName: string

    Returns any

  • Squad_IncreaseVeterancy(squad: SquadID, veterancy: number, silent: boolean, applyModifiers: boolean): any
  • Increase current squad veterancy

    Parameters

    • squad: SquadID
    • veterancy: number
    • silent: boolean
    • applyModifiers: boolean

    Returns any

  • Squad_IncreaseVeterancyRank(squad: SquadID, numranks: number, silent: boolean): void
  • Squad_InstantSetupTeamWeapon(squad: SquadID): void
  • Squad_IsAttackMoving(squad: SquadID): any
  • Squad_IsAttacking(squad: SquadID, time: number): boolean
  • Returns true if any unit in the squad is attacking within the time Time is in seconds

    Parameters

    Returns boolean

  • Squad_IsCamouflaged(squad: SquadID): boolean
  • Squad_IsCapturing(squad: SquadID): any
  • Squad_IsCasualty(squad: SquadID): any
  • Squad_IsConstructing(squad: SquadID): any
  • Squad_IsFemale(squad: SquadID): any
  • Squad_IsGatheringResourceType(targetSquad: SquadID, type: number): any
  • Returns if squad contains an entity that is performing a specific unit role

    Parameters

    Returns any

  • Squad_IsHoldingAny(squad: SquadID): boolean
  • Squad_IsHoldingPosition(squad: SquadID): any
  • Squad_IsInAIEncounter(squad: SquadID): any
  • Squad_IsInBackground(pSquad: SquadID): any
  • Returns whether or not the squad is in the background. Default returns false (if the squad is empty)

    Parameters

    Returns any

  • Squad_IsInCover(squadId: SquadID, all: boolean): boolean
  • Returns true if ALL or ANY troopers in a squad are in cover. Set all to true to check if all troopers are in cover or set to false to check if any.

    Parameters

    Returns boolean

  • Squad_IsInHoldEntity(squad: SquadID): boolean
  • Squad_IsInHoldSquad(squad: SquadID): boolean
  • Squad_IsInMeleeCombat(pSquad: SquadID): any
  • Squad_IsKnockedBack(squad: SquadID): any
  • Squad_IsMoving(squad: SquadID): boolean
  • Squad_IsOfType(squad: SquadID, type: string): any
  • Determines if this squad is of the given type. Types are defined in squad_type_ext/squad_type_list

    Parameters

    Returns any

  • Squad_IsOnWalkableWall(squad: SquadID, all: boolean): any
  • Returns true if any entity of a squad (all=false) or the whole (all=true) squad is on walkable wall.

    Parameters

    Returns any

  • Squad_IsPinned(squad: SquadID): boolean
  • Squad_IsPinnedOrSuppressed(squad: SquadID): any
  • Squad_IsReinforcing(squad: SquadID): boolean
  • Returns true if the squad is currently reinforcing. This function will return false if the squad does not have a reinforce ext.

    Parameters

    Returns boolean

  • Squad_IsRetreating(squadid: SquadID): boolean
  • Returns true if the given blueprint is of the given type. Types are defined in squad_type_ext/squad_type_list

    Parameters

    Returns any

  • Squad_IsSettingDemolitions(squad: SquadID): any
  • Squad_IsStunned(squad: SquadID): any
  • Squad_IsSuppressed(squad: SquadID): boolean
  • Squad_IsUnderAttack(squad: SquadID, time: number): boolean
  • Returns true if any unit in the squad is under attack within the time Time is in seconds

    Parameters

    Returns boolean

  • Squad_IsUnderAttackByPlayer(squad: SquadID, pAttackerOwner: PlayerID, time: number): boolean
  • Returns true if squad is under attack by enemy from a particular player Time is in seconds

    Parameters

    Returns boolean

  • Squad_IsUnderAttackFromDirection(squad: SquadID, offset: number, timeSeconds: number): boolean
  • Returns true if the squad was under attack from a certain direction (8 offset types, see LuaConsts.scar)

    Parameters

    • squad: SquadID
    • offset: number
    • timeSeconds: number

    Returns boolean

  • Squad_IsUpgradingAny(squad: SquadID): boolean
  • Squad_IsValid(id: number): boolean
  • Check if a squad with the given ID can be found in the world

    Parameters

    • id: number

    Returns boolean

  • Squad_Precache(sbp: ScarSquadPBG, skinItemDefinitionID: number, player: PlayerID, resourceContainerCacheName: string, source: string, id: string): any
  • Precache squad resources and listen for event GE_EntityPrecached that it is done callback example: Rule_AddGlobalEvent(EntityPrecacheComplete, GE_SquadPrecached) Params: sbp - squad blueprint skinID - this is the server item id for a skin, it will precache and equip it player - the player that we want to precache the entity or squad for cacheName - name of cache where resource will be loaded into source - helps identify who requested the precaching id - id to table of data that will be used once entity/squad is loaded

    Parameters

    • sbp: ScarSquadPBG
    • skinItemDefinitionID: number
    • player: PlayerID
    • resourceContainerCacheName: string
    • source: string
    • id: string

    Returns any

  • Squad_RemoveSlotItemAt(squad: SquadID, index: number, bInstantWeaponChange: boolean): any
  • Squad_RemoveStateModelListBool(squad: SquadID, key: string, value: boolean): any
  • Removes a boolean value in the squad's state model list corresponding to the given key.

    Parameters

    • squad: SquadID
    • key: string
    • value: boolean

    Returns any

  • Squad_RemoveStateModelListEntityTarget(squad: SquadID, key: string, value: EntityID): any
  • Squad_RemoveStateModelListFloat(squad: SquadID, key: string, value: number): any
  • Removes a float value in the squad's state model list corresponding to the given key.

    Parameters

    • squad: SquadID
    • key: string
    • value: number

    Returns any

  • Squad_RemoveStateModelListInt(squad: SquadID, key: string, value: number): any
  • Removes an integer value in the squad's state model list corresponding to the given key.

    Parameters

    • squad: SquadID
    • key: string
    • value: number

    Returns any

  • Squad_RemoveStateModelListPlayerTarget(squad: SquadID, key: string, value: PlayerID): any
  • Squad_RemoveStateModelListSquadTarget(squad: SquadID, key: string, value: SquadID): any
  • Removes a Squad TargetHandle value in the squad's state model list corresponding to the given key.

    Parameters

    Returns any

  • Squad_RemoveStateModelListVector3f(squad: SquadID, key: string, value: Position): any
  • Squad_RewardActionPoints(squad: SquadID, actionPoint: number): void
  • Squad_SetAnimatorAction(squadid: SquadID, actionName: string): void
  • Trigger animation action for a squad. Please only use this for simple animations

    Parameters

    Returns void

  • Squad_SetAnimatorEvent(squadid: SquadID, actionName: string): void
  • Trigger animation event for a squad. Please only use this for simple animations

    Parameters

    Returns void

  • Squad_SetAnimatorState(squadid: SquadID, stateMachineName: string, stateName: string): void
  • Set animation state of a state machine for a squad. Please only use this for simple animations

    Parameters

    • squadid: SquadID
    • stateMachineName: string
    • stateName: string

    Returns void

  • Squad_SetBackground(pSquad: SquadID, isInBackground: boolean): void
  • Sets the squad to be in the background or foreground. By default, all squads are in the foreground

    Parameters

    • pSquad: SquadID
    • isInBackground: boolean

    Returns void

  • Squad_SetExtEnabled(pSquad: SquadID, extID: string, enabled: boolean): void
  • Enables or disables the squad's UI extension (which controls all UI elements related to the squad)

    Parameters

    • pSquad: SquadID
    • extID: string
    • enabled: boolean

    Returns void

  • Squad_SetHealth(squad: SquadID, healthPercent: number): void
  • Set the health of all units in a squad. Health must be in range [0.0, 1.0]

    Parameters

    • squad: SquadID
    • healthPercent: number

    Returns void

  • Squad_SetInvulnerable(squad: SquadID, enable: boolean, reset_time: number): void
  • Set invulnerability on the squad. Reset time is in seconds. If it is non-negative, the invulnerability will expire after this time.

    Parameters

    • squad: SquadID
    • enable: boolean
    • reset_time: number

    Returns void

  • Squad_SetInvulnerableEntityCount(squad: SquadID, invEntityCount: number, resetTime: number): void
  • Make a squad invulnerable to physical damage when number of members drop to or below specified count. member count, 0 means squad is vulnerable; above 0 means number of alive entities will not go below this count resetTime is the time in seconds that vulnerability will be restored.; zero time for reset time means the buff will last forever

    Parameters

    • squad: SquadID
    • invEntityCount: number
    • resetTime: number

    Returns void

  • Squad_SetInvulnerableMinCap(squad: SquadID, minHealthPercentage: number, resetTime: number): void
  • Make a squad invulnerable to physical damage. resetTime is the time in seconds that vulnerability will be restored.; zero time for reset time means the buff will last forever

    Parameters

    • squad: SquadID
    • minHealthPercentage: number
    • resetTime: number

    Returns void

  • Squad_SetMoodMode(squad: SquadID, mode: number): void
  • Moves the squad to an arbitrary new 3D position. Note that the squad will still have the same properties, so any squad that snaps to the terrain (most land based squads) will interpolate to the terrain height immediately after this move. This function should really only be used for skimmers and other units that require the y axis to be specified. Use Squad_SetPosition() otherwise.

    Parameters

    Returns void

  • Squad_SetRecrewable(squad: SquadID, capturable: boolean): void
  • Set entity inside the squad to be recrewable or not when it becomes abandoned

    Parameters

    Returns void

  • Squad_SetSharedProductionQueue(squad: SquadID, shared: boolean): void
  • Enables shared team production on a building (teammates can build using THEIR resources)

    Parameters

    Returns void

  • Squad_SetStateModelBool(squad: SquadID, key: string, value: boolean): void
  • Sets a boolean value in the squad's state model corresponding to the given key.

    Parameters

    • squad: SquadID
    • key: string
    • value: boolean

    Returns void

  • Squad_SetStateModelEntityTarget(squad: SquadID, key: string, value: EntityID): void
  • Squad_SetStateModelEnumTableBool(squad: SquadID, key: string, tableRowIndex: number, value: boolean): void
  • Sets a boolean value in the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • squad: SquadID
    • key: string
    • tableRowIndex: number
    • value: boolean

    Returns void

  • Squad_SetStateModelEnumTableEntityTarget(squad: SquadID, key: string, tableRowIndex: number, value: EntityID): void
  • Sets an Entity TargetHandle value in the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • Squad_SetStateModelEnumTableFloat(squad: SquadID, key: string, tableRowIndex: number, value: number): void
  • Sets a float value in the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • squad: SquadID
    • key: string
    • tableRowIndex: number
    • value: number

    Returns void

  • Squad_SetStateModelEnumTableInt(squad: SquadID, key: string, tableRowIndex: number, value: number): void
  • Sets an integer value in the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    • squad: SquadID
    • key: string
    • tableRowIndex: number
    • value: number

    Returns void

  • Squad_SetStateModelEnumTablePlayerTarget(squad: SquadID, key: string, tableRowIndex: number, value: PlayerID): void
  • Sets a Player TargetHandle value in the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • Squad_SetStateModelEnumTableSquadTarget(squad: SquadID, key: string, tableRowIndex: number, value: SquadID): void
  • Sets a Squad TargetHandle value in the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • Squad_SetStateModelEnumTableVector3f(squad: SquadID, key: string, tableRowIndex: number, value: Position): void
  • Sets a Vector3f value in the squad's state model corresponding to the given key and table row index (0 based).

    Parameters

    Returns void

  • Squad_SetStateModelFloat(squad: SquadID, key: string, value: number): void
  • Sets a float value in the squad's state model corresponding to the given key.

    Parameters

    • squad: SquadID
    • key: string
    • value: number

    Returns void

  • Squad_SetStateModelInt(squad: SquadID, key: string, value: number): void
  • Sets an integer value in the squad's state model corresponding to the given key.

    Parameters

    • squad: SquadID
    • key: string
    • value: number

    Returns void

  • Squad_SetStateModelListBool(squad: SquadID, key: string, value: boolean, allowDuplicates: boolean): void
  • Sets a boolean value in the squad's state model list corresponding to the given key.

    Parameters

    • squad: SquadID
    • key: string
    • value: boolean
    • allowDuplicates: boolean

    Returns void

  • Squad_SetStateModelListEntityTarget(squad: SquadID, key: string, value: EntityID, allowDuplicates: boolean): void
  • Sets an Entity TargetHandle value in the squad's state model list corresponding to the given key.

    Parameters

    Returns void

  • Squad_SetStateModelListFloat(squad: SquadID, key: string, value: number, allowDuplicates: boolean): void
  • Sets a float value in the squad's state model list corresponding to the given key.

    Parameters

    • squad: SquadID
    • key: string
    • value: number
    • allowDuplicates: boolean

    Returns void

  • Squad_SetStateModelListInt(squad: SquadID, key: string, value: number, allowDuplicates: boolean): void
  • Sets an integer value in the squad's state model list corresponding to the given key.

    Parameters

    • squad: SquadID
    • key: string
    • value: number
    • allowDuplicates: boolean

    Returns void

  • Squad_SetStateModelListPlayerTarget(squad: SquadID, key: string, value: PlayerID, allowDuplicates: boolean): void
  • Sets a Player TargetHandle value in the squad's state model list corresponding to the given key.

    Parameters

    Returns void

  • Squad_SetStateModelListSquadTarget(squad: SquadID, key: string, value: SquadID, allowDuplicates: boolean): void
  • Sets a Squad TargetHandle value in the squad's state model list corresponding to the given key.

    Parameters

    Returns void

  • Squad_SetStateModelListVector3f(squad: SquadID, key: string, value: Position, allowDuplicates: boolean): void
  • Sets a Vector3f value in the squad's state model list corresponding to the given key.

    Parameters

    Returns void

  • Squad_SetStateModelPlayerTarget(squad: SquadID, key: string, value: PlayerID): void
  • Squad_SetStateModelSquadTarget(squad: SquadID, key: string, value: SquadID): void
  • Squad_SetStateModelVector3f(squad: SquadID, key: string, value: Position): void
  • Squad_SetSuppression(squad: SquadID, percentage: number): void
  • Set current squad suppresion level. Suppression value value from 0 to 1

    Parameters

    Returns void

  • Squad_SetVeterancyDisplayVisibility(squad: SquadID, visible: boolean): void
  • Squad_SetWorldOwned(squad: SquadID): void
  • Split the squad into 2. The new squad size is specified by the number passed in The new squad size is specified by the number passed in.

    Parameters

    Returns SquadID

  • Squad_SuggestPosture(squad: SquadID, posture: number, duration: number): void
  • Suggests a posture to a squad, lasting the passed duration Posture of 0 is prone, 1 is kneel/crouch, and 2 is standing. Duration is in seconds, negative means indefinate.

    Parameters

    • squad: SquadID
    • posture: number
    • duration: number

    Returns void

  • Squad_TryFindClosestFreePosition(squad: SquadID, targetPosition: Position): any
  • StateTree_QueueGlobalStateTreeEntity(keepAlive: boolean, openingBranchName: string, entity: EntityID): any
  • Run a global state tree on an entity The state tree will be queued to run when safe to do so. A global state tree has its own lifetime, separate from any other state trees running on the target. parameters: - keepAlive: whether the state tree should restart if it finishes running - openingBranchName: name of state tree node to run - entity: the entity to run the tree on. This will be the context owner for the spawned state controller

    Parameters

    • keepAlive: boolean
    • openingBranchName: string
    • entity: EntityID

    Returns any

  • StateTree_QueueGlobalStateTreePlayer(keepAlive: boolean, openingBranchName: string, player: PlayerID): any
  • Run a global state tree on a player The state tree will be queued to run when safe to do so. A global state tree has its own lifetime, separate from any other state trees running on the target. parameters: - keepAlive: whether the state tree should restart if it finishes running - openingBranchName: name of state tree node to run - player: the player to run the tree on. This will be the context owner for the spawned state controller

    Parameters

    • keepAlive: boolean
    • openingBranchName: string
    • player: PlayerID

    Returns any

  • StateTree_QueueGlobalStateTreeSquad(keepAlive: boolean, openingBranchName: string, squad: SquadID): any
  • Run a global state tree on a squad The state tree will be queued to run when safe to do so. A global state tree has its own lifetime, separate from any other state trees running on the target. parameters: - keepAlive: whether the state tree should restart if it finishes running - openingBranchName: name of state tree node to run - squad: the squad to run the tree on. This will be the context owner for the spawned state controller

    Parameters

    • keepAlive: boolean
    • openingBranchName: string
    • squad: SquadID

    Returns any

  • Subtitle_EndAllSpeech(): any
  • Prematurely finish all queued speech This is useful for skipping all speech events that may have been queued

    Returns any

  • Subtitle_EndCurrentSpeech(): void
  • Prematurely finish currently playing speech and advance the next one in queue This is useful for skipping speech events

    Returns void

  • Subtitle_PlayNarrativeEvent(str: string): any
  • Plays a narrative event as a series of subtitled speech transitions when given the event's reflect ID. Pass in the reflect ID (make sure it is represented as an integer) of a NarrativeEvent which is authored in a NarrativeCollection data object. This function will add a wait object which will terminate when all transitions are complete.

    Parameters

    • str: string

    Returns any

  • Subtitle_PlayNarrativeLine(str: string): any
  • Plays a global speech with subtitle and actor icon specified in the narrative line with given ID. The line should be present in an authorable narrative collection and referenced by the reflect ID Adds a wait object if successful. Returns the title ID, call UI_TitleDestroy to remove.

    Parameters

    • str: string

    Returns any

  • Subtitle_PlaySpeechForSquadFromLocString(briefingActorPBG: ScarBriefingActorPBG, loc: string, disableIconSubtitle: boolean, audioCtrlEvent: string, squad: SquadID, is3D: boolean): any
  • Plays a global speech with subtitle and actor icon in the overlay with speech bubbles on squad decorators. localization id is used for both subtitle text and speech If the speech file is 3D, make sure that is3D is set to true. Shows speech bubble indicator on squad decorator. Call UI_TitleDestroy to remove.

    Parameters

    Returns any

  • Subtitle_PlaySpeechInternal(briefingActorPBG: ScarBriefingActorPBG, loc: string, disableIconSubtitle: boolean, audioCtrlEvent: string, squad: SquadID, is3D: boolean): any
  • Plays a global speech with subtitle and actor icon in the overlay localization id is used for both subtitle text and speech please make sure that the the speech file is 2D Call UI_TitleDestroy to remove.

    Parameters

    Returns any

  • Subtitle_UnstickCurrentSpeech(): void
  • SyncWeapon_IsAttacking(weapon: SyncWeaponID, time: number): boolean
  • Returns true if the specified player owns the sync weapon. Use a playerid of nil to see if it's unonwed. If player is not specified, then the code will check to see if the SyncWeapon is owned by the world.

    Parameters

    Returns boolean

  • SyncWeapon_SetAutoTargetting(weapon: SyncWeaponID, hardpoint: string, enable: boolean): void
  • Send a player ability command (PCMD_Ability) to a player. Only use this function from code which is executed for a single player (such as UI button callbacks).

    Parameters

    Returns any

  • Send a positional ability command (PCMD_Ability) to a player Only use this function from code which is executed for a single player (such as UI button callbacks).

    Parameters

    Returns any

  • Table_Concatenate(table1: any, table2: any): any
  • Creates a third table that points to every element in table1 and table2, in that order

    Parameters

    • table1: any
    • table2: any

    Returns any

  • Table_Contains(OriginalTable: any, item: Item): boolean
  • Table_Contains(OriginalTable: any, item: Item): boolean
  • Table_Copy(OriginalTable: any): any
  • Table_Copy(OriginalTable: any): any
  • Copies the contents of the original table returns a new table with the contents of that table

    Parameters

    • OriginalTable: any

    Returns any

  • Copies the contents of the original table returns a new table with the contents of that table

    Parameters

    • OriginalTable: any

    Returns any

  • Table_FillWithDefaultValues(myTable: any, myDefaults: any, OPT_errorMessage?: string): any
  • Updates myTable by applying default values from the myDefaults table for any items that are not explicitly declared already If the myDefaults table has any item with the value REQUIRED_DATA, then you are declaring that there is no default for this item and that you REQUIRE the user provides a value. You will get a Fatal Scar Error if these are left out, listing exactly which required keys are missing.

    Parameters

    • myTable: any
    • myDefaults: any
    • Optional OPT_errorMessage: string

    Returns any

  • Table_GetRandomItem(table: any, numberofitems?: number): Item
  • Table_GetRandomItem(table: any, numberofitems?: number): Item
  • Returns a random item from a table. You can return multiple items (without duplicates) by passing in an optional number parameter.

    Parameters

    • table: any
    • Optional numberofitems: number

    Returns Item

  • Returns a random item from a table. You can return multiple items (without duplicates) by passing in an optional number parameter.

    Parameters

    • table: any
    • Optional numberofitems: number

    Returns Item

  • Table_GetRandomItemWeighted(thistable: any): Returns
  • Takes a table of key-value pairs, where the keys are the items, and the values are the weights. The chance that a particular key is chosen is proportional to its associated weight. Weights should be integers.

    Parameters

    • thistable: any

    Returns Returns

  • Table_MakeReadOnly(table: any, OPT_recursive?: boolean, OPT_errorMessage?: string): any
  • Table_MakeReadOnly(table: any, OPT_recursive?: boolean, OPT_errorMessage?: string): any
  • Makes a table read-only. This can be done recursively to also apply to any subtables. Any attempts to write to this table after this has been called will trigger a Fatal SCAR Error. You can customize the error message that will be given with the "error" parameter.

    Parameters

    • table: any
    • Optional OPT_recursive: boolean
    • Optional OPT_errorMessage: string

    Returns any

  • Makes a table read-only. This can be done recursively to also apply to any subtables. Any attempts to write to this table after this has been called will trigger a Fatal SCAR Error. You can customize the error message that will be given with the "error" parameter.

    Parameters

    • table: any
    • Optional OPT_recursive: boolean
    • Optional OPT_errorMessage: string

    Returns any

  • Table_RemoveFirstItem(table: any, toRemove: any): void
  • Finds the first instance of a given item in the given table and removes it

    Parameters

    • table: any
    • toRemove: any

    Returns void

  • Table_Reverse(table: any): any
  • Table_Shuffle(table: any): any
  • Taskbar_IsVisible(): boolean
  • Taskbar_SetVisibility(visible: boolean): void
  • Team_AddResource(team: TeamID, resourceType: number, value: number): void
  • Add resource to each member of a team, as opposed to just setting it. Possible resource types are RT_FOOD, RT_WOOD, RT_STONE, RT_GOLD, RT_ACTION

    Parameters

    • team: TeamID
    • resourceType: number
    • value: number

    Returns void

  • Team_AddSquadsToSGroup(team: TeamID, squadgroupName: string): SGroupID
  • For the given team, get all of the squads gathered into a squadgroup of your naming. This will add all squads for the entire team to one group. To do so for each player, iterate the team table Squads will be added to given squad group. If the given squad group does not exist it will be created.

    Parameters

    • team: TeamID
    • squadgroupName: string

    Returns SGroupID

  • Team_ClearArea(team: TeamID, marker: MarkerID, invulnerable: boolean): void
  • Any of the team's units in the marker area move out of the area, and can be made invulnerable for a bit whilst they do it You can replace the marker with a position and a range - i.e. Team_ClearArea(team, pos, range, invulnerable)

    Parameters

    Returns void

  • Team_CountPlayers(teamid: any): number
  • Team_FindByRace(race: string, race2?: string): TeamID
  • Returns the TeamID for a given race. See LuaConsts for constants to use. You can pass in multiple races, for example: allies and commonwealth.

    Parameters

    • race: string
    • Optional race2: string

    Returns TeamID

  • Team_ForEachAllOrAny(team: TeamID, all: boolean, function_: any): boolean
  • Tests a condition on teams. Calls your function for each player. Parameters of your function: (TeamID, player index, PlayerID). Your function must return true or false to indicate whether the player meets the condition.

    Parameters

    • team: TeamID
    • all: boolean
    • function_: any

    Returns boolean

  • Creates/Clears groups that contain all of a team's units and buildings. Defaults - sg_allsquads and eg_allentities Fills an SGroup with all of the given team's squads, and an EGroup with all the team's entities. If you don't provide and groups, then it defaults to using sg_allsquads and eg_allentities.

    Parameters

    Returns void

  • Gather together all of a teams's entities that are in proximity to a marker, a position, or within a territory sector into an EGroup. The EGroup is cleared beforehand. You can override a marker's normal proximity by specifying a range.

    Parameters

    Returns void

  • Gather together all of a teams's squads that are in proximity to a marker, a position, or within a territory sector into an SGroup. The SGroup is cleared beforehand. You can override a marker's normal proximity by specifying a range.

    Parameters

    Returns void

  • Returns the entityID of the first team owned building listed in the table. This only looks at completed buildings Use ALL to return a table containing the first building listed for each player on the team

    Parameters

    Returns EntityID

  • Team_GetBuildingsCount(team: TeamID): number
  • Team_GetEntitiesFromType(team: TeamID, unitType: string): EGroup
  • Returns an EGroup containing all of the teams entities of a specific unit_type (as defined by the type_ext on the entity) This function returns a new EGroup to allow tracking of different types.

    Parameters

    Returns EGroup

  • Team_GetEntityConcentration(team: TeamID, popcapOnly?: boolean, includeBlueprints?: any, excludeBlueprints?: any, bLeastConcentrated?: boolean, onlyInThisMarker?: any): EGroup
  • Finds the greatest (or least) concentration of entities owned by a team. This function is slow, so don't call it very often

    Parameters

    • team: TeamID
    • Optional popcapOnly: boolean
    • Optional includeBlueprints: any
    • Optional excludeBlueprints: any
    • Optional bLeastConcentrated: boolean
    • Optional onlyInThisMarker: any

    Returns EGroup

  • Team_GetRelationship(team1: number, team2: number): any
  • Returns the relationship between 2 teams.

    Parameters

    • team1: number
    • team2: number

    Returns any

  • Team_GetSquadConcentration(team: TeamID, popcapOnly?: boolean, includeBlueprints?: any, excludeBlueprints?: any, bLeastConcentrated?: boolean, onlyInThisMarker?: any): SGROUP
  • Finds the greatest (or least) concentration of squads owned by a team. This function is slow, so don't call it very often

    Parameters

    • team: TeamID
    • Optional popcapOnly: boolean
    • Optional includeBlueprints: any
    • Optional excludeBlueprints: any
    • Optional bLeastConcentrated: boolean
    • Optional onlyInThisMarker: any

    Returns SGROUP

  • Returns true if this team owns any buildings listed in the table. Use ALL to check if all players on the team have this building This only looks at completed buildings - use Team_HasBuildingUnderConstruction to see if the team is building something

    Parameters

    Returns boolean

  • Returns true if this team owns any buildings listed in the table currently under construction. Use ALL to check if all players on the team have this building under construction

    Parameters

    Returns boolean

  • Returns true if this team owns any buildings. (with exclusions). Use ALL to check if all players on the team have buildings EXCEPT this one

    Parameters

    Returns boolean

  • Team_HasHuman(team: TeamID, bool?: any): boolean
  • Team_IsAlive(teamid: any): boolean
  • Returns whether a team is still alive or not (all member players must be 'alive')

    Parameters

    • teamid: any

    Returns boolean

  • Team_IsSurrendered(teamid: any, any: any): boolean
  • Team_OwnsEGroup(team: TeamID, egroup: EGroupID, any?: boolean): boolean
  • Team_OwnsSGroup(team: TeamID, sgroup: SGroupID, all?: boolean): boolean
  • Team_RestrictAddOnList(team: TeamID, addonlist: any): void
  • Restrict a list of addons. list should contain an array of strings to restrict.

    Parameters

    Returns void

  • Team_RestrictBuildingList(team: TeamID, blueprintlist: any): void
  • Restrict a list of buildings. list should contain an array of strings to restrict.

    Parameters

    • team: TeamID
    • blueprintlist: any

    Returns void

  • Team_RestrictResearchList(team: TeamID, list: string[]): void
  • Restrict a list of research items. list should contain an array of strings to restrict.

    Parameters

    Returns void

  • Team_SetAbilityAvailability(team: TeamID, bp: number, availability: number): void
  • Sets the availability of an ability. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT

    Parameters

    • team: TeamID
    • bp: number
    • availability: number

    Returns void

  • Team_SetCommandAvailability(team: TeamID, command: number, availability: number): void
  • Sets the availability of entity, squad and player commands. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT

    Parameters

    • team: TeamID
    • command: number
    • availability: number

    Returns void

  • Team_SetConstructionMenuAvailability(team: TeamID, menuname: string, availability: number): void
  • Sets the availability of a construction menu. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT

    Parameters

    • team: TeamID
    • menuname: string
    • availability: number

    Returns void

  • Team_SetEntityProductionAvailability(team: TeamID, bp: number, availability: number): void
  • Sets the availability of an entity production item. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT

    Parameters

    • team: TeamID
    • bp: number
    • availability: number

    Returns void

  • Team_SetMaxCapPopulation(team: TeamID, captype: number, newcap: number): void
  • Sets the current personnel or vehicle max-cap for each player on a team. The captype is either CT_Personnel or CT_Vehicle (you can't adjust Medic caps just yet). you will have to call Team_SetMaxPopulation to adjust the current max population to do this. Note that any modifiers that adjust the current max cap will be applied on top of this. Also note, this is only adjusting the max cap, not the current cap,

    Parameters

    • team: TeamID
    • captype: number
    • newcap: number

    Returns void

  • Team_SetMaxPopulation(team: TeamID, captype: number, newcap: number): void
  • Sets the current personnel or vehicle cap for each player on a team. The captype is either CT_Personnel or CT_Vehicle (you can't adjust Medic caps just yet). Note that any modifiers that adjust the current cap will be applied on top of this. Also note, the current cap cannot go higher than the max cap.

    Parameters

    • team: TeamID
    • captype: number
    • newcap: number

    Returns void

  • Team_SetSquadProductionAvailability(team: TeamID, bp: number, availability: number): void
  • Sets the availability of a squad production item. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT

    Parameters

    • team: TeamID
    • bp: number
    • availability: number

    Returns void

  • Team_SetTechTreeByYear(team: TeamID, year: number): void
  • Team_SetUpgradeAvailability(team: TeamID, bp: number, availability: number): void
  • Sets the availability of an upgrade. Availability can be either ITEM_LOCKED, ITEM_UNLOCKED, ITEM_REMOVED or ITEM_DEFAULT

    Parameters

    • team: TeamID
    • bp: number
    • availability: number

    Returns void

  • Team_SetUpgradeCost(team: TeamID, upgrade: UpgradeID, food: number, wood: number, stone: number, gold: number): void
  • TerrainHighlight_Hide(): any
  • TerrainHighlight_Show(metadataLayerName: string, opacity: number): any
  • Display metadata layer on terrain. Replaces previously displayed terrain highlight

    Parameters

    • metadataLayerName: string
    • opacity: number

    Returns any

  • Terrain_CreateSplat(_name: string, xpos: number, zpos: number, scale: number): any
  • Create a splat on the terrain

    Parameters

    • _name: string
    • xpos: number
    • zpos: number
    • scale: number

    Returns any

  • Terrain_DrawGrid(increment: number): any
  • Draw a grid on the terrain with tunable increment

    Parameters

    • increment: number

    Returns any

  • Terrain_DrawGridLines(spacing: number): any
  • Draw lines on a grid on the terrain with tunable spacing

    Parameters

    • spacing: number

    Returns any

  • Terrain_DrawMaterialMap(onoff: boolean): any
  • Terrain_GetCoverType_AsNumber(pos: Position): any
  • Terrain_GetCoverType_AsString(pos: Position): any
  • Terrain_LoadHeightMap(): any
  • Load the saved terrain height map. This will restore the state of the terrain height map to

    Returns any

  • Terrain_SaveHeightMap(): any
  • Save the current terrain height map. It can be restored to that state by using Terrain_LoadHeightMap.

    Returns any

  • Territory_ContainsSectorID(sectorID: SectorID): any
  • Territory_FindClosestSectorToPoint(pos3D: Position): any
  • Territory_GetAdjacentSectors(sectorID: SectorID): any
  • Territory_GetPrimaryEntityInSector(sectorID: SectorID): any
  • Territory_GetSectorContainingPoint(pos3D: Position): any
  • Territory_GetSectorCreatorEntity(sectorID: SectorID): any
  • Territory_GetSectorGeneratorPointOnTerrain(sectorID: SectorID): any
  • Territory_GetSectorOwnerID(sectorID: SectorID): any
  • Territory_IsHexagonTerritory(): any
  • TestConfig_AutoGenerateTestTemplate(optional: Stack_level): any
  • Auto generates a test configuration template and stores it for later saving. This is a debug feature. The system tries to gather the parameters of the calling function and auto generates a template for it. The resulting template is added to a list which is written to cache:AutoConfig.json (see TestConfig_SaveCachedTestTemplates() above). If you use a non json compatible type you need to update _SerializeParameters above. See example for ScarPos.

    Parameters

    Returns any

  • TestConfig_LoadFromCommandLine(): any
  • Tries to load the test configuration from the command line argument. See TEST_CONFIG_ARGUMENT_TEST_CONFIG above. See definition of TestConfig_LoadFromFile.

    Returns any

  • TestConfig_LoadFromFile(path: string): any
  • Tries to load the test configuration from the given file. The test configuration file is a json file containing groups of tests. Each test is defined with a function to call and its parameters. The system parses the file and tries to invoke the functions in the global space (by calling _G[function_string] ). Tests marked as active: false are skipped. Parameters either need to be json compatible (strings, numbers, boolean) or have a 'constructor' function associated to them. e.g: 2D positions { "parameters": [ 0, -20 ], "func": "Util_ScarPos" }

    Parameters

    • path: string

    Returns any

  • TestConfig_SaveCachedTestTemplates(): any
  • TestGroup_BuildingBasics(): any
  • expect_destruction=nil will let the test determine this value based on entity targeting settings expect_destruction=nil will let the test determine this value based on entity targeting settings

    Returns any

  • TestGroup_SquadBasics(): any
  • idx used to should be unique per run to prevent entity stacking expect_destruction=nil will let the test determine this value based on entity targeting settings

    Returns any

  • TestGroup_SquadBasics_NoCombat(): any
  • small version of TestGroup_SquadBasics() without the combat-specific tests

    Returns any

  • TestPhysics_Destruction(): any
  • spawns instances of an unit in a grid, then kills it to trigger physics destruction. Fails if to rigid bodies where created. params table : testName, unitPath, quantity, spacing, slowdown, timeout_seconds, use_telemetry

    Returns any

  • TestUtil_CallWithoutBlocking(t_function_parameter: any): any
  • Calls given method/parameter combinations one at a time to avoid blocking for long calls. Expects to receive a table in the format of {{func=,params=<table-containing-parameters in order}}. Calls one function at a time and queues the next function after completing the call. This allows the engine to simulate in between and will not block the other threads for extended amounts of time. Useful for tests that spawn a large amount of squads and entities and need to give them commands. Giving a callback to notify when the list has been processed is optional.

    Parameters

    • t_function_parameter: any

    Returns any

  • TestUtil_DestroyAllNeutralEntities(): any
  • TestUtil_DestroyAllPlayerSquadsAndEntities(player: Player): any
  • TestUtil_DestroyAllSquadsAndEntities(): any
  • TestUtil_DestroySpecifiedPlayerSquadsAndEntities(player: Player, t_blueprintsToDestroy: string): any
  • Destroy specified player squads and entities from the blueprint list Destroys all squads and entities belonging to player that match one of the

    Parameters

    • player: Player
    • t_blueprintsToDestroy: string

    Returns any

  • TestUtil_GetAllBlueprintNames(do_entity: boolean, for_: False): any
  • Returns all blueprints that match the given filters. Filters the property bags inside attrib/instances and returns the paths that match the filters. After matching the base filter this part of the path is removed and the detail filter is applied. Example: base_filter "sbps\races\eng\" will match all english units. detail filter "archer" will return return a table with "unit_archer_2_eng", "unit_archer_3_eng", "unit_archer_4_eng"

    Parameters

    • do_entity: boolean
    • for_: False

    Returns any

  • TestUtil_HighlightCircleRadius(position?: Position): any
  • Draws a circle at the given location. calls a render debug function in a way that creates a visible outline on terrain. Any provided colour value that isn't within the char bit range (0 - 255) will be adjusted. The colour, segment and thickness parameters are optional and will default to reasonable values if excluded.

    Parameters

    Returns any

  • TestUtil_MakeBuildingFast(ebpname_building: string): any
  • Applies a modifier making player 1 build the given ebp faster. The modifier is returned.

    Parameters

    • ebpname_building: string

    Returns any

  • TestUtil_PrintAllSquadsAndEntities(): any
  • Prints the location and health of all player owned squads and entities Iterates over all players and prints the position and health of all squads and entities the player owns.

    Returns any

  • TestUtil_PrintPlayerEntities(player: Player): any
  • Prints the location and health of all entities owned by a player Iterates over all entities a player owns and prints their blueprint name, position and health.

    Parameters

    Returns any

  • TestUtil_PrintPlayerSquads(player: Player): any
  • Prints the location and health of all squads owned by a player Iterates over all squads a player owns and prints their blueprint name, position and health.

    Parameters

    Returns any

  • Create a new unit test and add it to the given table Once all tests have been added using this function, the test group passed to t_test_group should be passed

    Parameters

    Returns any

  • TestUtil_SpawnEntitiesInGridWithoutBlocking(player: Player, t_ebpnames: any): any
  • Spawn entities in a grid based on a list of blueprint names. Grabs one entry of the given blueprint list each iteration and spawns it. Then it creates a new timed rule requesting to be called again as soon as possible. This gives the engine time to update in between calls so that the other threads are not blocked in case a huge list of units needs to get spawned. Once every unit is spawned the given callback function will be called. The spawning grid starts at the given top left corner and spawns in an axis aligned grid based on the given spacing. The grid expands towards positive x/z

    Parameters

    Returns any

  • TestUtil_SpawnSquadsInGridWithoutBlocking(player: Player, t_sbpnames: any): any
  • Spawn squads based on a list of blueprint names. Grabs one entry of the given blueprint list each iteration and spawns it. Then it creates a new timed rule requesting to be called again as soon as possible. This gives the engine time to update in between calls so that the other threads are not blocked in case a huge list of units needs to get spawned. Once every unit is spawned the given callback function will be called.

    Parameters

    Returns any

  • TestUtil_TestClose(value1: any, value2: any, OPT_acceptable_difference?: number, OPT_value1_name?: string, OPT_value2_name?: string): any
  • Compare two values and print to standard_test if they are close enough Uses equality if acceptable_difference is nil or 0

    Parameters

    • value1: any
    • value2: any
    • Optional OPT_acceptable_difference: number
    • Optional OPT_value1_name: string
    • Optional OPT_value2_name: string

    Returns any

  • TestUtil_TestCompare(value1: any, value2: any, OPT_value1_name?: string, OPT_value2_name?: string): any
  • Compare two values using the given comparator

    Parameters

    • value1: any
    • value2: any
    • Optional OPT_value1_name: string
    • Optional OPT_value2_name: string

    Returns any

  • Checks if directions are equal and prints message to standard_test if they are not The items must of of types that can have a direction resolved on them with Util_GetDirection()

    Parameters

    Returns any

  • TestUtil_TestEqual(value1: any, value2: any, OPT_value1_name?: string, OPT_value2_name?: string): any
  • Compare two values and print to standard_test if they are equal Uses equality if acceptable_difference is nil or 0

    Parameters

    • value1: any
    • value2: any
    • Optional OPT_value1_name: string
    • Optional OPT_value2_name: string

    Returns any

  • TestUtil_TestPositionsSame(object1: EGroupID, object2: EGroupID, max_accepted_difference: number): any
  • Checks if positions are equal and prints message to standard_test if they are not

    Parameters

    Returns any

  • ThreatArrow_DestroyAllGroups(): void
  • ThreatArrow_DestroyGroup(GroupID: number): void
  • TimerAdd(command: string, freqInSec: number): any
  • Add a timer to be triggered every 'freqInSec'. the timer will then run the passed-in command

    Parameters

    • command: string
    • freqInSec: number

    Returns any

  • TimerAddFrame(command: string): any
  • Add a timer to be triggered every frame the timer will then run the passed-in command

    Parameters

    • command: string

    Returns any

  • TimerAddOnce(command: string, timeInSec: number): any
  • Add a timer to be triggered once after 'freqInSec' has elapsed. the timer will then run the passed-in command

    Parameters

    • command: string
    • timeInSec: number

    Returns any

  • TimerDel(command: string): any
  • Timer_Add(timerID: number, period: number): void
  • Add the amount of time to the specified timer

    Parameters

    • timerID: number
    • period: number

    Returns void

  • Timer_Advance(timerID: number, period: number): void
  • Advances the timer by the specified amount of time

    Parameters

    • timerID: number
    • period: number

    Returns void

  • Timer_Display(timerID: number): void
  • Display (in the console) the amount of time remaining in the specified timer.

    Parameters

    • timerID: number

    Returns void

  • Timer_DisplayOnScreen(timerID: number): void
  • Displays a timer on the screen - You need to call this regularly (i.e. every second) to update the onscreen display. THIS IS A TEMPORARY FUNCTION - WELL GET PROPER UI SUPPORT LATER ON

    Parameters

    • timerID: number

    Returns void

  • Timer_End(timerID: number): void
  • Timer_Exists(timerID: number): boolean
  • Timer_GetElapsed(timerID: number): number
  • Returns how much time has elapsed since this timer has been started

    Parameters

    • timerID: number

    Returns number

  • Timer_GetMinutesAndSeconds(getTimeFunction: any, TimerID: number): void
  • Returns TWO values: minutes and seconds. Provide it a function like Timer_GetRemaining or Timer_GetElapsed

    Parameters

    • getTimeFunction: any
    • TimerID: number

    Returns void

  • Timer_GetRemaining(timerID: number): number
  • Timer_IsPaused(timerID: number): boolean
  • Timer_Pause(timerID: number): void
  • Pause the specified timer. Pause and Resume calls are ref-counted: if you have called Pause twice on a timer, you will also need to call Resume twice in order to start the timer up again.

    Parameters

    • timerID: number

    Returns void

  • Timer_Resume(timerID: number, force?: boolean): void
  • Resume the specified timer. Pause and Resume calls are ref-counted: if you have called Pause twice on a timer, you will also need to call Resume twice in order to start the timer up again. Set the force parameter to true if you want to bypass the refcounting and make sure a timer starts up again.

    Parameters

    • timerID: number
    • Optional force: boolean

    Returns void

  • Timer_Start(timerID: number, period: number): void
  • Start a timer with the specified id, taking the required period ( in seconds )

    Parameters

    • timerID: number
    • period: number

    Returns void

  • TogglePhysicsDebug(enable: boolean): any
  • TogglePhysicsRaycastAsCapsuleDebug(enable: boolean): any
  • Toggle_Scanning_Info(): any
  • Toggles the scanning info from the ScanForTarget track for the debug entity

    Returns any

  • TownLife_Disband(moduleData: any, OPT_returned_sgroup?: SGroupID): any
  • Stops the TownLife module entirely and returns the units it contained

    Parameters

    • moduleData: any
    • Optional OPT_returned_sgroup: SGroupID

    Returns any

  • TownLife_IsDefeated(): any
  • TownLife_SetPlayerOwner(): void
  • TrackTradeCartsForPlayers(players: any): any
  • Starts a rule which will monitor the mission for trade cart deaths belonging to the specified players, and has a 1/3 chance of dropping a random resource pickup.

    Parameters

    • players: any

    Returns any

  • Training_AddCallbacksToGoal(target: The): any
  • register two callbacks to a goal. One fires when starts while the other fires when completes.

    Parameters

    Returns any

  • Training_AddExTagToGoal(): any
  • Training_AddGoalSequence(): any
  • Adds a sequence of goals to the training system, also starting the sequence's timer

    Returns any

  • Training_EnableGoalSequence(goalSequence: GoalSequence, enabled: boolean): any
  • Training_EnableGoalSequenceByID(id: string, enabled: boolean): any
  • Enable/disable goal sequence with given id

    Parameters

    • id: string
    • enabled: boolean

    Returns any

  • Training_EndGoalSequence(): any
  • Training_Goal(key: string, data: any): any
  • Creates a goal object A goal represents one step in a training sequence. Each goal gets one hint popup. Only one goal hint will be displayed at a time. key is the object to visually anchor the hint to. This can be: - the name of an adornable UI element - an entity - a squad - the pbg of a production button - a squad or entity unique id - UniqueSquadButton will anchor to the hero selection - UniqueRespawningSquadButton will anchor to the respawning hero element - CenterLeftSecondaryInfo will anchor to the information panel left of the command card. data is a table of arbitrary information for use in the isCompletePredicate and is routed to the ui. It should include: Message: Localized text to display on the hint pop-up. Use DataTemplate: template for the UI hint. Options are: - LeftClickTrainingDataTemplate: a box displaying an image of a left clicking mouse and message text - RightClickTrainingDataTemplate: a box displaying an image of a right clicking mouse and message text - PanCameraTrainingDataTemplate: a box displaying an image of a middle clicking mouse and message text - GenericTrainingDataTemplate: a box displaying message text - LargeGenericDataTemplate: a larger box dislpaying message text isComplete predicate to run on the goal. It should return true if and only if the goal is complete.

    Parameters

    • key: string
    • data: any

    Returns any

  • Training_GoalSequence(id: string, repeatMax: number, remindMax: number, goalTriggeredAudioEvent: string, completeAudioEvent: string): any
  • Creates a goal sequence A Goal Sequence represents the a single high-level task to prompt the user to do, composed of one or more goals. The goal sequence will begin when its trigger predicate is met, assuming its ignore and bypass conditions aren't met first. Only one goal sequence will be run at a time. id - unique string id to identify or reference the goal seqeuence repeatMax - if the goal sequence has been completed less than repeatMax times and its triggerPredicate passes, the goal sequence will run again. Infinite if less than 0. remindMax - if the . Infinite if less than 0. trigger - predicate to run on the goal sequence. If it returns true, start the goal sequence. ignore - predicate to run on the goal sequence. If it returns true, don't show the goal sequence even if trigger passes. remind - predicate to run on the goal sequence. It should indicate that the player needs a reminder on how to do the task. If it returns true, show the goal sequence again. bypass - predicate to run on the goal sequence. It should indicate whether the player has completed the goal without prompting. If true, the goal sequence will be ended and its completion count incremented. canRegress - if the complete condition for the current goal in the sequence stops passing, back up to the previous goal goals - list of goals to proceed through to as part of this goal sequence repeatMax and remindMax will be infinite if less than 0.

    Parameters

    • id: string
    • repeatMax: number
    • remindMax: number
    • goalTriggeredAudioEvent: string
    • completeAudioEvent: string

    Returns any

  • TransferModuleIntoModule(sourceModule: string, targetModule: string, pause?: boolean): undefined
  • Transfers all units from one module to another module, without destroying the source module

    Parameters

    • sourceModule: string
    • targetModule: string
    • Optional pause: boolean

    Returns undefined

  • UIWarning_Show(locText: string): void
  • Displays a breif UI warning in the critical alert message area.

    Parameters

    • locText: string

    Returns void

  • UI_AddChild(elementName: string, typeName: string, childName: string, propertyTable: StackVarTable): any
  • Add a new child named childName and of type typeName to elementName.

    Parameters

    • elementName: string
    • typeName: string
    • childName: string
    • propertyTable: StackVarTable

    Returns any

  • UI_AddCommandBinding(groupName: string, bindingName: string, callbackName: string): any
  • Adds a command binding for groupName.bindingName to global function callbackName.

    Parameters

    • groupName: string
    • bindingName: string
    • callbackName: string

    Returns any

  • UI_AddEventHandler(elementName: string, eventName: string, callbackName: string): any
  • Adds the event handler on elementName for event eventName to global function callbackName(elementName, eventName). The callback function should take two arguments, the element name and the event name.

    Parameters

    • elementName: string
    • eventName: string
    • callbackName: string

    Returns any

  • UI_AddHintAndFlashAbility(playerid: PlayerID, abilityID: AbilityID, text: string, length: number, blueprint_filter?: any): void
  • Creates and flashes an ability button on the taskbar if the unit is selected Length parameter determines how long to flash the item, and the blueprint filter is used if certain squad types need to be selected before flashing the button.

    Parameters

    • playerid: PlayerID
    • abilityID: AbilityID
    • text: string
    • length: number
    • Optional blueprint_filter: any

    Returns void

  • UI_AddText(elementName: string, text: string): any
  • UI_AllTerritoryHide(): any
  • Toggle off all territory lines. Each call to UI_AllTerritoryHide must be matched by a call to UI_AllTerritoryShow

    Returns any

  • UI_AllTerritoryShow(): any
  • Toggle on all territory lines. Each call to UI_AllTerritoryShow must be matched by a call to UI_AllTerritoryHide

    Returns any

  • UI_AutosaveMessageHide(): any
  • UI_AutosaveMessageShow(): any
  • DEPRECATED! Shows a message indicating that the game is autosaving. DEPRECATED! Call UI_AutosaveMessageHide to remove the message.

    Returns any

  • UI_CapturePointLinesHide(): any
  • Toggle off capture-point boundary lines. Each call to UI_CapturePointLinesHide must be matched by a call to UI_CapturePointLinesShow

    Returns any

  • UI_CapturePointLinesShow(): any
  • Toggle on capture-point boundary lines. Each call to UI_CapturePointLinesShow must be matched by a call to UI_CapturePointLinesHide

    Returns any

  • UI_Clear(elementName: string): any
  • UI_ClearEventCueFromID(id: number): any
  • Clears an event cue with a specific ID. The ID is obtained as a return value from either UI_CreateEventCueClickable or UI_CreateEventCueClickableByType.

    Parameters

    • id: number

    Returns any

  • UI_ClearEventCues(): void
  • UI_ClearModalAbilityPhaseCallback(): void
  • UI_ClearModalConstructionPhaseCallback(): any
  • UI_ClearModalHoverCallback(): any
  • UI_ClearSkipNISCallback(): any
  • UI_CommandCardSetColumns(columns: number): void
  • UI_CommandCardSetRows(rows: number): void
  • UI_CoverPreviewHide(): void
  • Toggle off cover preview. Each call to UI_CoverPreviewHide must be matched by a call to UI_CoverPreviewShow

    Returns void

  • UI_CoverPreviewShow(): void
  • Toggle on cover preview. Each call to UI_CoverPreviewShow must be matched by a call to UI_CoverPreviewHide

    Returns void

  • UI_CreateCommand(): any
  • UI_CreateDataContext(): any
  • Create a table that will be interpreted as a data context for UI properties.

    Returns any

  • UI_CreateEntityKickerMessage(player: PlayerID, entity: EntityID, message: string): void
  • UI_CreateEventCue(title: string, description: undefined | string, data_template: string, icon_path: string, sound_path: string, visibility?: EventCueVisibility, lifetime?: number): Event
  • Creates an event cue without a callback (you won't know when it's clicked).

    Parameters

    • title: string
    • description: undefined | string
    • data_template: string
    • icon_path: string
    • sound_path: string
    • Optional visibility: EventCueVisibility
    • Optional lifetime: number

    Returns Event

  • UI_CreateEventCueClickable(iconPath: string, soundPath: string, title: string, description: string, f: any, lifetime: number, dismissOnClick: boolean): number
  • Creates a event cue with custom lua callback function when icon is clicked. Lifetime of -1 means use the default. The return value is an event cue ID. The callback receives one parameter: the ID of the event cue that was clicked. the lua function is executed when the event cue icon is pressed example: UI_CreateEventCueClickable( "event_cue_icons/icon_player_attacked", "General_alert", 42761, 42762, prt, -1 )

    Parameters

    • iconPath: string
    • soundPath: string
    • title: string
    • description: string
    • f: any
    • lifetime: number
    • dismissOnClick: boolean

    Returns number

  • UI_CreateEventCueClickableByType(eventType: UIEventType, lifetime: number, title: string, description: string, dataTemplate: string, iconPath: string, soundPath: string, red: number, green: number, blue: number, alpha: number, visibility: EventCueVisibility, function_: any): any
  • Creates a named event cue. Returns the ID associated to the created event cue item. This ID can be used to clear the event cue item with UI_ClearEventCueFromID. The Lua function callback passed in takes an ID as an argument which can be used to clear the event cue with UI_ClearEventCueFromID.

    Parameters

    • eventType: UIEventType
    • lifetime: number
    • title: string
    • description: string
    • dataTemplate: string
    • iconPath: string
    • soundPath: string
    • red: number
    • green: number
    • blue: number
    • alpha: number
    • visibility: EventCueVisibility
    • function_: any

    Returns any

  • UI_CreateMinimapBlip(where: StackVar, lifetime: number, blipDataTemplate: string): BlipID
  • Creates a blip on the minimap; return the ID of the blip. 'where' can be an entity, marker, position, egroup, sgroup, or squad.

    Parameters

    • where: StackVar
    • lifetime: number
    • blipDataTemplate: string

    Returns BlipID

  • UI_CreateMinimapBlipOnMarkerFrom(sender: PlayerID, marker: MarkerID, lifeTime: number, dataTemplate: string): any
  • Create a blips on a ScarMarker from a sender. sender is used for retrieving player information like team color

    Parameters

    Returns any

  • UI_CreateMinimapBlipOnPosFrom(sender: PlayerID, position: Position, lifeTime: number, dataTemplate: string): any
  • Create a blips on a position from a sender. sender is used for retrieving player information like team color

    Parameters

    Returns any

  • UI_CreatePositionKickerMessage(player: PlayerID, position: Position, message: string): void
  • UI_CreateSGroupKickerMessage(player: PlayerID, sgroup: SGROUP, message: string): void
  • UI_CreateSquadKickerMessage(player: PlayerID, squad: SquadID, message: string): void
  • UI_CreateTagForPosition(scar: A): any
  • UI_CursorHide(): any
  • UI_CursorShow(): any
  • UI_DeleteMinimapBlip(blipID: number): void
  • UI_DestroyTagForPosition(position: Position): void
  • Destroy a position tag. position: same of or extremely close (std::numeric_limits::min()) to an existing position. If there are multiple candidates, delete the closest.

    Parameters

    Returns void

  • UI_EnableEntityDecorator(entity: EntityID, enabled: boolean): any
  • UI_EnableEntityMinimapIndicator(entity: EntityID, enabled: boolean): void
  • UI_EnableEntitySelectionVisuals(entity: EntityID, enabled: boolean): any
  • Enable or disable entity selection visuals. The default is visuals enabled.

    Parameters

    Returns any

  • UI_EnableGameEventCueType(gameEventType: GameEventID, enable: boolean): any
  • UI_EnableResourceTypeKicker(resourceType: number, enable: boolean): void
  • Enables or disables resource kickers. Possible resource types are RT_Manpower, RT_Fuel, RT_Munition, RT_Action, RT_Command.

    Parameters

    • resourceType: number
    • enable: boolean

    Returns void

  • UI_EnableSquadDecorator(squad: SquadID, enabled: boolean): void
  • UI_EnableSquadMinimapIndicator(squad: SquadID, enabled: boolean): void
  • UI_EnableUIEventCueType(uiEventType: UIEventType, enable: boolean): any
  • UI_FadeOutEventCueFromID(id: number): any
  • Triggers an event cue to start its fadeout animation. The animation is determined in XAML.

    Parameters

    • id: number

    Returns any

  • UI_FlashAbilityButton(ability: AbilityBlueprint, bStopOnClick: boolean, blipType: number): number
  • Begins flashing an ability widget. Flashes a taskbar binding associated with a specific ability ID.

    Parameters

    Returns number

  • UI_FlashConstructionButton(ebp: EntityBlueprint, bStopOnClick: boolean, blipType: number): number
  • UI_FlashEntity(entity: EntityID, actionOnName: string): void
  • Flash an entity order command button. Pass the return value to UI_StopFlashing to stop flashing the button.

    Parameters

    Returns any

  • UI_FlashEventCue(eventCueID: number, bStopOnClick: boolean, blipType: number): number
  • Flashes an event cue icon

    Parameters

    • eventCueID: number
    • bStopOnClick: boolean
    • blipType: number

    Returns number

  • UI_FlashMenu(menuName: string, stopOnClick: boolean): any
  • Flash a menu command button. Pass the return value to UI_StopFlashing to stop flashing the button.

    Parameters

    • menuName: string
    • stopOnClick: boolean

    Returns any

  • UI_FlashObjectiveCounter(objectiveID: number, blipType: number): number
  • Flashes an objective counter

    Parameters

    • objectiveID: number
    • blipType: number

    Returns number

  • UI_FlashObjectiveIcon(objectiveID: number, bStopOnClick: boolean, blipType: number): number
  • Flashes an objective icon

    Parameters

    • objectiveID: number
    • bStopOnClick: boolean
    • blipType: number

    Returns number

  • UI_FlashProductionBuildingButton(type: string, stopOnClick: boolean): any
  • Flash a production building button. Pass the return value to UI_StopFlashing to stop flashing the button. Type should match the unit_class of a Production Building in the army bag for the player's race

    Parameters

    • type: string
    • stopOnClick: boolean

    Returns any

  • UI_FlashProductionButton(pType: number, pbg: Blueprint, bStopOnClick: boolean, blipType: number): number
  • Begins flashing a production widget. Flashes a taskbar binding associated with a production type and PBG id. Use PGB id of -1 if you only care about the production type. Type may be one of PITEM_Spawn, PITEM_SquadUpgrade, PITEM_Reinforce

    Parameters

    • pType: number
    • pbg: Blueprint
    • bStopOnClick: boolean
    • blipType: number

    Returns number

  • UI_FlashSquadCommandButton(command: SquadCommandType, stopOnClick: boolean): any
  • Flash a squad order command button. Pass the return value to UI_StopFlashing to stop flashing the button.

    Parameters

    Returns any

  • UI_FlashUSSEntityButton(entity: EntityID, stopOnClick: boolean): any
  • Flash a button on the USS for this entity. Pass the return value to UI_StopFlashing to stop flashing the button.

    Parameters

    Returns any

  • UI_FlashUSSSquadButton(squad: SquadID, stopOnClick: boolean): any
  • Flash a button on the USS for this squad. Pass the return value to UI_StopFlashing to stop flashing the button.

    Parameters

    Returns any

  • UI_GetColourAsString(): any
  • Converts a colour table to an ARGB hex string (e.g. {a=0, r=255, g=204, b=136} => #00FFCC88).

    Returns any

  • UI_GetDecoratorVisibilityEntity(entity: EntityID): any
  • UI_GetDecoratorVisibilitySquad(squad: Squad): any
  • UI_GetDecoratorsEnabled(): boolean
  • UI_HighlightSGroup(sgroup: SGroupID, duration: number): void
  • UI_HighlightSquad(squad: SquadID, duration: number): void
  • UI_IsReplay(): any
  • UI_LetterboxFade(r: number, g: number, b: number, a: number, duration: number, aspectRatio: number, persistent: boolean): any
  • Fades the letterbox to a given RGBA colour over a number of seconds by a given aspect ratio. Call UI_TitleDestroy to remove.

    Parameters

    • r: number
    • g: number
    • b: number
    • a: number
    • duration: number
    • aspectRatio: number
    • persistent: boolean

    Returns any

  • UI_MessageBoxHide(btn: number): void
  • If the message box is activated, close it. The callback will receive the button parameter given.

    Parameters

    • btn: number

    Returns void

  • UI_MessageBoxReset(): any
  • Reset message box data set by previous calls (to display a new message box).

    Returns any

  • UI_MessageBoxSetButton(btn: number, text: string, tooltip: string, bEnabled: boolean): void
  • Set the text/tooltip/enabled state of a button on the dialog.

    Parameters

    • btn: number
    • text: string
    • tooltip: string
    • bEnabled: boolean

    Returns void

  • UI_MessageBoxSetText(title: string, msg: string): void
  • Set the title and message body of the dialog.

    Parameters

    • title: string
    • msg: string

    Returns void

  • UI_ModalVisual_CreateReticule(reticulePbg: ScarReticulePBG, radius: number): any
  • UI_ModalVisual_Destroy(id: number): any
  • UI_NewHUDFeature(newHUDFeature: HUDFeatureType, featureText: string, featureIcon: string, duration: number): any
  • Brings up a message and arrow pointing to a HUD feature. Accepted parameters are: HUDF_AbilityCard, HUDF_MiniMap, HUDF_Upgrades, HUDF_CommandCard, HUDF_None Call UI_TitleDestroy to remove.

    Parameters

    • newHUDFeature: HUDFeatureType
    • featureText: string
    • featureIcon: string
    • duration: number

    Returns any

  • UI_OutOfBoundsLinesHide(): any
  • Toggle off terrain out of bounds lines. Each call to UI_OutOfBoundsLinesHide must be matched by a call to UI_OutOfBoundsLinesShow

    Returns any

  • UI_OutOfBoundsLinesShow(): any
  • Toggle on terrain out of bounds lines. Each call to UI_OutOfBoundsLinesShow must be matched by a call to UI_OutOfBoundsLinesShowHide

    Returns any

  • UI_Remove(elementName: string): any
  • UI_RemoveCommandBinding(groupName: string, bindingName: string): any
  • Removes a command binding for groupName.bindingName.

    Parameters

    • groupName: string
    • bindingName: string

    Returns any

  • UI_RemoveEventHandler(elementName: string, eventName: string, callbackName: string): any
  • Removes the event handler on elementName for event eventName to global function callbackName(elementName, eventName). The callback function should take two arguments, the element name and the event name.

    Parameters

    • elementName: string
    • eventName: string
    • callbackName: string

    Returns any

  • UI_RestrictBuildingPlacement(mkr: MarkerID): void
  • UI_ScreenFade(r: number, g: number, b: number, a: number, duration: number, bKeepBlockingInput: boolean): void
  • Fades the screen to a given RGBA colour over a number of seconds. mouse input is blocked during the fade, and you can control whether the input keeps being blocked after the fade has ended (be careful!)

    Parameters

    • r: number
    • g: number
    • b: number
    • a: number
    • duration: number
    • bKeepBlockingInput: boolean

    Returns void

  • UI_SectorsHide(): any
  • Toggle off sector lines. Each call to UI_SectorsHide must be matched by a call to UI_SectorsShow

    Returns any

  • UI_SectorsShow(): any
  • Toggle on sector lines. Each call to UI_SectorsShow must be matched by a call to UI_SectorsHide

    Returns any

  • UI_SetAlliedBandBoxSelection(allow: boolean): void
  • Sets the game to allow allied squads to be selected at the same time as your own squads

    Parameters

    • allow: boolean

    Returns void

  • UI_SetAllowLoadAndSave(allowLoadAndSave: boolean): void
  • Enables or disable load and save features at the pause menu

    Parameters

    • allowLoadAndSave: boolean

    Returns void

  • UI_SetCPMeterVisibility(visible: boolean): void
  • UI_SetControlGroupSelectedCallback(the: In): void
  • Sets a callback firing when user select a control group either by hotkey or by control group button

    Parameters

    Returns void

  • UI_SetDataContext(elementName: string, table: StackVarTable): void
  • UI_SetDecoratorsEnabled(enabled: boolean): void
  • UI_SetEnablePauseMenu(isEnable: boolean): void
  • Enable/Disable pause menu showing up when the pause menu hot key is pressed.

    Parameters

    • isEnable: boolean

    Returns void

  • UI_SetEntityDecorator(entity: EntityID, decorator: string): void
  • UI_SetForceShowSubtitles(forceShowSubtitles: boolean): void
  • Sets the game to force show subtitles even if the player has them turned off.

    Parameters

    • forceShowSubtitles: boolean

    Returns void

  • UI_SetMinimapTrueNorth(trueNorthAngleDeg: number): void
  • Sets the angle of True North for the minimap in degrees

    Parameters

    • trueNorthAngleDeg: number

    Returns void

  • UI_SetModalAbilityPhaseCallback(f: any): void
  • Sets a function to be called when the player clicks an ability and gets a targetting UI. Your function will have 2 arguments: [Blueprint] ability blueprint, [Real] phase: MAP_Placing, MAP_Facing (only if ability requires facing) or MAP_Confirmed

    Parameters

    • f: any

    Returns void

  • UI_SetModalConstructionPhaseCallback(function_: any): void
  • Sets a function to be called when the player clicks a construction item and gets a targeting UI. Your function will have 2 arguments: [Blueprint] ability blueprint, [integer] phase: TP_Position, TP_Facing (only if ability requires facing), TP_Issued (not strict) or TP_Cancelled (for all issuables)

    Parameters

    • function_: any

    Returns void

  • UI_SetModalHoverCallback(function_: any): void
  • Sets a function to be called when the player clicks a construction item and gets a targeting UI. Your function will have 2 arguments: [Blueprint] ability blueprint, [integer] phase: TP_Position, TP_Facing (only if ability requires facing), TP_Issued (not strict) or TP_Cancelled (for all issuables)

    Parameters

    • function_: any

    Returns void

  • UI_SetPropertyValue(elementName: string, propertyName: string, stackVar: StackVar): void
  • Sets the property propertyName on elementName to value stackVar.

    Parameters

    • elementName: string
    • propertyName: string
    • stackVar: StackVar

    Returns void

  • UI_SetPropertyValues(elementName: string, propertyTable: StackVarTable): void
  • UI_SetSGroupSpecialLevel(sgroup: SGROUP, level: number): void
  • Sets a level decorator that's defined in all of the squads squad_ui_ext in the target SGroup if level value is -1 it will hide the special decorator, if no level is defined -1 is default

    Parameters

    Returns void

  • UI_SetSkipNISCallback(function_: any): void
  • Sets a callback firing when user try to skip the NIS

    Parameters

    • function_: any

    Returns void

  • UI_SetSquadDecorator(squad: SquadID, decorator: string): void
  • UI_SetSquadDecoratorAlwaysVisible(squad: SquadID, alwaysVisible: boolean): void
  • Turn on of off the squad decorator being always visible. The default is decorator not always visible.

    Parameters

    • squad: SquadID
    • alwaysVisible: boolean

    Returns void

  • UI_StopFlashing(updaterID: number): void
  • Stops a flash handler of a given id. If the given flash handler doesn't exist, then there is no effect.

    Parameters

    • updaterID: number

    Returns void

  • UI_SystemMessageHide(message: string): any
  • UI_SystemMessageShow(message: string): any
  • Shows a system message in the area where Game Paused text appears. Call Game_HideSystemMessage to remove the message.

    Parameters

    • message: string

    Returns any

  • UI_TitleDestroy(): any
  • UI_ToggleDecorators(): void
  • UI_UnrestrictBuildingPlacement(): void
  • UnitEntry_CompleteAllDeploymentsImmediately(): void
  • UnitEntry_CompleteAllImmediately(): void
  • UnitEntry_CompleteDeploymentImmediately(deployment: DeploymentID): void
  • UnitEntry_CompleteImmediately(index: any): void
  • Forces a specific index of the deploy table to complete instantly.

    Parameters

    • index: any

    Returns void

  • UnitEntry_DeploySquads(player: PlayerID, sgroup: any, units: any, spawn: Position | MarkerID, entryMethod?: any, stagger?: number, options?: any): any
  • UnitEntry_NoType_StartFunc(data: any): void
  • UnitEntry_ResolveSpawnLocation(): any
  • Returns a spawnLocation and Facing. If the unit has a custom spawn, it uses that, otherwise it gets it from deployment

    Returns any

  • UnitExit_CompleteAllImmediately(): any
  • UnitProvider_CanModuleProvideUnits(module: any, requestData: any): boolean
  • Checks if a non-townLife module has units to fulfill a request, and is willing to give those units up according to its unitProvider data

    Parameters

    • module: any
    • requestData: any

    Returns boolean

  • UnitSpawner_IsDefeated(): any
  • UnitTable_AddUnits(unitTable: any, unitsToAdd: any): any
  • Add all of the units in a UnitTable to another UnitTable

    Parameters

    • unitTable: any
    • unitsToAdd: any

    Returns any

  • UnitTable_AddUnitsByType(unitTable: any, type: string, OPT_amount?: number): any
  • Add units of a specific type to a UnitTable

    Parameters

    • unitTable: any
    • type: string
    • Optional OPT_amount: number

    Returns any

  • UnitTable_CountUnitsOfType(unitTable: any, type: string): any
  • Count how many units of a given type there are in the UnitTable

    Parameters

    • unitTable: any
    • type: string

    Returns any

  • UnitTable_GetTotalUnitCount(unitTable: any): number
  • Returns the count of the units in a UnitTable

    Parameters

    • unitTable: any

    Returns number

  • UnitTable_RemoveUnits(unitTable: any, unitsToRemove: any): any
  • Remove all of the units in a UnitTable from another UnitTable

    Parameters

    • unitTable: any
    • unitsToRemove: any

    Returns any

  • UnitTable_RemoveUnitsByType(unitTable: any, type: string, OPT_amount?: number): any
  • Removes units of a specific type from a UnitTable

    Parameters

    • unitTable: any
    • type: string
    • Optional OPT_amount: number

    Returns any

  • Util_AddMouseoverSquadToSGroup(clearGroup?: boolean): SGroupID
  • If there's a squad under the mouse cursor, this adds it to a unique SGroup. Return value is the SGroup it was added to, or nil if there was no squad under the mouse cursor. Pass in true for 'clearGroup' to clear the sgroup before adding the squad.

    Parameters

    • Optional clearGroup: boolean

    Returns SGroupID

  • Util_ApplyModifier(groupid: SGroupID | EGroupID | Player, modifier: string, scalefactor: number, mathtype: number, applytype?: number, exclusive?: boolean, targetname?: string): Modids
  • Applies any modifier to the target SGroup, EGroup, or Player Valid applytypes are MAT_...(Entity, Squad etc.), if left default assumption is default type for the target Cases you want to define applytype: Weapon Modifiers, Enable Modifiers, or a player modifier for all entity or squad types Valid mathtypes are MUT...(Addition, Multiplication, etc.) Exclusive modifiers will replace all pre-existing modifiers of that modifier type on the target

    Parameters

    • groupid: SGroupID | EGroupID | Player
    • modifier: string
    • scalefactor: number
    • mathtype: number
    • Optional applytype: number
    • Optional exclusive: boolean
    • Optional targetname: string

    Returns Modids

  • Util_AutoAmbient(intelEventTable: any): void
  • Auto-generate an Ambient Event. These are Low priority, and will hopefully interrupt nothing. Takes a table of Actors and LOC numbers

    Parameters

    • intelEventTable: any

    Returns void

  • Util_AutoIntel(intelEventTable: any): void
  • Auto-generate an Intel Event. These are medium priority, and will interrupt ambient, but not an NIS. Takes a table of parameters defining speaker(s) and line(s)

    Parameters

    • intelEventTable: any

    Returns void

  • Util_AutoNISlet(nisletType: number, intelEventTable: any, bFOWvisible?: boolean): void
  • Auto-generate an NISlet Event, a simple NIS meant to convey mission location. These are high priority, and will interrupt ambient and Intel Events. Takes an NISLET type and a table of parameters defining speaker(s) and line(s) NISLET_BLACK2GAME = 1 -- starts in black and fades up, ends in gamplay NISLET_GAME2GAME = 2 -- transitions from game play to letterbox and backto gameplay NISLET_GAME2BLACK = 3 -- starts in gameplay and ends in black NISLET_GAME2LETTER = 4 -- starts in gameplay and ends in letterbox mode (for transition to sitrep) NISLET_TIME = 1 -- use seconds to wait on camera movements NISLET_VO = 2 -- use voice to wait on camera movements t_eventes.nislet_start = { {camPos = pos1, waitType = NISLET_TIME, waitValue = 5}, {camPos = pos2, waitType = NISLET_VO, waitValue = {ACTOR.GenericAlly, 000000}}, }

    Parameters

    • nisletType: number
    • intelEventTable: any
    • Optional bFOWvisible: boolean

    Returns void

  • Util_AutoSave(waitUntilOutOfCombat?: boolean, onlyCareAboutCombatOnScreen?: boolean, maxWaitTime?: number): void
  • Automatically save the game for the player. The savegame name is built using the abbreviated mission name + checkpoint. You can optionally have it wait until the player is out of combat. This function checks the user setting regarding autosaves (so you don't have to!), and does nothing if the player has them disabled.

    Parameters

    • Optional waitUntilOutOfCombat: boolean
    • Optional onlyCareAboutCombatOnScreen: boolean
    • Optional maxWaitTime: number

    Returns void

  • Kills an SGroup when under attack by a specific Sgroup. Use this when you want a specific squad to kill a specifit squad.

    Parameters

    Returns any

  • Util_ClearSquadsForCine(sgroup: SGROUP, filepath: string): undefined
  • Plays a speech file on the first squad in an sgroup. Pass in a string with the filepath of the audio file under Cardinal_Speech_Sources e.g. "Civ_Rus/rus_manatarms/rus_manatarms_attack_iHigh_cHigh_03" Destroy all Squads and disable Mission_Fail rules

    Parameters

    • sgroup: SGROUP
    • filepath: string

    Returns undefined

  • Clears vehicle wrecks from a given area. Area can be a marker (with or without a range override), a position and range combo, or a territory sector ID. Uses EBP.WRECKED_VEHICLES unless wrecksList is defined.

    Parameters

    Returns void

  • Util_Comparison(value1: number, comparison: Comparison, value2: number): any
  • Helper function to process comparisons that use the Comparison enum... i.e. return true if value1 IS_LESS_THAN value2 Comparison type can be IS_EQUAL, IS_LESS_THAN, IS_LESS_THAN_OR_EQUAL, IS_GREATER_THAN, IS_GREATER_THAN_OR_EQUAL or IS_NOT_EQUAL

    Parameters

    • value1: number
    • comparison: Comparison
    • value2: number

    Returns any

  • Util_CorpseField(units_table: any, spawnlocation: Position | MARKER, cleanlocation?: MARKER): undefined
  • Spawn (and immediately kill) a series of units to create a field of corpses for outro cameras. units_table can either be a single SBP or a table/tables in the same basic format as UnitDeploy functions. Each entry in that table can optionally have numSqauds (defaults to 15), spawn (an override spawn location), rad_min (radius from center not to spawn in; defaults to 2), rad_max (defaults to marker radius or 20), player (defaults to player 2). cleanLocation allows you to have a marker that will be cleared of corpses.

    Parameters

    Returns undefined

  • Creates a given number of entities at a location and adds them to an egroup. A PlayerID of nil will create the entities as world objects. The skipForceConstruct parameter allows you to skip the step that normally spawns buildings fully constructed, so you can spawn buildings that self-construct. The toward parameter should be a world location that the entity should look at, NOT a direction. Leave it blank if you want the location's orientation to be used for a direction (assuming location is a marker). The useMarkerTransform parameter, if no toward is passed in, will determine if the marker's transform should be used for the entity OR if the marker's direction should be used in which case the entity will face the same way as the marker.

    Parameters

    Returns EGroup

  • High level function to create squads and give them basic orders upon spawning. Detailed explanation found in ScarUtil.scar

    Parameters

    • player: PlayerID
    • sgroup: any
    • sbp: any
    • spawn_point: Position | MARKER | EGroup | SGROUP
    • Optional destination: Position
    • Optional numsquads: number
    • Optional loadout: number
    • Optional attackmove: boolean
    • Optional dest_facing: Position
    • Optional upgrades: any
    • Optional spawn_facing: Position
    • Optional spawntype: string
    • Optional first: The
    • Optional is: Or
    • Optional due: Or
    • Optional the: Then
    • Optional into: Load
    • Optional attack: Or
    • Optional the2: If
    • Optional the3: Then
    • Optional the4: Then
    • Optional determines: This
    • Optional determines2: This
    • Optional the5: And
    • Optional marker: The
    • Optional will: This

    Returns SGROUP

  • Util_DeploySquads(spawntype: Spawntype, player: PlayerID, sgroup: any, location: Position, squadlist: any, stagger: number, callback: any, ignorepathfindinggroup: EGroup): any
  • High level function to deploy squads in different ways. Details can be found in UnitEntry.scar Spawntype spawntype - enum of the spawn type (ex: SPAWN.Race_Teleport). SPAWN.No_Type can be used to force a spawn with no type\n

    Parameters

    Returns any

  • Util_DifVar(difficultyVariables: any, difficulty?: number): any
  • Takes in a table and chooses the right variable for the difficulty setting. 1-4 elements. Acquires current difficulty by default.

    Parameters

    • difficultyVariables: any
    • Optional difficulty: number

    Returns any

  • Util_DotProductRadians(vectorA: Vector, vectorB: Vector): number
  • Util_EnableCardinalCinematicMode(enable: boolean, camera_type: boolean, OPT_Keep_gampelayunits_forOutro?: boolean, OPT_fowUnRevealDelay?: number): any
  • Wrapper to trigger proper audio and video settings for entering or exiting intro and outro cameras. Setting enable to true enters the camera mode; false exits. Pass in CAM_INTRO or CAM_OUTRO for camera_type. Keep_gampelayunits_forOutro removes gameplay units by default unless set to true. fowUnRevealDelay sets the delay for when to hide units in FoW (3.825 seconds is the default).

    Parameters

    • enable: boolean
    • camera_type: boolean
    • Optional OPT_Keep_gampelayunits_forOutro: boolean
    • Optional OPT_fowUnRevealDelay: number

    Returns any

  • Util_EnterCinematicMode(OPT_VisibilityFlag?: GameUICore, OPT_of?: List, skipNISCallback?: any): any
  • Util_EntityLimit(entityLimit?: number): boolean
  • Checks the entity count for the world and returns true or false depending on the result. A specific value can be passed in to override the default amount.

    Parameters

    • Optional entityLimit: number

    Returns boolean

  • Util_ExitCinematicMode(): any
  • Util_ExitSquads(squads: SGroupID, exitType: ExitType, data: any, staggered: boolean): any
  • High level function to have squad exit the map (despawn) in different ways. Details can be found in UnitExit.scar

    Parameters

    Returns any

  • Try to garrison a loadable building within radius that is closer to the first squad of the sgroup than enemy The squad suppression would be resetted before fallling back so that they would not succumb to pinned state Returns the entity id of the building that the squad try to garrison into. Return nil if nothing is found

    Parameters

    Returns EntityID

  • Following a path from origin to destination, finds the HS_CLOSEST/HS_FURTHEST hidden position to/from the destination If no position is found, returns origin

    Parameters

    Returns Position

  • Following a path from origin to destination, finds the HS_CLOSEST/HS_FURTHEST visible position to/from the destination If no position is found, returns destination

    Parameters

    Returns Position

  • Util_ForceRetreatAll(sgroup: SGroupID, marker: MARKER, aiEncounterDisable: boolean): any
  • Forces all squads given to retreat, regardless of whether they are on team weapons or not. Disables aiEncounters input (true disables all encounters).

    Parameters

    Returns any

  • Util_FullscreenMode(OPT_VisibilityFlag?: GameUICore, OPT_of?: List): any
  • Util_GarrisonNearbyBuilding(sgroup: SGroupID, pos: Position, radius: number, occupied?: boolean, filter?: any): EntityID
  • Finds a nearby building to garrison. can ignore occupied [friendly] buildings. return ID of entity it found, or nil if not found Can also filter out groups not to occupy

    Parameters

    • sgroup: SGroupID
    • pos: Position
    • radius: number
    • Optional occupied: boolean
    • Optional filter: any

    Returns EntityID

  • Util_GarrisonNearbyVehicle(sgroup: SGroupID, pos: Position, radius: number, occupied?: boolean, filter?: any): SquadID
  • Finds a nearby vehicle to garrison. can ignore occupied [friendly] vehicles. return ID of vehicle it found, or nil if not found, Can also filter out groups not to occupy

    Parameters

    • sgroup: SGroupID
    • pos: Position
    • radius: number
    • Optional occupied: boolean
    • Optional filter: any

    Returns SquadID

  • Util_GetClosestMarker(var_: any, markers: any): MarkerID
  • Returns the closest MarkerID to the entity/marker/pos/egroup/sgroup/squad from the table of markers provided

    Parameters

    • var_: any
    • markers: any

    Returns MarkerID

  • Util_GetCommandLineArgument(key: string): undefined
  • Wrapper function for command line arguments. DO NOT USE MORE THAN ONCE PER ARGUMENT. It is impossible for them to change after application start, so save the result and reuse it.

    Parameters

    • key: string

    Returns undefined

  • Util_GetMouseoverSGroup(): void
  • Returns a unique SGroup used to hold mouseover squads obtained from Util_AddMouseoverSquadToSGroup

    Returns void

  • Returns a random position within an area that is not near a player searchRadius is the area to look for the location in. Distance is how far from the player's units the position must be. Useful for dropping artillery NEAR a player, but not on him, for example.

    Parameters

    Returns Position

  • Util_GetRandomPosition(range?: number): Position
  • Returns a random position either within the marker's proximity or with a pos and range provided. Range is ignored for rectangular markers

    Parameters

    • Optional range: number

    Returns Position

  • Util_GetTrailingNumber(val: string): number
  • Returns trailing numbers from a string, if it exists, nil otherwise. E.G. "marker23" would return 23.

    Parameters

    • val: string

    Returns number

  • Util_Grab(subselect: boolean): SGROUP
  • Grabs the selected squads/entities and returns them in a group. Only works with -dev. Tries to return an SGroup first. If it's empty, it will return an EGroup. (Both types can't be selected at the same time)

    Parameters

    • subselect: boolean

    Returns SGROUP

  • Util_HasPosition(var_: any): boolean
  • Returns true if given entity/marker/pos/egroup/sgroup/squad has a position; if false, Util_GetPosition will fail.

    Parameters

    • var_: any

    Returns boolean

  • Util_HidePlayerForNIS(player: PlayerID, hide: boolean): void
  • Hides all of a player's squads and/or buildings Doesn't hide buildings a player is in, or any base structures. Only items like sandbags, tanktraps, mg nests, etc. Put multiple playerIDs in a table to hide many players together, or use ALL for the playerID to apply to all players at once.

    Parameters

    Returns void

  • Util_IsCinematicMode(): boolean
  • Util_IsSequenceSkipped(): boolean
  • Util_LogSyncWpn(syncweapon: SGroupID, kill?: boolean): void
  • Tracks a syncweapon ID and destroys it (by default) or makes it uncapturable (if kill is set to false)

    Parameters

    • syncweapon: SGroupID
    • Optional kill: boolean

    Returns void

  • Util_MarkerFX(markername: string, eventfile: string): void
  • Play an events file at a given markers location

    Parameters

    • markername: string
    • eventfile: string

    Returns void

  • Util_MissionTitle(title: string, time_fade_in?: number, lifetime?: number, time_fade_out?: number): void
  • Play the mission title fade.

    Parameters

    • title: string
    • Optional time_fade_in: number
    • Optional lifetime: number
    • Optional time_fade_out: number

    Returns void

  • Util_NewHUDFeatureEvent(newHUDFeature: HUDFeatureType, featureText: string, featureIcon: string, duration: number): void
  • Calls UI_NewHUDFeature() as an IntelEvent. Will get queued as any other event. See UI_NewHUDFeature() for parameter details.

    Parameters

    • newHUDFeature: HUDFeatureType
    • featureText: string
    • featureIcon: string
    • duration: number

    Returns void

  • Util_NormalMode(): any
  • Util_PlayCameras(cameraData: any): undefined
  • Run a series of camera splines, each with optional speech lines and functions

    Parameters

    • cameraData: any

    Returns undefined

  • Util_PlayMovie(name: string, fadeOut?: number, fadeIn?: number, onComplete?: any, delay?: number, onCompleteAfterMovie?: boolean): void
  • Play a movie. If onCompleteAfterMovie is true, the onComplete function will play as soon as the movie is over, instead of after the fade-in Plays a movie file after fading out the screen. Fades back in and triggers onComplete once it ends. If fadeIn < 0, does not face back in once complete.

    Parameters

    • name: string
    • Optional fadeOut: number
    • Optional fadeIn: number
    • Optional onComplete: any
    • Optional delay: number
    • Optional onCompleteAfterMovie: boolean

    Returns void

  • Util_PlayMusic(name: string): void
  • Plays music from the Data:Sound folder, and stores the music track so it can be resumed after a save/load The new music will phase out the old one. There can only be one music playing at anytime.

    Parameters

    • name: string

    Returns void

  • Util_PrintIf(boolean: any, toPrint: any): undefined
  • Simply prints something if the first variable is true

    Parameters

    • boolean: any
    • toPrint: any

    Returns undefined

  • Util_PrintObject(obj: any, max_depth?: number, data_type?: string, print_func?: any): void
  • Prints out the entire contents of an Object Objects can be anything (Player, SGroup, Int, Table, String, etc.), but this is most useful for Tables This is most useful when used in conjunction with fatal() or bug() to populate the log file.

    Parameters

    • obj: any
    • Optional max_depth: number
    • Optional data_type: string
    • Optional print_func: any

    Returns void

  • Util_PrintTable(toPrint: any, indent: any): undefined
  • Simply prints out everything in a table including nested tables

    Parameters

    • toPrint: any
    • indent: any

    Returns undefined

  • Util_PrintUnitTable(toPrint: any, indent: any): undefined
  • Prints out a unit table. indent is the number of tabs at the beginning of each line

    Parameters

    • toPrint: any
    • indent: any

    Returns undefined

  • Util_ReloadScript(): void
  • Reloads the running scar script. Current running rules would also be updated to the redefined functioin.

    Returns void

  • Util_RestoreMusic(): void
  • Resumes playing the music track that was last triggered i.e. after a save/load

    Returns void

  • Util_ReverseList(list_to_reverse: any): any
  • Reverses the entries of the table that is passed to the function This function will iterate over a 1D array/table and flip it, so that the first element is the last, the last is the first, and so on.

    Parameters

    • list_to_reverse: any

    Returns any

  • Util_ScarPos(xpos: number, zpos: number, ypos: number): Position
  • Converts a 2D top down position to a 3D ScarPosition. returns Position, if y-height is nil, y-height = ground height, terrain ground or walkable

    extdesc

    3D ScarPositions have the x axis left to right, the z axis in to out, and the y axis down to up (y axis represents the height of the terrain). Use this function to convert a top-down 2D position to a 3D world position.\n\n Note: (0,0) is in the center of the map.

    Parameters

    • xpos: number
    • zpos: number
    • ypos: number

    Returns Position

  • Util_SetPlayerCanSkipSequence(event: any, skippedCallback: any, noFadeIn: boolean, fadeInTime?: number): void
  • Sets it so that a player can skip a scripted sequence. When the skip key is pressed, calls back the given function as a post-sequence setup. noFadeIn stops the system from fading back into gameplay when finished. Call Util_SetPlayerUnableToSkipSequence() when the sequence is finished to disable

    Parameters

    • event: any
    • skippedCallback: any
    • noFadeIn: boolean
    • Optional fadeInTime: number

    Returns void

  • Util_SetPlayerUnableToSkipSequence(event: any, skippedCallback: any, noFadeIn: boolean): void
  • Disables Util_SetPlayerCanSkipSequence

    Parameters

    • event: any
    • skippedCallback: any
    • noFadeIn: boolean

    Returns void

  • Util_SortPositionsByClosest(origin: EGroupID, positions: any): any
  • Returns a table of positions sorted from closest to furthest (or furthes to closest if reverse is true) from the origin

    Parameters

    Returns any

  • Util_StartAmbient(func: any): void
  • Play a Speech Ambient. These are the lowest priority, and will be bumped by Intel Events or NIS's. This function should used instead of Event_Start because it handles priorities.

    Parameters

    • func: any

    Returns void

  • Util_StartIntel(func: any): void
  • Play an Intel Event. These are medium priority, and will interrupt a ambient, but not an NIS. This function should used instead of Event_Start because it handles priorities.

    Parameters

    • func: any

    Returns void

  • Util_StartNIS(NIS: any): void
  • Plays an NIS. The NIS should have a call to NIS_START(details) at the beginning, and NIS_END() at the end. Example details table keys: {style = NIS_OPENING, NIS_MID or NIS_CLOSING, exemptions = {sg_unit_to_not_despawn}, revealFOW = true, callbackStart = func, callbackEnd = func}

    Parameters

    • NIS: any

    Returns void

  • Util_StartQuickIntel(actor: string, speech: string): void
  • Play a quick, one-line Intel event. These are medium priority, and will interrupt ambient, but not an NIS. Use this when playing a single line. For multi-line events, use Util_StartIntel

    Parameters

    • actor: string
    • speech: string

    Returns void

  • Util_StringSplit(str: any, sep: any): any
  • Splits a string into a table of substrings based on a given separator. Comma is used as the default separator if none is provided.

    Parameters

    • str: any
    • sep: any

    Returns any

  • Util_TableContains(targetTable: any, obj: any): boolean
  • Checks the first layer of a table and looks for a specified Object, returns true if found. Objects can be anything (Player, SGroup, Int, Table, String, etc.)

    Parameters

    • targetTable: any
    • obj: any

    Returns boolean

  • Util_ToggleAllowIntelEvents(): void
  • Debug function used to toggle whether or not IntelEvents are played. Only works with -dev parameter

    Returns void

  • Util_TriggerEvent(playerid: PlayerID, position: Position | MARKER | EGroup | SGROUP, range: number, func: any, non_combat: boolean, onscreen_only: boolean, onscreen_duration: number): void
  • Library function to trigger NIS event under a certain sets of conditions. NOTE: if checking against a marker DO NOT specify a range. The range of the marker set in the WorldBuilder will be used. onscreen_only set to TRUE means the squad must be onscreen if the event is to be triggered. non_combat set to TRUE means the squad cannot be in combat if the event is to be triggered. 6 arguments when using marker, 7 arguments when using position, egroup and sgroup with the additional range value triggering event when one of the player's squads come near a particular SGroup, EGroup, Marker, or Position and that squad is onscreen, and that squad is not in combat.

    Parameters

    Returns void

  • Util_UnitCounts(world: boolean): any
  • Returns a table containing either the total or a specific player's squad count, entity count, and vehicle count. table can be accessed as scene below Get Player Example:\n local t = Util_UnitCounts(player1)\n print(t.squad)\n print(t.entity)\n print(t.vehicle)\n Get World Example:\n local t = Util_UnitCounts(true)\n print(t.squad)\n print(t.entity)\n print(t.vehicle)\n Alternate Format:\n print(Util_UnitCounts(true).squad)\n

    Parameters

    • world: boolean

    Returns any

  • Util_UnitParade(marker_table: any, unit_table: any, parade_sgroup?: SGROUP, delay?: number, player?: Player): undefined
  • Spawn a series of units and have them move along a path in a parade. Useful for bringing in or out units in a long line rather than a broad formation. marker_table should be the path of the parade. unit_table should follow the format for UnitEntry functions; each entry is a "row" in the parade. Preferably each should have separate spawn point. If there is a destination defined in a unit entry, that row will go to the destination after completing the parade.

    Parameters

    • marker_table: any
    • unit_table: any
    • Optional parade_sgroup: SGROUP
    • Optional delay: number
    • Optional player: Player

    Returns undefined

  • Utility_FormatSeconds(seconds: any): string
  • Returns the game time as a string. Formatted as mm:ss

    Parameters

    • seconds: any

    Returns string

  • Utility_GetFormattedTime(): string
  • Vaulting_DrawDebug(): any
  • Returns the normalized version of the provided vector. Returns a vector pointing the same direction as the provided vector, but shortened/elongated to a length of 1. Don't pass in a vector of length 0, or you'll get a divide-by-zero error!

    Parameters

    Returns Position

  • VerifyAllDissolves(): any
  • Add some new villagers to a VillagerLife. If job is left as nil, villagers will roam. Or you can specify "roaming", "wood", "food", "gold", or "stone".

    Parameters

    Returns any

  • VillagerLife_Attack(): any
  • This is the proper way to create a VillagerLife at runtime. Villagers can be assigned to 5 different jobs, and you can provide an sgroup for each job. villager_response can be "none", "flee", or "attack". "mkr_flee" is only required if villager_response is "flee". "mkr_flee_backup" is only required if villager_response is "flee" and b_require_garrison is true. SGroups can be nil if you don't want villagers in those roles.

    Parameters

    Returns any

  • VillagerLife_DestroyIfNearPosition(): any
  • Private function. Despawns any villagers in the sgroup that have gotten close enough to the specified position.

    Returns any

  • VillagerLife_GarrisonIsNearby(): any
  • Private function. Checks if mkr_flee has a valid garrisonable building nearby.

    Returns any

  • VillagerLife_GoToWork(): any
  • Private function. Orders the villagers to harvest resources. Any villagers who can't find something to harvest will end up roaming.

    Returns any

  • VillagerLife_Monitor(): any
  • Private function. This is the main loop that keeps villagers working. It only stops running when the villagers are attacking, or when they all die.

    Returns any

  • VillagerLife_OnFail(): any
  • VillagerLife_OnSuccess(): any
  • VillagerLife_Wander(): any
  • Private function. Orders a single villager to wander to a random building or random location.

    Returns any

  • Wave_AddUnits(wave: Wave, units: any): any
  • Adds units to the wave's unit table. These units will be produced whenever prepare is called

    Parameters

    • wave: Wave
    • units: any

    Returns any

  • Wave_GetSpawnableCategories(): any
  • Returns an array containing all the categories that this spawn is capable of producing

    Returns any

  • Wave_Launch(wave: Wave, OPT_index?: number): any
  • Transfers all the units from the staging module into the assault module. If the wave is still spawning from a prepare, it will stop. Index defaults to 1.

    Parameters

    • wave: Wave
    • Optional OPT_index: number

    Returns any

  • Wave_New(wave_data: any): any
  • Wave_OverrideBuildingSpawnType(building_type: string, categories: any): any
  • Sets which unit categories can be built by a building. Categories are "infantry", "ranged", "cavalry", "siege", "town_center", and "religious"

    Parameters

    • building_type: string
    • categories: any

    Returns any

  • Wave_OverrideUnitBuildTime(type: string, time: number): any
  • Sets how long a wave spawner will be on cooldown after spawning a certain unit type

    Parameters

    • type: string
    • time: number

    Returns any

  • Wave_Prepare(wave: Wave, OPT_sg_custom?: SGroupID, OPT_data?: any): any
  • Orders a wave to start spawning units. Units will go into the staging module, or into the assault module if no staging module is defined. You can optionally pass in an sgroup. All units that are spawned will go into it.

    Parameters

    • wave: Wave
    • Optional OPT_sg_custom: SGroupID
    • Optional OPT_data: any

    Returns any

  • Wave_RefreshSpawns(): any
  • Searches the spawn area for any new buildings and adds them to the list of spawns

    Returns any

  • Wave_SetUnits(wave: Wave, units: any): void
  • Updates the wave with a new unit table. These units will be produced whenever prepare is called

    Parameters

    • wave: Wave
    • units: any

    Returns void

  • Weapon_AllWeaponAttackGround(): any
  • Weapon_AnimInfo(): any
  • Weapon_AttackRadii(): any
  • Weapon_Firing(): any
  • Weapon_HardPointInfo(): any
  • Weapon_Info(): any
  • Weapon_PrintBestTarget(): any
  • Weapon_PriorityInfo(): any
  • Toggle weapon priority information (must TAG entity you want info about)

    Returns any

  • Weapon_ProjectileDetonateTimer(): any
  • Weapon_ProjectileInfo(): any
  • Weapon_ScatterInfo(): any
  • Weapon_Tracking(): any
  • WinWarning_PublishLoseReminder(player: PlayerID, warningLevel: number): void
  • Triggers a UI event cue and an audio cue that the player is about to lose the game. The lower the warningLevel, the closer the player is to losing and the more intense the warning is

    Parameters

    Returns void

  • WinWarning_ShowLoseWarning(text: string, fadeIn: number, duration: number, fadeOut: number): any
  • Call UI_TitleDestroy to remove.

    Parameters

    • text: string
    • fadeIn: number
    • duration: number
    • fadeOut: number

    Returns any

  • World_CalculateEntitiesAveragePositionInArea(player: PlayerID, pos: Position, radius: number, ownerType: OwnerType, onlyEntitiesInSquads: boolean): any
  • Returns the average positions of the entities in the area Owner type could be OT_Player, OT_Ally, OT_Enemy or OT_Neutral It filters out entities not belonging to a squad, when onlyEntitiesInSquads is true

    Parameters

    Returns any

  • World_ChangeZoneInteractivity(targetInteractivity: number, adjustedInteractivity: number): any
  • Changes target interactivity zones to adjusted interactivity (255 max), probably only safe to use post NIS

    Parameters

    • targetInteractivity: number
    • adjustedInteractivity: number

    Returns any

  • World_CleanUpTheDead(player: PlayerID): void
  • World_DestroyWallsNearMarker(marker: MarkerID): void
  • World_DistanceEGroupToPoint(egroup: EGroupID, p1: Position, closest: boolean): number
  • Get the distance between a squad group and a point. Pass in true for 3rd parameter to get the closest point and pass in false to get the furthest point. The closest/furthest point is calculated on a per entity basis. So the closest distance would be that of the closest entity. Also note, it is an error to call this function with an empty group.

    Parameters

    Returns number

  • World_DistanceSGroupToPoint(sgroup: SGroupID, p1: Position, closest: boolean): number
  • Get the distance between a squad group and a point. Pass in true for 3rd parameter to get the closest point and pass in false to get the furthest point. The closest/furthest point is calculated on a per squadron basis. So the closest distance would be that of the closest squadron. It is an error to call this function with an empty group. Check the group size with SquadGroup_Count( ) first.

    Parameters

    Returns number

  • World_EnableReplacementObjectForEmptyPlayers(enable: boolean): void
  • *** You must call this from OnGameSetup, otherwise it's too late *** Determines whether empty players get converted to null resource points. see Attribute Editor under tuning/player/empty_player_replacement_object

    Parameters

    • enable: boolean

    Returns void

  • World_EnableSharedLineOfSight(p0: PlayerID, p1: PlayerID, enableSharedVision: boolean): any
  • World_EndSP(win: boolean): void
  • Wins/loses a single team mission for the local teams

    Parameters

    • win: boolean

    Returns void

  • World_GetAllNeutralEntities(egroup: EGroupID): any
  • Clears the egroup, then finds and adds all neutral entities to it Returns the number of entities found

    Parameters

    Returns any

  • World_GetClosest(var_: any, items: any): any
  • Returns the closest object from the table of marker/pos/egroup/sgroup to the closest marker/pos/egroup/sgroup specified The table may mix together objects of different types.

    Parameters

    • var_: any
    • items: any

    Returns any

  • World_GetCoverPoints(group: EGroupID): any
  • Appends all cover points to an egroup. Takes an egroup where you want to put the points. If this 'group' already contains a cover point, this cover point will not be added a second time. This function does not clear the contents of 'group'.\n

    Parameters

    Returns any

  • World_GetEntitiesNearPoint(player: PlayerID, egroup: EGroupID, pos: Position, radius: number, ownerType: number): number
  • Find and add entities near the point to the egroup Entities belonging to a squad would not be added to the egroup

    Parameters

    Returns number

  • World_GetEntitiesWithinTerritorySector(player: PlayerID, egroup: EGroupID, sectorID: number, ownerType: number): number
  • Find and add entities within the territory sector to the egroup Entities belonging to a squad would not be added to the egroup

    Parameters

    Returns number

  • World_GetFurthest(var_: any, items: any): any
  • Returns the furthest object from the table of marker/pos/egroup/sgroup to the furthest marker/pos/egroup/sgroup specified. The table may mix together objects of different types.

    Parameters

    • var_: any
    • items: any

    Returns any

  • World_GetGameTicks(): any
  • World_GetGameTime(): number
  • World_GetHeightAt(x: number, y: number): number
  • Find a position on a path hidden from view, as close to the destination as possible whilst still satisfying your hidden checktype. Checktype can be either CHECK_IN_FOW, CHECK_OFFCAMERA or CHECK_BOTH. The path is always calculated as if it were plain infantry. This function returns nil if it can't find a suitable position, so you can do a backup plan.

    Parameters

    Returns Position

  • World_GetInteractionStageAtPoint(position: Position): any
  • Returns the interaction stage of the cell in the provided position Returns a value between 0 - 63

    Parameters

    Returns any

  • World_GetLength(): number
  • Returns the total playable length of the game world (z coordinate) Since the center of the map is 0,0 the world z range is (-l/2 -> l/2)

    Returns number

  • World_GetMetadataBiomePBGName(layerName: string, x: number, y: number): any
  • Get the Biome PBG's name of the specified terrain metadata layer and the specified coordinates.

    Parameters

    • layerName: string
    • x: number
    • y: number

    Returns any

  • World_GetMetadataLayerBoolean(layerName: string, x: number, y: number): any
  • Get the boolean value of the specified terrain metadata layer and the specified coordinates.

    Parameters

    • layerName: string
    • x: number
    • y: number

    Returns any

  • World_GetMetadataLayerInteger(layerName: string, x: number, y: number): any
  • Get the integer value of the specified terrain metadata layer and the specified coordinates.

    Parameters

    • layerName: string
    • x: number
    • y: number

    Returns any

  • World_GetMetadataLayerNumber(layerName: string, x: number, y: number): any
  • Get the numeric value of the specified terrain metadata layer and the specified coordinates.

    Parameters

    • layerName: string
    • x: number
    • y: number

    Returns any

  • World_GetMetadataLayerPBG(layerName: string, x: number, y: number): any
  • Get the PBG of the specified terrain metadata layer and the specified coordinates.

    Parameters

    • layerName: string
    • x: number
    • y: number

    Returns any

  • World_GetMetadataLayerString(layerName: string, x: number, y: number): any
  • Get the PBG of the specified terrain metadata layer and the specified coordinates.

    Parameters

    • layerName: string
    • x: number
    • y: number

    Returns any

  • World_GetNearestInteractablePoint(position: Position): any
  • Find and add neutral entities near the marker to the egroup Entities belonging to a squad would not be added to the egroup

    Parameters

    Returns number

  • World_GetNeutralEntitiesNearPoint(egroup: EGroupID, pos: Position, radius: number): number
  • Find and add neutral entities near the point to the egroup Entities belonging to a squad would not be added to the egroup

    Parameters

    Returns number

  • World_GetNeutralEntitiesWithinTerritorySector(egroup: EGroupID, sectorID: number): number
  • Find and add neutral entities within the territory sector to the egroup Entities belonging to a squad would not be added to the egroup

    Parameters

    Returns number

  • World_GetNumStrategicPoints(): number
  • Returns the number of strategic points on this map (does not count strat. objectives)

    Returns number

  • Returns a position that is offset a certain distance from the position/heading passed in. see LuaConsts.scar for explanation of 'offset' parameter.

    Parameters

    Returns Position

  • World_GetOffsetPositionRelativeToFacingTarget(position: Position, facingTarget: Position, offset: number): any
  • World_GetPlayerAt(index: number): PlayerID
  • World_GetPlayerCount(): number
  • World_GetPlayerIndex(player: PlayerID): number
  • World_GetPossibleSquadsBlueprint(race_index: number, squad_index: number): SquadBlueprint
  • World_GetPossibleSquadsCount(race_index: number): number
  • Returns the number of types of squads a race can build

    Parameters

    • race_index: number

    Returns number

  • World_GetRaceBlueprint(racename: string): any
  • Returns the race index of a race, given its name (from the ME).

    Parameters

    • racename: string

    Returns any

  • World_GetRand(min: number, max: number): number
  • Returns a random Real with range [min, max] It is recomended you use this instead of luas math.random function

    Parameters

    • min: number
    • max: number

    Returns number

  • World_GetScenarioMaxPlayers(): any
  • Find and add squads near the marker to the sgroup This function is faster if radius is small and/or number of squads to search for is large

    Parameters

    Returns number

  • Find and add squads near the point to the sgroup This function is faster if radius is small and/or number of squads to search for is large

    Parameters

    Returns number

  • World_GetSquadsWithinTerritorySector(player: PlayerID, sgroup: SGroupID, sectorID: number, ownerType: number): number
  • Find and add squads within territory sector identified by sector ID Owner type could be OT_Player, OT_Ally, OT_Enemy or OT_Neutral

    Parameters

    Returns number

  • World_GetStrategyPoints(group: EGroupID, bIncludeVP: boolean): any
  • Appends all the strategic resource points to an egroup. takes the egroup where you want to put the points, and 2nd parameter is a bool which indicates if you want to include VPs or not If 'group' already contains an entity from 'grouptoadd' it will not be added.\n This function does not clear the contents of 'group'.\n Example: World_GetStrategyPoints(mypointgroup, true) --puts all the points including vps into mypointgroup

    Parameters

    Returns any

  • World_GetTeamTerritoryGaps(sectorid1: number, sectorid2: number, results: LuaBinding): boolean
  • Returns one or more sector IDs that would connect two unconnected pieces of territory. return value is through a table (since there can be more than one way to connect territory) - each entry in this table is a table of sector IDs. Currently only finds single gaps - i.e. if two territories are 'almost' connected.

    Parameters

    • sectorid1: number
    • sectorid2: number
    • results: LuaBinding

    Returns boolean

  • World_GetTerrainCellType(x: number, y: number): any
  • returns the cell type of the cell in the specified coordinates. 0 = Sky, 1 = Land, 2 = Water.

    Parameters

    • x: number
    • y: number

    Returns any

  • World_GetTerritorySectorID(pos: Position): number
  • World_GetTerritorySectorPosition(sectorID: number): Position
  • Returns the position of a sector based on the capture entity (ex: the fuel point's position)

    Parameters

    • sectorID: number

    Returns Position

  • World_GetWidth(): number
  • Returns the total playable width of the game world (x coordinate) Since the center of the map is 0,0 the world x range is (-w/2 -> w/2)

    Returns number

  • World_IsCurrentInteractionStageActive(stage: number): any
  • Returns whether the interaction stage is currently active

    Parameters

    • stage: number

    Returns any

  • World_IsGameOver(): boolean
  • World_IsMultiplayerGame(): any
  • Returns true if position if part of the entity territory Note that this does not care if territory is in supply or not

    Parameters

    Returns boolean

  • World_IsPosOnWalkableWall(p: Position): any
  • World_IsReplay(): any
  • World_IsTerritorySectorOwnedByPlayer(player: PlayerID, sectorID: number): boolean
  • Find if player has ownership to this territory sector. Other players on the same team would also have the ownership to the sector

    Parameters

    Returns boolean

  • World_KillAllNeutralEntitesNearMarker(marker: MarkerID): void
  • World_LeaveGameMatch(): any
  • World_OwnsEGroup(egroup: EGroupID, all: boolean): boolean
  • Returns whether ANY or ALL of the entities in the group are owned by the world (i.e. neutral)

    Parameters

    Returns boolean

  • World_OwnsEntity(entity: EntityID): boolean
  • World_OwnsSGroup(sgroup: SGroupID, all: boolean): boolean
  • Returns whether ANY or ALL of the squads in the group are owned by the world (i.e. neutral)

    Parameters

    Returns boolean

  • World_OwnsSquad(squad: SquadID): boolean
  • World_Pos(x: number, y: number, z: number): Position
  • Creates a new Position object. A position object is basically a table with an x, y, and z attribute. You can directly access the individual components in the same way that you would access a field in a table. Example: --* lua script snip local pos = World_Pos(2, 0, 0) pos.x = pos.x + 1 print pos.x -- this will print 3 --* lua script snip

    Parameters

    • x: number
    • y: number
    • z: number

    Returns Position

  • World_Reset(): any
  • DO NOT CALL UNLESS YOU DO AUTOMATED TESTING This resets the world into a state comparable to a fresh scenario start. Used in automated testing to avoid tests being dependent on each other.

    Returns any

  • World_SetAllInteractiveStagesVisibility(visibilityStatus: boolean): void
  • World_SetDesignerSupply(point: Position, bSupply: boolean): void
  • World_SetInteractionStage(stage: number): void
  • Set current interaction stage to value supplied, must be >= 0

    Parameters

    • stage: number

    Returns void

  • World_SetPlayerLose(player: PlayerID, identifier: string, endgame: boolean): void
  • Sets the player to a lose state, with a reason for losing, and kills the player

    Parameters

    • player: PlayerID
    • identifier: string
    • endgame: boolean

    Returns void

  • World_SetPlayerWin(player: PlayerID, identifier: string): void
  • Sets the player and all the members allied to player to a win state, with a reason for winning. Also sets all other players to a lose state, and kills them (if they're not already dead)

    Parameters

    Returns void

  • World_SetSharedLineOfSightEnabledAndMergeExploredMaps(p0: PlayerID, p1: PlayerID, enableSharedVision: boolean): void
  • Enables or disables shared line of sight between these two players, and merges explored maps when needed

    Parameters

    Returns void

  • World_SetTeamWin(team: number, identifier: string): void
  • Sets every player on a team to a win state, with a reason for winning. Also sets all other players to a lose state, and kills them (if they're not already dead)

    Parameters

    • team: number
    • identifier: string

    Returns void

  • World_TeamTerritoryPointsConnected(team_index: number, p1: Position, p2: Position): boolean
  • Returns true if the two points are in the same territory region, and owned by the specified territory team, Returns false otherwise.

    Parameters

    Returns boolean

  • _AudioTrigger_ComposeError(): any
  • _AudioTrigger_InitCore(): any
  • _IntelDebugNext(): void
  • Plays the next intel event in the debug queue. IntelEvents are played sequentially as they are defined in a mission's .events file.

    Returns void

  • _IntelDebugPrev(): void
  • Plays the next intel event in the debug queue. IntelEvents are played sequentially as they are defined in a mission's .events file.

    Returns void

  • _IntelDebugReplay(): void
  • _MissionOMatic_IsUpgrading(): any
  • _MissionOMatic_WatchForAbility(): any
  • Monitors abilities that have been flagged for usage-based hint resolution

    Returns any

  • _Missionomatic_GoalPredicate_HoveredOverBP(): any
  • _Missionomatic_Hint_UserHasTimedOut(): any
  • _Missionomatic_SequencePredicate_HoveredOverBP(): any
  • _Missionomatic_TrainingPredicate_IgnoreHover(): any
  • _PlayerUpgrades_GetRaceName(): any
  • _QuickDelay(sgroup: SGROUP, enable: boolean, duration?: number, walla?: string, audioDelay?: number): undefined
  • Enables or disables cheering on an Sgroup. Defaults to 60 second duration; pass in -1 for infinite. Defaults to short celebrate walla. WARNING: Units cannot move while cheering. Only works on bipeds. audioDelay delays audio but not animation. Enable or disable the crown over leader units. The Leader must be the first squad in the sgroup.

    Parameters

    • sgroup: SGROUP
    • enable: boolean
    • Optional duration: number
    • Optional walla: string
    • Optional audioDelay: number

    Returns undefined

  • _Raiding_FindIdleRaiders(): any
  • _Raiding_GenerateUnitList(): any
  • _Raiding_GetSpawnLocation(): any
  • _Raiding_InitRaid(): any
  • _Raiding_Monitor(): any
  • Sometimes spawns a scout to attack-move around the map, looking to engage the player

    Returns any

  • _Raiding_ResetRaidTimer(): any
  • _Raiding_ResetScoutTimer(): any
  • _RovingArmy_AboveThreshold(): any
  • _RovingArmy_AttackTarget(): any
  • _RovingArmy_BelowThreshold(): any
  • Called when the module falls below its withdraw threshold while attacking

    Returns any

  • _RovingArmy_Complete(): any
  • Called when the module completes its last target and there are none left

    Returns any

  • _RovingArmy_CreateAttackEncounter(moduleData: Module): any
  • _RovingArmy_CreateDefendEncounter(moduleData: Module, target: string): any
  • Orders the modules to defend an area. This can be when the module starts, when it falls back, or when it completes

    Parameters

    • moduleData: Module
    • target: string

    Returns any

  • _RovingArmy_Death(): any
  • _RovingArmy_DefendCurrentPosition(): any
  • _RovingArmy_DefendCurrentTarget(): any
  • _RovingArmy_DefendFallbackOrSpawn(): any
  • Instructs the RA to defend the nearest fallback if there is one, or the spawnLocation if there isn't one

    Returns any

  • _RovingArmy_DefendPreviousTarget(): any
  • Called on complete. Orders the rovingArmy to defend the last completed target.

    Returns any

  • _RovingArmy_DefendSpawnLocation(): any
  • _RovingArmy_Fail(): any
  • _RovingArmy_FindModuleByEncounterID(): any
  • _RovingArmy_GetFallback(moduleData: Module): any
  • _RovingArmy_GetMeanderingTargetIndex(): any
  • _RovingArmy_GetProximityTargetIndex(): any
  • Returns the target index for the nearest target to the homeLocation. Returns nil if there are no targets

    Returns any

  • _RovingArmy_GetRandomTargetIndex(): any
  • returns a random index to a target other than the current one. Returns nil if no valid targets exist

    Returns any

  • _RovingArmy_HasDefendReason(moduleData: Module): any
  • Checks if the module should be defending. Returns true if any of the 3 possible reasons are true.

    Parameters

    Returns any

  • _RovingArmy_HasValidFallback(): any
  • returns true if rovingArmy.fallback[rovingArmy.fallbackIndex] is a valid fallback.

    Returns any

  • _RovingArmy_HasValidTarget(): any
  • returns true if rovingArmy.targets[rovingArmy.targetIndex] is a valid target.

    Returns any

  • _RovingArmy_InitializeFallbacks(moduleData: any): any
  • _RovingArmy_InitializeTargets(moduleData: any): any
  • _RovingArmy_IsAboveThreshold(): any
  • Returns true if the rovingArmy is above the withdraw threshold, or if ignoreWithdrawThreshold was set to true

    Returns any

  • _RovingArmy_IsBelowThreshold(): any
  • Returns true if the rovingArmy is below the withdraw threshold, and ignoreWithdrawThreshold is false

    Returns any

  • _RovingArmy_OnEncounterSuccessAttack(): any
  • _RovingArmy_StopAttacking(): any
  • _RovingArmy_StopDefending(): any
  • _RovingArmy_TargetIsNotFinal(): any
  • Used to determine if target should be handled with enRoute behavior. May need more logic to handle non-linear targetting types

    Returns any

  • _RovingArmy_UpdateEmptyStatus(): any
  • This checks to see if the RA has died, and calls the appropriate callbacks if it has

    Returns any

  • _RovingArmy_UpdateFallback(): any
  • _RovingArmy_UpdateTarget(): any
  • Updates targets, targetIndex and targetShift according to the targetingType. After running this, call _RovingArmy_HasValidTarget to find out if a new target was established.

    Returns any

  • __Internal_Game_Autosave(): any
  • __Internal_Game_Quicksave(): any
  • __Internal_Game_SaveGame(): any
  • DO NOT call this function directly, use Event_SaveWithName(STT_Standard) instead

    Returns any

  • __Internal_Game_SaveToFileDev(): any
  • DO NOT call this function directly, use Event_SaveWithName(STT_Dev) instead

    Returns any

  • __UnRevealEntities(enable: boolean, camera_type: boolean, Keep_gampelayunits_forOutro?: boolean, fowUnRevealDelay?: number): undefined
  • Wrapper to trigger proper audio and video settings for entering or exiting intro and outro cameras. Setting enable to true enters the camera mode; false exits. Pass in CAM_INTRO or CAM_OUTRO for camera_type. Keep_gampelayunits_forOutro removes gameplay units by default unless set to true. fowUnRevealDelay sets the delay for when to hide units in FoW (3.825 seconds is the default).

    Parameters

    • enable: boolean
    • camera_type: boolean
    • Optional Keep_gampelayunits_forOutro: boolean
    • Optional fowUnRevealDelay: number

    Returns undefined

  • _idleBehaviour_stop(data: any): undefined
  • This is a global function that needs to exist for other things to work correctly. It used to be in module_defend.scar, but wasn't relevant to that particular chunk!

    Parameters

    • data: any

    Returns undefined

  • app_currenttime(): any
  • app_setidealframerate(frameRate: number): any
  • Set the ideal frame rate for the game. Set to 0 if an unbounded frame rate is desired.

    Parameters

    • frameRate: number

    Returns any

  • E-mails a warning out with logfiles at the end of the game. Example: bug( "This shouldn't happen, fix "..problem.here)

    Parameters

    Returns void

  • canseetrigger_GetTriggerCount(instance: any): number
  • Returns how many times this instance has been triggered

    Parameters

    • instance: any

    Returns number

  • canseetrigger_Trigger(instance: string): any
  • Start triggering the items listed in the CanSeeTrigger prefab This prefab can only be triggered once, either by the trigger zone or by script, whichever is first

    Parameters

    • instance: string

    Returns any

  • cmdline_string(name: string): any
  • cursor_hide(): any
  • cursor_setposition(x: number, y: number): any
  • cursor_show(): any
  • dca_get_variable_value(pEntity: EntityID, variableName: string): any
  • Get dca variable value for an entity. Can be used to validate presentation state from lua.

    Parameters

    Returns any

  • dr_clear(frame: string): any
  • dr_drawCircle(frame: string, x: number, y: number, z: number, radius: number, r: number, g: number, b: number): any
  • Draw a circle, positioned in 3D, aligned to scren.

    Parameters

    • frame: string
    • x: number
    • y: number
    • z: number
    • radius: number
    • r: number
    • g: number
    • b: number

    Returns any

  • dr_setautoclear(frame: string, bEnable: boolean): any
  • dr_setdisplay(frame: string, bEnable: boolean): any
  • dr_terraincircle(pos: Position, radius: number, r: number, g: number, b: number, divs: number, frame: string): any
  • Draw circle on terrain.

    Parameters

    • pos: Position
    • radius: number
    • r: number
    • g: number
    • b: number
    • divs: number
    • frame: string

    Returns any

  • dr_terraincirclewithlifetime(pos: Position, radius: number, r: number, g: number, b: number, divs: number, frame: string, lifetime: number): any
  • Draw circle on terrain with lifetime.

    Parameters

    • pos: Position
    • radius: number
    • r: number
    • g: number
    • b: number
    • divs: number
    • frame: string
    • lifetime: number

    Returns any

  • dr_terrainrect(pos: Position, w: number, h: number, r: number, g: number, b: number, rads: number): any
  • dr_text2d(frame: string, x: number, y: number, cmd: string, r: number, g: number, b: number): any
  • Draw text, positioned in 2D, aligned to the screen. (x,y) gives position in normalized screen coordinates cmd is the text to print r,g,b give colour values from 0-255

    Parameters

    • frame: string
    • x: number
    • y: number
    • cmd: string
    • r: number
    • g: number
    • b: number

    Returns any

  • dr_text3d(frame: string, x: number, y: number, z: number, cmd: string, r: number, g: number, b: number): any
  • Draw text, positioned in 3D, aligned to screen.

    Parameters

    • frame: string
    • x: number
    • y: number
    • z: number
    • cmd: string
    • r: number
    • g: number
    • b: number

    Returns any

  • fx_dump(): any
  • fx_forcelod(lod: number): any
  • force the LOD of the FX system (use 0 to enable dynamic LOD)

    Parameters

    • lod: number

    Returns any

  • fx_logenable(enable: boolean): any
  • fx_refresh(): any
  • fx_toggle(): any
  • fx_toggleRendering(): any
  • fx_usedebugshader(enable: boolean): any
  • use the debugshader, which will render all fx green

    Parameters

    • enable: boolean

    Returns any

  • getgametype(): any
  • Gets the type of game we are playing ( GT_SP = 0, GT_MP = 1, GT_Skirmish = 2)

    Returns any

  • getlocalplayer(): any
  • getmapname(): any
  • getsimrate(): any
  • healthtrigger_Activate(instance: string): any
  • healthtrigger_Trigger(instance: string): any
  • Start triggering the items listed in the HealthTrigger prefab This prefab can only be triggered once

    Parameters

    • instance: string

    Returns any

  • inv_dump(): any
  • listplayers(): any
  • lockstep_simulation_presentation_toggle(): any
  • Run simulation and presentation in lockstep, with simulation ticked every frame (useful for debugging sync errors)

    Returns any

  • memdump(): any
  • memdumpf(foldername: string): any
  • Write the OS map of allocated memory to the log folder

    Parameters

    • foldername: string

    Returns any

  • mempoolcount(): any
  • mempoolinuse(int: number): any
  • Given a poolID it will return the current memory in use

    Parameters

    • int: number

    Returns any

  • mempoolmax(int: number): any
  • Given a poolID it will return the max amount of memory this pool has allocated

    Parameters

    • int: number

    Returns any

  • mempoolname(poolid: number): any
  • Given a poolID it will return the name of the pool

    Parameters

    • poolid: number

    Returns any

  • memshrink(): any
  • memtofile(pool: string): any
  • Write to a file all allocation content for specified pool

    Parameters

    • pool: string

    Returns any

  • network_show_calls(): any
  • network_show_statgraph(): any
  • pcanseetrigger_Activate(instance: string): any
  • playertrigger_Activate(instance: string): any
  • playertrigger_GetTriggerCount(instance: any): number
  • Returns how many times this trigger zone instance has been triggered

    Parameters

    • instance: any

    Returns number

  • playertrigger_Trigger(instance: string): any
  • Start triggering the items listed in the PlayerTrigger prefab This prefab can only be triggered once, either by the trigger zone or by script, whichever is first

    Parameters

    • instance: string

    Returns any

  • quit(): any
  • render_viewport_toggle(): any
  • restart(): any
  • Restart a single player game, skirmish game, or the front end. (doesn't work in multiplayer games)

    Returns any

  • Returns ST_NIL,ST_BOOLEAN,ST_NUMBER,ST_STRING,ST_TABLE,ST_FUNCTION,ST_SCARPOS,ST_EGROUP,ST_ENTITY,ST_SGROUP,ST_SQUAD,ST_TEAM,ST_MARKER, ST_PBG, or ST_UNKNOWN

    Parameters

    Returns number

  • scartype_enum_tostring(v: StackVar): any
  • separated(not: Or, smallvector: SGroupID, sgroup: SGroupID, spawnedOnly: boolean, idealSquadRadius: number): any
  • Try to group the squads, returning the squads in groupings that are at least the ideal squad range apart

    Parameters

    Returns any

  • setsimframecap(fcap: number): any
  • setsimpause(): any
  • setsimrate(rate: number): any
  • standard_test(unique_name: string): any
  • standard_test(unique_name: string): any
  • A closure-based class-like object for performing unit-tests and outputting test-results unique_name A name used as identifier in the json result file unit_tests A table containing UnitTest objects which this driver manages is_long_test (Optional, default is false) The driver will only run if the command line argument -TestLong is set

    Parameters

    • unique_name: string

    Returns any

  • A closure-based class-like object defining a single unit test unique_name - Unique name of the test. It is used as a key in the JSON result file. description - Description of this test and the feature it tests. start_function - Executed at test start to setup any preconditions to running the test (e.g. spawning a unit) update_function - Function which is repeatedly executed to test when the test should end. Should return true when the test needs to continue and false when the test needs to end. e.g. a timer which returns true until 5 seconds have elapsed, a predicate which returns true while a unit is still alive etc. finish_function - A predicate which tests the success of the test. This is invoked when the test is finished (indicated by the update function). If finish returns true then the test is successful otherwise the test is a failure. timeout_seconds - A timeout will result in test termination and the test will be considered a failure.

    Parameters

    • unique_name: string

    Returns any

  • statgraph_save(begin: boolean): any
  • std(): any
  • std(): any
  • std(): any
  • Predicate testing if a value is of specific type e.g. f = std.TypePredicate(); f() => 1; f() => 2 ...

    Returns any

  • Performs basic type-checking on [value] e.g. foo = 7; std.Validate(foo, 'foo', T_NUMBER, false)

    Returns any

  • Makes an assertion. If the assertion turns out to be false, raises an error. e.g. foo = 7; assert(foo ~= nil, 'foo should not be nil!', 'If foo is nil we don't know how many bars to spawn!'') This is intended to be a more scripter friendly version of LUA assert.

    Returns any

  • villagerlife_Init(): any
  • Private function. Do not call this function in mission scripts, call VillagerLife_Create instead. VillagerLife_Create calls this, and the prefab system calls this when it creates a VillagerLife during startup.

    Returns any

Generated using TypeDoc