From 28c653428d80e4f19dd181f7dc76a77e1c96d020 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 3 Oct 2026 18:08:32 -0400 Subject: [PATCH] =?UTF-8?q?debug:=20OMNI-CONFIRM=20probe=20(did=20the=20se?= =?UTF-8?q?rver=20actually=20create=20each=20outgoing=20skull=20tag=3F)=20?= =?UTF-8?q?+=20OMNI-GATE=20trace=20(which=20readiness=20sub-check=20closed?= =?UTF-8?q?=20and=20skull=20state)=20=E2=80=94=20netgunner=20selection=20p?= =?UTF-8?q?roven=20fine=20(best=2029x=20skull=20passes,=20prio=205),=20pin?= =?UTF-8?q?g=20loss=20is=20between=20send=20and=20accept?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AutoMark/scripts/mods/AutoMark/AutoMark.lua | 14 +++++++- .../mods/AutoMark/mark/servo_skull_mark.lua | 34 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/AutoMark/scripts/mods/AutoMark/AutoMark.lua b/AutoMark/scripts/mods/AutoMark/AutoMark.lua index 3cc8365..dbb9a98 100644 --- a/AutoMark/scripts/mods/AutoMark/AutoMark.lua +++ b/AutoMark/scripts/mods/AutoMark/AutoMark.lua @@ -477,7 +477,16 @@ local function is_tag_valid(tag_name) elseif tag_name == TAG_NAMES.ENEMY_TAG then return context.class_name ~= "veteran" or not context.has_focus_target elseif tag_name == TAG_NAMES.SERVO_SKULL_TAG then - return context.class_name == "cryptic" and context.has_servo_skull and mod:is_servo_skull_ready_to_shoot() and (is_training_grounds() or can_noospheric_command_boost()) + local tg = is_training_grounds() + local state_ok = mod:is_servo_skull_ready_to_shoot() + local charge_ok = tg or can_noospheric_command_boost() + if not (state_ok and charge_ok) and mod_settings.debug_mode then + mod.omni_gate_diag_counter = (mod.omni_gate_diag_counter or 0) + 1 + if mod.omni_gate_diag_counter % 15 == 1 then + mod:diag(string.format("OMNI-GATE closed counter=%d state=%s state_ok=%s charge_ok=%s", mod.omni_gate_diag_counter, mod:debug_servo_skull_state(), tostring(state_ok), tostring(charge_ok))) + end + end + return context.class_name == "cryptic" and context.has_servo_skull and state_ok and charge_ok end return false end @@ -539,6 +548,9 @@ local function auto_mark_by_tag(tag_name, t, fixed_frame) mod:set_auto_mark(TAG_NAMES.ENEMY_TAG, target_unit, target_tag) else mod:set_auto_mark(tag_name, target_unit, target_tag) + if tag_name == TAG_NAMES.SERVO_SKULL_TAG and mod.arm_skull_mark_check then + mod:arm_skull_mark_check(target_unit) + end end return true end diff --git a/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua b/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua index 669d553..ea63276 100644 --- a/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua +++ b/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua @@ -223,6 +223,29 @@ function mod:is_servo_skull_ready_to_shoot() return state == servo_skull_states.following or state == servo_skull_states.following_shooting or state == servo_skull_states.following_shooting_ability end +function mod:debug_servo_skull_state() + local companion_spawner_extension = context.companion_spawner_extension + local companion_unit = companion_spawner_extension and companion_spawner_extension:spawned_unit_lookup(special_rules.cryptic_servo_skull_hack) + if not companion_unit then + return "no_unit" + end + + local game_session = Managers.state.game_session:game_session() + local game_object_id = Managers.state.unit_spawner:game_object_id(companion_unit) + return tostring(get_game_object_field(game_session, game_object_id, "state")) +end + +local skull_mark_check = nil +function mod:arm_skull_mark_check(unit) + if not mod_settings.debug_mode or not unit then + return + end + + local unit_data_extension = ScriptUnit_extension(unit, "unit_data_system") + local breed = unit_data_extension and unit_data_extension._breed + skull_mark_check = { unit = unit, ttl = 0.6, n = breed and breed.name or "?" } +end + function mod:is_noospheric_command_boost_breed_valid(target_unit) local unit_data_extension = ScriptUnit_extension(target_unit, "unit_data_system") local breed_data = unit_data_extension and unit_data_extension._breed @@ -368,6 +391,17 @@ end local hack_interval = 0 local hack_check = nil function mod:auto_hack(dt, t, fixed_frame) + if skull_mark_check then + skull_mark_check.ttl = skull_mark_check.ttl - dt + if skull_mark_check.ttl <= 0 then + local smart_tag_system = context.smart_tag_system + local tag = smart_tag_system and smart_tag_system:unit_tag(skull_mark_check.unit) + local accepted = tag and tag._template and tag._template.name == TAG_NAMES.SERVO_SKULL_TAG + mod:diag(string.format("OMNI-CONFIRM skull-mark %s accepted=%s alive=%s state=%s", skull_mark_check.n, tostring(accepted == true), tostring(HEALTH_ALIVE[skull_mark_check.unit] == true), mod:debug_servo_skull_state())) + skull_mark_check = nil + end + end + if not mod_settings.auto_hack or (mod_settings.disable_auto_hack_for_noospheric_command and context.has_noospheric_command) or context.class_name ~= "cryptic" or not context.has_servo_skull then return end