Posts: 4,606
Threads: 543
Joined: Dec 2009
02-25-2023, 03:13 AM
(This post was last modified: 09-27-2024, 08:27 PM by kyonides.)
EKuipSwitch XP
by Kyonides
Introduction
Are you in desperate need to turn on a switch whenever a hero equips a specific weapon or armor and vice versa?
Well, now you can do it!
RMXP's Setup
Either set the key value pairs of the WEAPON_IDS or ARMOR_IDS constants like this:
Code: ARMOR_IDS = { 33 => 10 }
Where 33 stands for the Armor ID and 10 is the Switch ID.
Terms & Conditions
Free as in beer.
Include my nickname in your game credits!
Do not repost it anywhere!
"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.
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!
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
Posts: 4,606
Threads: 543
Joined: Dec 2009
Your Usual Update Announcement
Just keep in mind guys that this script has been ported to RMXP and RMVX as well!
VX's version works the same way as VX Ace's, but the XP port needs to use 2 CONSTANTS to achieve the same effect on its own terms. If you have worked with Hashes before, it will be a piece of cake.
"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.
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!
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
Posts: 4,606
Threads: 543
Joined: Dec 2009
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.
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.
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!
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
|