Jump to content
Raizen

Akea Active Time Battle

Recommended Posts

Akea Active TIme Battle

 
 
Compatible with: RMVXAce
Compatibility :good
Usage difficulty: easy
 

Usage Condition


 Can be modified and distributed as long as the credits remain
  for portuguese users: Here
 

Script functions

 
The script modifies the basic turn based system for an active time based, this affects any system that was made on Scene_Battle.

- Allows total configuration of ATB formulas and Flee speed
- Allows to modify refresh rate
- Allows skills/items to have an optional atb cost(if you do not want it to deplete the whole bar)
- Allows the atb to be by images(for those who uses images instead of windows)
- adds the flee function similar to games with the ATB system, where you need to keep a configured button pressed to run.
- Obs: Any skill that either raises ou depletes a parameter(in general speed), from the formula, will change how fast will be the atb bar, so you can create skills to make either faster or slower.
 
 

Script

 
http://pastebin.com/gRZf44ZP

 

Images and Videos

 
No animated battlers




With animated battlers






 

Credits

 
 
 Raizen for the script Edited by Raizen884

Share this post


Link to post
Share on other sites

Forgive my newbliness.

 

I'm having trouble getting your script to work, though it seems to be EXACTLY what I'm looking for.

 

As soon as I enter a battle, the playtest crashes with the message "Unable to find file: Graphics/Akea/base_input_hud"

 

I've tried setting "Allow_Flee = false" and "Has_Ator = false" because I am not using battlers and planned on using the default "Escape" function.

 

Am I doing something wrong?

 

Jinumon

Share this post


Link to post
Share on other sites

Forgive my newbliness.

 

I'm having trouble getting your script to work, though it seems to be EXACTLY what I'm looking for.

 

As soon as I enter a battle, the playtest crashes with the message "Unable to find file: Graphics/Akea/base_input_hud"

 

I've tried setting "Allow_Flee = false" and "Has_Ator = false" because I am not using battlers and planned on using the default "Escape" function.

 

Am I doing something wrong?

 

Jinumon

Graphics xD, just put these 2 like this, :)

# Image that will be in front of the flee_bar

Flee_Back = ""

 

# Bar Image

Flee_Bar = ""

Share this post


Link to post
Share on other sites

Using your script, I'm not given the option to "Engage" or "Escape." I assume that's because you include "Flee" in your script. Is there any way for me to get your "Flee" command to work if I'm not using Battlers? Setting "Allow_Flee = true" with Flee_Back = "" and Flee_Bar = "" causes the game to crash whenever I attempt to Flee from a fight using the Shift Key.

 

Also, is there a way to make equipment directly affect ATB without affecting Agility? (i.e. Heavy Weapons gain ATB 1/2 as quickly)

 

Thanks for all your patience :P

 

Jinumon

Edited by Jinumon

Share this post


Link to post
Share on other sites

Using your script, I'm not given the option to "Engage" or "Escape." I assume that's because you include "Flee" in your script. Is there any way for me to get your "Flee" command to work if I'm not using Battlers? Setting "Allow_Flee = true" with Flee_Back = "" and Flee_Bar = "" causes the game to crash whenever I attempt to Flee from a fight using the Shift Key.

 

Also, is there a way to make equipment directly affect ATB without affecting Agility? (i.e. Heavy Weapons gain ATB 1/2 as quickly)

 

Thanks for all your patience :P

 

Jinumon

Hey, sorry for long time to answer xD.

 

Here goes, first of, you need to turn off the Has_Actor,

 

# Select, in case you use a sistem that visualizes the battlers,
# DO NOT set true if you do not use, if you use, you can either choose
# for the script to set the bar position according to the battler(true),
# or according to the screen(false)
Has_Ator = false

I should've put that automatically, but I wanted to who had an actor also have the choice to use it as if they where without it xD... But turning that off will already get rid of the error.

 

Second, the formula to fleeing, since you do not use flle bars, put this

# Escape Formula
  def self.flee_formula(actor, enemy)
    1
  end

This will make 100% chance to flee WHEN the ATB bar is complete, I guess maybe that works for you, sorry for getting rid of the Fight/Run :/, but I found it easier to manage, 

 

Buuut, I think it would be WAY better to deactivate the flee I use on ATB script, and add a command Run for each character, and on that command you put the Run,(I think it would be pretty easy to do that)

 

 

Third and last x).

 

you can make ANYTHING affect the ATB bar speed, I mean ANYTHING xD, BUUUT you will need a script request to someone do how you want to manage the atb bar, this is the part on formulas to do that.

# Atb speed, remember that 1000 is the maximum atb!
  def self.atb_formula(subject)
    30 + subject.param(6)/5
  end

this is where any beginner scripter can manipulate the atb bar speed, for the example you want, you could just add a notetag on the item written:

<atb_change 50>  

 

and put the formula like this.

  def self.atb_formula(subject)
    mult = 100
    if subject.actor?
      note = /<atb_change *(\d+)?>/i
      subject.equips.each{|equip| 
        mult = $1.to_i * mult/100 if equip && equip.note =~ note }
    end
    (30 + subject.param(6)/5) * mult/100
  end

 

That will make the atb go depending on the equip hes using putting that notetag <atb_change x>  on the equipment xD.

 

 

You can use the above code I made, but it was to show that if you do need different formulas, you can ask here in script requests for example to other scripters make formulas for you :)

Edited by Raizen

Share this post


Link to post
Share on other sites

Okay, Raizen. I swear this is the last question....

 

Sorry.

 

So I put in this script:

  def self.atb_formula(subject)
    mult = 100
    if subject.actor?
      note = /<atb_change *(\d+)?>/i
      subject.equips.each{|equip|
        mult = $1.to_i * mult/100 if equip && equip.note =~ note }
    end
    (30 + subject.param(6)/5) * mult/100
  end

 

And while I was able to increase the ATB and set it to a particular speed with <atb_change x> and <atb_change +x>, I wasn't able to decrease it by a specified amount. It's important in my game for ATB effects to stack. For example, Machine Guns give a penalty to ATB of -20% because they're big and bulky. Heavy Armor, while good at stopping damage, gives another -20% penalty to ATB because it's hard to move in it.

 

If I have script tags on each piece of equipment, won't they contradict each other? Why can't I reduce it with an <atb_change -x>? Is it possible the "mult/100" is rounding everything greater than 0 to a value of 1?

 

Just so you know I'm not contacting you with this lightly. I played with the script for at least an hour trying to get it to work.

 

Sorry I'm such a hassle. I've tried to learn scripting in the past but I suck at it.

 

Jinumon

Share this post


Link to post
Share on other sites

oh, don't put + and - on the notetag xD, I made it to be in %.

 

Example.

 

<atb_change 50> will go 50% the speed, so 2x slower.

 

<atb_change 200> will go 200% the speed, so 2x faster. And it stacks, if you have...

 

<atb_change 50> on a weapon, and <atb_change 200> on an armor, it will go the same speed as without both, as if you have.

<atb_change 50> and another <atb_change 50> it will go 4x slower.

 

 

So the 20% penalty, will just be.

<atb_change 80>

 

Oh and the formula, put this instead, the way it was before, it wouldn't stack the effects.

 

  def self.atb_formula(subject)

    mult = 100.0

    if subject.actor?

      note = /<atb_change *(\d+)?>/i

      subject.equips.each{|equip|

        mult = $1.to_i * mult/100 if equip && equip.note =~ note }

    end

    (30 + subject.param(6)/5) * (mult/100)

  end

Edited by Raizen

Share this post


Link to post
Share on other sites

Hey. Thread resurrection time.

 

Question:

 

How does this script interact with Turns and Actions for the duration of States? Is it possible to make an ability that lasts until the end of a particular Battler's turn?

 

Thanks again, Raizen. I really appreciate all the effort you've gone through to help me incorporate your script into my game.

 

Jinumon

Share this post


Link to post
Share on other sites

Hey. Thread resurrection time.

 

Question:

 

How does this script interact with Turns and Actions for the duration of States? Is it possible to make an ability that lasts until the end of a particular Battler's turn?

 

Thanks again, Raizen. I really appreciate all the effort you've gone through to help me incorporate your script into my game.

 

Jinumon

Implementation wise, it completely uses the default codes, meaning the state durations in turns and actions work the exact same way as the default battle system.

 

What really changed in this script is how the battle turn works. Just add 2 battle events with condition as "When the end of the turn" and "Turn No. 1 * X" respectively, Event Command as "Show Text" showing "Turn End" and "Turn Start" respectively, and Span as "Turn" for both. Then you'll probably know what I'm talking about lol

 

The below lists all the changes to how the battle turn works in this script:

- The battle turn start will be triggered, along with the battle turn count increase, whenever a battler's about to execute actions.

- The battle turn end will be triggered, along with the regenerations and state/buff turns updates, whenever a battler's finished executing actions but no other battler's about to execute ones immediately afterwards.

Technically speaking:

 

 

 

 

  def call_update_atb_bar
    return if (!@actor_atb_array.empty? && !Input.press?(Akea_Active_Battle::Flee_Input)) || BattleManager.has_action?
    $game_troop.alive_members.each{|member|
    member.atb = increment_atb(member)
    if member.atb >= 1000
      @enemy_atb_array = $game_troop.members.index(member)
       BattleManager.add_enemy_order(@enemy_atb_array) 
       Akea_Active_Battle.atb_formula(member)
       BattleManager.input_start
      turn_start
      return
    end
    }
    return unless @actor_atb_array.empty?
    $game_party.alive_members.each{|member|
    member.atb = increment_atb(member)
    if member.atb >= 1000
      @actor_atb_array << $game_party.members.index(member)
      @status_window.refresh_atb
      start_party_command_selection
      return
    end
    }
    @status_window.refresh_atb
  end
  def start_party_command_selection
    unless scene_changing?
      refresh_status
      @status_window.unselect
      @status_window.open
      if BattleManager.input_start
        @actor_command_window.close
        @party_command_window.setup
      else
        @party_command_window.deactivate
        turn_start
      end
    end
  end
  def start_actor_command_selection
    return turn_start if BattleManager.has_action?
    akea_atb_start_actor_command_selection
  end
  def turn_start
    @party_command_window.close
    @actor_command_window.close
    @status_window.unselect
    @subject =  nil
    BattleManager.turn_start
    @log_window.wait
    @log_window.clear
  end
  def self.turn_start
    @phase = :turn
    clear_actor
    $game_troop.increase_turn
    make_action_orders
  end
  def update
    super
    if BattleManager.in_turn?
      process_event
      process_action
    end
    BattleManager.judge_win_loss
  end
  def process_action
    return if scene_changing?
    if !@subject || !@subject.current_action
      @subject = BattleManager.next_subject
    end
    return turn_end unless @subject
    if @subject.current_action
      @subject.current_action.prepare
      if @subject.current_action.valid?
        @status_window.open
        execute_action
      end
      @subject.remove_current_action
    end
    process_action_end unless @subject.current_action
  end
  def self.next_subject
    loop do
      battler = @action_battlers.shift
      return nil unless battler
      next unless battler.index && battler.alive?
      return battler
    end
  end
  def turn_end
    if !@actor_atb_array.empty? && $game_party.members[@actor_atb_array.first].dead?
      @actor_atb_array.shift 
      @back_flee_atb.opacity = 0
      @bar_flee_atb.opacity = 0  
      @start_flee = true
    end
    akea_atb_turn_end
  end
  def turn_end
    all_battle_members.each do |battler|
      battler.on_turn_end
      refresh_status
      @log_window.display_auto_affected_status(battler)
      @log_window.wait_and_clear
    end
    BattleManager.turn_end
    process_event
    start_party_command_selection
  end
  def on_turn_end
    @result.clear
    regenerate_all
    update_state_turns
    update_buff_turns
    remove_states_auto(2)
  end
  def self.turn_end
    @phase = :turn_end
    @preemptive = false
    @surprise = false
  end

 

 

Right before a battler executes actions, turn_start will always be called, setting @phase as :turn, thus causing BattleManager.in_turn? to return true.

When process_action is called, it'll execute actions of @subject if @action_battlers has an alive battler, or call turn_end otherwise.

@action_battlers will have an alive battler right before that battler executes actions, and it'll have nothing right after so.

After a battler has executed actions, the battle will proceed to the next frame.

process_action will still be called unless another or the same battler can act, causing turn_end to be called as now @action_battlers contains nothing, causing BattleManager.next_subject to return nil.

When on_turn_end is called, update_state_turns and update_buff_turns are also called, causing possibly erratic behavior on state and/or buff/debuff turns.(It also causes battle events triggered on turn/turn end to have possibly erratic behavior)

Also, right before executing battler's actions, turn_start will be called, casuing the turn count to be increased. This effectively means each turn can contain at most 1 battler action executions(1 battler might execute many actions).

As mentioned before, the turn_end behavior can be erratic(sometimes called frequently, sometimes called rarely), it won't be always in sync with turn_start. Normally, after calling turn_start, turn_end will be called before calling turn_start again, and turn_start will be called before calling turn_end again. Here, that assumption can be broken in some cases.

 

 

Edited by DoubleX

Share this post


Link to post
Share on other sites

Implementation wise, it completely uses the default codes, meaning the state durations in turns and actions work the exact same way as the default battle system.

 

What really changed in this script is how the battle turn works. Just add 2 battle events with condition as "When the end of the turn" and "Turn No. 1 * X" respectively, Event Command as "Show Text" showing "Turn End" and "Turn Start" respectively, and Span as "Turn" for both. Then you'll probably know what I'm talking about lol

 

The below lists all the changes to how the battle turn works in this script:

- The battle turn start will be triggered, along with the battle turn count increase, whenever a battler's about to execute actions.

- The battle turn end will be triggered, along with the regenerations and state/buff turns updates, whenever a battler's finished executing actions but no other battler's about to execute ones immediately afterwards.

 

It's official, X. I'm giving you a credit in my game. You better stop being so helpful or I'm gonna try to marry you regardless of gender or sexual orientation.

 

Jinumon

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×