From 9dc88e53f0f289056d8dc45dda3b24cc89d7ed34 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 15:01:53 +0400 Subject: feat(factory): order schemes with selected internal parts On the stock Constructor map, walk to the factory communicator, claim it, order the revised scheme, and walk back outside. The released custom robot advances the production objective. Check that an unresearched part prevents a new custom order before it uses the free quota. --- apps/fparkan-game/src/main.rs | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs index 1c55502b..8c2e12f9 100644 --- a/apps/fparkan-game/src/main.rs +++ b/apps/fparkan-game/src/main.rs @@ -108,7 +108,7 @@ use fparkan_render_vulkan::{ use fparkan_runtime::{ apply_projectile_contact, autodemo_camera, board_friendly_warbot, capture_building_with_notice, capture_neutral_warbot, create, deploy_mine, disembark_warbot, frame as step_mission_frame, - frame_with_player_motion, load_gameplay_mission, load_mission_static_preview, + frame_with_player_motion, load_gameplay_mission_with_build_parts, load_mission_static_preview, load_mission_static_preview_roots, loaded_mission_assets, loaded_mission_object_drafts, loaded_terrain, mission_object_handle, order_lab_research, plan_player_motion_with_collision, player_vehicle, prepared_warbot_weapons, projectile_terrain_hit, projectile_unit_hit, @@ -370,7 +370,7 @@ fn load_requested_mission(engine: &mut Engine, args: &Args) -> Result Result, + build_parts: Vec<(String, String)>, list_missions: bool, sim_report_ms: Option, viewer: bool, @@ -12904,6 +12906,7 @@ impl Args { let mut root = None; let mut mission = None; let mut build_scheme = None; + let mut build_parts = Vec::new(); let mut list_missions = false; let mut sim_report_ms = None; let mut viewer = false; @@ -12964,6 +12967,14 @@ impl Args { "--build-scheme requires a Unit DAT path".to_string() })?); } + "--build-part" => { + let (from, to) = iter + .next() + .and_then(|value| value.split_once('=')) + .filter(|(from, to)| !from.is_empty() && !to.is_empty()) + .ok_or("--build-part requires OLD=NEW")?; + build_parts.push((from.to_owned(), to.to_owned())); + } "--frames" => { frames = iter .next() @@ -13065,6 +13076,9 @@ impl Args { if build_scheme.is_some() && (viewer || list_missions || sim_report_ms.is_some()) { return Err("--build-scheme requires a playable mission window".to_string()); } + if !build_parts.is_empty() && build_scheme.is_none() { + return Err("--build-part requires --build-scheme".into()); + } if control_clock_ms.is_some() && frames < 2 { return Err( "--control-clock-ms requires --frames of at least 2 to replay the animation clock" @@ -13081,6 +13095,7 @@ impl Args { root, mission, build_scheme, + build_parts, list_missions, sim_report_ms, viewer, @@ -13099,7 +13114,7 @@ impl Args { } fn usage() -> String { - "usage: fparkan-game --root --list-missions\n fparkan-game --root --mission --sim-report \n fparkan-game --root --mission [--build-scheme ] [--viewer] [--frames ] [--atmosphere-seconds ] [--control-clock-ms ] [--validation] [--preview-roots ] [--legacy-camera-capture ] [--static-animation-frame ] [--static-material-phase ] [--readback-out ] [--readback-sequence-out ]\n--viewer skips mission simulation. Capture, static pose/material and root-limit options select viewer mode. --control-clock-ms replays the scene clock from zero to the selected time over the requested frames; --readback-sequence-out captures each submitted frame and requires that clock.".to_string() + "usage: fparkan-game --root --list-missions\n fparkan-game --root --mission --sim-report \n fparkan-game --root --mission [--build-scheme [--build-part OLD=NEW]...] [--viewer] [--frames ] [--atmosphere-seconds ] [--control-clock-ms ] [--validation] [--preview-roots ] [--legacy-camera-capture ] [--static-animation-frame ] [--static-material-phase ] [--readback-out ] [--readback-sequence-out ]\n--viewer skips mission simulation. Capture, static pose/material and root-limit options select viewer mode. --control-clock-ms replays the scene clock from zero to the selected time over the requested frames; --readback-sequence-out captures each submitted frame and requires that clock.".to_string() } #[cfg(test)] @@ -15725,6 +15740,7 @@ mod tests { root: PathBuf::from("testdata/IS"), mission: "MISSIONS/Autodemo.00/data.tma".to_string(), build_scheme: None, + build_parts: Vec::new(), list_missions: false, sim_report_ms: None, viewer: false, -- cgit v1.2.3