Ticket #41730

Lua API: allow setting move side effects

Open Date: 2021-03-11 08:43 Last Update: 2021-03-12 21:33

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Accepted
File:
1

Details

The Lua API allows moving a unit without considering what the move rules are via edit.unit_move() and edit.unit_teleport(). This can be used to create custom move actions, teleporting items on the map etc. They have side effects that used to be a part of regular moves but that now live in separate actions.

Add parameters to control what side effects not a part of enabler controlled moves the move should have. This allows the ability to specify a unit to embark to, to determine if a unit is allowed to unload from its current transport to perform the move, if any city at the target tile is conquered, if any extra at the target tile is conquered, if huts at the target tile are entered or frightened.

The old versions of edit.unit_move() and edit.unit_teleport() that infers side effects based on game rules and state can be deprecated as soon as enough of their old rules can be expressed in Lua.

Ticket History (3/4 Histories)

2021-03-11 08:43 Updated by: kvilhaugsvik
  • New Ticket "Lua API: allow setting move side effects" created
2021-03-11 08:45 Updated by: kvilhaugsvik
  • Resolution Update from None to Accepted
2021-03-12 21:33 Updated by: kvilhaugsvik
  • Status Update from Open to Closed

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login