aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-14 20:03:39 +0300
committerValentin Popov <valentin@popov.link>2026-11-14 20:03:39 +0300
commit58910ebe71100617abf6523827e2b04351709de9 (patch)
tree3acb94399e5c5131ba183ee837fddbcaf42e3614 /apps/fparkan-game/src
parent77ab4031f5c140ae5bce4096abab0552a0675ef9 (diff)
downloadfparkan-58910ebe71100617abf6523827e2b04351709de9.tar.xz
fparkan-58910ebe71100617abf6523827e2b04351709de9.zip
feat(ai): dispatch periodic clan problem scripts
Runs the supported Problems0 prefix for AI clans and counts every stop by clan, event and instruction. Single.01 now reaches the native scenario body and identifies Handler(49) as the next unsupported command. Existing defensive behavior remains active.
Diffstat (limited to 'apps/fparkan-game/src')
-rw-r--r--apps/fparkan-game/src/main.rs1
-rw-r--r--apps/fparkan-game/src/script_coverage.rs13
2 files changed, 13 insertions, 1 deletions
diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs
index 4d8e4b27..40fe8f3f 100644
--- a/apps/fparkan-game/src/main.rs
+++ b/apps/fparkan-game/src/main.rs
@@ -220,6 +220,7 @@ fn run(args: &[String]) -> Result<String, String> {
for stop in &report.mission_event_stops {
log_mission_event_stop(stop);
}
+ script_coverage::log_clan_ai_stops(&report);
if guard_clans != 0 {
eprintln!(
"mission_guard_combat first_shot_ms={:?} first_destroyed_ms={:?}",
diff --git a/apps/fparkan-game/src/script_coverage.rs b/apps/fparkan-game/src/script_coverage.rs
index 1cf1f544..0b0eea99 100644
--- a/apps/fparkan-game/src/script_coverage.rs
+++ b/apps/fparkan-game/src/script_coverage.rs
@@ -1,4 +1,6 @@
-use fparkan_runtime::{loaded_mission_script_bundles, Engine, MissionScriptInitExecution};
+use fparkan_runtime::{
+ loaded_mission_script_bundles, Engine, MissionScriptInitExecution, SimulationReport,
+};
pub(super) fn log_script_init(engine: &Engine, mission: &str) {
for bundle in loaded_mission_script_bundles(engine).unwrap_or_default() {
@@ -17,3 +19,12 @@ pub(super) fn log_script_init(engine: &Engine, mission: &str) {
}
}
}
+
+pub(super) fn log_clan_ai_stops(report: &SimulationReport) {
+ for (stop, count) in &report.clan_ai_event_stops {
+ eprintln!(
+ "sim_coverage script_clan_ai_stops={count} clan={} script={} event={} instruction={} reason={}",
+ stop.clan_index, stop.script_path, stop.event_index, stop.instruction_index, stop.reason,
+ );
+ }
+}