Atoa ACBS, Equipment Set Add-on Error
#1
Hi all!

I have another question about the Atoa ACBS script, in the demo, I was testing out some of the various neat add-ons that are included. But I ran across one that gave back an error despite me not touching or editing it in any way.

It's called "Equipment Set" (Well, technically "Equipament Sets") and whenever I enable it (As I said, in the demo. Completely unaltered) it crashes the game during battle, the first time someone attacks : (screenshot of the error + section in the script where the error is supposed to be happening)
I'm not familiar with a lot of scripting stuff, and I'm at a loss of what to do, as after searching online I couldn't find any posts talking about this specific issue. But did find some general ruby-related info about "fixnum" errors that didn't really shed any light on things either.

I hope someone can make sense of it, any help would be greatly appreciated. Thanks.
}
#2
Vic had this issue with working on things, but then didn't go back to account for ... possibilities... after an upgrade. He likely didn't touch this script after upgrading ACBS to its current state.

NOW!!!.... let's look at the section... 331 you said?

Code:
#--------------------------------------------------------------------------
  # * Get Critical Hit Rate
  #--------------------------------------------------------------------------
  alias crt_equiset crt
  def crt
    return crt_equiset + @set_crt
  end

Ah, I see. Well, this section gives the attacker an extra "oomph" to his critical hit rate. But he didn't account that the Equipment set didn't GIVE any bonus... aka, the @set_crt value being 'nil'.

We can change this method like so:

Code:
#--------------------------------------------------------------------------
  # * Get Critical Hit Rate
  #--------------------------------------------------------------------------
  alias crt_equiset crt
  def crt
    value = crt_equiset
    value += @set_crt unless @set_crt.nil?
    return value
  end
  • Now here, we just 'snag' the already calculated critical hit damage, and store it into a value (suitably named 'value')(line 1)
  • Then we ONLY add the @set_crt value to it if the @set_crt value isn't nil (line 2)
  • And finally, we return that 'value' it so desired (line 3)

Its annoying, patching a patch. But it needed to be done since it likely wasn't updated or considered. And I felt, this was the easiest fix with the easiest explanation of what's going on.

FOR the record, look further down for THIS set of code
Code:
#--------------------------------------------------------------------------
  # * Get Critical Hit Evasion Rate
  #--------------------------------------------------------------------------
  alias rcrt_equiset rcrt
  def rcrt
    return rcrt_equiset + @set_rcrt
  end

Change it to THIS:

Code:
#--------------------------------------------------------------------------
  # * Get Critical Hit Evasion Rate
  #--------------------------------------------------------------------------
  alias rcrt_equiset rcrt
  def rcrt
    value = rcrt_equiset
    value += @set_rcrt unless @set_rcrt.nil?
    return value
  end

This bit handles the chance of evading a critical hit, and again.... needs to be patched.

While playtesting, these two methods were the only ones that I ran into with issues. I didn't run into any others that gave me problems. BUT, if the others run into 'nil' issues, the fix is pretty simple in design.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
}
#3
Oh come on, Wulfo! It's way easier than that set of changes!

Just copy and paste this below the add-ons.

Code:
# * ATOA CBS - Equipment Set Variables Patch * #
#  Scripter : Kyonides Arkanthes
#  2024-10-13

class Game_Actor
  alias :kyon_atoa_eqset_patch_gm_act_setup :setup
  def setup(actor_id)
    equipment_set_vars
    kyon_atoa_eqset_patch_gm_act_setup(actor_id)
  end

  def equipment_set_vars
    @set_eva  = 0
    @set_hit  = 0
    @set_crt  = 0
    @set_dmg  = 0
    @set_rcrt = 0
    @set_rdmg = 0
  end
end
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
}
#4
NOPE, but almost. Creating the instance values and zero-ing them out when the actor is made seems viable, but the bonuses or penalties will not properly reset when the player changes equipment. You were SO close... it had to be when the data resets:

Code:
# * ATOA CBS - Equipment Set Variables Patch * #
#  Scripter : Kyonides Arkanthes
#  2024-10-13

class Game_Actor
  alias :kyon_atoa_eqset_patch_gm_act_reset_set_status :reset_set_status
  def reset_set_status
    equipment_set_vars
    kyon_atoa_eqset_patch_gm_act_reset_set_status
  end

  def equipment_set_vars
    @set_crt  = 0
    @set_dmg  = 0
    @set_rcrt = 0
    @set_rdmg = 0
  end
end

Just changing over from Setup to the reset_set_status method does the trick. The values reset to 0 just before any 'new' equipment sets are calculated... if any at all.

AND DAMMIT, I KNEW SOMETHING WAS WRONG! VIC WROTE ANOTHER SCRIPT!!!!

IF you were to add "Add | New Status", this script adds the so-mentioned critical hits and damage values and takes care of the issues with the screwed up crt values on its own. That is, if you want to add the four new values to your equipment.

IF you don't care about critical hit bonuses, critical hit resistance and/or critical damage bonuses, use the script snippet above.

IF you want them, use the script that gives the new statuses.

VICTOR SANT!!!!! IT WOULDA BEEN GREAT IF YOU MENTIONED THAT IN THE SCRIPTS!!!!!
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
}
#5
DerVVulfman Wrote:AND DAMMIT, I KNEW SOMETHING WAS WRONG! VIC WROTE ANOTHER SCRIPT!!!!

That explains it all. Serious
Sadly, Victor Sant never considered he had to remove / alter the previous one from the demo. Sarcasm

There might be another (partial?) solution...

IGNORE THIS POST AND JUMP TO POST #7!

EDIT #3:

Code:
class Game_Actor
  def apply_set_efect(set_id)
    return if Set_Effect[set_id].nil?
    set = Set_Effect[set_id].dup
    if set['status'] != nil
      for st in Set_Effect[set_id]['status']
        eval("@set_#{st[0]} += #{st[0] ? st[1] || 0}")
      end
    end
    @set_equipment_skills << set['skills'] if set['skills'] != nil
    @set_elemental_resist << set['elements'] if set['elements'] != nil
    @set_state_resist << set['states'] if set['states'] != nil
    @set_auto_states << set['auto states'] if set['auto states'] != nil
    @set_auto_states.flatten!
    @set_auto_states.uniq!
    gain_set_skill
  end
end

Edit #4

This would be the full version of my patch.

Code:
# * ATOA CBS - Equipment Set Variables Patch * #
#  Scripter : Kyonides Arkanthes
#  2024-10-13

class Game_Actor
  alias :kyon_atoa_eqset_patch_gm_act_setup :setup
  def setup(actor_id)
    equipment_set_vars
    kyon_atoa_eqset_patch_gm_act_setup(actor_id)
  end

  def equipment_set_vars
    @set_eva  = 0
    @set_hit  = 0
    @set_crt  = 0
    @set_dmg  = 0
    @set_rcrt = 0
    @set_rdmg = 0
  end

  def apply_set_efect(set_id)
    return if Set_Effect[set_id].nil?
    set = Set_Effect[set_id].dup
    if set['status'] != nil
      for st in Set_Effect[set_id]['status']
        eval("@set_#{st[0]} += #{st[0] ? st[1] || 0}")
      end
    end
    @set_equipment_skills << set['skills'] if set['skills'] != nil
    @set_elemental_resist << set['elements'] if set['elements'] != nil
    @set_state_resist << set['states'] if set['states'] != nil
    @set_auto_states << set['auto states'] if set['auto states'] != nil
    @set_auto_states.flatten!
    @set_auto_states.uniq!
    gain_set_skill
  end
end
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
}
#6
Afraid not. It would not reset the values back to 0 if no set was worn, nor reset them if a set was removed. That only functions upon detection and application of a set. It is solely executed within the 'update_equip_set' method. and only when a set detected worn within the Equip_Set iteration loop.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
}
#7
Detective Did you really check the update_equip_set method?
There you can see several calls to apply_set_efect.

And yes, it's spelled apply_set_efect with a single f. What a funny typo! Laughing

Posted while Wulfo was editing his previous post!

Keep in mind that update_equip_set is called from equip and level_change.



Actually...

Code:
  def reset_set_status
    status = ['maxhp','maxsp','atk','pdef','mdef','str','dex','int','agi','eva','hit']
    status << ['crt','dmg','rcrt','rdmg'] if $atoa_script['Atoa New Status']
    status.flatten!
    for st in status
      eval("@set_#{st} = 0")
    end
    @set_equipment_skills = []
    @set_auto_states = []
    @set_elemental_resist = []
    @set_state_resist = []
    forget_set_skills
  end

That piece of code should have set all values to 0... but it fails to do so while running the demo. Confused
The reason is that Atoa New Status script is not included... and that makes it an epic fail because those values should be set even if nobody includes the other script at all.

So the actual fix would be a way shorter than all the previous ones:

THE FIX

Code:
# * ATOA CBS - Equipment Set Variables Patch * #
#  Scripter : Kyonides Arkanthes
#  2024-10-13

class Game_Actor
  def reset_set_status
    status = ['maxhp','maxsp','atk','pdef','mdef','str','dex','int','agi','eva','hit']
    status += ['crt','dmg','rcrt','rdmg']
    for st in status
      eval("@set_#{st} = 0")
    end
    @set_equipment_skills = []
    @set_auto_states = []
    @set_elemental_resist = []
    @set_state_resist = []
    forget_set_skills
  end
end
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
}
#8
The 'update_equip_set' method is indeed called within 'setup', 'level_change' and 'equip'. That I grant you.

But the content within the 'update_equip_set' method that executes the 'apply_set_efect' is thus:

Code:
...
      apply_set_efect(set[0]) if armors_set and weapons_set
    ...
The triggers for valid armor and weapon sets must both be true for any given equipment set.

The code looks a bit whacked, but it iterates each set. If a set has a weapon, it will only flag the weapons_set value true if equipped, or false if not. But if the set has no weapon, it is set to true so it would pass. And the same goes for armor.

And if no set is equipped, this method is not reached,



EDIT: You added a fix WHILE I was typing

THAT would do it. Yep. That he set up values to be added to other conditions in the script, but not even initialized or set (and thus nil and error causing) unless another script in place was a big oof.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
}
#9
While reading the reset_set_status method I noticed the main issue was the condition that mentioned the other script you were talking about. It was the Atoa New Status script. Now it should set all values regardless of the presence of that script if the OP applies my latest patch found in post #7, IMHO.

Wulfo Wrote:EDIT: You added a fix WHILE I was typing

THAT would do it. Yep. That he set up values to be added to other conditions in the script, but not even initialized or set (and thus nil and error causing) unless another script in place was a big oof.

Just a big oof? Laughing
Anyway, now that it's fixed, it's time for some Pizza guys!
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
}
#10
Says you.  It takes me HOURS to type the gazette. 

I'm getting soup... and that's all I can have while working on it.

... we have no soup emote.  Head-desk Thud
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
}


Possibly Related Threads…
Thread Author Replies Views Last Post
   GW Animated Battle backs Patch for Atoa ACBS Solitaire 21 1,443 10-17-2024, 06:37 AM
Last Post: Solitaire
   ACBS - Atoa Custom Battle System and TP System zlsl 2 4,568 10-20-2021, 05:09 AM
Last Post: zlsl
   I want to add an Atoa Custom Battle System command cut-in. zlsl 11 13,891 11-11-2019, 08:55 PM
Last Post: DerVVulfman
   Question about ACBS (Atoa Custom Battle System) aeliath 10 12,765 08-08-2019, 02:50 PM
Last Post: aeliath
   (RMVXace) Battle error with Tankentai's battle system, help. x( Starmage 0 3,911 02-14-2018, 04:25 PM
Last Post: Starmage
   Atoa Individual Battle Commands Geminil 3 6,967 08-02-2017, 03:17 AM
Last Post: DerVVulfman
  Expiration States with Atoa acbs: error Noctis 5 9,267 02-18-2017, 01:10 AM
Last Post: DerVVulfman
Shocked  Help needed with Atoa's CBS jreagan406 2 5,764 02-16-2017, 12:36 PM
Last Post: jreagan406
   Problems with counteraatack addon of Atoa Custom Battle System Djigit 22 35,466 01-05-2017, 08:05 PM
Last Post: Noctis
   Atoa ACBS HP Regen Skill Lightness 11 14,102 03-11-2016, 10:43 PM
Last Post: Lightness



Users browsing this thread: 2 Guest(s)