(RESOLVED)[XP]Guarding Actors Guard Before Others Act?

Started by Untitled, December 22, 2011, 02:09:17 am

Previous topic - Next topic

Untitled

December 22, 2011, 02:09:17 am Last Edit: December 23, 2011, 02:30:26 am by Untitled
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!

Fantasist

The method you're looking for is make_action_orders in Scene_Battle 4. Just do your sorting there and you'll be good.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Untitled

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

Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Untitled

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  :^_^':