Skip to content

Instantly share code, notes, and snippets.

@HimeWorks
HimeWorks / scrolling_parallax_speed.rb
Created August 2, 2016 19:22
[Ace] Scrolling Parallax Speed
# Script that allows you to specify custom scroll speeds for parallax scrolling.
# Note-tag maps with:
#
# <horz scroll: VALUE />
# <vert scroll: VALUE />
#
# The VALUE is a number that determines how fast it scrolls.
#
# You can specify positive or negative numbers depending on whether you want it to scroll left or right.
@HimeWorks
HimeWorks / mv_damage_formula_debug.js
Created May 26, 2016 15:40
MV Damage Formula Debug
// By default, RPG Maker MV simply returns 0 and pretends nothing wrong happened.
// We allow it to continue to return 0, but it should print out a stacktrace.
Game_Action.prototype.evalDamageFormula = function(target) {
try {
var item = this.item();
var a = this.subject();
var b = target;
var v = $gameVariables._data;
var sign = ([3, 4].contains(item.damage.type) ? -1 : 1);
@HimeWorks
HimeWorks / wasd_movement.rb
Created May 9, 2016 17:11
WASD + 8-dir movement
# Title: WASD Movement
# Author: Hime
# Description: Allows you to use WASD keys for movement, with support for
# diagonal movement: http://himeworks.com/2014/11/eight-directional-movement/
#==============================================================================
module Input
#--------------------------------------------------------------------------
# alias method: self.dir4
#--------------------------------------------------------------------------
@HimeWorks
HimeWorks / lonewolf_gamepad_extender.rb
Created April 22, 2016 19:52
Lone Wolf - Gamepad Extender
#================================================= =============================
# Gamepad Extender v1.0a (7/25/12)
# by Lone Wolf
#------------------------------------------------------------------------------
# This allows scripters to utilize the extra buttons on modern
# XInput-compatible gamepads. It requires DirectX 9.0 or later and
# an XInput compatible gamepad. Incompatible pads will default to
# using the standard Input module functionality.
#
# This is not a plug-and-play script.
@HimeWorks
HimeWorks / gist:778102940f8c70ecf7f38faad4e56cf2
Created April 6, 2016 15:00
[Ace] Show items from all party members during key item selection
class Window_KeyItem < Window_ItemList
def make_item_list
@data = []
$game_party.members.each {|mem|
@data.concat(mem.all_items.select {|item| include?(item) })
}
@data.uniq!
@data.push(nil) if include?(nil)
end
@HimeWorks
HimeWorks / Window Drawing Test
Created March 2, 2016 18:41
Test. Draw 100 numbers in a window on the map.
function Window_Test() {
this.initialize.apply(this, arguments);
}
Window_Test.prototype = Object.create(Window_Base.prototype);
Window_Test.prototype.constructor = Window_Test;
Window_Test.prototype.initialize = function() {
Window_Base.prototype.initialize.call(this, 0, 0, Graphics.width, 200);
@HimeWorks
HimeWorks / HIME_VictoryAftermath_ActionExp.js
Created February 25, 2016 20:32
Compatibility patch for HIME Battle Action EXP with Yanfly Victory Aftermath
/* Insert this code under both yanfly's victory aftermath and HimeWorks Battle Action EXP to properly show level ups.
*/
var TH_VictoryAftermath_BattleManager_startBattle = BattleManager.startBattle;
BattleManager.startBattle = function() {
TH_VictoryAftermath_BattleManager_startBattle.call(this);
this.prepareBattleStartInfo();
}
BattleManager.prepareBattleStartInfo = function() {
@HimeWorks
HimeWorks / HimeATB_v6.js
Created January 29, 2016 05:20
Hime ATB: Initial ATB and encounter type
// Version 6 of Hime ATB. We implement custom initial ATB based on surprise or preemptive encounter
// Code example for tutorial: http://himeworks.com/2016/01/tutorial-series-hime-atb-6-initial-atb/
var Imported = Imported || {} ;
var TH = TH || {};
Imported.TH_ActiveTimeBattle = 1;
TH.ActiveTimeBattle = TH.ActiveTimeBattle || {};
(function ($) {
@HimeWorks
HimeWorks / HimeATB_v5.js
Last active January 29, 2016 03:25
Hime ATB: Bug Fixes 1
// Version 5 of Hime ATB. We implement a number of bug fixes that occur after testing various use cases
// Code example for tutorial: http://himeworks.com/2016/01/tutorial-series-hime-atb-5-bug-fixes-1/
var Imported = Imported || {} ;
var TH = TH || {};
Imported.TH_ActiveTimeBattle = 1;
TH.ActiveTimeBattle = TH.ActiveTimeBattle || {};
(function ($) {
@HimeWorks
HimeWorks / HimeATB_v3.js
Last active January 28, 2016 03:42
Hime ATB: Turn Counts
// Version 3 of Hime ATB, with support for turn counts.
// Code example for tutorial: http://himeworks.com/2016/01/tutorial-series-hime-atb-3-implementing-turn-count/
var Imported = Imported || {} ;
var TH = TH || {};
Imported.TH_ActiveTimeBattle = 1;
TH.ActiveTimeBattle = TH.ActiveTimeBattle || {};
(function ($) {