Loader
logo

Follow-up: Bunch of warnings at arena melee fights

Started by tos1, April 15, 2024, 07:02:09 PM

Previous topic - Next topic
Related topic (v8.* but inherited to v9.3):
"Re: Unmotivated practice melee fighters in arenas" by me

Warning-lines displayed at the beginning of melee fight at arenas. They block the normal message for 20 - 30 seconds.
----
SCRIPT WARNING ON OPCODE 505: Invalid Agent ID: 0; LINE NO 6:
At Mission Template mst_arena_melee_fight trigger no: 33 consequences.
At Mission Template mst_arena_melee_fight trigger no: 33 consequences.
At Mission Template mst_arena_melee_fight trigger no: 33 consequences.
:
----

As I wrote in the self-reply to the thread above on 2023-12-12, it is too early to set all 40 agent slots before they spawn.

I experimentally removed the try-block and moved the "agent_set_slot" operation just before the "try_end" of the next trigger 34's exit, and there seems to be no problem. This prevents the warning from appearing and allows normal messages to be displayed without delay.

(Please note that this does not correct the "unmotivated fighters" I pointed out in the topic above.)

My hand-disassembly:
AWoIaF 9.3  mission_templates.txt  mst_arena_melee_fight

#---- trigger 33 (count from 0)
0.000000, 0.000000, ti_once,
[],
[
eq "$g_mt_mode" 1       # 31 2 144115188075856304 1
assign "$g_arena_training_max_opponents" 40     # 2133 2 144115188075856710 40
assign "$g_arena_training_num_agents_spawned" 0 # 2133 2 144115188075856708 0
assign "$g_arena_training_kills" 0      # 2133 2 144115188075856709 0
assign "$g_arena_training_won" 0        # 2133 2 144115188075856711 0
###################### Remove 3 lines below to fix the warning.
try_for_range ":L0" 0 "$g_arena_training_max_opponents" # 6 3 1224979098644774912 0 144115188075856710
  agent_set_slot ":L0" 7 0      # 505 3 1224979098644774912 7 0
try_end # 3 0
######################
call_script "script_music_set_situation_with_culture" 131072    # 1 2 936748722493063661 131072
],

#---- trigger 34 (count from 0)
ti_on_agent_spawn, 0.000000, 0.000000,
[
eq "$g_mt_mode" 1   # 31 2 144115188075856304 1
],
[
store_trigger_param_1 ":L0"   # 2071 1 1224979098644774912
agent_get_troop_id ":L1" ":L0"   # 1718 2 1224979098644774913 1224979098644774912
try_begin   # 4 0
  eq ":L1" "trp_player"[Player]   # 31 2 1224979098644774913 360287970189639680
  agent_set_team ":L0" 6   # 1771 2 1224979098644774912 6
else_try   # 5 0

:

  agent_set_team ":L0" ":L3"   # 1771 2 1224979098644774912 1224979098644774915
  val_add "$g_arena_training_num_agents_spawned" 1   # 2105 2 144115188075856708 1
  ###################### Add a line below. Probably here is the right place to initialize the slot.
  agent_set_slot ":L0" 7 0      # 505 3 1224979098644774912 7 0
  ######################
try_end   # 3 0
],

Quick Reply

Note: this post will not display until it has been approved by a moderator.

Name:
Email:
Shortcuts: ALT+S post or ALT+P preview