Skip to content

feat(metal-farp): animated construction scene + dev/test recipe#25

Merged
FullGas1 merged 6 commits into
masterfrom
develop
Jul 19, 2026
Merged

feat(metal-farp): animated construction scene + dev/test recipe#25
FullGas1 merged 6 commits into
masterfrom
develop

Conversation

@FullGas1

@FullGas1 FullGas1 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Test plan

  • CI green on all jobs (busted, luacheck, validate-docs, build)
  • Visual scene validated in DCS: crane t+0.5s, UC t+5.5s, helipad t+25.5s, crane gone t+30.5s
  • Download buttons tested in browser
  • Versioned docs accessible on GitHub Pages

Generated with Claude Code

Summary by Sourcery

Add an animated, timed construction sequence to the Metal FARP scene and document a full plugin development and DCS visual test workflow.

New Features:

  • Introduce a progressive Metal FARP construction animation using tower crane and under-construction helipad variants with timed deployment steps.
  • Provide DCS injection scripts (inject_scene.lua and cleanup.lua) and a visual test recipe for iterating on scenes without mission reloads.
  • Add an English and French plugin development and test guide, including unit testing, DCS visual testing, and CI expectations.

Enhancements:

  • Extend Metal FARP scene metadata to include the under-construction helipad mod type while keeping tower crane as a stock asset.
  • Update template plugin tests to reference the new plugin development guide in the docs navigation.

Documentation:

  • Add bilingual plugin development and test guides and link them into the MkDocs navigation, documenting repo layout, test loop, and CI gates.
  • Document the Metal FARP visual test procedure and timing checkpoints for validating the construction animation in DCS.

Tests:

  • Add smoke tests for the Metal FARP scene model covering registration, crate declaration, modTypes contents, step count, and critical flags.
  • Introduce a generic cleanup script for destroying scene-spawned objects while preserving the reference helicopter group for repeated visual testing.

FullGas1 and others added 6 commits July 19, 2026 15:23
#19) (#22)

- Rewrites the 9-step scene into a 13-step animated sequence (~45 s total)
- Trucks and tent appear first; Tower Crane spawns at t+5.5 s
- FG_small_Helipad_Under_Construction animates construction from t+10.5 s to t+30.5 s
- FG_small_Helipad revealed at t+30.5 s (critical); crane removed at t+35.5 s
- Equipment and warehouse follow; warehouse stocked only once pad is live
- Cross-step object references stored in scene._params (_craneObj, _underConstObj)
- Registers Tower Crane and FG_small_Helipad_Under_Construction via registerIfAbsent
- Adds FG_small_Helipad_Under_Construction to modTypes (same zip, no new modUrls)
- Creates plugins/metal-farp/tests/metal_farp_spec.lua with 6 Busted assertions

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
… RECIPE.md (#23)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
- docs/plugin-dev-guide.md + .fr.md: creation, Busted tests, DCS visual loop, CI
- mkdocs.yml: guide added under 'For authors' nav section
- template_spec.lua: pointer to the guide for new plugin authors

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…inject_scene (#20)

playSceneAtPos hardcodes North-facing direction. Replace with a mock unit
carrying the helicopter's actual forward vector so scene polar offsets
are oriented along the helicopter axis.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
DCS keeps Airbase objects alive after static:destroy() for heliports. Sweep world.getAirbases() and destroy all non-airdrome entries (cat != 0). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… UC helipad

- Add FG_small_Helipad_Under_Construction spawn (category=Fortifications) at t+5.5s
- Add Tower Crane prop at t+0.5s, ~20m right of pad
- Destroy UC at t+25.5s, immediately spawn final FG_small_Helipad
- Destroy Tower Crane 5s after helipad appears (t+30.5s)
- Fix delayAfterPreviousStep semantics: delay on step N controls when step N+1 runs
- Document timing model in layout comment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implements a timed, animated Metal FARP construction sequence, adds DCS visual test scripts and recipe, introduces unit tests for the scene model, and documents the plugin development/testing process in both English and French with MkDocs navigation updates.

Sequence diagram for the animated Metal FARP construction scene

sequenceDiagram
    actor Pilot
    participant CTLDSceneManager
    participant metalFarpScene
    participant TowerCrane
    participant UnderConstructionPad as FG_small_Helipad_Under_Construction
    participant FinalPad as FG_small_Helipad

    Pilot->>CTLDSceneManager: playSceneAtPos(metalFarpScene)
    CTLDSceneManager->>metalFarpScene: steps[1..3] spawn support equipment

    CTLDSceneManager->>metalFarpScene: step 4 (Tower Crane)
    metalFarpScene->>CTLDSceneManager: func(ctx) saves _craneObj
    CTLDSceneManager->>TowerCrane: spawn static object

    CTLDSceneManager->>metalFarpScene: step 5 (FG_small_Helipad_Under_Construction)
    metalFarpScene->>CTLDSceneManager: func(ctx) saves _underConstObj
    CTLDSceneManager->>UnderConstructionPad: spawn fortification

    CTLDSceneManager->>metalFarpScene: step 6 destroy UC pad
    metalFarpScene->>UnderConstructionPad: Object.isExist(obj)
    metalFarpScene->>UnderConstructionPad: destroy()

    CTLDSceneManager->>metalFarpScene: step 7 (final FG_small_Helipad)
    CTLDSceneManager->>FinalPad: spawn heliport (critical=true)
    metalFarpScene->>metalFarpScene: func(ctx) sets farpName

    CTLDSceneManager->>metalFarpScene: step 8 destroy Tower Crane
    metalFarpScene->>TowerCrane: Object.isExist(obj)
    metalFarpScene->>TowerCrane: destroy()

    CTLDSceneManager->>metalFarpScene: steps[9..13] spawn remaining objects
Loading

File-Level Changes

Change Details Files
Add a progressive, timed construction animation for the Metal FARP scene including under-construction helipad and tower crane lifecycle.
  • Extend scene object registry with visual-only under-construction helipad and Tower Crane entries, including proper categories and probeSkip handling.
  • Update metalFarpScene.modTypes to include the under-construction helipad variant while keeping Tower Crane as a stock type.
  • Restructure metalFarpScene.steps into a 13-step sequence that spawns trucks, tent, construction props, transitions from under-construction pad to final helipad, and destroys temporary objects at specific timings.
  • Ensure critical=true on the finished helipad step and persist references to spawned objects in scene._params for later destruction.
plugins/metal-farp/src/CTLD_metalFarpScene.lua
Introduce automated tests and DCS injection/cleanup scripts for the Metal FARP scene, plus a visual test recipe.
  • Add a Busted spec that loads the Metal FARP scene, verifies registration, crate declaration, requiresCtld version, modTypes contents, step count, and critical flag semantics.
  • Provide inject_scene.lua that spawns the Metal FARP scene 100m ahead of reference unit uh1-1 using a mock unit aligned to the helicopter’s heading.
  • Provide cleanup.lua that generically destroys all groups, static objects, and non-airdrome airbases while preserving the uh1 group, with logging and on-screen feedback.
  • Document the Metal FARP DCS visual test loop, prerequisites, injection order, and expected animation timing checkpoints in RECIPE.md.
plugins/metal-farp/tests/metal_farp_spec.lua
plugins/metal-farp/tests/inject_scene.lua
plugins/metal-farp/tests/cleanup.lua
plugins/metal-farp/tests/RECIPE.md
Document the plugin development and test workflow and expose it in MkDocs navigation.
  • Add English and French plugin development guides describing directory layout, template usage, modUrls front-matter, scene authoring rules, unit test expectations, DCS visual testing flow, injection methods, cleanup contract, and CI gates.
  • Reference the plugin dev guide from the template plugin’s test spec header comments to direct authors to the full documentation.
  • Update MkDocs navigation to include the new plugin dev guide under the authors section.
docs/plugin-dev-guide.md
docs/plugin-dev-guide.fr.md
plugins/_template/tests/template_spec.lua
mkdocs.yml

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@FullGas1
FullGas1 merged commit 61909bb into master Jul 19, 2026
12 checks passed

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The documented timing in CTLD_metalFarpScene.lua and plugins/metal-farp/tests/RECIPE.md (e.g., UC pad at 10.5s, crane/ ammo at 35.5s, lights at 40s) does not match the actual delayAfterPreviousStep values in the scene steps; please reconcile the comments and recipe table with the cumulative timings from the code.
  • plugins/metal-farp/tests/cleanup.lua currently destroys all static objects and non-airdrome airbases across all coalitions, which could wipe unrelated mission content; consider narrowing the cleanup to objects spawned by this scene (e.g., by namePrefix or a scene-specific tag) to make it safer to reuse.
  • The "has exactly 13 steps" assertion in plugins/metal-farp/tests/metal_farp_spec.lua is quite brittle and will fail on any future step adjustment; you might prefer asserting the presence and properties of key steps (e.g., helipad spawn, UC variant, crane destroy) rather than the total count.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The documented timing in CTLD_metalFarpScene.lua and plugins/metal-farp/tests/RECIPE.md (e.g., UC pad at 10.5s, crane/ ammo at 35.5s, lights at 40s) does not match the actual delayAfterPreviousStep values in the scene steps; please reconcile the comments and recipe table with the cumulative timings from the code.
- plugins/metal-farp/tests/cleanup.lua currently destroys all static objects and non-airdrome airbases across all coalitions, which could wipe unrelated mission content; consider narrowing the cleanup to objects spawned by this scene (e.g., by namePrefix or a scene-specific tag) to make it safer to reuse.
- The "has exactly 13 steps" assertion in plugins/metal-farp/tests/metal_farp_spec.lua is quite brittle and will fail on any future step adjustment; you might prefer asserting the presence and properties of key steps (e.g., helipad spawn, UC variant, crane destroy) rather than the total count.

## Individual Comments

### Comment 1
<location path="docs/plugin-dev-guide.md" line_range="136" />
<code_context>
+**On a problem (Step 3):**
+
+1. Inject `plugins/{name}/tests/cleanup.lua`.
+2. Fix the plugin lua.
+3. Repeat from Step 1.
+
</code_context>
<issue_to_address>
**nitpick (typo):** Use "Lua" (capital L) for consistency with the rest of the document.

This instance should be capitalized to "Lua" to match usage elsewhere in the guide.

Suggested implementation:

```
2. Fix the plugin Lua.

```

If "Lua" appears elsewhere in lowercase (e.g. "lua script", "lua file") in this guide, those should be updated to "Lua" as well for consistency, following the same SEARCH/REPLACE pattern.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread docs/plugin-dev-guide.md
**On a problem (Step 3):**

1. Inject `plugins/{name}/tests/cleanup.lua`.
2. Fix the plugin lua.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nitpick (typo): Use "Lua" (capital L) for consistency with the rest of the document.

This instance should be capitalized to "Lua" to match usage elsewhere in the guide.

Suggested implementation:

2. Fix the plugin Lua.

If "Lua" appears elsewhere in lowercase (e.g. "lua script", "lua file") in this guide, those should be updated to "Lua" as well for consistency, following the same SEARCH/REPLACE pattern.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant