Home › Operations › Player operations › MOVE_GREAT_WORK
Available out of the box. Usable from Lua in the unmodified game.
MOVE_GREAT_WORK
|
|
| Lua constant |
PlayerOperations.MOVE_GREAT_WORK |
| Hash |
0x291d387e |
| Kind |
Player operations |
| Status |
verified |
| Handled in |
case of Player::Operations::Manager::Process (symbol 0x30d4dd, current 0x30e6ed) |
Moves a great work the player owns from one building slot to another building slot, in the same or another city of that player.
-- as used by the game's own Great Works screen (Base/Assets/UI/GreatWorksOverview.lua)
local tParameters = {}
tParameters[PlayerOperations.PARAM_PLAYER_ONE] = Game.GetLocalPlayer()
tParameters[PlayerOperations.PARAM_CITY_SRC] = srcCityId
tParameters[PlayerOperations.PARAM_CITY_DEST] = destCityId
tParameters[PlayerOperations.PARAM_BUILDING_SRC] = srcBuildingId
tParameters[PlayerOperations.PARAM_BUILDING_DEST] = destBuildingId
tParameters[PlayerOperations.PARAM_GREAT_WORK_INDEX] = greatWorkIndex
tParameters[PlayerOperations.PARAM_SLOT] = destSlotIndex
UI.RequestPlayerOperation(Game.GetLocalPlayer(), PlayerOperations.MOVE_GREAT_WORK, tParameters)
- The source is found by looking the great work up in the source building's slots (Buildings::GetGreatWorkInSlot), so a work that sits in no building cannot be moved with this operation.
[verified; evidence: static-analysis — case body calls GetGreatWorkInSlot]
- Sends the engine event GREAT_WORK_MOVED and dispatches a signal after placing the work.
[verified; evidence: static-analysis — event hash constant in the case body]
- The seven parameters listed are exactly the ones the vanilla Lua passes.
[verified; evidence: game-script — GreatWorksOverview.lua line ~914]
See also: player-operation.CHOOSE_ARTIFACT_PLAYER, CityBuildings.GetGreatWorkInSlot, Game.GetGreatWorkPlayer
Parameters
Pass these as the keys of the parameter table (for example tParameters[PlayerOperations.PARAM_BUILDING_DEST] = value). Meanings come from the parameter reference.
PARAM_BUILDING_DEST
PARAM_BUILDING_SRC
PARAM_CITY_DEST
PARAM_CITY_SRC
PARAM_GREAT_WORK_INDEX
PARAM_PLAYER_ONE
PARAM_SLOT
Events sent
GREAT_WORK_MOVED
Functions called (names from the symbol build)
Globals::EditPlayer, Districts::Find, Buildings::GetGreatWorkInSlot, Instance>::edit, Buildings::RemoveGreatWork, Culture::Get, CollectorDefault<void>_>::Dispatch, Buildings::AddGreatWorkToSlot, Event::Send
Evidence: static-analysis — hash comparison in the Process decision tree