Script to change action order calculations for Action Times+?

● ARCHIVED · READ-ONLY
Started by TheHonorableRyu 5 posts View original ↗
  1. Hey all, I'm new to Ace and looking for some scripting help.

    In my game some classes and enemies will have Action Times+ applied so that they can take two or more actions per round in battle. However, it looks like some scripting is necessary to get the battle engine to determine the order in which these multiple actions are performed in the way that I would like it.

    Basically I want the battle engine to apply the "Speed" adjustment (the one under the Invocation window for each Skill in the database, which can be adjusted higher or lower) of each selected skill independently when determining the action orders in battle, such that the actions could come out at separate times during the battle within the same turn, allowing other battlers to perform actions in between.

    For example, let's say that a party member or enemy with Action Times+ 100% selects two skills, one with Speed 0 and the other with Speed -25. I want it so that the skill with Speed 0 would come out normally in the action order (according to the battler's Agility parameter with no Speed adjustment) and the skill with Speed -25 could come out later, with other battlers potentially performing their actions in between.

    By the default the engine makes both of the battler's actions come out one immediately following the other (with no other battlers ever performing actions in between), and it apparently determines the action order by applying only the lowest Speed rating among the selected actions for that battler. So if a batter with Action Times+ selects, say, a -25 Speed skill and a +25 Speed skill for that turn (or even Guard at the default +2000 Speed adjustment), both actions will be performed in succession as if the battler had -25 Speed applied to both actions. I expected that the default engine might add the Speed adjustments together or give priority to the Speed rating of the skill that was selected first or last, but instead it applies the lowest Speed adjustment to both. Based on some simple play testing, this appears to hold true regardless of whether the battler is an enemy or party member, and regardless of what order the player selects the actions for the battler from the menu screens.

    I know a little bit of programming but not enough about RGSS3 to figure out the most elegant way to adjust this, so any help would be appreciated and help me learn as well.

    Thanks!
  2. Bump.

    Is there a relatively simple way of doing this in RGSS3? Or would it require some drastic structural changes to the default battle engine?
  3. Is there a relatively simple way of doing this in RGSS3? Or would it require some drastic structural changes to the default battle engine?
    No. By default, the turn order and actions have no relations between them.

    The order is based only on the battlers, no matter how many actions they will take.
  4. Alright, thank you very much for your response.

     

     

    Since it looks like getting the actions come out separately isn't a likely option, I decided that it still would be worthwhile to average each battler's action speeds among their selected actions when determining their order, rather than the default procedure which sets each battler's order to the lowest action speed.

     

    So I tried overriding the following in lines 314-321 of Game_Battler...

    #-------------------------------------------------------------------------- # * Determine Action Speed #-------------------------------------------------------------------------- def make_speed @speed = @actions.collect {|action| action.speed }.min || 0 end

    ...with this:

    Code:
     #--------------------------------------------------------------------------  # * Determine Action Speed  #--------------------------------------------------------------------------  def make_speed    @speedtemp1 = @actions.collect {|action| action.speed }.sum || 0    @speedtemp2 = @actions.collect {|action| action.speed }.length || 0    @speed = @speedtemp1/@speedtemp2 || 0  end
    It seems to be working in play-testing. Is there a smarter way of scripting it, or does this look fine?
  5. I think you got it fine. The default method use the speed of the slowest action only.
     
    Just one thing. By default, there's no method "sum" for arrays. So i suppose you're using a script that provide this method.
    Coincidentially, my Basic Module do offer this method. If you're using my basic module you have a better option
     
    inestad of:

    @speedtemp1 = @actions.collect {|action| action.speed }.sum || 0@speedtemp2 = @actions.collect {|action| action.speed }.length || 0@speed = @speedtemp1/@speedtemp2 || 0 
    You can use

    @speed = @actions.collect {|action| action.speed }.average || 0
    Ignore this if you're not using my Basic Module