EKuipSwitch XP
#3
Official Add-On for EkuipSwitch XP

Available Now!

Due to a strange help request thread I had read some time ago, I came up with this add-on to allow the game developers predefine the game variables that will be used by your game any time a hero equips or unequips any weapon or piece of armor.

I hope this will help anyone already using my EkuipSwitch XP script a lot. Winking 

Code:
# * EkuipVar XP -- EkuipSwitch XP Add-On * #
#   Scripter : Kyonides Arkanthes
#   2023-04-26

# This script works pretty much the same way EkuipSwitch XP script does.
# The only difference is that you must assign some unique Game Variable ID
# for every Equip Slot currently available in your game project.
# Setup the VARS_4_EQUIP_IDS Constant accordingly.
# 1st Slot stands for the weapon, the 2nd Slot for the 1st piece of armor, etc.

#   ACTOR_EQUIP_VARS = { ActorID1 => [Slot1Var, etc.], etc. }

# If you equip or unequip a weapon or armor included in one of the constants:
#   VAR_WEAPON_VALUES = { WeaponID1 => Value, etc. }
#   VAR_ARMOR_VALUES  = { ArmorID1 => Value, etc. }

module EKuipSwitch
  ACTOR_EQUIP_VARS = { 1 => [1, 2, 3, 4, 5] }
  VARS_4_EQUIP_IDS.default = [0, 0, 0, 0, 0]
  VAR_WEAPON_VALUES = {}
  VAR_ARMOR_VALUES = {}
  def self.var_value(type, item_id, equipped)
    return 0 unless equipped
    type == 0 ? VAR_WEAPON_VALUES[item_id] : VAR_ARMOR_VALUES[item_id]
  end
end

class Game_Actor
  def turn_equip_var(equip_type, equip_id, in_use)
    var = EKuipSwitch::ACTOR_EQUIP_VARS[@actor_id][type]
    $game_variables[var] = EKuipSwitch.var_value(equip_type, equip_id, in_use)
  end

  def update_equip_switches(equip_type, old_id, new_id)
    return if @is_temp_actor or old_id == new_id
    equip_type = 0 if equip_type == 1 and @dual_wield
    turn_equip_switch(equip_type, old_id, false)
    turn_equip_switch(equip_type, new_id, true)
    turn_equip_var(equip_type, old_id, false)
    turn_equip_var(equip_type, new_id, true)
    true
  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
Reply }


Messages In This Thread
EKuipSwitch XP - by kyonides - 02-25-2023, 03:13 AM
RE: EKuipSwitch - by kyonides - 02-27-2023, 06:14 AM
RE: EKuipSwitch - by kyonides - 04-26-2023, 07:36 AM



Users browsing this thread: 1 Guest(s)