Thi is the first time that I have used any of the |repeat_for_... concepts. And I failed. I am trying to make it so that the repeat_for_troops only shows the troop stacks in the current center using the following code:
Only problem is that it shows all the troops in the game. So I am clearly stuffing up somewhere. Help would be really apreciated. Thanks.
插入代码块:
[anyone|plyr|repeat_for_troops, "companion_officer_task_train_2",
[(store_repeat_object, ":troop"),
(party_get_num_companion_stacks, ":no_stack", "$current_town"),
(try_for_range, ":i_stack", 0, ":no_stack"),
(party_stack_get_troop_id, ":stack_troop", "$current_town", ":i_stack"),
(eq, ":stack_troop", ":troop"),
(assign, ":continue", 1),
(try_end),
(eq, ":continue", 1),
(str_store_troop_name_plural, s1, ":troop"),],
"Train the {s1}", "companion_officer_task_train_accept",
[(store_repeat_object, ":troop"),
(party_set_slot, "$current_town", slot_town_train_troop, ":troop"),]],

