Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Script Request: Unite attack (Solved)

Script Title:
A Unite/combination attack

RMXP or RMVX:
RMXp

Detailed Description:
I'm looking for a script (simple one please) that will allow two or more characters to preform a unite attack. If anyone here has ever played Suikoden, I'm asking for something very much like the rune combination attacks. Another example is:
Char1 casts fire
Char2 casts wind
Combo spell is cast instead: fireblade


Screen shots:
http://www.youtube.com/watch?v=eknQpws2Pak The very beginning of the video shows a character casting two rune spells to form a new more powerful one. That's the one I am going for.

Thank you very much for any and all help given!
 
Try looking for KGC Software scripts. They made that script a few years ago but it's hard to find when you don't have the link to their website.

I'll come back with the link when I'll have it.

-Dargor
 
Hmmm...

I don't think this would be too hard to do from scratch in a few minutes.

In the make_action_battlers method or whatever it is, check to see if skills match. If they do, create a dummy battler and put that battler in the action list.

Let me see what I can't come up with. You'll have to let me know how it works, because I don't rmxp where I am at.
 
@ Dargor: Still looking for it, but again thanks for pointing me in the right direction. Was kinda running around like a chicken without a head. :haha: But having a bunch of hits on google, so its only a matter of time!

@SephirothSpawn: Your scripts are legendary, and I be happy to use it ^_^

Again to both of you thanks for your help, believe it or not its the last script i needed for my 2nd game >_<
 
Let me know how this works:
Code:
module ConnectedAttacks

  # [skill_id, ...] => combined_skill_id, ...

  Attack_List = {[7, 57] => 60}

  

  def self.connected_battlers

    used_skills = {}

    for actor in $game_party.actors

      action = actor.current_action

      next if action.kind != 1

      if $data_skills[action.skill_id] != nil

        target_index = action.target_index

        unless used_skills.has_key?(target_index)

          used_skills[target_index] = {}

        end

        used_skills[target_index][actor.id] = action.skill_id

      end

    end

    connected_battlers = []

    Attack_List.each do |req_skills, skill_id|

      used_skills.each do |target_index, skills|

        if skills.values.include_all?(req_skills)

          actor_list = []

          req_skills.each do |s|

            index = skills.index(s)

            skills.delete(s)

            actor_list << index

          end

          connected_battlers << Battler.new(actor_list, skill_id, target_index)

        end

      end

    end

    return connected_battlers

  end

end

 

class ConnectedAttacks::Battler < Game_Battler

  attr_reader :actor_list

  def initialize(actor_list, skill_id, target_index)

    @actor_list = actor_list

    super()

    @current_action.kind = 1

    @current_action.skill_id = skill_id

    @current_action.target_index = target_index

  end

  def index

    return nil

  end

  for i in ['base_str', 'base_dex', 'base_agi', 'base_int', 'base_atk', 'hit']

    s  = "def #{i};"

    s += "  n = 0;"

    s += "  @actor_list.each {|id| n += $game_actors[id].#{i}};"

    s += "  return n / @actor_list.size;"

    s += "end;"

    eval s

  end

  def skill_can_use?(skill_id)

    return true

  end

  def maxsp

    return 9999

  end

  def sp

    return 9999

  end

  alias_method :seph_connnectattacks_gmbtlr_isa?, :is_a?

  def is_a?(cn)

    if cn == Game_Actor

      return true

    end

    return seph_connnectattacks_gmbtlr_isa?(cn)

  end

end

 

class Game_Battler

  alias_method :seph_connnectattacks_gmbtlr_se, :skill_effect

  def skill_effect(user, skill)

    effective = seph_connnectattacks_gmbtlr_se(user, skill)

    if user.is_a?(ConnectedAttacks::Battler)

      for id in user.actor_list

        actor = $game_actors[id]

        skill = $data_skills[actor.current_action.skill_id]

        actor.sp -= skill.sp_cost

      end

    end

    return effective

  end

end

 

class Scene_Battle

  alias_method :seph_connnectattacks_scnbtl_mao, :make_action_orders

  def make_action_orders

    seph_connnectattacks_scnbtl_mao

    battlers = ConnectedAttacks.connected_battlers

    battlers.each do |cb|

      @action_battlers.each do |battler|

        if battler.is_a?(Game_Actor) && cb.actor_list.include?(battler.id)

          @action_battlers.delete(battler)

        end

      end

      @action_battlers << cb

    end

    @action_battlers.sort! {|a,b| b.current_action.speed - a.current_action.speed }

  end

end

 

class Array

  def include_all?(array)

    array.each {|i| return false unless include?(i)}

    return true

  end

end

Paste that below Scene_Battle.

Now in Scene_Battle 4, find this block:
Code:
    if @active_battler.index == nil

      return

    end
Change it to
Code:
    if @active_battler.index == nil && @active_battler.is_a?(ConnectedAttacks::Battler) == false

      return

    end

You only need to setup the Attack_List = {[7, 57] => 60}.

You need to fill that list with [skill_id, ...] => combined skill

With what I gave you in the example, is when skill 7 and 57 are both used, skill 60 is used instead (so arshes first skill whatever it is and fire should cast arshes final skill).

As of now, the attributes of the "dummy" battler that cast the spell is the average of the actors using the spell. The target selected must be the same. Cast skills 7 on a different target than 57 will result in 2 different skills being used instead of the combined skill.

Actors still lose sp equal to their original skills sp cost.


Again, let me know if it doesn't work.
 
Dargor":1ettb0p3 said:
Yes, they have a section for XP and their script database is bigger for XP than for VX. But I can't find it :/

I just found it:

The script: http://f44.aaa.livedoor.jp/~ytomy/tkool ... tion_skill
The site: http://f44.aaa.livedoor.jp/~ytomy/tkool ... st_xp.html

Sweet deal dood! Thanks so much! I'ma looking over the script now, seeing if it can go from Japanese to English. Or maybe I can just plug and play? In any case I'm going to give it a go and thank you very much for you help!

Edit: I also wanted to say I just got done trying the Ks script. It's very much plug and play so far, with no problems. Thanks for pointing it out!
 
Edit:
@ SephirothSpawn: Hey I just tried out your script, and everything works well save for one thing. Think the best way I can describe it is to use this example.

Battle commands entered:
Char1: Casts Earthquake
Char2: Casts Final flame

What happens:
Char1: casts earthquake
Scorched Earth (the combo earth and fire spell) is cast.

Any way to stop the 1st spell being cast? Or manybe I did something wrong?
 
Ok. Let me test this now.

O only changed 1 thing, but it seems to work for me:
[rgss]module ConnectedAttacks
 
  Attack_List = {[7, 57] => 60}
 
  def self.connected_battlers
    used_skills = {}
    for actor in $game_party.actors
      action = actor.current_action
      next if action.kind != 1
      if $data_skills[action.skill_id] != nil
        target_index = action.target_index
        unless used_skills.has_key?(target_index)
          used_skills[target_index] = {}
        end
        used_skills[target_index][actor.id] = action.skill_id
      end
    end
    connected_battlers = []
    Attack_List.each do |req_skills, skill_id|
      used_skills.each do |target_index, skills|
        if skills.values.include_all?(req_skills)
          actor_list = []
          req_skills.each do |s|
            index = skills.index(s)
            skills.delete(s)
            actor_list << index
          end
          connected_battlers << Battler.new(actor_list, skill_id, target_index)
        end
      end
    end
    return connected_battlers
  end
end
 
class ConnectedAttacks::Battler < Game_Battler
  attr_reader :actor_list
  def initialize(actor_list, skill_id, target_index)
    @actor_list = actor_list
    super()
    @current_action.kind = 1
    @current_action.skill_id = skill_id
    @current_action.target_index = target_index
  end
  def index
    return nil
  end
  for i in ['base_str', 'base_dex', 'base_agi', 'base_int', 'base_atk', 'hit']
    s  = "def #{i};"
    s += "  n = 0;"
    s += "  @actor_list.each {|id| n += $game_actors[id].#{i}};"
    s += "  return n / @actor_list.size;"
    s += "end;"
    eval s
  end
  def skill_can_use?(skill_id)
    return true
  end
  def maxsp
    return 9999
  end
  def sp
    return 9999
  end
  alias_method :seph_connnectattacks_gmbtlr_isa?, :is_a?
  def is_a?(cn)
    if cn == Game_Actor
      return true
    end
    return seph_connnectattacks_gmbtlr_isa?(cn)
  end
end
 
class Game_Battler
  alias_method :seph_connnectattacks_gmbtlr_se, :skill_effect
  def skill_effect(user, skill)
    effective = seph_connnectattacks_gmbtlr_se(user, skill)
    if user.is_a?(ConnectedAttacks::Battler)
      for id in user.actor_list
        actor = $game_actors[id]
        skill = $data_skills[actor.current_action.skill_id]
        actor.sp -= skill.sp_cost
      end
    end
    return effective
  end
end
 
class Scene_Battle
  alias_method :seph_connnectattacks_scnbtl_mao, :make_action_orders
  def make_action_orders
    seph_connnectattacks_scnbtl_mao
    battlers = ConnectedAttacks.connected_battlers
    battlers.each do |cb|
      cb.actor_list.each {|i| @action_battlers.delete($game_actors)}
      @action_battlers << cb
    end
    @action_battlers.sort! {|a,b| b.current_action.speed - a.current_action.speed }
  end
end
 
class Array
  def include_all?(array)
    array.each {|i| return false unless include?(i)}
    return true
  end
end
[/rgss]
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top