I always found it annoying how in RMXP, actors and enemies will Defend whenever their speed tells them to, but that the defending applies to the whole turn. I tried to fix this, but I don't even know how turn order is determined :^_^':
So my request is: Could someone make an edit to the default Scene_Battle4 script (or whatever else is necessary) to make actors using Defend act before any other actor?
Thanks!
The method you're looking for is make_action_orders in Scene_Battle 4. Just do your sorting there and you'll be good.
Yeah, I tried a few things with that. But how do I sort?
I think most of what I tried is similar to
# Decide action speed for all
for battler in @action_battlers
battler.make_action_speed
end
#IMPORTANT PART STARTS HEEEEEERE
if @active_battler.current_action.basic == 1
battler.make_action_speed = battler.make_action_speed + 200
end
#MY FAIL EDITS END HEEEEEERE
# Line up action speed in order from greatest to least
@action_battlers.sort! {|a,b|
b.current_action.speed - a.current_action.speed }
end
Should be like this:
for battler in @action_battlers
if battler.current_action.basic == 1
battler.current_action.speed += 1000
end
end
I pulled this out of my ass (aka I haven't tested it), but it should work.
Oh, so +=/-= do work? That's great to know.
But the script seems to work like a charm! I had to increase the value, but things make much more sense now. Now to find a good reason to make the player want to defend...
Thanks, though! I'm already crediting you for a bunch of stuff so there's nothing else I can say :^_^':