DoubleX RMVXA Confusion Edit

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by DoubleX, Jan 2, 2014.

    Tags:
  1. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,462
    Likes Received:
    543
    First Language:
    Chinese
    Primarily Uses:
    N/A

    DoubleX RMVXA Confusion Edit  v1.02e


    by DoubleX




    Introduction


    If a battler has inflicted states with restrictions "attack an enemy", "attack anyone" or "attack an ally", he/she/it'll attack the respective targets via autobattle like actions with the autobattle flag unchanged.


    This is done by reversing his/her/its identifications of allies and enemies(allies are identified as enemies and vice versa) with 50% and 100% chance with "attack anyone" and "attack an ally" respectively.


    The battler won't just use "Attack"(skill #1), but instead will use all available skills. Actors will randomly pick actions as if they've autobattle flags; Enemies will pick actions according to their action patterns.

    Spoiler




    #------------------------------------------------------------------------------|
    # * (v1.01a+)Notetag <confusion edit> for states |
    # To make a state with those restrictions have edited confusion effects, put|
    # the above notetag into that state's notebox in the database. |
    #------------------------------------------------------------------------------|
    # * (v1.02a+)Notetag <exclude self> for states |
    # To make battlers with an edited confusion state never target themselves, |
    # put the above notetag into that state's notebox in the database. |
    # This noteag only works on skills picking a single non-random target |
    #------------------------------------------------------------------------------|

    module DoubleX_RMVXA
    module Confusion_Edit

    #------------------------------------------------------------------------------|
    # * (v1.01a+)Always_Confusion_Edit, default = false |
    # Notetags will be ignored and all states with those restrictions will have |
    # the edited confusion effects if Always_Confusion_Edit is true |
    #------------------------------------------------------------------------------|
    Always_Confusion_Edit = false

    #------------------------------------------------------------------------------|
    # * (v1.02a+)Always_Exclude_Self, default = false |
    # Notetags will be ignored and all states with those restrictions will stop |
    # the battlers from targeting themselves if Always_Exclude_Self is true |
    # This setting only works on skills picking a single non-random target |
    #------------------------------------------------------------------------------|
    Always_Exclude_Self = false

    end # Confusion_Edit
    end # DoubleX_RMVXA



    Features


    Use of notetags(requires knowledge of notetag usage) to set specific states with those restrictions to have the edited confusion effects


    A way to set all states with those restrictions to have edited confusion effects without using notetags(and ignoring them)


    Screenshots

    Spoiler



    [​IMG]


    [​IMG]



    How to use


    Open the script editor and put this script into an open slot between Materials and Main. Save to take effect.


    FAQ


    None


    Credit and Thanks


    DoubleX(Giving me credit is completely optional)


    No terms of use other than not claiming this script as created by anyone except DoubleX or his alias


    Compatibility


    Scripts aliasing or rewriting method:


    - evaluate_item_with_target, friends_unit, opponents_unit, prepare, valid?, make_targets, confusion_target, targets_for_opponents or targets_for_friends under class Game_Action


    - make_actions under class Game_Actor


    may have compatibility issues with this script


    Place this script above those aliasing any of these methods if possible


    Changelog


    v1.02e(GMT 0100 13-8-2015):


    - Fixed some syntax errors and typos


    v1.02d(GMT 1400 7-7-2015):


    - Improved this script's efficiency and readability


    v1.02c(GMT 0000 2-6-2014):


    - Fixed bugs on adding stuff other than damage in custom damage formula


    v1.02b(GMT 0300 22-3-2014):


    - Fixed bugs on <exclude self> notetag implementations


    v1.02a(GMT 0600 21-3-2014):


    - Added <exclude self> notetag


    v1.01b (GMT 0000 17-1-2014):


    - Methods are aliased rather than rewritten


    v1.01a (GMT 0000 3-1-2014):


    - Added <confusion edit> notetag to enable confusion edit for states


    v1.00a (GMT 1600 1-1-2014):
     - 1st version of this script finished


    View attachment (DoubleX)Confusion Edit v1.02e.rar
     
    Last edited by a moderator: Aug 13, 2016
    #1
  2. tiagoms

    tiagoms Veteran Veteran

    Messages:
    181
    Likes Received:
    4
    Hello doublex again.

    Very interesting your script, however, when using:
    - VXAce_SP1
    - Doublex: Confusion Edit
    - Doublex: Unison
               * Fix Unison
    - Doublex: Intercept Magic

    Link VXAce_SP1: http://forums.rpgmakerweb.com/index.php?/topic/23038-vxace-sp1-bug-fix/

    The following problem occurs:
    Script "DoubleX - Unison" line 240: NoMethodError ocurred.
    Undefined Method 'Size' for # <Game_Action:0x34b5b10>

    The test was done only with scripts cited.
    The error only occurs when adding the "Edit Confusion" script, and add the notetag <confusion edit> in a state, and after applying it on an actor (1 turn after application)
     
    Last edited by a moderator: Jun 10, 2014
    #2
  3. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,462
    Likes Received:
    543
    First Language:
    Chinese
    Primarily Uses:
    N/A
    I've tested but failed to reproduce the error. I've also checked the scripts and it seems that it just have no chance to happen. Would you please give me a demo to work with? It may help me figure out the cause :)
     
    #3
  4. tiagoms

    tiagoms Veteran Veteran

    Messages:
    181
    Likes Received:
    4
    All right! =D

    With Erik, in battle, use the "Confusão", and wait. =)

    Project1.rar
     

    Attached Files:

    #4
  5. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,462
    Likes Received:
    543
    First Language:
    Chinese
    Primarily Uses:
    N/A
    The root cause is the VXAce_SP1 you're using. Precisely and technically speaking, it's because it changed the method make_auto_battle_actions under class Game_Actor. The original one is this:

    def make_auto_battle_actions @actions.size.times do |i| @actions = make_action_list.max_by {|action| action.value } endendAnd the VXAce_SP1 changed it to this:

    def make_auto_battle_actions @actions.size.times do |i| @actions = make_action_list.max_by {|action| action.value } endendOriginally, @actions is an array of Game_Action, but due to the above changes made by the VXAce_SP1, @actions now becomes Game_Action.

    It causes my unison script to return error as it expects @actions as an array of Game_Action but now it's actually an Game_Action.

    The easiest and fastest way to fix this is to remove the method make_auto_battle_actions under class Game_Actor in the VXAce_SP1, but I don't know if it'll create some other problems :)

    Off topic: I don't have any clue why the VXAce_SP1 changes @actions from an array of Game_Action to Game_Action. I don't know what it's trying to achieve and it seems to me that it can screw up lots of stuffs.
     
    Last edited by a moderator: Jun 11, 2014
    #5
  6. tiagoms

    tiagoms Veteran Veteran

    Messages:
    181
    Likes Received:
    4
     

    But so far, the error only occurs if you add the script Confusion Edit.
    "this error" ...

    In unison, I did only superficial tests (to check the functioning), but had no problems (without the confusion edit).





    *** Edit

    This "VXace_SP1" script is not official?
     
    Last edited by a moderator: Jun 11, 2014
    #6
  7. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,462
    Likes Received:
    543
    First Language:
    Chinese
    Primarily Uses:
    N/A
    You can try to test with some actors having autobattle flag and see what happens if you use the VXAce_SP1 and my unison script :)

    You had that conclusion as my confusion edit makes confused actors behave like autobattle actors although no autobattle flag is added to them.

    It's done by asking those actors to make actions using methods that are used by actors with autobattle flags, i.e., method make_auto_battle_actions under class Game_Actor.

    I don't know much about the VXAce_SP1 but I heard from somewhere that it's included in the English version, which doesn't change @actions from an array of Game_Actions to Game_Actions:

    def make_auto_battle_actions @actions.size.times do |i| @actions = make_action_list.max_by {|action| action.value } endendMaybe they think they did some undesirable changes to the above method in the VXACE_SP1 so they reverted that method back to what it was, but I don't know what actually happened :D
     
    Last edited by a moderator: Jun 11, 2014
    #7
  8. tiagoms

    tiagoms Veteran Veteran

    Messages:
    181
    Likes Received:
    4


    Indeed, the same error if I add the option of "auto battle" occurs (even without the script "confusion Edit".

    After all, you consider "VXAce_SP1" an important script? What does it do? corrects something? add something? (beyond what you already mentioned)

    I just added it because many spoke it was official, and almost everything is official, is important.

    But would like to know your opinion.
     
    #8
  9. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,462
    Likes Received:
    543
    First Language:
    Chinese
    Primarily Uses:
    N/A
    My opinion is that you may want to ask someone understanding the VXAce_SP1 what it does then think if you want to change anything. That's the safest approach I can think of.

    A faster but more risky approach is to just delete the whole method make_auto_battle_actions under class Game_Actor in the VXAce_SP1 and test if something undesirable happens.
     
    #9
  10. tiagoms

    tiagoms Veteran Veteran

    Messages:
    181
    Likes Received:
    4
    Got it, so for the purpose of "testing". what is the correct form?

    A ) This form (check the number and locations of "ends")

    class Game_Actor  #--------------------------------------------------------------------------  # ● 装備できない装備品を外す  #     item_gain : 外した装備品をパーティに戻す  #--------------------------------------------------------------------------  alias vxace_sp1_release_unequippable_items release_unequippable_items  def release_unequippable_items(item_gain = true)    loop do      last_equips = equips.dup      vxace_sp1_release_unequippable_items(item_gain)      return if equips == last_equips    end  endend

    B ) Deleting all this. B)

    class Game_Actor  #--------------------------------------------------------------------------  # ● 装備できない装備品を外す  #     item_gain : 外した装備品をパーティに戻す  #--------------------------------------------------------------------------  alias vxace_sp1_release_unequippable_items release_unequippable_items  def release_unequippable_items(item_gain = true)    loop do      last_equips = equips.dup      vxace_sp1_release_unequippable_items(item_gain)      return if equips == last_equips    end  end  #--------------------------------------------------------------------------  # ● 自動戦闘時の戦闘行動を作成  #--------------------------------------------------------------------------  def make_auto_battle_actions    @actions.size.times do |i|      @actions = make_action_list.max_by {|action| action.value }    end  endend


    ******************** EDIT 1

    see this :unsure:

    http://forums.rpgmakerweb.com/index.php?/topic/23038-vxace-sp1-bug-fix/
     
    Last edited by a moderator: Jun 12, 2014
    #10
  11. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,462
    Likes Received:
    543
    First Language:
    Chinese
    Primarily Uses:
    N/A
    B ) Deleting all this. B)

    class Game_Actor  #--------------------------------------------------------------------------  # ● 装備できない装備品を外す  #     item_gain : 外した装備品をパーティに戻す  #--------------------------------------------------------------------------  alias vxace_sp1_release_unequippable_items release_unequippable_items  def release_unequippable_items(item_gain = true)    loop do      last_equips = equips.dup      vxace_sp1_release_unequippable_items(item_gain)      return if equips == last_equips    end  end  #--------------------------------------------------------------------------  # ● 自動戦闘時の戦闘行動を作成  #--------------------------------------------------------------------------  def make_auto_battle_actions    @actions.size.times do |i|      @actions = make_action_list.max_by {|action| action.value }    end  endend


    ******************** EDIT 1

    see this :unsure:

    http://forums.rpgmakerweb.com/index.php?/topic/23038-vxace-sp1-bug-fix/

    I've checked the VXAce SP1 Bug Fix there and found something strange with your VXAce_SP1. It's about the method make_auto_battle_actions. The one in that version is this:

    def make_auto_battle_actions @actions.size.times do |i| @actions = make_action_list.max_by {|action| action.value } endendAnd yours is this:

    def make_auto_battle_actions @actions.size.times do |i| @actions = make_action_list.max_by {|action| action.value } endendAs it seems to me that you didn't touched this, the root cause to this maybe problems related to downloads. I guess that due to some reasons, square brackets(i.e., []) and things included by them(i in this case) are gone during your download. I've checked the whole VXAce SP1 Bug Fix and only the above problematic line has square brackets.

    So you can try to replace your VXAce_SP1 with the original VXAce SP1 Bug Fix and see if the square brackets come back: http://forums.rpgmakerweb.com/index.php?/topic/23038-vxace-sp1-bug-fix/
     
    Last edited by a moderator: Jun 13, 2014
    #11
    tiagoms likes this.
  12. tiagoms

    tiagoms Veteran Veteran

    Messages:
    181
    Likes Received:
    4


     

    Truth ...I changed and "Auto Battle" now work perfectly.

    Thanks DoubleX (Again)
     
    #12
  13. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,462
    Likes Received:
    543
    First Language:
    Chinese
    Primarily Uses:
    N/A
    Updates

    v1.02d(GMT 1400 7-7-2015):

    - Improved this script's efficiency and readability
     
    #13
  14. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,462
    Likes Received:
    543
    First Language:
    Chinese
    Primarily Uses:
    N/A
    Updates


    v1.02e(GMT 0100 13-8-2015):


    - Fixed some syntax errors and typos
     
    #14

Share This Page