1. Try for agents
I've seen a lot posts that said try_for_agents can burden the engine and cause quite the stutter when there's a lot of npcs. Question is, is it caused just from the try_for_agents operation, or is it caused by the data gathered from the follow up operations (like agent_get_wielded_item etc) under try_for_agents? I got the impression that its the latter because of this code I found from this mod but still unsure because it still iterates every agent in the scene right?
2. agent_set_attack_action
From the enhanced header operation, I read that when agent_set_attack_action's dir value is set to -2 (per 1.153 patch), the agent will cancel their action. But for some reason it doesn't work, was it removed or something?
I've seen a lot posts that said try_for_agents can burden the engine and cause quite the stutter when there's a lot of npcs. Question is, is it caused just from the try_for_agents operation, or is it caused by the data gathered from the follow up operations (like agent_get_wielded_item etc) under try_for_agents? I got the impression that its the latter because of this code I found from this mod but still unsure because it still iterates every agent in the scene right?
common_battle_morale_check = (
0.1, 0, 0, [
(store_mission_timer_a_msec,":mission_time_ms"),
(ge,":mission_time_ms",10000),
(store_div,":mission_time_s",":mission_time_ms",1000),
(store_div,":mission_time_ticks",":mission_time_ms",100),
(try_for_agents, ":agent_no"),
(agent_is_active, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_is_alive, ":agent_no"),
# Only check every 50th agent each tick to reduce stutter
(store_mod,":ticks_mod",":mission_time_ticks",50),
(store_mod,":agent_mod",":agent_no",50),
(eq,":agent_mod",":ticks_mod"),
(call_script, "script_decide_run_away_or_not", ":agent_no", ":mission_time_s"),
(try_end),
], [])
0.1, 0, 0, [
(store_mission_timer_a_msec,":mission_time_ms"),
(ge,":mission_time_ms",10000),
(store_div,":mission_time_s",":mission_time_ms",1000),
(store_div,":mission_time_ticks",":mission_time_ms",100),
(try_for_agents, ":agent_no"),
(agent_is_active, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_is_alive, ":agent_no"),
# Only check every 50th agent each tick to reduce stutter
(store_mod,":ticks_mod",":mission_time_ticks",50),
(store_mod,":agent_mod",":agent_no",50),
(eq,":agent_mod",":ticks_mod"),
(call_script, "script_decide_run_away_or_not", ":agent_no", ":mission_time_s"),
(try_end),
], [])
2. agent_set_attack_action
From the enhanced header operation, I read that when agent_set_attack_action's dir value is set to -2 (per 1.153 patch), the agent will cancel their action. But for some reason it doesn't work, was it removed or something?