Skip to content

Mission API - Move/Rotate Unit Actions - #8541

Open
Damgam wants to merge 7 commits into
mission-api/devfrom
mission-api-move-unit
Open

Mission API - Move/Rotate Unit Actions#8541
Damgam wants to merge 7 commits into
mission-api/devfrom
mission-api-move-unit

Conversation

@Damgam

@Damgam Damgam commented Jul 30, 2026

Copy link
Copy Markdown
Member
  • Added RotateUnit action
    Provide it with point on the map towards which the unit should be rotated

  • Added MoveUnit action
    Provide it with point on the map towards which the unit should be teleported
    Allows to provide randomised radius for teleportation
    Also allows rotating within the same action

  • Test Mission included. Tested, Works 100%.

- Added RotateUnit action
  Provide it with point on the map towards which the unit should be rotated
- Added MoveUnit action
  Provide it with point on the map towards which the unit should be teleported
  Allows to provide randomised radius
  Also allows rotating within the same action

- Test Mission included. Tested, Works 100%.
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Integration Test Results

16 tests  +2   8 ✅ +2   3s ⏱️ ±0s
 1 suites ±0   8 💤 ±0 
 1 files   ±0   0 ❌ ±0 

Results for commit f385b82. ± Comparison against base commit 851cbbe.

♻️ This comment has been updated with latest results.

@Damgam
Damgam requested a review from WatchTheFort July 30, 2026 14:20
@efrec efrec added the Mission API Framework to support campaign missions and scenarios label Aug 1, 2026
Comment thread luarules/mission_api/actions/move_units.lua Outdated
Comment thread luarules/mission_api/actions/move_units.lua Outdated
Comment thread luarules/mission_api/actions/move_units.lua Outdated
Comment thread luarules/mission_api/actions/rotate_units.lua Outdated
Comment thread luarules/mission_api/actions/rotate_units.lua
Comment thread luarules/mission_api/actions/rotate_units.lua Outdated
Comment thread luarules/mission_api/actions/move_units.lua
Comment thread luarules/mission_api/actions/move_units.lua Outdated
@WatchTheFort

Copy link
Copy Markdown
Member

I'm not sure we want any randomness in actions, mission authors should be able to rely on the outcome of an action being deterministic.

@efrec

efrec commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

I'm not sure we want any randomness in actions, mission authors should be able to rely on the outcome of an action being deterministic.

Noted

@Damgam

Damgam commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

I'm not sure we want any randomness in actions, mission authors should be able to rely on the outcome of an action being deterministic.

Well, that's why this is optional and down to the mission author to decide.

@efrec

efrec commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Still, randomness was going to be my next set of notes. It is just a bigger design question so safe to save for last. Randomly placing units will overlap them. Buildings especially will trap units.

@Damgam

Damgam commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

Still, randomness was going to be my next set of notes. It is just a bigger design question so safe to save for last. Randomly placing units will overlap them. Buildings especially will trap units.

Thats why you make the radius only cover empty space, duh.

@efrec

efrec commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Why not place them in a custom formation? Why not in a square, a donut, a circle, a sunflower, a triangle, a straight line, a hollow rectangle, an clustered-noise distribution with archipelagic extinction, anything at all?

@efrec

efrec commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

To be clear that is a great -- TODO: group placement strategies and randomness types comment and a bad extension of this PR.

@Damgam

Damgam commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

Why not place them in a custom formation? Why not in a square, a donut, a circle, a sunflower, a triangle, a straight line, a hollow rectangle, an clustered-noise distribution with archipelagic extinction, anything at all?

So you're telling me simple random radius is too much for the idiot-proof system, but advanced formations are not... okay.
When it gets under 25C in my room maybe I could think about implementing that, lol. Right now it's nearing 35.

@efrec

efrec commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

I am saying that it will fuck up, yes

@keithharvey

keithharvey commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

@Damgam in the POC for modules I had a LOT of problems around this: scav waves wouldn't spawn, spawned units wouldn't spawn. Went with this approach.

{ name = 'unitName', required = true, type = ParameterTypes.UnitName },
{ name = 'position', required = true, type = ParameterTypes.Position },
{ name = 'direction', required = false, type = ParameterTypes.Position }, -- Point on the map towards which the unit rotates
{ name = 'randomRadius', required = false, type = ParameterTypes.Number }, -- Spread teleported units around in radius this big.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a radius. It is a half-length of a side of a map-aligned box.

@sprunk sprunk Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/remindme 7d 01b70b39a3909f35799b246f434f9e61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Mission API Framework to support campaign missions and scenarios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants