Home › Operations › Player operations › EXECUTE_SCRIPT

Available out of the box. Usable from Lua in the unmodified game.

EXECUTE_SCRIPT

Lua constant PlayerOperations.EXECUTE_SCRIPT
Hash 0xc665ad08
Kind Player operations
Status verified
Handler class ExecuteScript::Start
Registered at symbol 0x5b1f0, current —

Routes a UI request to a gameplay-side GameEvents handler named by the OnStart parameter, so a script action is processed through the normal operation path.

-- UI state
local kParameters = {}
kParameters.OnStart = "MyScriptAction"   -- name of the GameEvents handler to run
kParameters.CityID = cityID
UI.RequestPlayerOperation(Game.GetLocalPlayer(), PlayerOperations.EXECUTE_SCRIPT, kParameters)

-- gameplay state
GameEvents.MyScriptAction.Add(function(playerID, kParameters)
    -- act on kParameters.CityID
end)

Evidence: static-analysis — handler class Start function