Is there any way to iterate through, and perform some action on, a stack of troops in your party?
I'm used to C/C++ so not being able to directly access, from what I've tried so far, a specific array index is killing me.
This is what I've tried so far, but it doesn't work so any help would be appreciated immensely.
( "foo",
[
( party_get_num_companion_stacks, ":num_stacks", "p_main_party" ), # get how many groups of troops we have
( try_for_range, ":curr_stack", 0, ":num_stacks" ), # iterate through the stacks
( party_stack_get_size, ":stack_size", "p_main_party", ":curr_stack" ), # get size, how many troops in it, of current stack
( party_stack_get_troop_id, ":curr_troop_id", ":curr_stack" ), # get the troop id for what's in current stack
( try_begin ),
( neq|troop_is_hero, ":curr_troop_id" ), # make sure these troops aren't heroes
( try_for_range, ":curr_stack_troop", 0, ":stack_size" ), # iterate through the current stack of troops
( eq, ":curr_troop_id", "trp_swadian_recruit" ), # is the current troop a swadian recruit? Used for testing
( troop_clear_inventory, ":curr_troop_id" ), # clear the troops inventory. Used for testing
( troop_add_item, ":curr_stack_troop", "itm_gold_tourney_helmet", 0 ), # give current troop a gold tourney helm. Used for testing
( troop_equip_items, ":curr_troop_id" ), # make current troop wear it. Used for testing
( end_try ), # end of second try_for_range
( end_try ), # end of try_begin
( end_try ), # end of first try_for_range
]),