DoubleX RMVXA Unison Addon to Yanfly Engine Ace - Ace Battle Engine

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Purpose


Lets users make actor unison skills/items needing multiple actors to use


Notetags

Spoiler


Code:
#  * Skill/Item Notetags:                                                      |
#    1. <unison actors: ids>                                                   |
#       - Sets the list of id of actors needed for the skill/item as ids.      |
#         For example:                                                         |
#         <unison actors: 1> means actor with id 1 is required to use it       |
#         <unison actors: 4, 2> means actors with id 4 and 2 are needed        |
#       - All actors in list ids needs to be in the battle, inputable, able to |
#         use it and pay its cost. They'll all pay the cost after using it.    |
#         Only actors in list x can select it.                                 |
#    2. <unison def rule: rule                                                 |
#       - Sets the rule of setting user's def in the skill/item's damage       |
#         formula as rule, whose symbol is one of those in UNISON_RULES.       |
#       - The symbol of def must be included in UNISON_DEFS                    |
#       - This notetag needs to be written below <unison item: ids> to work.   |
#    3. <unison def actors: ids>                                               |
#       - Sets user's method def in the skill/item's damage formula to use its |
#         unison rule to combine those of actors with id includedin the list   |
#         ids. def needs to be able to take no arguments and return a Numeric  |
#         to work.                                                             |
#         For example:                                                         |
#         <unison atk actors: 1> means the user's atk in its damage formula    |
#         uses thatof actor with id 1                                          |
#         <unison mat actors: 4, 2> means the user's mat in its damage formula |
#         uses mat of actors with id 4 and 2 under the skill/item's unison rule|
#       - The symbol of def must be included in UNISON_DEFS                    |
#       - This notetag needs to be written below <unison item: ids> to work.   |



Configurations

Spoiler


Code:
    # Sets if the battlelog will show all actors involved in the unison skills
    # or items instead of only the one invoking them
    # If SHOW_UNISON_ACTOR_SWITCH_ID is a natural number, the state of switch
    # with id SHOW_UNISON_ACTOR_SWITCH_ID will be used instead
    SHOW_UNISON_ACTOR = true
    SHOW_UNISON_ACTOR_SWITCH_ID = 0

    # Sets the symbol of the rule used for setting the user's methods in the
    # damage formula by using those of the included unison actors
    # or items instead of only the one invoking them
    # It must return a symbol included in UNISON_RULES
    # If UNISON_DEF_RULE_VAR_ID is a natural number, the value of variable
    # with id UNISON_DEF_RULE_VAR_ID will be used instead
    UNISON_DEF_RULE = :avg
    UNISON_DEF_RULE_VAR_ID = 0

    # Implements the unison method rules
    # The unison method value of all unison battlers can be referneced by vals
    # The unison method rule symbol can be referenced by rule
    # It's a method under Game_BattlerBase
    # It must return a real number 
    UNISON_RULES = %Q(
  def unison_rules(vals, rule) # This line shalln't be changed
    if rule == :min
      vals.min
    elsif rule == :avg
      vals.inject(:+) / vals.size
    elsif rule == :max
      vals.max
    else
      0
    end
  end
    )

    # Sets the battler methods to use the unison method rules
    # Its keys must be the battler method name symbols
    # Methods with name method_name will be aliased to method_name_unison
    UNISON_DEFS = {

      # General Form:
      # [:method_class, :super_class] => [
      #   :method_name
      # ]

      [:Game_BattlerBase] => [
        :hp,
        :mp,
        :tp,
        :mhp,
        :mmp,
        :atk,
        :def,
        :mat,
        :mdf,
        :agi
        # Adds new methods here
        
      ],

      [:Game_Actor, :Game_Battler] => [
        :level
        # Adds new methods here
        
      ]

      # Adds new classes here
      

    }



Info

 





New Terms


Unison skill/item - Skill/item needing more than 1 battler to be used


Unison actors - All actors needed for the same unison skill/item


Unison invoker - The unison actor actually selecting and executing the unison skill/item


Unison invokee - Unison actor that's not the unison invoker


Empty action slot - An action slot without a skill/item but can be inputted with a skill/item


Inputted action slot - An action slot with a skill/item inputted


Reserved action slot - An action slot that can't be inputted with a skill/item


Actor inputable check


An actor's inputable if and only if that actor has at least 1 empty action slot. Only empty and inputted action slots can be selected.


Unison skill/item usability check


1. The actor trying to select an unison skill/item must be an unison actor of that skill/item


2. That actor must pass all the ordinary skill/item usability checks


3. For skills, all unison invokees must be movable, without autobattle nor confusion, meet the ordinary skill conditions, have learned that skill, and have at least 1 empty action slot or reserved action slot that is reserved by the currently inputted unison skill in the currently selected action slot


4. For items, all unison invokees must be movable and without autobattle nor confusion





Video










Games Using This Script


None so far


Prerequisites


Scripts:


1. Yanfly Engine Ace - Ace Battle Engine


2. DoubleX RMVXA Clear Addon to Yanfly Engine Ace - Ace Battle Engine


Abilities:


1. Little RGSS3 scripting proficiency to fully utilize this script


Terms Of Use


You shall:


1. Follow the terms of use of Yanfly Engine Ace - Ace Battle Engine


2. Keep this script's Script Info part's contents intact


You shalln't claim that this script's written by anyone other than DoubleX, his aliases, Yanfly, or his/her aliases


None of the above applies to Yanfly or his/her aliases


Instructions


1. Open the script editor and put this script into an open slot between DoubleX RMVXA Clear Addon to Yanfly Engine Ace - Ace Battle Engine and Main, save to take effect.


Authors


DoubleX:


1. This script


Yanfly:


1. Yanfly Engine Ace - Ace Battle Engine


Changelog

Spoiler


Code:
#    v1.00c(GMT 0000 25-2-2016):                                               |
#    1. Fixed nil actor in unison_item_usable? due to missing code bug         |
#    2. Fixed not restroing the unison usable lock for the currently selected  |
#       unison skill/item right before processing the prior command            |
#    3. Fixed not clearing the unison usable lock for the currently selected   |
#       unison skill/item right after processing the next command              |
#    4. Fixed not clearing unison inputable/usable locks upon clearing unison  |
#       action slot                                                            |
#    v1.00b(GMT 1100 26-7-2015):                                               |
#    1. Fixed reserving nonempty action slots and selecting reserved ones bug  |
#    v1.00a(GMT 1200 22-7-2015):                                               |
#    1. 1st version of this script finished                                    |



View attachment (DoubleX)YEA-BattleEngine Unison v1.00c.rar
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Updates

Code:
#    v1.00b(GMT 0700 26-7-2015):                                               |#    1. Fixed reserving nonempty action slots and selecting reserved ones bug  |
 
Joined
Jun 5, 2013
Messages
459
Reaction score
85
First Language
English
Primarily Uses
N/A
Wait, is there a way to get it so that the skill doesn't activate twice if two actors both select it? Because it would be really OP that way. Also, the link's broken. 
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Wait, is there a way to get it so that the skill doesn't activate twice if two actors both select it? Because it would be really OP that way. Also, the link's broken. 
If 2 actors can select the exact same unison skill/item(the same id), it either means each of those 2 actors has at least 2 unused action points(granted by Action Times+), or there's a bug in this script :)

Also, thanks for reporting the broken link. It's now fixed :D
 
Last edited by a moderator:
Joined
Jun 5, 2013
Messages
459
Reaction score
85
First Language
English
Primarily Uses
N/A
By the way, there was something I was wondering if I could do in this script.

I have two actors who have a unison attack that requires them to have a certain class equipped. One actor has to have force equipped as their class(using the yanfly class manager) and one needs to have wind.

When using a unison attack do both actors need to select the skill or does one actor selecting the skill automatically lock the other in?
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
By the way, there was something I was wondering if I could do in this script.

I have two actors who have a unison attack that requires them to have a certain class equipped. One actor has to have force equipped as their class(using the yanfly class manager) and one needs to have wind.

When using a unison attack do both actors need to select the skill or does one actor selecting the skill automatically lock the other in?
In this script, when an actor selects an unison skill/item, all the other required actors will automatically reserve an action point(granted by Action Times+) to use that unison skill/item together, so the actor selecting that unison skill/item will automatically lock all the others in :)
 
Joined
Jun 5, 2013
Messages
459
Reaction score
85
First Language
English
Primarily Uses
N/A
In this script, when an actor selects an unison skill/item, all the other required actors will automatically reserve an action point(granted by Action Times+) to use that unison skill/item together, so the actor selecting that unison skill/item will automatically lock all the others in :)
Alright, it was just really confusing the way you demonstrated it in the video.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Alright, it was just really confusing the way you demonstrated it in the video.
Probably because I didn't describe what I'm doing in the video at all(I think I'll have to work on it) :)
 
Last edited by a moderator:
Joined
Jun 5, 2013
Messages
459
Reaction score
85
First Language
English
Primarily Uses
N/A
Probably because I didn't describe what I'm doing in the video at all(I think I'll have to work on it) :)
Yes, that would be ideal. A game me and my friend are working on heavily incorporates elemental fusion attacks in its battle system.

By the way, is it intentional that you can use the fusion skill even if the other actor doesn't have access to it? I think that there should be an option to have a requirement that needs both actors having access to the skill in order to use it. Our game incorporates a class system of sorts so it would be really OP if one actor could use the fusion spell while the other could use a completely different class.
 
Last edited by a moderator:
Joined
Jun 5, 2013
Messages
459
Reaction score
85
First Language
English
Primarily Uses
N/A
Actually, I figured out the problem. I just had to change the skill type, that's all
 

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
Hello, I was hoping you could help me with a problem I'm having.

As is, the script will not work when two or more actors are added to the note tags to any combination skill. What I mean is when said skill has <union actors 1> and actor 1 is using the skill, everything works fine. However when <union actors 1, 2> is added, and both actors are in the party, the skill is greyed out! Can anyone help with this.

The linked picture here is the current script set up (i deleted everything but what was needed) and how the skill looks like.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Hello, I was hoping you could help me with a problem I'm having.

As is, the script will not work when two or more actors are added to the note tags to any combination skill. What I mean is when said skill has <union actors 1> and actor 1 is using the skill, everything works fine. However when <union actors 1, 2> is added, and both actors are in the party, the skill is greyed out! Can anyone help with this.

The linked picture here is the current script set up (i deleted everything but what was needed) and how the skill looks like.
Are both actors able to use that skill if it weren't an unison one? Have both of them learned that skill? If either's not the case, the unison skill won't be usable.

If neither's the case, you may want to give me your project to inspect further :)
 

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
Ha!

After reading your comment, the light bulb went off. I was actually using two different skills for each actor (each had different flavor text on it) and that was the problem! Thanks for the insight!
 

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
Another question. Using Yanfly and Battle Symphony (and commenting out anything that caused a problem) I eventally got to have a error with Game_Action line 146.

Script 'Game_Action; line 149: NoMehodError occurred.

undefined method 'for_opponent?' for nil:NilClass

  def make_targets               <~~~~~~ 146
    if !forcing && subject.confusion?
      [confusion_target]
    elsif item.for_opponent?
      targets_for_opponents
    elsif item.for_friend?
      targets_for_friends
    else
      []
    end
  end
  #---

Any idea what that could be?
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
The apparent cause is that, an unison invokee's trying to make targets for his/her/its current action when it's not inputted at all.

It's almost 100% a compatibility issue, as it shouldn't be possible with this script and its required ones alone.

But to pinpoint the root cause(the scripts involved in this compatibility issue), place this script just above main and check what's logged on the console :)
 

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
See now I love you even more for pointing out that awesome debug script. Holy information batman!

Here is what I got!

Edit: I should mention that these errors are from your clear script and unite script being below everything.

Edit 2: After some messing around, I tried a rather silly idea. Since it seems to be a targeting issue, I made it so everyone doing the unite attack got a state that would basically prevent them from doing... well anything. For now, it seems to work!
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
I think you'll have to give me your project for me to inspect further :)
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Updates

Code:
#    v1.00c(GMT 0000 25-2-2016):                                               |
#    1. Fixed nil actor in unison_item_usable? due to missing code bug         |
#    2. Fixed not restroing the unison usable lock for the currently selected  |
#       unison skill/item right before processing the prior command            |
#    3. Fixed not clearing the unison usable lock for the currently selected   |
#       unison skill/item right after processing the next command              |
#    4. Fixed not clearing unison inputable/usable locks upon clearing unison  |
#       action slot                                                            |


Edit: Added this clarification as well:


New Terms


Unison skill/item - Skill/item needing more than 1 battler to be used


Unison actors - All actors needed for the same unison skill/item


Unison invoker - The unison actor actually selecting and executing the unison skill/item


Unison invokee - Unison actor that's not the unison invoker


Empty action slot - An action slot without a skill/item but can be inputted with a skill/item


Inputted action slot - An action slot with a skill/item inputted


Reserved action slot - An action slot that can't be inputted with a skill/item


Actor inputable check


An actor's inputable if and only if that actor has at least 1 empty action slot. Only empty and inputted action slots can be selected.


Unison skill/item usability check


1. The actor trying to select an unison skill/item must be an unison actor of that skill/item


2. That actor must pass all the ordinary skill/item usability checks


3. For skills, all unison invokees must be movable, without autobattle nor confusion, meet the ordinary skill conditions, have learned that skill, and have at least 1 empty action slot or reserved action slot that is reserved by the currently inputted unison skill in the currently selected action slot


4. For items, all unison invokees must be movable and without autobattle nor confusion
 
Last edited by a moderator:

KaedeS

Villager
Member
Joined
Oct 11, 2014
Messages
8
Reaction score
1
First Language
Vietnamese
Primarily Uses
Help me. I have this error.

untitled.JPG
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
# Sets the se played when triggering the skill/item clearance command
# "file", volume and pitch is its filename, volume and pitch respectively
# It must return a RPG::AudioFile and should return a RPG::SE
# If CLEAR_SE_VAR_ID is a natural number, the value of variable with id
# CLEAR_SE_VAR_ID will be used instead
CLEAR_SE = RPG::SE.new("file", volume, pitch)
CLEAR_SE_VAR_ID = 0

# Sets the se played when trying to clear an empty action slot
# "file", volume and pitch is its filename, volume and pitch respectively
# It must return a RPG::AudioFile and should return a RPG::SE
# If CLEAR_NIL_SE_VAR_ID is a natural number, the value of variable with id
# CLEAR_NIL_SE_VAR_ID will be used instead
CLEAR_NIL_SE = RPG::SE.new("file", volume, pitch)
CLEAR_NIL_SE_VAR_ID = 0


It means that you've to substitute volume into concrete values in the Clear addon.


Actually, you've to do so for "file" and pitch as well.


volume should be between 0 and 100, and pitch should be between 50 and 150.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,062
Members
137,575
Latest member
akekaphol101
Top