This script was made for all of the RGSS based RPG Makers available out there!
Are you bored of getting a Game Switch or a Game Variable by using a Number that's easy to forget?
Don't worry about! I've got the perfect solution for you!
Use the script posted below and you'll be able to set or access its contents scriptwise.
It has several script calls you can manage at any given moment.
Take in consideration that my script is not for everyone, especially not for novice game developers!
The Script
Code:
# * Name Game Switch & Variable RG * #
# Scripter : Kyonides Arkanthes
# 2023-06-27
# * Basic Scripting Tool * #
# * Not Intended for use by Novice Game Developers * #
# * Never use Old Save Files! * #
# Please set a Game Switch or Game Variable Name before calling its get method.
# $game_switches.set("Name", ID)
# $game_switches.set("Name", ID, true)
# $game_switches.get("Name") - Identical to on?
# $game_switches.on?("Name") - Identical to get
# $game_switches.names #=> Lists All Names Used So Far
# $game_switches.total_names #=> Returns Hash Size
# $game_variables.set("Name", ID)
# $game_variables.set("Name", ID, 100)
# $game_variables.get("Name")
# $game_variables.names #=> Lists All Names Used So Far
# $game_variables.total_names #=> Returns Hash Size
module NameGameSV
def get(name)
data_id = @names[name]
@data[data_id]
end
def set(name, data_id, value=NAMES_DEFAULT)
@names[name] = data_id
@data[data_id] = value
end
def clear_names
@names = {}
end
def total_names
@names.size
end
attr_reader :names
end
class Game_Switches
include NameGameSV
NAMES_DEFAULT = false
alias :kyon_name_gs_gv_gm_swi_init :initialize
def initialize
kyon_name_gs_gv_gm_swi_init
clear_names
end
alias :on? :get
end
class Game_Variables
include NameGameSV
NAMES_DEFAULT = 0
alias :kyon_name_gs_gv_gm_var_init :initialize
def initialize
kyon_name_gs_gv_gm_var_init
clear_names
end
end
Terms & Conditions
Free for use in any game.
Due credit is optional.
That's it!
It has several Optional Script Calls, thus feel free to read the # embedded comments left there.
Embedded Comments
Code:
# * Script Calls * #
# - Step 1: Find an Actor - 2 Methods
# actor = $game_actors[ActorID]
# actor = $game_party.member(ActorPosition)
# - Step 2: Use Any of the Following Calls
# - Check if the Actor Has a Trait - 2 Ways
# -- Pass a "Trait"
# actor.personality?("Trait")
# actor.like?("Trait")
# actor.dislike?("Trait")
# actor.hobby?("Trait")
# -- Pass 2 ActorID's
# personality?(ActorID1, ActorID2)
# like?(ActorID1, ActorID2)
# dislike?(ActorID1, ActorID2)
# hobby?(ActorID1, ActorID2)
# * Optional Script Calls * #
# Their purpose is to change the Traits at a specific moment or as per the
# player's request at a store, etc.
# - Change a Type of Trait Randomly
# actor.change_personality
# actor.change_like
# actor.change_dislike
# actor.change_hobby
WARNING!
It would fail if you are testing your game using old save files.
An Actor's Position or Actor's Index can be any Number starting from 0.
The larger your Party is, the more positions there will be available.
# ALL of these Script Calls will cause an Irreversible Loss of Equipment!
# actor will be treated by Game_Interpreter as a local variable.
# This means that once the event finishes processing the Call Script command,
# it will no longer exist.
# Use @actor instead if you need it to exist outside the Call Script command.
# Don't forget to add a Call Script command at the end of the process to clear
# that variable by entering: @actor = nil
# * Script Calls * #
# - Step 1: Find an Actor, namely a Teammate
# actor = $game_party.member(ActorIndex)
# OR #
# @actor = $game_party.member(ActorIndex)
# - Step 2: Use Any of the following Calls
# - Discard Equipment By Index (SlotID)
# actor.discard_equip_by_index(SlotID)
# - Discard Many of Them By Indexes (SlotIDs)
# actor.discard_equip_by_indexes(SlotID1, etc.)
# - Discard Equipment By Index (SlotID) and Store it in a Game Variable
# actor.store_discarded_equip_by_index(VarID, SlotID)
# - Discard Many of Them By Indexes (SlotIDs)
# -> It will store them in consecutive Game Variables!
# actor.store_discarded_equip_by_indexes(VarID, SlotID1, etc.)
class Game_Actor
# Store Equipment ID or Name? :id or :name or :equip (the whole object)
EQUIP_VAR_MODE = :id
def discard_equip_by_index(index)
this_equip = @equips[index]
this_equip.object = nil if this_equip.object
end
def discard_equip_by_indexes(*slot_ids)
slot_ids.each {|slot_id| discard_equip_by_index(slot_id) }
end
def equip_id_or_name(slot_id)
equip = @equips[slot_id].object
case EQUIP_VAR_MODE
when :id
equip ? equip.id : 0
when :name
equip ? equip.name : "?"
when
equip
end
end
def store_discarded_equip_by_index(var_id, index)
$game_variables[var_id] = equip_id_or_name(index)
discard_equip_by_index(index)
end
def store_discarded_equip_by_indexes(var_id, *slot_ids)
slot_ids.each do |slot_id|
store_discarded_equip_by_index(var_id, slot_id)
var_id += 1
end
end
end
class Game_Party
def member(pos)
$game_actors[@actors[pos]]
end
end
Terms & Conditions
Free for use in any game.
Due credit is mandatory.
Don't piss me off!
That's it!
Pick 1 Item and let your hero learn a New Skill based on the Actor ID or Class ID.
Side Note
If you ever want to use a single Item to make the heroes learn more than 1 Skill at a given time, use my KEquipSkills family of scripts for XP and VX. They are not identical!
For XP
Content Hidden
This script will let you teach a Skill to a Hero by consuming an Item!
There are a couple of caveats to keep in mind.
If the item has the FAILURE_ELEM_ID included in its Element Set, the Hero won't learn the Skill!
Or might learn some USELESS_SKILLS instead.
It is also possible to get a Predefined Item as a Byproduct!
You can limit the number of Heroes that can learn that specific Skill, too.
Add a Skill to SKILL_FOR_ACTORS Constant
Code:
# - Learn the Skill - For Everybody!
# [ItemID1] = [SkillID1]
# - Learn the Skill Depending on 1 or more ActorID's
# [ItemID2] = [SkillID2. nil, nil, ActorID1, etc.]
# - Learn the Skill, Earn an Item, Depending on 1 or more ActorID's
# [ItemID3] = [SkillID3, :item, ItemID1, ActorID1, etc.]
# - Learn the Skill, Check a State, Depending on 1 or more ActorID's
# [ItemID4] = [SkillID4, :state, StateID1, ActorID1, etc.]
For VX
Content Hidden
It teaches your hero a brand new skill using a simple item with special note tags!
If the item has the FAILURE_ELEM_ID included in its Element Set, the Hero won't learn the Skill!
Leave a Note in the Item's Note Box for specific Actors: _teach skill 33 actors 2_
Leave a Note in the Item's Note Box for specific Classes: _teach skill 33 classes 2_
Leave a Note in the Item's Note Box for specific States: _teach skill 33 states 2_
Leave a Note in the Item's Note Box to include Useless Skills to be learned if it fails _useless skills 1 2 3_
Obviously, you can add as many actors or classes as deemed necessary.
OR you can use number 0 for All Actors or All Classes!
For VX ACE and MV
Content Hidden
I know very well that both VX ACE and MV allows you to consume an item and automatically teach the target hero some skill. That's what has inspired me to look for a way to limit that ability to only allow certain actors or classes learn such an useful skill.
Leave a Note in the Item's Note Box for specific Actors: _teach skill actors 1_
Leave a Note in the Item's Note Box for specific Classes: _teach skill classes 1_
Leave a Note in the Item's Note Box for specific States: _teach skill states 1_
Obviously, you can add as many actors or classes as deemed necessary.
Free for use in any game as long as you don't mess with this badass!
Due credit is mandatory.
Tell the werewolf and the bounty hunter that tons of spammers are coming their way!
That's it!
There was an old scriptlet that would make you pick the stats you don't want to show up.
My script actually asks you to tell it which stats you want to show on screen on different menu scenes.
Why did I make it?
That's easy to answer! The old script sucked. It was inefficient. It included too many extra steps for no good reason.
And yes, it works with Yanfly's Party System as well.
Here are some details on how you'd configure it.
Code:
# Available STATS for the STATS Constant:
# 2 - ATK
# 3 - DEF
# 4 - MAT
# 5 - MDF
# 6 - AGI
# 7 - LUK
Free for use in any game.
Due credit is mandatory.
Getting a free copy of your game would be appreciated.
Don't delete the header nor my embedded comments.
That's it!
All editions of the Maker offer you a way to assign the Party's Steps to a Game Variable. Normally, that's all you ever needed to do right?
What if you actually needed to keep track of the current map's steps only?
Here's where this scriptlet comes to help you achieve your stepping goal!
For All RGSS Editions
Assign a Game Variable ID to VAR_ID and you're ready to go!
There is also the LAST_VAR_ID that will help you keep track of your previous map's steps.
And you can also count on the TOTAL_VAR_ID to check if your player has reached the maximum number of steps for a given couple of maps.
The steps will be reset every single time you move to another map!
This is the most basic script or plugin that one could ever publish, but here I am publishing it here. :tongueout:
Yes, this script lets you customize the way your heroes will level up.
There is always a DEFAULT option to rely upon in case you do not set a custom type of heal for your heroes.
For XP & VX
Code:
# Enter HP or SP or States or combine them at will.
# Enter ALL for all 3 options.
# * Script Calls * #
# - Set the Default Type In Game
# $game_system.lvlup_default = "" OR "SP" OR "HP States"
# - Step 1: Find an Actor - 2 Methods:
# actor = $game_actors[ActorID]
# actor = $game_party.actor(ActorID)
# - Step 2: Add a given Actor's Type in Game: :hp or :sp or :states or :all
# actor.add_lvlup_type(Type)
# - Or Remove a given Actor's Type in Game: :hp or :sp or :states or :all
# actor.remove_lvlup_type(Type)
It allows you to leave note tags to get your Actors restore their HP or MP or both of them or clear their states or handle all of that in a blink of an eye.
For VX ACE
You can also combine options like this: <lvlup hp states>
For All Editions
If you prefer to set a default value via the DEFAULT Constant or the Plugin Manager, you would just need to enter a string containing any of these options:
HP or MP or States or ALL
Both the note tags and the default options are case insensitive.
No, it's not a Blue Mage skill script!
Your heroes don't need to ever die to learn the skill for one reason only...
They will steal it themselves!
For XP
Code:
# If you succeed, the Target Animation will be displayed on top of your hero!
# Add the same number of Skill & State ID's to the SKILL_IDS & STATE_IDS
# Constants because they are totally correlated.
# The higher the Skill ID, the more powerful it should be.
# Create the same number of Skills and States in the DB.
# The stealable skills may add 1+ of those States to their Plus State Set.
# They are another indicator of the Skill's Power Level required to steal them.
module SkillRobber
SKILL_IDS = [82, 83]
FAIL_SKILL_ID = 101
WAIT_FRAMES = 20
MESSAGE_LEARNED = "%s already learned %s!"
MESSAGE_SUCCESS = "%s successfully stole %s!"
MESSAGE_FAILURE = "%s failed to steal any skill!"
MESSAGE_NO_SKILL = "%s found no skill to steal from %s"
For VX
Code:
# Create the same number of Skill & State ID's in the DB.
# The new skills should include the following note tag:
# <steal skill lvl 1>
# The level increases the more useful the given skill is.
# The stealable skills may only add 1 single State depending on the mininmum
# skill level required to steal them.
module SkillRobber
SKILL_ANIME = 49
For VX ACE
Code:
# Create the same number of Skill & State ID's in the DB.
# The new skills should include the following note tags:
# Stealable Skill's Note Tag
# <stealable skill lvl 1>
# The level indicates how powerful Skill Robber should be in order to learn it.
# The animations will be used for the success and failure cases. Here a fail
# actually means that your hero already knows the skill.
This scriptlet or short plugin provides you with the following features:
Treat a Win as a Loss
Treat an Escape as a Loss
For XP, VX & VX ACE
Set the appropriate value of SWITCH_NO_WIN and SWITCH_NO_ESCAPE to the right Switch ID and turn on any of those switches before the battle begins (confirmed) or as part of a Troop page (untested).
For RMMV
You just need to pick the right Game Switches on the Plugin Manager and then turn on any of those switches before the battle begins (confirmed) or as part of a Troop page (untested).
# This scriptlet lets you change the Background and Foreground Titles of your
# game project based on the value of a predefined Game Variable.
# You must configure 7 CONSTANTS to tell it which Title will be displayed on
# screen at that specific point.
# * Warning! * #
# If you don't use the Scene_End menu scene, delete that part from this script.
module KTitleUpdate
# For the Game's Root Save Directory the String might be "Save*"
# For a Custom Save Directory the String might be "CustomDir/Save*"
DIR_N_SAVE_FILENAME = "Save*"
TITLE_VAR_ID = 1
# Load Data Types: :var_max or :recent
LOAD_DATA_TYPE = :var_max
USE_BACKGROUNDS = true
USE_FOREGROUNDS = true
# Manually List All of Your Background and Foreground Titles
BACKGROUNDS = ["Book", "Fountain", "Island", "Sword"]
FOREGROUNDS = ["Metal", "Heroes", "Mist", "Mountains"]
extend self
def sort_save_files
Dir[DIR_N_SAVE_FILENAME].sort
end
def find_bg_fg(index)
[BACKGROUNDS[index], FOREGROUNDS[index]]
end
end
module DataManager
extend self
attr_accessor :titles, :total_save_files
def load_vars_only(fn)
File.open(fn, "rb") do |file|
Marshal.load(file)
data = Marshal.load(file)
variables = data[:variables]
@titles << variables[KTitleUpdate::TITLE_VAR_ID]
@make_times << File.mtime(fn) rescue Time.at(0)
end
end
def default_title?
@titles.empty? or @titles.max == 0
end
check_save_files
end
class Scene_Title
alias :kyon_title_change_scn_ttl_create_backgr :create_background
def create_background
if DataManager.default_title?
kyon_title_change_scn_ttl_create_backgr
else
custom_background
end
end
def custom_background
case KTitleUpdate::LOAD_DATA_TYPE
when :var_max
background, foreground = DataManager.highest_titles
when :recent
background, foreground = DataManager.latest_titles
end
@sprite1 = Sprite.new
@sprite1.bitmap = Cache.title1(background)
@sprite2 = Sprite.new
@sprite2.z = 25
@sprite2.bitmap = Cache.title2(foreground)
center_sprite(@sprite1)
center_sprite(@sprite2)
end
end
class Scene_End
alias :kyon_title_change_scn_end_comm_ttl :command_to_title
def command_to_title
kyon_title_change_scn_end_comm_ttl
DataManager.check_save_files
end
end
Usually, I would not make this kind of simple scripts, still, an unknown forumer was desperate to get another one work the way he expected and it made me flex my scripting muscles once again.
Terms & Conditions
Free for use in any game
Due credit is optional but appreciated.
That's it!