Introduction
This is my collection of code snippets i make for fun. I just release to the public in case they want them or see them as handy. This is not a shop, don't ask me to write you a snippet. I write these in my spare time and therefore, requests ruin my fun.
List
Here is a list of all my snippets here, useful more so when i get more. Descriptions for snippets can be found here in the list.
Code:
WindowSkin Snippet: This lets you have custom windowskins for every default window in the program.
Hide Text Box Snippet: This lets you make a text box that can be hidden, then brought back up by the player.
Run/Guard Hotkey: This lets you assign a button for quick access in battle that lets the player guard, or run.
Run/Guard Hotkey ATB Version: Does the same as the above, except works only with ATB.
Aliased Load Menu Option: It adds a Load menu option for quick loading.
Speed Save: This lets you assign a button to bring up the save menu quickly.
Extra Windows: This adds extra windows to the main menu, decided by you.
Parameter Icons: This adds icons next to parameters. Not yet compatible with Enelvon’s luck and resistance scripts.
Success Bar: This lets you create a bar of success that can turn switches on/off.
Change Actor Options: This allows you to change actor options like super guard or two swords style.
No Actor EXP: This allows you to define actors that cannot gain exp for some reason or another.
Change Windowskin: This lets you change the windowskin will in-game with a simple script call.
Cheat System: This lets you add a cheat system to your game.
The Snippets
Windowskin snippet:
[rgss] #===============================================================================
# WindowSkin Snippet
# By Jet10985
#===============================================================================
# This snippet allows you to change the windowskin of every default window in
# the program.
# This script has: A lot of customization options.
#===============================================================================
# This script is not open for distribution to other sites without permission
# from me, Jet10985. Please credit me if you use this script, for aliasing is
# slightly difficult, and you probably couldn't do it unless your cool
# like scripters are. Make sure that the new windowskin is not called window
# because that would replace the default skin, unless that's what you wanted.
# Also make sure the new windowskin is in the Graphics/System folder
#===============================================================================
module Windowskins
# This Window is what is shown in the main menu containing player info.
MENU_STATUS_SKIN = "window"
# This the windows that has menu commands like "items, skills, equip"
MENU_COMMAND_SKIN = "window"
# This is the window that appears when you click game end in the menu.
GAME_END_SKIN = "window"
# This is the status screen window. That's self explanatory.
STATUS_SCREEN_SKIN = "window"
# This is the window text in shown in from events.
MESSAGE_SKIN = "window"
# This is the window that shows items in the inventory.
ITEM_SKIN = "window"
# This shows what the item does/it's desciption
ITEM_DESCRIPTION_SKIN = "window"
# This is the window shown when you have to select what actor to use the item on
ITEM_USE_SKIN = "window"
# This shows what the actor has equipped
EQUIP_SKIN = "window"
# This shows the actors parameter changes in the equip screen
EQUIP_STATUS_SKIN = "window"
# This shows all the items the player can equip
EQUIP_LIST_SKIN = "window"
# This shows the weapon/armor description.
EQUIP_DESCRIPTION_SKIN = "window"
# This shows the actors details on the skill screen.
SKILL_SKIN = "window"
# This shows all the skills the actor has to use.
SKILL_LIST_SKIN = "window"
# This shows the skills description
SKILL_DESCRIPTION_SKIN = "window"
# This is the window shown when you have to select what actor to use the skill on
SKILL_USE_SKIN = "window"
# This window shows how much gold you have.
GOLD_SKIN = "window"
# This is the left half of the debug screen.
DEBUG_LEFT_SKIN = "window"
# This is the right half of the debug screen.
DEBUG_RIGHT_SKIN = "window"
# This is the other window in the debug screen, below the right half.
DEBUG_DESCRIPTION_SKIN = "window"
# This is the window that holds the letters you can choose from in name input
NAME_INPUT_SKIN = "window"
# This shows the actors current name in name input
NAME_EDIT_SKIN = "window"
# This window is what pops-up when you have a number input.
NUMBER_INPUT_SKIN = "window"
# This window is when a text box is hsown in battle. Different then TEXT_SKIN.
BATTLE_MESSAGE_SKIN = "window"
# This shows actor's names, hp, and mp in battle
BATTLE_STATUS_SKIN = "window"
# This shows the options in battle "attack, skill, guard, item"
BATTLE_COMMAND_SKIN = "window"
# This shows the items to choose from in battle.
BATTLE_ITEM_SKIN = "window"
# This shows the skills to choose from in battle
BATTLE_SKILL_SKIN = "window"
# This shows the description of items/skills in battle.
BATTLE_DESCRIPTION_SKIN = "window"
# This shows the options of "fight, run" at the beginning of battle
PARTY_COMMAND_SKIN = "window"
# This windows shows what enemy you are targeting
TARGET_ENEMY_SKIN = "window"
# This shows items to buy in the shop
SHOP_BUY_SKIN = "window"
# This shows items to sell in the shop
SHOP_SELL_SKIN = "window"
# This shows the amount of items to buy/sell in the shop
SHOP_NUMBER_SKIN = "window"
# This shows actors parameters in the shop.
SHOP_STATUS_SKIN = "window"
# This shows the command in the shop "buy, sell, cancel"
SHOP_COMMAND_SKIN = "window"
# This is shown when in the shop, but not in the buy/sell menus
SHOP_IDLE_SKIN = "window"
# This shows the description of items in shops.
SHOP_DESCRIPTION_SKIN = "window"
# This is the window that you can choose save files from.
SAVE_SKIN = "window"
# This shows the description of the save file.
SAVE_DESCRIPTION_SKIN = "window"
# This is the window t the beggining of starting a game "new game, continue"
TITLE_CHOICE_SKIN = "window"
end
#===============================================================================
# There is no need to edit further unless you know what you are doing.
# If you've got any errors, check to see if you spelled the name of the
# custom windowskin correctly. An underscore and capital letter in the wrong
# place can cause a error.
#===============================================================================
class Window_Base < Window
alias jets_little_script_initialize_window_base :initialize unless $@
def initialize(*args)
jets_little_script_initialize_window_base(*args)
if $scene.is_a?(Scene_Shop)
self.windowskin = Cache.system(Windowskins::SHOP_IDLE_SKIN)
elsif $scene.is_a?(Scene_Debug)
self.windowskin = Cache.system(Windowskins::DEBUG_DESCRIPTION_SKIN)
elsif
self.windowskin = Cache.system("Window")
end
end
end
#===============================================================================
class Window_Selectable
alias jet8912_initialize initialize unless $@
def initialize(*args)
jet8912_initialize(*args)
if $scene.is_a?(Scene_End)
self.windowskin = Cache.system(Windowskins::GAME_END_SKIN)
end
if $scene.is_a?(Scene_Menu)
self.windowskin = Cache.system(Windowskins::MENU_COMMAND_SKIN)
end
if $scene.is_a?(Scene_Title)
self.windowskin = Cache.system(Windowskins::TITLE_CHOICE_SKIN)
end
end
end
#===============================================================================
class Window_Help
alias jet6384_initialize initialize unless $@
def initialize
jet6384_initialize
if $scene.is_a?(Scene_Equip)
self.windowskin = Cache.system(Windowskins::EQUIP_DESCRIPTION_SKIN)
end
if $scene.is_a?(Scene_Skill)
self.windowskin = Cache.system(Windowskins::SKILL_DESCRIPTION_SKIN)
end
if $scene.is_a?(Scene_Item)
self.windowskin = Cache.system(Windowskins::ITEM_DESCRIPTION_SKIN)
end
if $scene.is_a?(Scene_File)
self.windowskin = Cache.system(Windowskins::SAVE_DESCRIPTION_SKIN)
end
if $scene.is_a?(Scene_Shop)
self.windowskin = Cache.system(Windowskins::SHOP_DESCRIPTION_SKIN)
end
if $scene.is_a?(Scene_Battle)
self.windowskin = Cache.system(Windowskins::BATTLE_DESCRIPTION_SKIN)
end
end
end
#===============================================================================
class Window_Gold
alias jet2944_initialize initialize unless $@
def initialize(*args)
jet2944_initialize(*args)
self.windowskin = Cache.system(Windowskins::GOLD_SKIN)
end
end
#===============================================================================
class Window_MenuStatus
alias jet3794_initialize initialize unless $@
def initialize(*args)
jet3794_initialize(*args)
if $scene.is_a?(Scene_Item)
self.windowskin = Cache.system(Windowskins::ITEM_USE_SKIN)
end
if $scene.is_a?(Scene_Menu)
self.windowskin = Cache.system(Windowskins::MENU_STATUS_SKIN)
end
if $scene.is_a?(Scene_Skill)
self.windowskin = Cache.system(Windowskins::SKILL_USE_SKIN)
end
end
end
#===============================================================================
class Window_Item
alias jet4759_initialize initialize unless $@
def initialize(*args)
jet4759_initialize(*args)
if $scene.is_a?(Scene_Equip)
self.windowskin = Cache.system(Windowskins::EQUIP_LIST_SKIN)
end
if $scene.is_a?(Scene_Item)
self.windowskin = Cache.system(Windowskins::ITEM_SKIN)
end
if $scene.is_a?(Scene_Shop)
self.windowskin = Cache.system(Windowskins::SHOP_SELL_SKIN)
end
if $scene.is_a?(Scene_Battle)
self.windowskin = Cache.system(Windowskins::BATTLE_ITEM_SKIN)
end
end
end
#===============================================================================
class Window_Skill
alias jet1983_initialize initialize unless $@
def initialize(*args)
jet1983_initialize(*args)
if $scene.is_a?(Scene_Battle)
self.windowskin = Cache.system(Windowskins::BATTLE_SKILL_SKIN)
elsif
self.windowskin = Cache.system(Windowskins::SKILL_LIST_SKIN)
end
end
end
#===============================================================================
class Window_SkillStatus
alias jet2739_initialize initialize unless $@
def initialize(*args)
jet2739_initialize(*args)
self.windowskin = Cache.system(Windowskins::SKILL_SKIN)
end
end
#===============================================================================
class Window_Equip
alias jet2344_initialize initialize unless $@
def initialize(*args)
jet2344_initialize(*args)
self.windowskin = Cache.system(Windowskins::EQUIP_SKIN)
end
end
#===============================================================================
class Window_EquipStatus
alias jet2848_initialize initialize unless $@
def initialize(*args)
jet2848_initialize(*args)
self.windowskin = Cache.system(Windowskins::EQUIP_STATUS_SKIN)
end
end
#===============================================================================
class Window_Status
alias jet4749_initialize initialize unless $@
def initialize(*args)
jet4749_initialize(*args)
self.windowskin = Cache.system(Windowskins::STATUS_SCREEN_SKIN)
end
end
#===============================================================================
class Window_SaveFile
alias jet2739_initialize initialize unless $@
def initialize(*args)
jet2739_initialize(*args)
self.windowskin = Cache.system(Windowskins::SAVE_SKIN)
end
end
#===============================================================================
class Window_ShopBuy
alias jet1224_initialize initialize unless $@
def initialize(*args)
jet1224_initialize(*args)
self.windowskin = Cache.system(Windowskins::SHOP_BUY_SKIN)
end
end
#===============================================================================
class Window_ShopNumber
alias jet5696_initialize initialize unless $@
def initialize(*args)
jet5696_initialize(*args)
self.windowskin = Cache.system(Windowskins::SHOP_NUMBER_SKIN)
end
end
#===============================================================================
class Window_ShopStatus
alias jet9999_initialize initialize unless $@
def initialize(*args)
jet9999_initialize(*args)
self.windowskin = Cache.system(Windowskins::SHOP_STATUS_SKIN)
end
end
#===============================================================================
class Window_NameEdit
alias jet8888_initialize initialize unless $@
def initialize(*args)
jet8888_initialize(*args)
self.windowskin = Cache.system(Windowskins::NAME_EDIT_SKIN)
end
end
#===============================================================================
class Window_NameInput
alias jet7777_initialize initialize unless $@
def initialize(*args)
jet7777_initialize(*args)
self.windowskin = Cache.system(Windowskins::NAME_INPUT_SKIN)
end
end
#===============================================================================
class Window_Message
alias jet6666_initialize initialize unless $@
def initialize
jet6666_initialize
if $scene.is_a?(Scene_Battle)
self.windowskin = Cache.system(Windowskins::BATTLE_MESSAGE_SKIN)
elsif
self.windowskin = Cache.system(Windowskins::MESSAGE_SKIN)
end
end
end
#===============================================================================
class Window_PartyCommand
alias jet5555_initialize initialize unless $@
def initialize
jet5555_initialize
self.windowskin = Cache.system(Windowskins::PARTY_COMMAND_SKIN)
end
end
#===============================================================================
class Window_ActorCommand
alias jet4444_initialize initialize unless $@
def initialize
jet4444_initialize
self.windowskin = Cache.system(Windowskins::BATTLE_COMMAND_SKIN)
end
end
#===============================================================================
class Window_TargetEnemy
alias jet3333_initialize initialize unless $@
def initialize
jet3333_initialize
self.windowskin = Cache.system(Windowskins::TARGET_ENEMY_SKIN)
end
end
#===============================================================================
class Window_BattleStatus
alias jet2222_initialize initialize unless $@
def initialize
jet2222_initialize
self.windowskin = Cache.system(Windowskins::BATTLE_STATUS_SKIN)
end
end
#===============================================================================
class Window_DebugLeft
alias jet1111_initialize initialize unless $@
def initialize(*args)
jet1111_initialize(*args)
self.windowskin = Cache.system(Windowskins::DEBUG_LEFT_SKIN)
end
end
#===============================================================================
class Window_DebugRight
alias jet0000_initialize initialize unless $@
def initialize(*args)
jet0000_initialize(*args)
self.windowskin = Cache.system(Windowskins::DEBUG_RIGHT_SKIN)
end
end
[/rgss]
Hide Text Box:
[rgss] #===============================================================================
# Hide Text Box Snippet
# By Jet10985
# Original Code by Piejamas
#===============================================================================
# This snippet allows you to add scenes where the player can hide the textbox
# to maybe look at a picture then bring the box back up.
# This script has: 2 customization options.
#===============================================================================
module Hide
ACTIVATION_SWITCH = 5 # This is the switch that allows the player to hide the box
TRIGGER = Input::F8 # This is the button that needs to be pressed to hide the box
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Window_Message
include Hide
alias jet7535_base_update update unless $@
def update
jet7535_base_update
unless $scene.is_a?(Scene_Battle)
if $game_switches[ACTIVATION_SWITCH] && Input.trigger?(TRIGGER)
if self.visible
self.visible = false
elsif
self.visible = true
end
Sound.play_cursor
end
end
end
def input_pause
if Input.trigger?(Input::B) or Input.trigger?(Input::C)
if self.visible
self.pause = false
if @text != nil && !@text.empty?
new_page if @line_count >= MAX_LINE
else
terminate_message
end
end
end
end
end
[/rgss]
Run/Guard Hotkey:
[rgss] #===============================================================================
# Run/Guard Hotkey Snippet
# By Jet10985
#===============================================================================
# This snippet allows you to add a hotkey type system to let players have a
# handy button to automaticly run or guard. Cannot use with ATB.
# This script has: 2 customization options.
#===============================================================================
module Hotkey
GUARD_BUTTON = Input::F5 # This is what button is set to make you guard.
RUN_BUTTON = Input::F6 # This is what button is set to make you run.
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Scene_Battle < Scene_Base
include Hotkey
alias jet2847_update_actor_command_selection update_actor_command_selection unless $@
def update_actor_command_selection
jet2847_update_actor_command_selection
if Input.trigger?(GUARD_BUTTON)
Sound.play_decision
@active_battler.action.set_guard
next_actor
end
if Input.trigger?(RUN_BUTTON)
if !$game_troop.can_escape
Sound.play_buzzer
return
end
Sound.play_decision
process_escape
end
end
end
[/rgss]
Run/Guard Hotkey ATB version:
[rgss] #===============================================================================
# Run/Guard Hotkey Snippet, ATB version
# By Jet10985
#===============================================================================
# This snippet allows you to add a hotkey type system to let players have a
# handy button to automaticly run or guard. Only to be used with ATB.
# This script has: 2 customization options.
#===============================================================================
module Hotkey
GUARD_BUTTON = Input::F5 # This is what button is set to make you guard.
RUN_BUTTON = Input::F6 # This is what button is set to make you run.
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Scene_Battle < Scene_Base
include Hotkey
alias jet2847_update_actor_command_selection update_actor_command_selection unless $@
def update_actor_command_selection
jet2847_update_actor_command_selection
if Input.trigger?(GUARD_BUTTON)
Sound.play_decision
@commander.action.set_guard
end_command
end
if Input.trigger?(RUN_BUTTON)
if !$game_troop.can_escape
Sound.play_buzzer
return
end
Sound.play_decision
process_escape
end
end
end
[/rgss]
Alias Load Menu Option:
[rgss] #===============================================================================
# Aliased Load Menu Option Snippet v.2
# By Jet10985
# Thanks to: Woratana
#===============================================================================
# This snippet adds a load option to the main menu for quick loading.
# This script has: 2 customization options.
#===============================================================================
# To disable the load menu access use this command in the "script" event command
# change_load_access(option)
# option can equal either: true or false
# true disables the load menu, false activates it.
#===============================================================================
module Load
LOAD_NAME = "Load" # This is the name of the load option
MENU_INDEX = 5 #This is where to add the load menu as a option
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Game_System
attr_accessor :load_disabled
end
class Game_Interpreter
def change_load_access(option)
$game_system.load_disabled = option
end
end
class Window_Command < Window_Selectable
alias jet4569_initialize initialize unless $@
alias jet9374_draw_item draw_item unless $@
def initialize(*args)
@disabled_commands = []
jet4569_initialize(*args)
end
def draw_item(*args)
jet9374_draw_item(*args)
@disabled_commands[args[0]] = args[1].nil? || args[1] ? nil : true
end
def ins_command(index, text)
@commands.insert(index, text)
@disabled_commands.insert(index, nil)
old_disabled_commands = @disabled_commands.dup
self.height = (@commands.size + @column_max - 1) / @column_max * WLH + 32
@item_max = @commands.size
create_contents
refresh
old_disabled_commands.each_index do |i|
if !old_disabled_commands.nil?
draw_item(i, false)
end
end
end
def add_command(text)
ins_command(@commands.size, text)
end
end
class Scene_Menu < Scene_Base
include Load
def sort_newcommand
@sorted_command ||= []
newcommand = @newcommand - @sorted_command
newcommand.sort.each {|i| @menu_index += 1 if @menu_index >= i }
@command_window.index = @menu_index
@sorted_command = @sorted_command + @newcommand
end
alias jet6993_create_command_window create_command_window unless $@
def create_command_window(*args)
jet6993_create_command_window(*args)
@command_window.ins_command(MENU_INDEX, LOAD_NAME)
@newcommand ||= []
@newcommand << MENU_INDEX
sort_newcommand
if $game_system.load_disabled
@command_window.draw_item(MENU_INDEX, false)
end
end
alias jet3943_update_command_selection update_command_selection unless $@
def update_command_selection(*args)
@menucomorpg_change = false
if Input.trigger?(Input::C) && @command_window.index == MENU_INDEX
if $game_system.load_disabled
Sound.play_buzzer
return
end
Sound.play_decision
$scene = Scene_File.new(false, false, false)
else
if Input.trigger?(Input::C) && @command_window.index >
MENU_INDEX
@command_window.index -= 1
@menucomorpg_change = true
end
jet3943_update_command_selection(*args)
end
@command_window.index += 1 if @menucomorpg_change
end
alias jet3446_update_actor_selection update_actor_selection unless $@
def update_actor_selection(*args)
@menucomorpg_change = false
if Input.trigger?(Input::C) && @command_window.index >
MENU_INDEX
@command_window.index -= 1
@menucomorpg_change = true
end
jet3446_update_actor_selection(*args)
@command_window.index += 1 if @menucomorpg_change
end
end
[/rgss]
Speed Save:
[rgss] #===============================================================================
# Speed Save Option Snippet
# By Jet10985
#===============================================================================
# This snippet adds a hotkey to open the save menu quickly on the map.
# This script has: 1 customization option.
#===============================================================================
module Speed_Save
COMMAND_BUTTON = Input::F7 # This is what button is set to make you save.
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Scene_Map < Scene_Base
include Speed_Save
alias jet2228_update update unless $@
def update
jet2228_update
update_save
end
def update_save
if Input.trigger?(COMMAND_BUTTON)
if $game_system.save_disabled
Sound.play_buzzer
else
$scene = Scene_File.new(true, false, false)
end
end
end
end
[/rgss]
Extra Windows:
[rgss] #===============================================================================
# Extra Windows Snippet
# By Jet10985
# Inspired by Modern Algebra
#===============================================================================
# This snippet allows you to add more windows to the main menu that will give
# the player more detail into what they have accomplished while playing.
# This script has: 5 customization options.
#===============================================================================
module Extra_Window
GOLD_ICON = 147 # The icon that appears in the gold window
PLAY_TIME_ICON = 188 # The icon that appears in the PlayTime window
STEP_COUNTER_ICON = 48 # The icon that appears in the Step Counter window
LOCATION_ICON = 153 # The icon that appears in the Location window
#---------------------------------------------------------------------------
# Here is where you decide what windows actually appear. Here is the list:
# You can input numbers 0, 1, 2, and 3. always have a comma and space
# between numbers.
# 0 = Gold Window
# 1 = StepCount Window
# 2 = Location Window
# 3 = PlayTime Window
#---------------------------------------------------------------------------
EXTRA_WINDOWS = [0, 2]
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Game_System
include Extra_Window
attr_reader :extra_windows
alias jet7812_initialize initialize unless $@
def initialize(*args)
@extra_windows = EXTRA_WINDOWS
jet7812_initialize(*args)
end
end
#-------------------------------------------------------------------------------
class Game_Interpreter
def add_optional_window(id)
$game_system.extra_windows.push(id) unless $game_system.extra_windows.include?(id)
end
def remove_optional_window(id)
$game_system.extra_windows.delete(id)
end
end
#-------------------------------------------------------------------------------
class Window_PlayTime < Window_Base
include Extra_Window
def initialize(x, y)
super(x, y, 160, 32 + WLH)
refresh
end
def refresh
self.contents.clear
x, qe = 0, contents.width
if PLAY_TIME_ICON >= 0
draw_icon(PLAY_TIME_ICON, x, 0)
x += 24
qe -= 24
end
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(x, 0, qe, WLH, text, 2)
end
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#-------------------------------------------------------------------------------
class Window_StepCount < Window_Base
include Extra_Window
def initialize(x, y)
super(x, y, 160, 32 + WLH)
x, qe = 0, contents.width
if STEP_COUNTER_ICON >= 0
draw_icon (STEP_COUNTER_ICON, x, 0)
x += 24
qe -= 24
end
contents.font.color = normal_color
contents.draw_text (x, 0, qe, WLH, $game_party.steps.to_s, 2)
end
end
#-------------------------------------------------------------------------------
class Window_Gold
include Extra_Window
def draw_currency_value(value, x, y, width, *args)
if GOLD_ICON >= 0
draw_icon(GOLD_ICON, x, y)
x += 24
width -= 24
end
super(value, x, y, width, *args)
end
end
#-------------------------------------------------------------------------------
class Window_Location < Window_Base
include Extra_Window
def initialize(x, y)
height = 32 + WLH
y -= height
super(x, y, 160, height)
x, qe = 0, contents.width
if LOCATION_ICON >= 0
draw_icon(LOCATION_ICON, x, 0)
x += 24
qe -= 24
end
map_name = load_data("Data/MapInfos.rvdata")[$game_map.map_id].name
contents.font.color = normal_color
contents.draw_text(x, 0, qe, WLH, map_name, 2)
end
end
#-------------------------------------------------------------------------------
class Scene_Menu < Scene_Base
alias jet5839_start start unless $@
def start
jet5839_start
create_extra_windows
end
alias jet2039_terminate terminate unless $@
def terminate
jet2039_terminate
@extra_windows.each { |window| window.dispose }
end
alias jet1099_update update unless $@
def update
jet1099_update
if $game_system.extra_windows.include?(1)
@extra_windows[$game_system.extra_windows.index(1)].update
end
end
def create_extra_windows
y = Graphics.height
@extra_windows = []
$game_system.extra_windows.each { |i|
window = extra_window(i)
y -= window.height
window.y = y
@extra_windows.push(window)
}
end
def extra_window(index)
return case index
when 0 then Window_Gold.new(0, 0)
when 1 then Window_StepCount.new(0, 0)
when 2 then Window_Location.new(0, 0)
when 3 then Window_PlayTime.new(0, 0)
end
end
end
[/rgss]
Parameter Icons:
[rgss] #===============================================================================
# Parameter Icons Snippet
# By Jet10985
#===============================================================================
# This snippet allows you to add icons next to parameter names whenever they are
# shownn in windows. Currently Incompatable with Enelvon's Luck and Resistance.
# This script has: 4 customization options.
#===============================================================================
module ParamIcons
ATK_ICON = 132 # Icon shown next to Attack
DEF_ICON = 52 # Icon shown next to Defence
AGI_ICON = 48 # Icon shown next to Agility
SPI_ICON = 133 # Icon shown next to Spirit
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Window_Base < Window
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = Vocab::atk
parameter_value = actor.atk
parameter_icon = ParamIcons::ATK_ICON
when 1
parameter_name = Vocab::def
parameter_value = actor.def
parameter_icon = ParamIcons::DEF_ICON
when 2
parameter_name = Vocab::spi
parameter_value = actor.spi
parameter_icon = ParamIcons::SPI_ICON
when 3
parameter_name = Vocab::agi
parameter_value = actor.agi
parameter_icon = ParamIcons::AGI_ICON
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, WLH, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, WLH, parameter_value, 2)
self.draw_icon(parameter_icon, x - 25, y)
end
end
[/rgss]
Success Bar:
[rgss] #===============================================================================
# Success Bar Snippet
# By Jet10985
# Original Code by DarkLich (Reinorpg.com)
#===============================================================================
# This snippet allows you to call a success bar, a bar with an area of success
# you have to hit by pressing the designated button.
# This script has: 4 customization options.
#===============================================================================
# To create a success bar., you should use the command 'call script' with
# Following code ==>> $scene = Scene_Bar.new(F, S, B, X, W)
# F = How fast the targeter takes to go across the entire bar.
# S = This is what switch wll be turned on/off if they succeed.
# B = This is what switch will be turn on/off if they fail. Set to 0 if not wanted.
# X = Where the success area is located.
# W = How wide the success area is.
#===============================================================================
module SuccessBar
BACK_COLOR = Color.new(255, 255, 255) # The color of the bar background.
SUCCESS_AREA_COLOR = Color.new(0, 255, 0) # The color of the area of success.
TARGETER_COLOR = Color.new(255, 0, 0) # The color of the targeter.
INPUT_BUTTON = Input::C # The button you have to press to stop the targetter.
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Window_Bar < Window_Base
include SuccessBar
attr_accessor :rx
def initialize(xa, barwidth)
super(152, 192, 282, 50)
self.opacity = 0
@rx = 0
@xa = xa
@bw = barwidth
refresh
end
def refresh
self.contents.clear
self.contents.fill_rect(@rx, 0, 10, 18, TARGETER_COLOR)
self.contents.fill_rect(0, 5, 250, 8, BACK_COLOR)
self.contents.fill_rect(@xa, 5, @bw, 8, SUCCESS_AREA_COLOR)
end
def check
if @rx >= @xa && @rx + 10 <= @bw + @xa
return true
else
return false
end
end
end
class Scene_Bar < Scene_Base
include SuccessBar
def initialize(speed, switch, badswitch, x, barwidth)
@direita = true
@speed = speed
@switch = switch
@bswitch = badswitch
@x = x
@b = barwidth
end
def start
create_bg
@bar = Window_Bar.new(@x, @b)
end
def terminate
@bar.dispose
@back.dispose
end
def create_bg
source = $game_temp.background_bitmap
bitmap = Bitmap.new(544, 416)
bitmap.stretch_blt(bitmap.rect, source, source.rect)
@back = Sprite.new(@viewport1)
@back.bitmap = bitmap
end
def update
@bar.refresh
if @bar.rx >= 240
@direita = false
elsif @bar.rx <= 0
@direita = true
end
if @direita
@bar.rx += @speed
else
@bar.rx -= @speed
end
if Input.trigger?(INPUT_BUTTON)
if @bar.check
$game_switches[@switch] = !$game_switches[@switch]
else
if @bswitch > 0
$game_switches[@bswitch] = !$game_switches[@bswitch]
end
$scene = Scene_Map.new
Sound.play_buzzer
end
end
end
end
[/rgss]
Change Actor Options:
[rgss] #===============================================================================
# Change Actor Options Snippet v.2
# By Jet10985
# Inspired and partially written by: BigEd781
#===============================================================================
# This snippet allows you to change the options of an actor such as auto battle,
# super guard, and two swords style.
# This script has: No customization options.
#===============================================================================
# To change the option use this line of code:
# change_trait(actor, option)
# trait = the option you want to change. this can be replaced by:
# two_swords_style, auto_battle, super_guard, fix_equipment, parmacology
# MAKE SURE that you include the "_" in the ones that show it.
# option = true or false. True give the actor the trait, false takes it away.
# actor = id of actor trait you want to change. remember, it starts at 0.
#===============================================================================
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Game_Interpreter
def change_two_swords_style(actor, option)
$game_party.members[actor].actor.two_swords_style = option
end
def change_super_guard(actor, option)
$game_party.members[actor].actor.super_guard = option
end
def change_fix_equipment(actor, option)
$game_party.members[actor].actor.fix_equipment = option
end
def change_pharmacology(actor, option)
$game_party.members[actor].actor.pharmacology = option
end
def change_auto_battle(actor, option)
$game_party.members[actor].actor.auto_battle = option
end
end
[/rgss]
No Actor EXP:
[rgss] #===============================================================================
# No Actor EXP Snippet
# By Jet10985
# Help by: OriginalWij
#===============================================================================
# This snippet allows you to define actors throughout the game that will not
# gain exp AT ALL. Note: They can still level up trough the event command.
# This script has: 1 customization option.
#===============================================================================
<span style="color:#000080; font-style:italic;">=begin
<span style="color:#000080; font-style:italic;">
<span style="color:#000080; font-style:italic;">Adding Actors:
<span style="color:#000080; font-style:italic;">To add Actors to the list of actors that don't gain exp use:
<span style="color:#000080; font-style:italic;">
<span style="color:#000080; font-style:italic;">no_exp_gain(actor)
<span style="color:#000080; font-style:italic;">
<span style="color:#000080; font-style:italic;">where actor is the id of the actor you don't want gaining exp.
<span style="color:#000080; font-style:italic;">
<span style="color:#000080; font-style:italic;">Removing Actors:
<span style="color:#000080; font-style:italic;">To allow an actor to gain exp again, use:
<span style="color:#000080; font-style:italic;">
<span style="color:#000080; font-style:italic;">yes_exp_gain(actor)
<span style="color:#000080; font-style:italic;">
<span style="color:#000080; font-style:italic;">where actor is the id of the actor you want to gain exp again.
<span style="color:#000080; font-style:italic;">=end
module NoActorEXP
# These are actors that will not gain exp by default. They
# can be removed from here by using the yes_exp_gain(actor)
NO_ACTOR_EXP = [6, 7, 8]
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Game_Actor
include NoActorEXP
alias jet1999_change_exp change_exp unless $@
def change_exp (*args)
if NO_ACTOR_EXP != nil
jet1999_change_exp(*args) unless NO_ACTOR_EXP.include?(@actor_id)
end
end
end
class Game_System
include NoActorEXP
attr_accessor :no_exp_actors
alias jet1092_initialize initialize unless $@
def initialize
jet1092_initialize
@no_exp_actors = NO_ACTOR_EXP.clone
end
end
class Game_Interpreter
include NoActorEXP
def no_exp_gain(actor)
if $game_system.no_exp_actors != nil
$game_system.no_exp_actors[$game_system.no_exp_actors.size] = actor unless $game_system.no_exp_actors.include?(actor)
end
end
def yes_exp_gain(actor)
if $game_system.no_exp_actors != nil
$game_system.no_exp_actors.delete(actor) if $game_system.no_exp_actors.include?(actor)
end
end
end
[/rgss]
Change Windowskin:
[rgss] #===============================================================================
# Change WindowSkin Snippet
# By Jet10985
# Original Code by: Woratana
#===============================================================================
# This snippet allows you to change the windowskin of all the windows with a
# simple script call in-game.
# This script has: No customization options.
#===============================================================================
# To change the windowskin, use this code:
# change_skin(skinname)
# skinname = the name of the windowskin file.
# Please note: The windowskins must all be in the Graphics/system folder.
#===============================================================================
class Window_Base
alias jet2888_initialize initialize unless $@
def initialize(*args)
jet2888_initialize(*args)
self.windowskin = Cache.system($game_system.windowskin)
@wskin = $game_system.windowskin
end
alias jet1899_update update unless $@
def update
jet1899_update
if @wskin != $game_system.windowskin
self.windowskin = Cache.system($game_system.windowskin)
@wskin = $game_system.windowskin
end
end
end
class Game_System
attr_accessor :windowskin
alias jet4729_initialize initialize unless $@
def initialize
jet4729_initialize
@windowskin = "Window"
end
end
class Game_Interpreter
def change_skin(skinname)
$game_system.windowskin = skinname
end
end
[/rgss]
Cheat System:
[rgss] #===============================================================================
# Cheat System
# By Jet10985
# Help by: Yanfly
#===============================================================================
# This script is not open for distribution to other sites without permission
# from me, Jet10985. Please credit me if you use this script.
#===============================================================================
# This script will add a cheat system
#
# This script has: 6 customization options.
#===============================================================================
<span style="color:#000080; font-style:italic;">=begin
<span style="color:#000080; font-style:italic;">The cheat name and the common event id match in the 2 different arrays.
<span style="color:#000080; font-style:italic;">By default, if they put in "god" as a cheat, common event 1 would occur.
<span style="color:#000080; font-style:italic;">If they put "cash" in as a cheat, then common event 2 would occur.
<span style="color:#000080; font-style:italic;">
<span style="color:#000080; font-style:italic;">To add cheats, use a comma and write the cheat in quotations in the first array.
<span style="color:#000080; font-style:italic;">Then, write the id of the common event that will occur in the second array.
<span style="color:#000080; font-style:italic;">
<span style="color:#000080; font-style:italic;">NOTE: Each cheat can only be used 1 time.
<span style="color:#000080; font-style:italic;">
<span style="color:#000080; font-style:italic;">If you decide to add a menu option, you may disable the entering of cheats
<span style="color:#000080; font-style:italic;">by using this command in a script event:
<span style="color:#000080; font-style:italic;">
<span style="color:#000080; font-style:italic;">change_cheat_access(option)
<span style="color:#000080; font-style:italic;">
<span style="color:#000080; font-style:italic;">Where option can be true or false.
<span style="color:#000080; font-style:italic;">true = They CAN'T enter cheats
<span style="color:#000080; font-style:italic;">false = They CAN eneter cheats.
<span style="color:#000080; font-style:italic;">=end
module CheatSystem
CHEAT_NAME = ["god", "cash", "wowza"] # These are the cheats themselves.
CHEAT_EVENT = [1, 2, 3] # These are the common events the cheats correpsond to.
ACTOR_ID = 8 # This is the actor id whose name will be used for cheats.
ADD_MENU_OPTION = true # Add a menu option for the cheats?
CHEATS_NAME = "Cheats" # This is the name of the Cheats option.
MENU_INDEX = 5 #This is where to add the Cheats menu as a option.
end
class Game_System
attr_accessor :cheat_names
attr_accessor :cheat_event
attr_accessor :used_cheats
attr_accessor :cheats_disabled
end
class Scene_Name
include CheatSystem
alias jet8593_terminate terminate unless $@
def terminate
jet8593_terminate
cheat_update
end
def cheat_update
$game_system.cheat_names = CHEAT_NAME.clone if $game_system.cheat_names.nil?
$game_system.cheat_event = CHEAT_EVENT.clone if $game_system.cheat_event.nil?
$game_system.used_cheats = [] if $game_system.used_cheats.nil?
for i in 0...$game_system.cheat_names.size
if $game_actors[ACTOR_ID].name == $game_system.cheat_names
$game_temp.common_event_id = $game_system.cheat_event unless $game_system.used_cheats.include?(i)
$game_system.used_cheats.push(i)
end
end
end
end
class Game_Interpreter
def change_cheat_access(option)
$game_system.cheats_disabled = option
end
end
if CheatSystem::ADD_MENU_OPTION
class Window_Command < Window_Selectable
alias jet8590_initialize initialize unless $@
alias jet9743_draw_item draw_item unless $@
def initialize(*args)
@disabled_commands = []
jet8590_initialize(*args)
end
def draw_item(*args)
jet9743_draw_item(*args)
@disabled_commands[args[0]] = args[1].nil? || args[1] ? nil : true
end
def ins_command(index, text)
@commands.insert(index, text)
@disabled_commands.insert(index, nil)
old_disabled_commands = @disabled_commands.dup
self.height = (@commands.size + @column_max - 1) / @column_max * WLH + 32
@item_max = @commands.size
create_contents
refresh
old_disabled_commands.each_index do |i|
if !old_disabled_commands.nil?
draw_item(i, false)
end
end
end
def add_command(text)
ins_command(@commands.size, text)
end
end
class Scene_Menu < Scene_Base
include CheatSystem
def sort_newcommand
@sorted_command ||= []
newcommand = @newcommand - @sorted_command
newcommand.sort.each {|i| @menu_index += 1 if @menu_index >= i }
@command_window.index = @menu_index
@sorted_command = @sorted_command + @newcommand
end
alias jet8940_create_command_window create_command_window unless $@
def create_command_window(*args)
jet8940_create_command_window(*args)
@command_window.ins_command(MENU_INDEX, CHEATS_NAME)
@newcommand ||= []
@newcommand << MENU_INDEX
sort_newcommand
if $game_system.cheats_disabled
@command_window.draw_item(MENU_INDEX, false)
end
end
alias jet8905_update_command_selection update_command_selection unless $@
def update_command_selection(*args)
@menucomorpg_change = false
if Input.trigger?(Input::C) && @command_window.index == MENU_INDEX
if $game_system.cheats_disabled
Sound.play_buzzer
return
end
Sound.play_decision
$game_temp.name_actor_id = ACTOR_ID
$game_temp.name_max_char = 8
$scene = Scene_Name.new
else
if Input.trigger?(Input::C) && @command_window.index >
MENU_INDEX
@command_window.index -= 1
@menucomorpg_change = true
end
jet8905_update_command_selection(*args)
end
@command_window.index += 1 if @menucomorpg_change
end
alias jet1234_update_actor_selection update_actor_selection unless $@
def update_actor_selection(*args)
@menucomorpg_change = false
if Input.trigger?(Input::C) && @command_window.index >
MENU_INDEX
@command_window.index -= 1
@menucomorpg_change = true
end
jet1234_update_actor_selection(*args)
@command_window.index += 1 if @menucomorpg_change
end
end
end
[/rgss]