I don't think you need a trigger, you can handle it from the same script that the party generates, in this way you avoid creating new global variables, which is what you would need if it were a trigger that handled it, or so I think.Cozur 说:I need a trigger
Something fast and as a prototype and example. You will have to adapt it to your script, for example, assigning a correct name to the variable 'party_no'.
插入代码块:
#Set a random name for the indicated troop
(assign, ":custom_troop", "trp_custom_bandit"), #select troop
(assign, ":continue", 0),
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(try_for_range, ":i_stack", 0, ":num_stacks"),
(party_stack_get_troop_id, ":stack_troop", ":party_no", ":i_stack"),
(eq, ":stack_troop", ":custom_troop"),
(assign, ":continue", 1),
(assign, ":num_stacks", 0), #break loop
(try_end),
(try_begin),
(eq, ":continue", 1),
(str_store_string, s1, "@_default_name"),
#assign random name
(store_random_in_range, ":r", 0, 3),
(try_begin),
(eq, ":r", 0),
(str_store_string, s1, "@custon_name_1"),
(else_try),
(eq, ":r", 1),
(str_store_string, s1, "@custon_name_2"),
(else_try),
(eq, ":r", 2),
(str_store_string, s1, "@custon_name_3"),
(try_end),
#set name
(troop_set_name, ":custom_troop", s1),
#reload variable
(assign, ":continue", 0),
(try_end),





