Skip to main content

Dunia.dll — The Lua-Exposed API Surface

Verified via reverse engineering

See the overview for binary identification, including the embedded Lua 4.1 (alpha) interpreter confirmation. This page covers what C++ exposes to Lua; see Domino Scripts for what the actual .lua script files built on top of it look like and cover.

Every C++ function/method exposed to the embedded Lua interpreter goes through one choke point: RegisterLuaBinding(namespace_or_0, "Name", handlerPtr) (0x102aa850). namespace_or_0 == 0 registers a global Lua function callable from anywhere; a class-name string (e.g. "CBuddiesManager") registers a method scoped to that manager's Lua handle, typically obtained via a GetXxxManager() global first (several of which are themselves in the global list below, e.g. GetBuddiesManager, GetFCXMissionManager).

Surveyed every one of the ~260 call sites (get_xrefs_to on 0x102aa850, fully enumerated) across ~30 distinct registration functions, each corresponding to one exposed class or global batch. This is the authoritative map of the engine's Lua scripting surface — the source for SCRIPTS\MissionTools.lua and friends.

Global functions (namespace = 0, callable from anywhere)

Entity/utility (0x10591120, 22 fns): GetInvalidEntityId, GetLocalPlayerId, GetEntityName, IsEntityLoaded, IsEntityValid, AttachAnchor, ValidateSyncAnim, GetEntityInPrefab, RemoveEntity, GetStringID, GetNoCaseStringID, PathID, SetPlayerActionMap, PushPlayerActionMap, PopPlayerActionMap, SendForceState, DrawTextToScreen, SetVisibility, one unnamed-string-literal binding, UnBind, GetGlobalString, GetGlobalNumber, SpawnEntityFromArchetype.

Gameplay/mission scripting, batch 1 (0x109fc830, 70 fns — the single largest registration site, almost certainly backing SCRIPTS\MissionTools.lua): SpawnPickupMissionItem, AddWeapon, AddGadget, CameraShakeAndGamePadRumble, SpawnWeapon, RefillWeaponAmmo, RefillSyrettes, RemoveAllWeapon, RemoveAllGadget, RemoveAllInventory, SelectWeapon, DrawWeapon, HolsterWeapon, TeleportEntity, SpawnReinforcementScenario, SetLookAtTargetID, PlayAnimSimpleObject, PhoneCall, CanAccessMedicine, SendAchievementData, RemoveScriptCallback, ClearScriptCallbackID, GetMalariaPillCount, SetMalariaPillCount, StopMalariaBlackout, SetSicknessLevel, SetBaseInfamy, EnablePostFx, DisablePostFx, SwitchCamera, SetToScriptedCollisionGroup, SendPierceStimWithOrigin, SendPierceStimNoOrigin, LookAtTarget, StopLookatTarget, EnableWagerRegion, DisableWagerRegion, PlayEmotion, PopUpEndOfGame, PopUpInGameCredits, StartDefenceReversal, StopDefenceReversal, PopUpObjective, StartBargeAssault, StopBargeAssault, BargeBreakdown, BargeRepaired, BargeEnableZone, BargeDisableZone, StartBuddyBetrayal, BindToVehicleRide, UnbindFromVehicleRide, StartAnimalFollowPath, StopAnimalFollowPath, SetupVehicleFollowPath, StartVehicleFollowPath, StopVehicleFollowPath, EnableScriptedAIMode, DisableScriptedAIMode, ForceSocialRegionToCombat, EnableRadioBroadcast, StartTownEscape, StopTownEscape, StartDentalPlan, StopDentalPlan, StartJacksBuddy, StopJacksBuddy, GetClosestAutomaticPrefab, SetupDefenceRevesalMikesPlace, SetupBuddyHealth, EnableCheck.

Gameplay/mission scripting, batch 2 (0x10725120, 33 fns): AddScriptedSceneParticipant, RemoveScriptedSceneParticipant, GetFCXMissionManager, GetBuddiesManager, GetGameplayManager, GetFCXBarkManagerService, GetWeaponBazaar, EnableTutorial, SetScriptedDeath, StartDefoliantFX, GameChangeWorld, GameChangeWorldDefaultSpawnPoint, GetTriggerComponentContacts, SendPlayGame, KillPawnAgent, ChangeReinforcementRegionSpawnRate, OverrideMapTexture, GameStartStopAMBXScript, ChangeHealingPreference, StartDesertStorm, StopDesertStorm, SetUsableEntitySize, AddDiamonds, SetObjectiveState, AddOverrideDesertSetting, RemoveOverrideDesertSetting, AttachAnimationPackage, DetachAnimationPackage, DeleteEntityInTrigger, IsPartnerMissionUnlock, SendSomeoneTalkedEventToPlayer, BlockBuddyRescue, UnblockBuddyRescue, SetCinematicUIMode.

Sound (0x10629290, 2 fns): StartSoundMixingFromLua, StopSoundMixingFromLua.

Class-scoped methods (manager singletons, obtained via a GetXxx()/instance accessor)

ClassMethod countMethods
CBuddiesManager34IsBuddyUnlocked, GetBuddyState, GetBuddyGender, IsBuddyAvailable, AssignBuddy, SpawnPrimaryBuddy, SpawnBuddy, GetBuddyList, GetBetrayedBuddyList, PositionSpawnedBuddy, RemoveBuddyFromWorld, MercyKilledBuddy, BetrayedBuddy, GetRescueBuddyEntityId, AddHistoryPointsToPrimaryBuddy, AddHistoryPointsToSidequestBuddy, SetSidequestMissionState, AddRescueBuddySpawnEventListener, RemoveRescueBuddySpawnEventListener, AddRescueBuddyChangedEventListener, RemoveRescueBuddyChangedEventListener, GetPrimaryBuddyName, CheatSetRescueBuddy, SetBuddyRescueActive, IsRescueBuddyAvailable, SetShowRescueBuddyInMenu, AddDefenceReversalEventListener, RemoveDefenceReversalEventListener, SetDefenceRevesalBetrayedBuddies, BypassSetPrimaryBuddy, BypassSetSecondaryBuddy, BypassSetBuddyUnlock, BypassSetBuddyHistoryPts, BypassSetBuddyLifeState
CFCXMissionManager22ActivateBuddyMission, SelectMission, GetMissionFaction, SetCurrentMission, MissionCompleted, GiveMissionReward, WasFactionBetrayed, BypassMissionCompleted, BypassLibraryMissionOffer, BypassSetLibraryMissionState, SetLibraryMissionState, HeardBriefing, SetGreetingHeard, GetGreeting, GetAcceptedMissionCount, GetSubvertedMissionCount, SetWinningFaction, GetWinningFactionPerAct, GetWinningFaction, AddMovieSequenceToUnload, NewJackalTapeFound, PartnerTapeFound
CDynamicEnvironmentManager16SetDepthOfFieldOverride, RemoveDepthOfFieldOverride, SetFogOverride, RemoveFogOverride, SetCloudOverride, RemoveCloudOverride, SetWindOverride, RemoveWindOverride, SetLightingOverride, RemoveLightingOverride, GetScriptedTimeOfDay, SetScriptedTimeOfDay, SetScriptedStormFactorOverride, RemoveScriptedStormFactorOverride, SetAdaptiveBloomOverride, RemoveAdaptiveBloomOverride
CDominoManager10SpawnDominoEntity, RemoveDominoEntity, RemoveCommandEventToEntity, SendCommandEventToEntity, SendCommandEventToEntity2, QueueCommandEventToEntity, QueueCommandEventToEntity2, SendRegisteredEventToEntity, TraceConnection, IsScriptAutorunEnabled
CGameMessageBoxHelper8CreateConfirmationMessageBox, CreateTutorialMessageBox, CreateCustomTutorialMessageBox, CreateFloatingTutorialMessageBox, CreateTutorialMessageBoxWithActionMap, CreateCustomTutorialMessageBoxWithActionMap, CreateFloatingTutorialMessageBoxWithActionMap, HideFloatingTutorialMessageBox
CScriptCallbackSystem8RegisterEventCallback, RegisterOnSpawnCallback, RegisterOnRemoveCallback, RemoveCallback, RemoveCallbacks, RegisterMessageListener, UnregisterMessageListener, BroadcastMessage
CFCXBarkManagerService4LoadMissionBarkBank, UnloadMissionBarkBank, RegisterMissionBankLoadedCallback, UnregisterMissionBankLoadedCallback
CBaseMission5IsEnabled, one unnamed-string-literal binding, Enable, Disable, SetState
CDominoDelayManager4CreateDelay, RemoveDelay, SetDelay, SendCommand
CDominoConsoleCommandManager2RegisterConsoleCommand, UnregisterConsoleCommand
CDominoSequenceManager2CreateListener, DeleteListener
CDominoBoxResource2RegisterBox, LoadResource
CDominoBoxInstance2CreateBox, GetParentEntity
CMusicManager3SetWorld, ChangeSet, PlayMusicFromLua
CDominoSoundManager1PlaySound
CMovieSystem1CommandSequence
CGameMissionMgr1GetMission
CFCXRegionManager1IsSafeHouseLocked
CFCXObjectiveHudManager1PushNewObjective
CDominoWaterLevelManager1SetWaterLevel
CTerrain1GetSector
CSector1SetWaterLevel
CEntityComponent1GetEntity
CVehicle1GetCurrentVehicle
CFCXGameplayManager1SetMapArmy
CJackalTapeManager1StopTape

Each of these manager classes also exposes a much larger set of plain data properties (not functions) through a separate, parallel reflection mechanism (FUN_1029b000/property-descriptor structs with GetNameHash("PropertyName", ...), visible interleaved in the same registration functions — e.g. CFCXMissionManager also exposes CurrentAct, MissionTime, InfMinCoefficient, etc. as readable/writable fields). Those aren't part of this function survey but are readable from the same decompiled registration functions if needed.

Unknowns

  • One registration call site (0x10738c38) sits outside any function Ghidra has identified as a Function object — needs a manual Disassemble+Create-Function pass in the GUI before it's readable via MCP. Every other one of the ~260 sites has been surveyed.