Change hero order but main hero 1st in caterpillar

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
guo
Metal Slime
Posts: 749
Joined: Fri Dec 04, 2009 9:12 pm

Change hero order but main hero 1st in caterpillar

Post by guo »

Any ideas for this?
You can arrange your party however you wish, but the protagonist is still the lead walkabout in the caterpillar outside of battle.
Short of removing caterpillar and giving all heroes the same walkabout, I can't think of a workaround at this stage outside of extensive before and after battle scripting.
vvight.wordpress.com
User avatar
Taco Bot
Meat, Cheese, and Silicon
Posts: 484
Joined: Fri Jul 18, 2014 12:15 am
Location: Santa Cruz
Contact:

Post by Taco Bot »

Honestly, the best solution I had for a similar problem was to lock the first hero in the first slot (using the "lock hero" function). I haven't really found a place where I'd need to move/remove the main character, so that worked for me.
Sent from my iPhone
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Is it really necessary that the player can change the leader's position in-battle? Otherwise, as Taco Bot said, you can just lock the leader.
Or maybe you want the 'Team/Order' menu to affect in-battle positions but not caterpillar positions? That definitely requires before/after battle scripts, and you'll also have to go through a script instead of triggering battles directly from textboxes.
Last edited by TMC on Wed Mar 22, 2017 2:00 am, edited 1 time in total.
User avatar
guo
Metal Slime
Posts: 749
Joined: Fri Dec 04, 2009 9:12 pm

Post by guo »

Yes, it's important. Melee attacks in Bale target the closest/first target.
vvight.wordpress.com
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

OK, but is it necessary that the battle and caterpillar parties can be different? If you need that, then you definitely need before- and after-battle scripts. But they won't be that complex.
Last edited by TMC on Tue Mar 28, 2017 12:48 pm, edited 1 time in total.
User avatar
guo
Metal Slime
Posts: 749
Joined: Fri Dec 04, 2009 9:12 pm

Post by guo »

Cool, I'm thinking store the battle order & caterpillar order in variables, then retrieve them when required pre and post battle.
vvight.wordpress.com
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Yes. Here are some scripts which might be what you need. They make the Order menu only affect the in-battle order, not the caterpillar party. But you need to also set up the "battle party order" array in your newgame script, and whenever a hero is added or swapped in/out. And also if you want to let the player use the Team menu to swap in/out. Hmm, maybe there is an easier way.

Code: Select all

script, save party order, global id, begin
  write global(global id, hero by slot(0))
  write global(global id + 1, hero by slot(1))
  write global(global id + 2, hero by slot(2))
  write global(global id + 3, hero by slot(3))
end

script, restore party order, global id, begin
  variable(idx)
  for(idx, 0, 3) do (
    swap by position(readglobal(global id + idx), hero by slot(idx))
  )
end

global variable(100, caterpillar party order)
global variable(104, battle party order)

plotscript, instead of battle, formation, begin
  save party order(@caterpillar party order)
  restore party order(@battle party order)   # Assumes you've previously used "save party order(@battle party order)"
  fight formation(formation)
  restore party order(@caterpillar party order)
end

# Call this script instead of the "Order" builtin menu option
plotscript, instead of order menu, begin
  save party order(@caterpillar party order)
  restore party order(@battle party order)
  order menu
  restore party order(@caterpillar party order)
end
Post Reply