Skip to content

Instantly share code, notes, and snippets.

@HimeWorks
HimeWorks / y_distance_zoom
Created December 31, 2014 02:35
RPGMaker Y-Distance Zoom
class Sprite_Character
alias :th_y_distance_update_other :update_other
def update_other
th_y_distance_update_other
update_distance_zoom
end
def update_distance_zoom
ratio = ((@character.screen_y - 50) / Graphics.height.to_f * 2 ) + 0.4
@HimeWorks
HimeWorks / Battle_Data_CarryOver
Created January 1, 2015 17:51
Battle Data CarryOver
# Simple proof-of-concept of how to save and load battle data across battles.
# Simply make script calls during battle.
class Game_Temp
attr_accessor :boss_data
end
class Data_BattleData
attr_accessor :hp
@HimeWorks
HimeWorks / Battle_Party_Actors
Created January 1, 2015 19:56
Check if an actor is in the Battle Party
# RPG Maker VX Ace example
#
# The "Battle party" are the party members that will participate in battle.
# You can use conditional branches to check who is in the battle party
# eg: Check if actor 1 is in the battle party
$game_party.battle_members.include?($game_actors[1])
# eg: Check if actor 5 is not in the battle party
!$game_party.battle_members.include?($game_actors[5])
@HimeWorks
HimeWorks / Hide Window Border and Title
Created January 3, 2015 19:27
Hide Window Border and Title
# This snippet will hide the window border and title for your RPG Maker VXAce game
# Simply insert it somewhere above Main in your project.
# Taken from Zeus81 Fullscreen++
# http://forums.rpgmakerweb.com/index.php?/topic/14081-fullscreen/
CreateWindowEx = Win32API.new('user32', 'CreateWindowEx', 'ippiiiiiiiii', 'i')
FindWindow = Win32API.new('user32', 'FindWindow', 'pp', 'i')
SetWindowLong = Win32API.new('user32' , 'SetWindowLong' , 'iii' , 'i')
@HimeWorks
HimeWorks / Toggle Border Addon
Created January 3, 2015 21:00
Toggle Border add-on to Fullscreen++
# This is an add-on to Zeus81's fullscreen++ script for RPG Maker
# http://forums.rpgmakerweb.com/index.php?/topic/14081-fullscreen/
# You can basically hide/show the title and border of the game window
# by pressing F8
# Doesn't work with F6 though.
class << Graphics
@border_hidden = false
@HimeWorks
HimeWorks / Non-Cumulative EXP display
Last active August 29, 2015 14:13
Non-Cumulative EXP display
# RPG Maker VX Ace by default shows the cumulative EXP up to now.
# For example, Level 1 to Level 2 requires 50 EXP and Level 2 to Level 3 requires 50 EXP.
# If you just reached level 2, Ace would say you currently have 50 EXP and need 50 EXP to level.
# This snippet makes it so that the current exp displayed is relative to the current level, and not level 1.
# So now it would say you have 0 EXP and need 50 EXP.
class Window_Status < Window_Selectable
def draw_exp_info(x, y)
s1 = @actor.max_level? ? "-------" : @actor.exp - @actor.exp_for_level(@actor.level)
@HimeWorks
HimeWorks / Pre-Battle Common Event
Created January 12, 2015 21:23
Pre-Battle Common Event
# Demonstration of how to run a common event when you encounter an enemy
class Scene_Map < Scene_Base
alias :th_encounter_common_event_start :start
def start
th_encounter_common_event_start
@battle_pending = false
end
@HimeWorks
HimeWorks / Region ID Sheet Generator
Last active August 29, 2015 14:13
Region ID Sheet Generator
# Just storing this somewhere
module TH
Colors = {
0 => [ [175, 105, 105], [183, 95, 95]],
1 => [ [175, 140, 106], [183,139,95]],
2 => [ [175, 174, 106], [183, 182, 95]],
3 => [ [141, 175, 106], [140, 183, 95]],
4 => [ [106, 175, 106], [95, 183, 95]],
@HimeWorks
HimeWorks / No Battle Transition
Created February 26, 2015 19:18
No Battle Transition
class Scene_Map
def pre_battle_scene
Graphics.update
Graphics.freeze
@spriteset.dispose_characters
BattleManager.save_bgm_and_bgs
BattleManager.play_battle_bgm
#~ Sound.play_battle_start
end
@HimeWorks
HimeWorks / SimpleMenuCursor
Created March 23, 2015 18:27
Simple Menu Cursor
class Sprite_Cursor < Sprite
def initialize(viewport=nil, window)
super(viewport)
@window = window
@name = "Menu_Cursor"
end
def update
super