ACE Equip Add-on: Level Based Equipment Slots

Panda_Artist

Humble RPG Fan
Veteran
Joined
Dec 22, 2018
Messages
59
Reaction score
4
First Language
Portuguese
Primarily Uses
RMVXA
Good Morning / Day / Afternoon / Evening everyone.

I have a request for a certain kind of script modification.

I have Tsukihime's Core Equip along with Dynamic Equip slots

The script give you the option to create your own custom equipment types and slots

However, I would like to implement an add on that for example. I have a custom equip type in which an actor starts with 1 slot of at level 1 but grows to 3 slots of the same at level 20 for example.

Is there any easy way to implement these?
 
Last edited:

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
75
Reaction score
25
First Language
Bulgarian
Primarily Uses
RMVXA
One very easy way that to happen is via this script call:
Code:
$game_actors[actor_id].actor.base_equip_slots.push(equip_type_id)
You replace the actor_id with the coresponding actor id number, and the equip_type_id with the coresponding equip type id number set in yanfly's script. Not too heavely tested though.

That script call does not work on actors that would use default equip slots. Or, it rather do work, but once you push any equip slot, the default ones would not load for the given actor. As that script call is something that could help you, it might not in the example you give.
To work for the example you give, the level up method could be modified, so it pushes more slots when certain conditions are met. But you need to provide more data how exactly that should happen. That happens for all actors, or only for certain? Different actors have different levels when they would recieve new slot, and different slot type to recieve on criteria met? Or it works same for all actors? Same level criteria, same slot type added?

Edit: Only the script call by itself won't help you, as that won't remain in the save file.
The equip slot data should be stored in save data, and extracted from there loading new game, if you add this snippet at the end of the Yanfly Equip Engine:
Code:
#Add-on for Ace Equip Engine
#Purpose: Save and loads the actors equip slots.

module DataManager
 
  class << self
    alias_method :ggz_yee_make_save_contents_old,    :make_save_contents
    alias_method :ggz_yee_extract_save_contents_old, :extract_save_contents
  end
 
   def self.make_save_contents(*args)
    contents = ggz_yee_make_save_contents_old(*args)
    equip_slot_save = Array.new
    $data_actors.each_with_index do |actor, i|
      next unless actor
      equip_slot_save[i] = actor.base_equip_slots
    end
    contents[:ynf_base_equip_slots] = equip_slot_save
    contents
  end
  #--------------------------------------------------------------------------
  # * Extract Save Contents
  #--------------------------------------------------------------------------
  def self.extract_save_contents(contents)
    ggz_yee_extract_save_contents_old(contents)
     equip_slot_load = contents[:ynf_base_equip_slots]
     if equip_slot_load
       $data_actors.each_with_index do |actor, i|
         next unless actor
         actor.base_equip_slots = equip_slot_load[i]
       end
     end
  end
 
end
You should add that snippet at the end of "Ace Equip Engine" script, after everything else there.
That snippet only makes it so whatever changes you make, to be stored in the save.
It would not add any equip slots on level up. For that, you need to provide more info how you want it to happen.
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
1,875
Reaction score
410
First Language
English
Primarily Uses
RMVXA
Not the best, but it works.
Code:
=begin
#=====================================================================
#   HIME's Dynamic Equip Slots - Add-on
#   Version 1.0.01
#   Author: Roninator2
#   Date: 18 Aug 2019
#   Latest: 19Aug 2019
#=====================================================================#
#   UPDATE LOG
#---------------------------------------------------------------------#
# 18 Aug 2019 - Created notetag to add slots by level
#=====================================================================#
#       NOTETAGS
#=====================================================================#

Notetag actors as many times as you require with the following:

    * <add slot: Level, etype_id>
    * e.g. <add slot: 5, 4>
 Where `etype_id` is the equip type ID. By default, they are as follows:
   0 - weapon
   1 - shield
   2 - headgear
   3 - bodygear
   4 - accessory
 
=end

module TH
  module Dynamic_Equip_Slots
    Regexlevel = /<add[-_ ]slot:[-_ ](\d+*)\,*.*?(\d+*)>/i
  end
end

module RPG
  class Actor
    attr_reader :level
    def load_notetag_level_equip_slots
      results = self.note.scan(TH::Dynamic_Equip_Slots::Regexlevel)
      results.each do |res|
        if $game_actors[@id].level == res[0].to_i
          $game_actors[@id].add_equip_slot(res[1].to_i)
        end
      end
    end
  end
end

class Game_Actor < Game_Battler
  alias :r2_level_up_97bfu  :level_up
  def level_up
    r2_level_up_97bfu
    actor.load_notetag_level_equip_slots
  end
end
Fix the code.
For the life of me I could not get this to work without a global variable. Perhaps someone can assist with that.
 
Last edited:

Panda_Artist

Humble RPG Fan
Veteran
Joined
Dec 22, 2018
Messages
59
Reaction score
4
First Language
Portuguese
Primarily Uses
RMVXA
Not the best, but it works.
Code:
=begin
#=====================================================================
#   HIME's Dynamic Equip Slots - Add-on
#   Version 1.0.01
#   Author: Roninator2
#   Date: 18 Aug 2019
#   Latest: 19Aug 2019
#=====================================================================#
#   UPDATE LOG
#---------------------------------------------------------------------#
# 18 Aug 2019 - Created notetag to add slots by level
#=====================================================================#
#       NOTETAGS
#=====================================================================#

Notetag actors as many times as you require with the following:

    * <add slot: Level, etype_id>
    * e.g. <add slot: 5, 4>
 Where `etype_id` is the equip type ID. By default, they are as follows:
   0 - weapon
   1 - shield
   2 - headgear
   3 - bodygear
   4 - accessory
 
=end

module TH
  module Dynamic_Equip_Slots
    Regexlevel = /<add[-_ ]slot:[-_ ](\d+*)\,*.*?(\d+*)>/i
  end
end

module RPG
  class Actor
    attr_reader :level
    def load_notetag_level_equip_slots
      results = self.note.scan(TH::Dynamic_Equip_Slots::Regexlevel)
      results.each do |res|
        if $game_actors[@id].level == res[0].to_i
          $game_actors[@id].add_equip_slot(res[1].to_i)
        end
      end
    end
  end
end

class Game_Actor < Game_Battler
  alias :r2_level_up_97bfu  :level_up
  def level_up
    r2_level_up_97bfu
    actor.load_notetag_level_equip_slots
  end
end
Fix the code.
For the life of me I could not get this to work without a global variable. Perhaps someone can assist with that.

It worked just fine without it, I leveled up my character and his slots increased, even with characters with a lower level on the party, I was able to accomplish just what I wanted.

Thank you so much, you will definitely be credited.
 

GGZiron

Veteran
Veteran
Joined
Nov 6, 2016
Messages
75
Reaction score
25
First Language
Bulgarian
Primarily Uses
RMVXA
Hey, just to apologise. I for some reason believed you used Yanfly equip engine, although you certainly said Tsukihime. Sometimes my short term memory play me such tricks. Is not my practice when someone ask help for one script, I to go for another. Anyway, I see Roninator2 helped you :).
 

Panda_Artist

Humble RPG Fan
Veteran
Joined
Dec 22, 2018
Messages
59
Reaction score
4
First Language
Portuguese
Primarily Uses
RMVXA
It worked just fine without it, I leveled up my character and his slots increased, even with characters with a lower level on the party, I was able to accomplish just what I wanted.

Thank you so much, you will definitely be credited.

I was wondering if it were also possible to add something that will tell you during battle victory that when you level up to the level i specified and they get a new slot, the vocabulary could tell you that like:

"Actor1 has gained a level!
Actor 1 has gained a new (equp) slot"

That would be really cool. Maybe add in a sound effect!
 

Panda_Artist

Humble RPG Fan
Veteran
Joined
Dec 22, 2018
Messages
59
Reaction score
4
First Language
Portuguese
Primarily Uses
RMVXA
Pardon me but what do you mean by script page? My english is okay but not perfect.

UPDATE

after using the new one this happens when i deliberately level up the actor to test it

even the old one doesn't work anymore...
 

Attachments

Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
1,875
Reaction score
410
First Language
English
Primarily Uses
RMVXA
You must have removed the dynamic equip slots script.
I updated my script. Use it and it will tell you if Hime's script is missing.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

tomorrow I'ma go on a cruise for the first time ever... lets hope I'll survive the experience!
Omg! 8 years in this forum :o
Ksi
Streaming the last of the RMN Valentiny event games so feel free to drop on by and watch me cry (whether that's from laughter, rage or sheer pain, who knows?)
Today I went to sleep without setting an alarm, so I could sleep more than 2 hours. I woke up after 2 hours.
Sigh :( ... displaying numbers representing the stats of the PCs for a custom menu in rm2k3 is haaaaaaaarrrd!!! DX

Forum statistics

Threads
94,304
Messages
919,801
Members
124,054
Latest member
stevechtrs
Top