Quantcast
Channel: RGSS3 Scripts (RMVX Ace) Latest Topics
Viewing all 416 articles
Browse latest View live

Kai Monkey's Show Characters in Choice Box

$
0
0

Kai Monkey's Show Characters in Choice Box
lv8jIAx.png
Intro
Hello ♫
This is just a short little script which allows you to use Character sprites in your choice box's. It's just a small graphical add-on, and it may well have been done before, but I thought it could be useful for anyone who has players choosing from a list of Appearance options, Ally options, Armour options, ect. (Although for a more complete customization experience, see my Full Character Creation System
 
How to use:
The script is so simple to use, you might even have figured it out from the screenshot! When you're writing your options for your option box simply put the following code in-front of your text:

<char>SpriteSheetName,CharacterNumber</char>

Replacing SpriteSheetName with the name of the spritesheet with the character on, and CharacterNumber with the number of the position that character appears on the sheet:
 
CharacterNumber Guide:


cft6v06.png

 
Script:
ShowCharacterInChoiceWindow.txt
 
Finally
I hope people find this useful, and if you have any questions or suggestions, don't hesitate to post them here!

Some Popup 2.8

$
0
0

Some Popup 2.8

mikb89

Introduction

With this script you can specify some text to be drawn when the player face an event. Text can be binded above the event or above the player or in center of the screen. There are many transition effects and it's possible to use picture instead of text. You can also play a SE, ME, BGM or BGS, on every popup event or for specific ones.

Features

  • show simple text
  • bind in the middle of screen
  • bind above the player
  • bind above the event
  • show text grayed out
  • show picture
  • play SE/ME/BGM/BGS
  • fade text transition
  • move text transition
  • zoom text transition
  • transitions mixed together

Screenshots

somepopupvxace.png

How to Use

Copy the script under Materials to use.

Info on how to create popup event inside the script.

Demo

Multilanguage demo v. 2.8 (1.35 MB)

http://www.mediafire.com/?1q8pjd848mvd6n4

Script

# Some Popup v 2.8
# VX Ace version
# by mikb89

# Details:
# Show some popup text when facing an event.
# Text can be placed in center of screen, over the player or over the event.
# Write [pop] in a comment to assign the popup to an event and write in the
# next comment the text that will be shown.
# NOTE: [pop] is by default, but you can change it in the settings.
# Text can be also grayed, to indicate a non-available something. To do so,
# write [npop] instead of [pop].
# You can also show a picture instead of text. In order to do this, the first
# comment must be [ppop] and the second will contain the name of the Picture.
# It is possible to play a sound/music effect for each event. Just write in a
# third comment these lines:
# SE (or ME or BGM or BGS)
# Audio filename
# Volume (1-100)
# Pitch (50-150)
# You can omit the two last lines, and they will be set by default:
# Volume 80 for BGS and SE, 100 for BGM and ME
# Pitch 100
# ATTENTION: comments have to be the first two (or three) commands of the event.
#
# You can also call a script with:
# $game_player.remove_town_sprite
# in it to remove the sprite. For example if you put the sprite on an event
# which you'll speak, with this code you can remove the popup.

# Configurations:
module SPOP
ID = "pop" # set "loc" for old version compatibility.
# What you have to write on a event to be identified as popup one.
# If the value here is for example "pop" you'll have to write:
# - [pop] for the common text popup;
# - [npop] for the grayed out popup;
# - [ppop] for the picture popup.
AUTO_REMOVE_AT_TRANSFER = true
# Test to understand what I mean.
# true - gives the same effect as the one in Chrono Trigger towns.
# false - let the popup be visible after the teleport. Will fade out at the
# first player movement.
GRAYED_COLOR = Color.new(255,245,255,175)
# Value of grey color. Red, green, blue, alpha. From 0 to 255.
WALK_8_DIR = true
# You don't have to include the 8dir script. Just set true this.
POPUP_TRANSITION = 9
# The effect of the popup appearing/disappearing.
# 0: no effect
# 1: fading in/out
# 2: movement up/down
# 3: movement & fading
# 4: reduced movement
# 5: reduced movement & fading
# 6: zoom in/out
# 7: zoom & fading
# 8: zoom & movement
# 9: zoom, movement, fading
# 10: zoom & reduced movement
# 11: zoom, reduced movement, fading
POPUP_SOUND = ["SE", "Book1", 80, 100]
# Play something on popup.
# 4 parameters:
# 1. Sound kind ("SE", "ME", "BGS", "BGM");
# 2. Name of the file;
# 3. Volume (0-100);
# 4. Pitch (50-150 (or 15-453 if you want MAXIMUM values)).
# To deactivate sound just set "" the 2. or set 0 to 3. Examples:
# POPUP_SOUND = ["SE", "", 80, 100]
# POPUP_SOUND = ["SE", "Book1", 0, 100]
# Won't be played.
# Eventual BGM or BGS playing will fade as the graphic fade/zoom/move and
# will start after the popup close. Obviously not valid if using SE/ME.

# Examples with ME, BGM, BGS:
# POPUP_SOUND = ["ME", "Item", 100, 100]
# POPUP_SOUND = ["BGM", "Town1", 100, 100]
# POPUP_SOUND = ["BGS", "Clock", 100, 100]
POPUP_BINDING = 2
# Where the popup should be binded.
# 0: center of the screen
# 1: over the player
# 2: over the event
end

# Others:
# You'll see 'town' everywhere in the script. This is because of the SECOND
# name given to this script: "Popup town name".
# The FIRST original name was "Location system", from this the [loc] to add in
# event comments. By the way I never publicated the version with this name, so
# you won't find anything.

#Codename: spop

($imported ||= {})[:mikb89_spop] = true

# License:
# - You can ask me to include support for other scripts as long as these scripts
# use the $imported[script] = true;
# - You can modify and even repost my scripts, after having received a response
# by me. For reposting it, anyway, you must have done heavy edit or porting,
# you can't do a post with the script as is;
# - You can use my scripts for whatever you want, from free to open to
# commercial games. I'd appreciate by the way if you let me know about what
# you're doing;
# - You must credit me, if you use this script or part of it.

class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias_method(:initGP_b4_spop, :initialize) unless method_defined?(:initGP_b4_spop)
#class Game_Player#def initialize() <- aliased
def initialize
initGP_b4_spop
@town_sprite = nil
@town_text = ""
reset_audio
@town_ex_audio = nil
@sync_event = nil
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias_method(:updateGP_b4_spop, :update) unless method_defined?(:updateGP_b4_spop)
#class Game_Player#def update() <- aliased
def update
updateGP_b4_spop
if @town_sprite != nil
case SPOP::POPUP_BINDING
when 1
@town_sprite.x = $game_player.screen_x
if @town_sprite.y != $game_player.screen_y && $game_player.screen_y != @sync_y
@town_sprite.y = $game_player.screen_y - (@town_sprite.y - @sync_y).abs
@sync_y = $game_player.screen_y
end
when 2
if @sync_event != nil
@town_sprite.x = @sync_event.screen_x
if @town_sprite.y != @sync_event.screen_y && @sync_event.screen_y != @sync_y
@town_sprite.y = @sync_event.screen_y - (@town_sprite.y - @sync_y).abs
@sync_y = @sync_event.screen_y
end
remove_town_sprite if Math.hypot(@sync_event.distance_x_from($game_player.x), @sync_event.distance_y_from($game_player.y)) > 2
end
end
rem = false
@town_sprite.visible = SceneManager.scene_is?(Scene_Map)
@town_sprite.update
if [1,3,5,7,9,11].include?(SPOP::POPUP_TRANSITION)
@town_sprite.opacity -= 15 if @town_sprite.z == 5 && @town_sprite.opacity > 0
@town_sprite.opacity += 15 if @town_sprite.z == 10 && @town_sprite.opacity < 255
rem = true if @town_sprite.opacity <= 0
end
if [2,3,4,5,8,9,10,11].include?(SPOP::POPUP_TRANSITION)
mov = [4,5,10,11].include?(SPOP::POPUP_TRANSITION) ? 32 : 64
val = mov/16
t = @town_sprite.y
@town_sprite.y += val if @town_sprite.z == 5 && @toadd > -mov
@town_sprite.y -= val if @town_sprite.z == 10 && @toadd > 0
@toadd -= val if t != @town_sprite.y
rem = true if @toadd <= -mov
end
if [6,7,8,9,10,11].include?(SPOP::POPUP_TRANSITION)
if @town_sprite.z == 5 && @town_sprite.zoom_x > 0
@town_sprite.zoom_x -= 0.25
@town_sprite.zoom_y -= 0.25
end
if @town_sprite.z == 10 && @town_sprite.zoom_x < 1
@town_sprite.zoom_x += 0.25
@town_sprite.zoom_y += 0.25
end
rem = true if @town_sprite.zoom_x <= 0
end
if @town_ex_audio != nil
if @audiowait > 0
@audiowait -= 1
elsif @audiowait == 0
if @town_audio != nil
@town_audio.play
if @town_ex_audio.class != @town_audio.class
@town_ex_audio.replay
@town_ex_audio = nil
end
reset_audio if @town_audio.name != SPOP::POPUP_SOUND[1]
end
@audiowait = -1
end
end
remove_town_sprite(true) if rem
end
end
#--------------------------------------------------------------------------
# * Removing of town sprite when changing map
#--------------------------------------------------------------------------
alias_method(:perform_transfer_b4_spop, :perform_transfer) unless method_defined?(:perform_transfer_b4_spop)
#class Game_Player#def perform_transfer() <- aliased
def perform_transfer
remove_town_sprite(true, false) if SPOP::AUTO_REMOVE_AT_TRANSFER
perform_transfer_b4_spop
end
#--------------------------------------------------------------------------
# * Processing of Movement via input from the Directional Buttons
#--------------------------------------------------------------------------
#class Game_Player#def move_by_input() <- rewritten
def move_by_input
return unless movable?
return if $game_map.interpreter.running?
x, y = self.x, self.y
case SPOP::WALK_8_DIR ? Input.dir8 : Input.dir4
when 1
move_diagonal(4,2)#lower_left
if !@move_succeed
check_town(x-1, y+1)
else
check_town(x-2, y+2)
end
when 2
move_straight(2)#down
if !@move_succeed
check_town(x, y+1)
else
check_town(x, y+2)
end
when 3
move_diagonal(6,2)#lower_right
if !@move_succeed
check_town(x+1, y+1)
else
check_town(x+2, y+2)
end
when 4
move_straight(4)#left
if !@move_succeed
check_town(x-1, y)
else
check_town(x-2, y)
end
when 6
move_straight(6)#right
if !@move_succeed
check_town(x+1, y)
else
check_town(x+2, y)
end
when 7
move_diagonal(4,8)#upper_left
if !@move_succeed
check_town(x-1, y-1)
else
check_town(x-2, y-2)
end
when 8
move_straight(8)#up
if !@move_succeed
check_town(x, y-1)
else
check_town(x, y-2)
end
when 9
move_diagonal(6,8)#upper_right
if !@move_succeed
check_town(x+1, y-1)
else
check_town(x+2, y-2)
end
end
end
#--------------------------------------------------------------------------
# * Operations for sprite removal and audio stopping
#--------------------------------------------------------------------------
#class Game_Player#def remove_town_sprite(instant, audio)
def remove_town_sprite(instant=false, audio=true)
if @town_sprite != nil
if instant || SPOP::POPUP_TRANSITION == 0
if audio
@town_audio.class.stop if @town_audio != nil
@town_ex_audio.replay if @town_ex_audio != nil
end
@town_ex_audio = nil
@town_sprite.dispose
@town_sprite = nil
@sync_event = nil
else
@town_sprite.z = 5
unless @town_audio.is_a?(RPG::SE)
@town_audio.class.fade(4) if @town_audio != nil
end
end
end
end
#--------------------------------------------------------------------------
# * Set the audio as the one specified in SPOP or passed
#--------------------------------------------------------------------------
#class Game_Player#def reset_audio(spn)
def reset_audio(spn = SPOP::POPUP_SOUND)
@town_audio = (spn[1] == "" ||
spn[2] <= 0) ? nil :
case spn[0]
when "BGM"; RPG::BGM.new(spn[1], spn[2], spn[3])
when "BGS"; RPG::BGS.new(spn[1], spn[2], spn[3])
when "ME"; RPG::ME.new(spn[1], spn[2], spn[3])
when "SE"; RPG::SE.new(spn[1], spn[2], spn[3])
end
end
#--------------------------------------------------------------------------
# * Check if there is a town event in front of the player
#--------------------------------------------------------------------------
#class Game_Player#def check_town(x, y)
def check_town(x, y)
return false if $game_map.interpreter.running?
result = false
for event in $game_map.events_xy(x, y)
unless [1,2].include?(event.trigger) and event.priority_type == 1
if event.list != nil
if event.list[0].code == 108 and
["[#{SPOP::ID}]", "[n#{SPOP::ID}]", "[p#{SPOP::ID}]"].include?(event.list[0].parameters[0])
result = true
next if @town_sprite != nil && @town_sprite.z == 10 && @town_text == event.list[1].parameters[0]
remove_town_sprite(true)
@town_sprite = Sprite.new
@town_sprite.z = 10
if [6,7,8,9,10,11].include?(SPOP::POPUP_TRANSITION)
@town_sprite.zoom_x = @town_sprite.zoom_y = 0.0
end
@town_sprite.opacity = 15 if [1,3,5,7,9,11].include?(SPOP::POPUP_TRANSITION)
if event.list[0].parameters[0] != "[p#{SPOP::ID}]"
@town_sprite.bitmap ||= Bitmap.new(1,1)
siz = @town_sprite.bitmap.text_size(event.list[1].parameters[0])
h = siz.height
s = siz.width
@town_sprite.bitmap.dispose
@town_sprite.bitmap = Bitmap.new(s, 24)
if event.list[0].parameters[0] == "[n#{SPOP::ID}]"
ex = @town_sprite.bitmap.font.color
@town_sprite.bitmap.font.color = SPOP::GRAYED_COLOR
end
@town_sprite.bitmap.draw_text(0,2,s,22,event.list[1].parameters[0],1)
@town_sprite.bitmap.font.color = ex if event.list[0].parameters[0] == "[n#{SPOP::ID}]"
else
@town_sprite.bitmap = Cache.picture(event.list[1].parameters[0])
s = @town_sprite.bitmap.width
h = @town_sprite.bitmap.height
end
@town_text = event.list[1].parameters[0]
@town_sprite.ox = s/2
@town_sprite.oy = h/2
case SPOP::POPUP_BINDING
when 1
@town_sprite.x = $game_player.screen_x#*32+16
@town_sprite.y = @sync_y = $game_player.screen_y#*32+16
when 2
@town_sprite.x = event.screen_x#*32+16
@town_sprite.y = @sync_y = event.screen_y#*32+16
@sync_event = event
else
@town_sprite.x = 544/2# - s/2
@town_sprite.y = 416/2# - h/2
end
@town_sprite.y -= 64 if [0,1,6,7].include?(SPOP::POPUP_TRANSITION)
@town_sprite.y -= 32 if [4,5,10,11].include?(SPOP::POPUP_TRANSITION)
@toadd = [2,3,4,5,8,9,10,11].include?(SPOP::POPUP_TRANSITION) ? 64 : 0
@toadd -= 32 if [4,5,10,11].include?(SPOP::POPUP_TRANSITION)
if @town_audio != nil || event.list[2].code == 108
if ["BGM", "ME", "BGS", "SE"].include?(event.list[2].parameters[0]) &&
event.list[3].code == 408
arr = []
arr.push(event.list[2].parameters[0])
arr.push(event.list[3].parameters[0])
if event.list[4].code == 408
arr.push(event.list[4].parameters[0].to_i)
arr.push(event.list[5].parameters[0].to_i) if event.list[5].code == 408
else
arr.push(["BGS", "SE"].include?(event.list[2].parameters[0]) ? 80 : 100)
end
arr.push(100) if arr.size < 4
reset_audio(arr)
end
@town_ex_audio = @town_audio.class.last if [RPG::BGM, RPG::BGS].include?(@town_audio.class)
if @town_ex_audio != nil
@town_ex_audio.class.fade(4)
@audiowait = 4
else
@town_audio.play
reset_audio if arr != nil
end
end
end
end
end
end
remove_town_sprite unless result
return result
end
end

#--------------------------------------------------------------------------
# * Sprite removal at Save (can't save a Sprite) and End
#--------------------------------------------------------------------------
class Scene_Save < Scene_File
if method_defined?(:start)
alias_method(:start_SSav_b4_spop, :start) unless method_defined?(:start_SSav_b4_spop)
end
#class Scene_Save#def start() <- aliased/added
def start
if respond_to?(:start_SSav_b4_spop)
start_SSav_b4_spop
else
super
end
$game_player.remove_town_sprite(true)
end
end

class Scene_End < Scene_MenuBase
alias_method(:start_SEnd_b4_spop, :start) unless method_defined?(:start_SEnd_b4_spop)
#class Scene_End#def start() <- aliased
def start
start_SEnd_b4_spop
$game_player.remove_town_sprite(true)
end
end

Also visible on Pastebin.

FAQ

Q: Can I use the 8 directions script?

A: No, but the 8 dir functionality is included, just enable it in settings.

Credit and Thanks

Thanks Guardian of Irael for various suggestions.

Author's Notes

N/A

Dash Stamina

$
0
0

Dash Stamina

Introduction

This script provides stamina feature for dashing on map. Dashing will comsume stamina and be disable if run our of stamina.

Features

- Provides Stamina.

- A small window shows stamina.

Screenshots

kz2Gp.png

Download & Manual

Get them here

Credit

Yami

Theolized Sideview Battle System (Version 1.4 + Patch!)

$
0
0

Theolized Sideview Battle System

(Or if you prefer, you may call it Theo Animated Battle)

 

Original Post : Theolized Sideview BS
Version : 1.3c (Stable) / 1.4 (Open beta)
Type : Battle System / Battle Engine
 
Opening :
This is my first battle system script and my masterpiece script so far. At first, I made this script for my own personal use. Back then when Ace was released, I always wanted an English version of Tankentai. But I heard nothing about the translation. I thought it was impossible tankentai to be translated to English. Moreover, it has bad compatibility to other scripts. Then I looked at avalaible battle scripts, and not even a single script I like. I just don't get the idea of those scripts. Then, hence my ambition started. 
 
Introduction :
This script was greatly inspired from Tankentai VX version and Eremidia : Dungeon! game. It's mainly aimed for free sequence animated battle without standard. I mean, there is no such a thing like "play all frames in row x" (the reason why I did this is because I hate standards). You can pick any grid in your spriteset. You can even use unorganized spriteset if you're too lazy to make one. As long as the format is consistent.
 
Features :

  • Animated battle of course
  • Free battler sequence
  • Free format battler sprite. You can even use unorganized spriteset as long as the format is consistent
  • Built-in damage counter
  • The rest are written in script ... and my sample game

Screenshots (taken from the old version) :


ss30.jpg
AED13.jpg
ss23.jpg
ss36.jpg

 
Video :

video for version 1.3 (also trailer for the sample game)

video for version 1.4

video for setup demonstration

You can look at my playlist if you want more

 
Scripts :
You could grab the raw on my github repository (old version, havent update it yet)

Or try Sample game
 

Latest version? Get it here | Mirror

Animation Samples / Alternative Demo : Click here | Mirror

 

Note :

If you want to download in solidfiles. Here is the way

7Drgida.jpg

 

IMPORTANT! Patch for version 1.4 - 04/02/2015
Just various bugfixes. Most likely going to stable version

https://github.com/t...1.4 Bugfixes.rb

 

How to patch? Simply put it below implementation

tsbs-patch.jpg

 

Newly Released addon :

 

Questions and Answers :

Q: Is it has a high compatibility?

A: Maybe yes, maybe no. I alter the damage flows. Any script that also alter the damage flow will highly not compatible. Such as YEA - Area of Effect or Lunatic Damage. But I haven't touch the HUD so var. I only provide animated battle sprite. So It's possible if you want to put any style of HUD for your battle system. It's also compatible with YEA Free turn battle, and Sabakhan Ao no Kiseki BS, and formar ATB (It should go under my script), EST - Ring System, AEA - Charge Turn Battle. Luna Engine. Doesn't work with Ocedic Motion Battle Camera.

 

In version 1.4, I tested the compatibility among various Yanfly Script. So, mine gonna be compatible with most of Yanfly's Include AoE or Lunatic series. Also, I have my own battle camera addon if you want.

 
Q: Can I use holder battler?
A: Yes, you can. But it will little bit troublesome. Since holder battler format has many rows in single battler image. I recommend you to split it up.
 
Q: What do you mean by "Format is consistent"?
A: If you decided to make 3x4 spriteset format like Kaduki do, then the rest of your battler sprites should also 3x4
 
Q: Can you make this script compatible with ...
A: No ... http://fc05.deviantart.net/fs70/f/2014/110/b/5/scripter_by_theoallen-d7fchsv.jpg But I will try if I like the script. As for Victor's scripts, it's a big NO.

 
Q: The xxx script is better than yours
A: I don't mind. I made it for my personal use afterall.

 

Terms of Use :

Q: What is the general ToU of this script?
A: Simply credit me as TheoAllen.

Q: May I use this script in Commercial games?
A: Yes. And you have to give me a free copy of the game.

Q: May I repost this script to other site?
A: Yes.

Q: May I edit this script?
A: Yes. Do as you want. And do not claim if it's yours

Q: May I take some money profit by editing this script?
A: No.

Q: May I translate the script to other language?
A: Yes.

Q: May I use this script for contest/challenge?
A: If it's non-profit challenge, yes. If it's profit challenge (like monetary gain), then NO.

Q: May I sell the third party script/addon?
A: No.

 
Special Thanks :
  • Eremidia : Dungeon!, some of script features are inspired on it
  • Mithran, for Graphical global object reference. If it's not by his script, I may not finish my battle system.
  • TDS, I found your basic movement module script on RMRK long time ago. Then I adopt it and I rewrote by my own.
  • Galenmereth for easing movement module
  • CielScarlet and Skourpy for the Translations


 
Author notes :
  • I use in script editor to make sequence movement instead of too many notetags as Symphony and Victor's do. It because there're already many script that uses notetags and notebox itself has no scroll.
  • As you know, I'm not so good at English. So I'm sorry in advance if there's any unclear informations. Feel free to ask
  • I will be more active on VXAN. You will get a better quick answer if you ask me there than this site.

Version 1.4 Release note :

  • My aim is to make it compatible with Luna Engine without extra patch. However, I haven't tested it with the latest version of TSBS.
  • It's still beta version. In other word, it may have many issues. You may test the script, but if you're going into real development, I suggest you to use the stable version 1.3c instead.
  • I haven't update the github at the moment. Considering it's still beta. Script must be taken by download the demo.
  • I changed the config 1 and config 2 parts. So, you need to update them as well.
  • Battle backdrop decoration addon is not translated yet. There're too many instructions that I can't really handle right now. Perhaps, sometimes. Also, it has a little glitch which I currently dunno how to fix. if you use Alarm Tone, in next battle that not use alarm tone, there 1 frame glitch where the screen blended with a wrong tone.
  • Sorry if the demo looks so messed up. I don't have the will to clear that up "OTL
  • TSBS version 1.4 will not updated. If you reported a bug, I will likely to make the patch instead.
  • Battle music taken from Dragonic Symphony if you wonder.
  • I added extra showcase of my scripts like animated portrait and hover notif tongue.png
  • Want to use the map BGM? That's mine, go ahead if you want to use. And you need to credit me as well.
  • After these hardworks, I will likely to take a very long break and will not touch anything complex related with the battle system (unless I choose to). But I will still provide the support for TSBS as long as I'm avalaible.

Visual Novel Interaction Menu

$
0
0

vnmenu.jpg

 

Visual Novel Interaction Menu

aka sabao learns to code

by Ryan (Me) & Fiona

 

Version 1.01 (4/27/2016)

Script: HERE

 

After years of saying I'd get to it, I've finally gotten off my ass and coded something. YAY ME. I decided on making this because I remember needing it for one of my older projects and realizing there still doesn't appear to be anything like it made for RPG Maker VX Ace. This script creates an interaction menu which creates a list of events present in the map that also triggers said events when selected. This script is ideal for anyone looking to build games like visual novels, text adventures, or if you just can't be assed to map stuff.

 

<I've added a 'Move' command as of version 1.01. I still feel there are already plenty of fully functional fast travel menus out (HERE and HERE to name a few) and those are more likely to be more feature-rich than anything I'd care to repeat here. For the sake of having it all ready to go though, I've put it on.>

 

Features:

  • Creates a command window that lists specified events present in the map and activates the specified event on select.
  • Events can be classified into three different actions: MoveTalk and Inspect.
  • Easy to use?

 

Terms of Use:

Free to use for commercial and non-commercial projects. Please credit the authors. Also, tell us about your project so we can try it out!

 

How to Use:

  • SceneManager.call(Scene_VNMenu) to call the menu.
  • Add the comment vn_area on any event you want listed under the Move action.
  • Add the comment vn_npc on any event you want listed under the Talk action.
  • Add the comment vn_object on any event you want listed under the Inspect action.
  • The script only checks for note tags on the active page of the event, so if you don't want the event to show up on the menu, just make a new page of that event without the note tag.

 

Known Bugs Features Bugs:

  • Delisted events still show up on the menu!
    Discovered that if Event A triggered a switch that made Event B go to its second page which is supposed to hide it from the NPC list, Event B will still show up on the menu. My current fix to this is adding a Wait command between Event A triggering the switch and calling the VN Menu. I believe this may be due to the fact that calling the menu suspends activity on the map, preventing Event B from refreshing itself into its non-active state before the menu compiles the event list.

 

Stuff Left to Do:
Advice on how to deal with these would be greatly appreciated!

  • The blurring and darkening of the screen bothers me. Still figuring out how to fix that.
  • I wanted an option on the command window that could call the main menu, but SceneManager.call causes crashing.
  • Darkening/disabling an option if no relevant event is present
  • Make it prettier

Stacking States

$
0
0

Stacking States v1.1a

Created by Neon Black

 

What is it?
This script states that can be stacked on top of each other for increased effectiveness.  In other words, having more than 1 instance of the same state on an actor or enemy.  Due to how it works, the "params" and "sp-params" of states in a multiplicative fashion rather than additive which increases the state's effectiveness with each stack.

 

How can I use it?
Insert this script under materials and above main.  The script has no config option, just tags.  Place the tags in a state and it will work on it's own.

  • max stack[2] - Allows two instances of the state to be present at once.  The "2" can be replaced with any number to increase the number of stacks.
  • stack icon[2, 100] - Changes the icon of stack 2 to icon 100.  You can use this tag more than once with different stack numbers to have a different icon for each level.  You can also use any icon rather than 100.

 

What does it work with?
This script should work with most other scripts, but overwrites the methods relating to adding or removing scripts.  For this reason it should go ABOVE any scripts that affect how states are added or removed.

 

How can I get the code?
Version 1.1a (base script, 8.27.2013) is available from my pastebin account here.

 

I would like to use this code.
80x15.png
This work is licensed under a Creative Commons Attribution 3.0 Unported License and is available for commercial and non-commercial use.

 

Author's Disclaimer:
I made this script actually as sort of a way to replace buffs.  I wanted a way to increase stats by a little but allow the player to keep on increasing the stat.  Obviously making the stat stack was the answer.  Like I mentioned, the states stacking is multiplicative, so having for example 10 states with 110% HP, the end result would be 259.3% or so, rather than 200%.  Still, I think it gives a nice effect of increasing returns for using a skill multiple times in a row.  As always, enjoy!

Ace Shop Options Add-on - Items States

$
0
0

Hello dear friends.

 

I'm not a programmer, and do not know ruby, and generally only start to understand rgss3 and of course i don't know english very well.

 

But i didn't found similar script and my friend help me with my first steps.

 

Here a bit modification for the Ace Shop Options:

 

9Acsggy.png   8uNDJZ7.png

 

5BAf2KT.png   RvOpAnJ.png

 

As you see, my modification has added six additional slots with colored information (red - bad, green good) about item.

 

Information was taken from section features and show only first six kinds:

 

mg9DEZB.png

 

Unfortunately limitation is due to the small screen, but you can certainly improve the script yourself.

 

Script also has support colorizing with Hime Item Rarity

 

Should you find any errors, inaccuracies or improvement, then I will gladly listen to them.

Ace Shop Options Add-on - Items States.txt

Khas Awesome Light Effects

$
0
0

Awesome Light Effects
by Khas Arcthunder

 

- New version!

A new version of my lighting script is available! It's called Ultra Lighting and it is a great improvement over Awesome Light Effects! You can get more information about it here

 

 

- Introduction:
Hello there! This is an advanced Light Effects script, which provides realistic effects. You can setup your own effects (static light sources) and create a lantern (dynamic light source).

- Features:
Realistic Light
Light does not pass over walls, blocks and roofs
Static Light Sources
Dynamic Light Sources (like a player's lantern)
Multiple effects
Easy to use (comments)

- How to use:
All the instructions are on the Awesome Light Effects demo.
Please read them carefully.

- Video:



- Screenshots:
KALE1.jpg
KALE2.jpg
KALE3.jpg
KALE4.jpg

- Links:
Terms of Use: Read before using
Download: English - Latest version
Blog: Click here!

- Credits:
Created by Khas Arcthunder
Enjoy!

Napoleons Script collection

$
0
0

Napoleons Script Collection
By Napoleon
& others

Introduction
A single topic for all my (or the ones that I have permission to share/alter/own) scripts. Because some had no topic and others are scattered all over the place. If you have any problems or find any bugs, ask&report them here. Except the minimap script, that one has it's own topic.
Most of these scripts are from my upcomming game, which uses over 140 custom scripts now. Yeah it got a bit out of hand >_> .

Script List (Items marked in red are for scripters/advanced users):

  • Auto Silence BGS: Automatically fade or stop Background sounds (BGS) when transferring between maps.
  • Auto-Dash: Automatically dash by flipping a switch. You can walk again by holding down the [shift]-key (can be configured). You can also completely disable dashing with a switch.
  • Autonomous Movement Range: Increases the range at which autonomous movement events are updated (for scripters).
  • Build & Version: For maintaining a version and build number. Automatically increments the build number.

post-9339-0-81151300-1406477614_thumb.jp
  • Bust Script + 2 addons: Shows automatic busts instead of face graphics. It's the bust script with the most features and the most stable one around.

Comes with a addon for repositioning the choice-window and an addon for displaying a name related to that bust.
post-9339-0-34554200-1406477775_thumb.jp

post-9339-0-21623500-1408455063_thumb.pn

  • Conditional events: Erases events when the map is loaded based on your methods (for scripters).
  • Camera Scroll: Allows you to scroll the camera to a specific location or event (including following an event). Scrolling can be done instantly or over time.

post-9339-0-50411200-1407004433_thumb.pn

  • Core Script: My core script. Not required for most scripts though.
  • Destructible Cache: Never forget an undisposed bitmap ever again (for scripters)
  • Destructible Sprite Bitmap: Automatically dispose tagged bitmaps within sprites. Alternative version of "destructible cache" (for scripters).
  • Detect Game-variable/switch value change: Gives you a method to alias or override to detect when a game-variable or game-switch was changed (real-time).

post-9339-0-34616500-1409086935_thumb.pn

  • Event Debugger: Shows you the name, id and location of the event that caused your game to crash (if caused by a script call). Also intended for non-scripters.
  • Event Text: Displays texts above events on the map.

post-9339-0-84494000-1406479063_thumb.jp
  • (Text) Image Gallery: Adds an image gallery to the main menu that shows a list of pictures that the player unlocked.

post-9339-0-06128900-1408453464_thumb.pn

  • Inifile: An inifile script. For scripters only.
  • Item Limit: Allows you to set a custom limit for all items as well as for specific items. Also applies for shops.
  • Item Popup: Shows (even automatically if desired) text and sound effects on the map when gaining/losing items.

post-9339-0-81270200-1406478895_thumb.jp
  • Japanese Name Input: Allows the player to switch between the Roman alphabet and the Japanese Kana alphabets.

post-9339-0-03005100-1406478689_thumb.jp
  • Local Event Variables: Allows you to use variables in events that are not saved/loaded to/from savefiles (for scripters).
  • Map ID Variable: Automatically stores the current Map ID into a game variable.
  • Minimap: An advanced minimap (http://forums.rpgmakerweb.com/index.php?/topic/13801-napoleons-minimap/).
  • Minimum Damage: Always deal a fixed and a percentage minimum damage value when a player/enemy has way too much defense. This is to prevent 0 or null damage values.
  • MoveRoute Wait: Allows you to wait for specific 'move routed events' to complete before you proceed with the event-execution.
  • Nap Image: Displays an image on screen (for scripters).
  • Nickname Escape: Enables the usage of \nn[x] for nicknames in Message Windows. The command can be customized.
  • Nickname Input: Shows a nickname input window just like the regular name-input-window.

post-9339-0-55634900-1406478710_thumb.jp
  • NPC Random: Randomizes event occurrences when entering a map without having to maintain duplicate maps.
  • Point: Provides a Point class. For scripters.
  • Rectangle: Provides an improved Rectangle class. Useful for collision detection and such. For scripters.
  • Region Limit Breaker: Allows you to assign extra regions to a map up to 127 (advanced users).
  • Remove "Enemy Emerged": Remove the "Enemy Emerged" message at the start of a battle.
  • Reserved: Keeps a list of used regions, game variables and game switches and alerts you when the same one is used by more than one script. Nice for keeping huge projects in check. For advanced users only.

post-9339-0-62304300-1409062871_thumb.pn

  • Restrict Encounters: Gives you more control about the amount of encounters per map and per troop type.
  • Party Step Counter: Stores the real-time total party-steps in a game variable.
  • Party Step Incremental Counter: Everytime the party's step-counter is increased a game_variable is also increased. It also supports automatically resetting the game_variable at a specific value as well as calling a method when that value was reached.
  • Picture Z-Index: Allows you to change & retrieve the z-indices for the game_pictures.
  • Script Boss: Enables/Disables scripts fast&easily and also scans for their dependencies (for advanced users).

post-9339-0-05259200-1406479353_thumb.jp
  • Skip Title Screen: How did Degica not implement this feature in their engine :/
  • Transfer Auto-location: Automatically transfers the player to the desired location upon entering a map.
  • Transfer w/o map display name: Self explanatory.
  • Unit Tests: Unit Testing, for scripters

post-9339-0-72177400-1409068284_thumb.pn

  • Variable Display: Displays the desired up2date (real-time) game_variables. Nice for debugging.

Also supports sorting and icons.
post-9339-0-08640300-1406478298_thumb.jp
  • Wait for map scroll: Allows you to pause the event or script execution until the map finishes scrolling. Nice for cut-scenes so you don't have to time a Wait command.
  • Wait for key: Holds the execution of the event until the player pressed the specified key. Nice for showing a map or some other image through show-picture for example and then wait for a key-press before proceeding.
  • Window Message Skin: Allows you to use images instead of regular window skins. Also supports profiles.

post-9339-0-96112200-1406478152_thumb.jp
  • Window Skin: Allows you to change the skins of all windows and/or of just specific ones. Does not use overlays and does not attach itself to an update method for more performance.

post-9339-0-75239200-1408625818_thumb.pn
  • Window Popup: Popup window that does not pause the game.

Also supports icons and Yanfly's message system (if present).
post-9339-0-92342300-1406478031_thumb.jp


 
Scripts & Demo
https://www.dropbox.com/s/jm92rbqb5eadryr/Napoleons%20Master%20Demo.zip

Credits & License
For credits/license see the script headers. For some of the master demo graphics, see the notes in the master demo.
Most of my scripts are CC3 (without required credits!). At the time of writing all of my scripts in the master demo are free for non-commercial and commercial use.

LICENSE UPDATE 12 December 2014:

From now on (12 December 2014) all my scripts posted here (or in the master demo), that were exclusively written by me, are now CC0/Public Domain. Credits are appreciated but obviously no longer required.

This overrules the licenses inside the script headers. But only for those scripts that were exclusively written by me (So Yami's scripts and such still retain their original license).
 
About Malware detected by Chrome
Download it and scan it with a real antivirus because Chrome has issues with false positives.
Alternatively copy the file "Data/Scripts.rvdata2" to a new project and you are safe. I will never put malware in my demo's and I don't resort to 'questionable sites' like adFly which may randomly contain porn or warez!

Map Effects

$
0
0

Map Effects
by Zeus81

 
This script allows you to add visual effects to maps (as distortion for example) in real time.
It goes over the main in materials as usual and should work in any project.
You can also put the instructions below in order to always have them along with.

Script
https://www.dropbox.com/s/zpoxi8gn8ul38uq/Map%20Effects.rb

How to Use
https://www.dropbox.com/s/sk3uwq2bleoxr7s/Map%20Effects%20Doc%20En.txt

Demo
https://www.dropbox.com/s/2ex6906dyehl7an/Map%20Effects.zip

In this video made with VXace, I've set the "refresh_rate" of the script (cf. notice) to 60 on the beginning to have better effects then to 30 from pixelize so it doesn't lag too much.
For blur effects I was at 4 images but I think we can go up to 8 without making it slow and even more on VX as it is more efficient on this point.
We can do much more effects than what I shown by using several at the same time or just by changing settings.

2 Arcade minigame

$
0
0

2 Arcade minigame i've made some day ago,i was planning doing more games but i don't know.
 
Here a video :
https://www.youtube.com/watch?v=JQSg2LkfJhg
 
Here the scripts :
 
Images Creations for numbers and class modifying (Needed to run the 2 other script)

#==============================================================================# ** Game_Images#------------------------------------------------------------------------------#  This Module handles Image Creations. #==============================================================================module Game_Images  #--------------------------------------------------------------------------  # * Numbers  #--------------------------------------------------------------------------  def self.zero    b = Bitmap.new(6,12)    b.fill_rect(b.rect, Color.new(255,255,255))    b.clear_rect(2,2,2,8)    return b  end  def self.one    b = Bitmap.new(6,12)    b.fill_rect(4,0,5,12, Color.new(255,255,255))    return b  end  def self.two    b = Bitmap.new(6,12)    b.fill_rect(b.rect, Color.new(255,255,255))    b.clear_rect(0,2,4,3)    b.clear_rect(2,7,4,3)    return b  end  def self.three    b = Bitmap.new(6,12)    b.fill_rect(b.rect, Color.new(255,255,255))    b.clear_rect(0,2,4,3)    b.clear_rect(0,7,4,3)    return b  end  def self.four    b = Bitmap.new(6,12)    b.fill_rect(b.rect, Color.new(255,255,255))    b.clear_rect(2,0,2,5)    b.clear_rect(0,7,4,5)    return b  end  def self.five    b = Bitmap.new(6,12)    b.fill_rect(b.rect, Color.new(255,255,255))    b.clear_rect(2,2,4,3)    b.clear_rect(0,7,4,3)    return b  end  def self.six    b = Bitmap.new(6,12)    b.fill_rect(b.rect, Color.new(255,255,255))    b.clear_rect(2,0,5,5)    b.clear_rect(2,7,2,3)    return b  end  def self.seven    b = Bitmap.new(6,12)    b.fill_rect(b.rect, Color.new(255,255,255))    b.clear_rect(0,2,4,10)    return b  end  def self.eight    b = Bitmap.new(6,12)    b.fill_rect(b.rect, Color.new(255,255,255))    b.clear_rect(2,2,2,3)    b.clear_rect(2,7,2,3)    return b  end  def self.nine    b = Bitmap.new(6,12)    b.fill_rect(b.rect, Color.new(255,255,255))    b.clear_rect(2,2,2,3)    b.clear_rect(0,7,4,5)    return b  end  def self.nbrstripe    b = Bitmap.new(60,12)    bb = self.zero    b.blt(0, 0,bb ,bb.rect)    bb = self.one    b.blt(6, 0,bb ,bb.rect)    bb = self.two    b.blt(12, 0,bb ,bb.rect)    bb = self.three    b.blt(18, 0,bb ,bb.rect)    bb = self.four    b.blt(24, 0,bb ,bb.rect)    bb = self.five    b.blt(30, 0,bb ,bb.rect)    bb = self.six    b.blt(36, 0,bb ,bb.rect)    bb = self.seven    b.blt(42, 0,bb ,bb.rect)    bb = self.eight    b.blt(48, 0,bb ,bb.rect)    bb = self.nine    b.blt(54, 0,bb ,bb.rect)    return b  end    end#==============================================================================# ** Bitmap Class#------------------------------------------------------------------------------#  Modify the Bitmap class to draw our new number#==============================================================================class Bitmap  def draw_custom_text(text,x,y)    b = Game_Images.nbrstripe    for i in 0..text.size-1      if (text[i].ord >= 48 && text[i].ord <= 57)        blt(x+(i*7), y, b, Rect.new((text[i].ord-48)*6,0,6,12))       end    end  endend#==============================================================================# ** Sprite Class#------------------------------------------------------------------------------#  Modify the Bitmap class to add Bounding Box method#==============================================================================class Sprite  def boundingbox()    return Rect.new(x,y,src_rect.width,src_rect.height)  endend


 
Pong
#==============================================================================#Pong V0.1#Author : Zarby - No Credit Required, free to use#Rule first to score 10 point win#==============================================================================#==============================================================================# ** Game_Images#------------------------------------------------------------------------------#  This Module handles Image Creations. #==============================================================================module Game_Images  #--------------------------------------------------------------------------  # * Paddle Image  #--------------------------------------------------------------------------  def self.paddle    b = Bitmap.new(8,32)    b.fill_rect(b.rect, Color.new(255,255,255))    return b  end  #--------------------------------------------------------------------------  # * Ball Image  #--------------------------------------------------------------------------  def self.ball    b = Bitmap.new(8,8)    b.fill_rect(b.rect, Color.new(255,255,255))    return b  end  end#==============================================================================# ** Scene_Pong#------------------------------------------------------------------------------#  This Class perform the game processing "Pong"#==============================================================================class Scene_Pong < Scene_Base  #--------------------------------------------------------------------------  #DIFFICULTY SETTING  Difficulty = 15  #12 = Very Easy,14 = Easy, 16 = Hard, 18 = Very Hard, 20 Impossible  #0 = AI wont move at all, 10 = AI Move 1 on 2, 20 = AI Follow the ball  #VARIABLE RETURN IF WIN OR NOT  ReturnVariable = 10  #IF we win the variable will = 1, if we loose variable = 0 / -1 if leave  #--------------------------------------------------------------------------    #--------------------------------------------------------------------------  # * Start Processing  #--------------------------------------------------------------------------  def start    super    set_score    add_sprite    reset_ball    @ai_move = 0    @ai_timer = 0    @pause = false  end    def add_sprite    @player_paddle = Sprite.new()    @cpu_paddle = Sprite.new()    @ball = Sprite.new()    @player_paddle.bitmap = Game_Images.paddle    @cpu_paddle.bitmap = Game_Images.paddle    @ball.bitmap = Game_Images.ball    @player_paddle.x = 16    @player_paddle.y = 220    @cpu_paddle.x = 520    @cpu_paddle.y = 220    @ball.x = 268    @ball.y = 204    @scorep1_spr = Sprite.new()    b = Bitmap.new(24,12)    b.draw_custom_text(sprintf('%02d',@scorep1),0,0)    @scorep1_spr.bitmap = b    @scorep1_spr.zoom_x = 2    @scorep1_spr.zoom_y = 2    @scorep1_spr.x = 120    @scorep1_spr.y = 8    @scorep2_spr = Sprite.new()    b = Bitmap.new(24,12)    b.draw_custom_text(sprintf('%02d',@scorep2),0,0)    @scorep2_spr.bitmap = b    @scorep2_spr.zoom_x = 2    @scorep2_spr.zoom_y = 2    @scorep2_spr.x = 544-120    @scorep2_spr.y = 8    @timer_spr = Sprite.new()    @timer_spr.x = 260  end    def set_score    @scorep1 = 0    @scorep2 = 0  end    def reset_ball    @timer = 3    @bugtimer = 0    @real_timer = 120    @started = false    @ball_speed = 4    @real_ball_x = 268.0    @real_ball_y = 204.0    @ball.x = @real_ball_x    @ball.y = @real_ball_y    @ball_direction = 0    update_score  end    def update_score    b = Bitmap.new(24,12)    b.draw_custom_text(sprintf('%02d',@scorep2),0,0)    @scorep2_spr.bitmap = b    b = Bitmap.new(24,12)    b.draw_custom_text(sprintf('%02d',@scorep1),0,0)    @scorep1_spr.bitmap = b  end    def update_timer    if (@real_timer >= 0)      @timer_spr.visible = true      @real_timer -=1      @timer = @real_timer / 30      b = Bitmap.new(24,12)      b.draw_custom_text(sprintf('%02d',@timer),0,0)      @timer_spr.bitmap = b      if (@real_timer == 0)        @real_timer = -1        @timer = -1        game_start        @timer_spr.visible = false      end    end  end    def game_start    #Set ball direction    rand = Random.new()    @ball_side_x = rand.rand(0..1).to_i    @ball_side_y = rand.rand(0..1).to_i    @started = true    @ball_direction = rand.rand(-70..70)  end  def update    super    if (@pause == false)      update_timer      if (@started)        if (@ball_side_x == 1)          @real_ball_x += @ball_speed * Math.cos(degtorad(@ball_direction));        elsif (@ball_side_x == 0)          @real_ball_x -= @ball_speed * Math.cos(degtorad(@ball_direction));        end        if (@ball_side_y == 1)          @real_ball_y += @ball_speed * Math.sin(degtorad(@ball_direction));        elsif (@ball_side_y == 0)          @real_ball_y -= @ball_speed * Math.sin(degtorad(@ball_direction));        end              @ball.x = @real_ball_x        @ball.y = @real_ball_y      end          #Bug Solver?      if (@ball.y == 4)        @bugtimer+=1        if (@bugtimer >= 160)          reset_ball        end      else        @bugtimer = 0      end              player_control      check_collision      ai_control # Stupid AI     end    if (Input.trigger?(:X))      if (@pause == false)        @pause = true      elsif(@pause == true)        @pause = false      end    end        if (@scorep1 >= 10)      $game_variables[ReturnVariable] = 1      dispose    end    if (@scorep2 >= 10)      $game_variables[ReturnVariable] = 0      dispose    end        if (Input.press?(:)      $game_variables[ReturnVariable] = -1      dispose      end  end    def dispose    @player_paddle.dispose    @cpu_paddle.dispose    @scorep1_spr.dispose    @scorep2_spr.dispose    @timer_spr.dispose    #return_scene    SceneManager.goto(Scene_Map)  end    #-----------------------------------------------------------------------------  # Control if the player is pressing a key  #-----------------------------------------------------------------------------  def player_control    if (Input.press?(:UP))      @player_paddle.y -=4      if (@player_paddle.y < 0)        @player_paddle.y = 0      end    end    if (Input.press?(:DOWN))      @player_paddle.y +=4      if (@player_paddle.y > 416-32)        @player_paddle.y = 416-32      end    end  end      def ai_control    @ai_timer += 1    rand = Random.new()        if (@ai_timer >= 10)      @ai_move = rand.rand(0..20)#Rand if move < 10, else > 10      @ai_timer = 0    end        if (@ai_move < Difficulty)      if (@ball_side_x ==1)              if (@ball.y+2 < @cpu_paddle.y+16)          @cpu_paddle.y-=4        end              if (@ball.y+2 > @cpu_paddle.y+16)          @cpu_paddle.y+=4        end              if (@cpu_paddle.y < 0)          @cpu_paddle.y = 0        end        if (@cpu_paddle.y > 416-32)          @cpu_paddle.y = 416-32        end              end    end  end    #-----------------------------------------------------------------------------  # Check Collison between ball and wall, paddle  #-----------------------------------------------------------------------------  def check_collision    if (@ball.y <= 0)      @ball.y = @ball_speed      if (@ball_side_y == 0)        @ball_side_y = 1      elsif (@ball_side_y == 1)        @ball_side_y = 0      end    end        if (@ball.y >= 412)      @ball.y = 412 - @ball_speed      if (@ball_side_y == 0)        @ball_side_y = 1      elsif (@ball_side_y == 1)        @ball_side_y = 0      end    end        if (@ball.x >= 540)      @scorep1+=1      reset_ball    end    if (@ball.x <= 0)      @scorep2+=1      reset_ball    end    if (rectangle_intersect(@ball.boundingbox,@player_paddle.boundingbox) == true)      @ball.x = (@player_paddle.x + 4 + @ball_speed)      @ball_side_x = 1      @ball_direction = (-50 + ((@ball.y+2)-@player_paddle.y)*4)      if ((@ball.y+4)-@player_paddle.y) < 16        @ball_side_y = 1      end      if ((@ball.y+4)-@player_paddle.y) > 16        @ball_side_y = 1      end    end        if (rectangle_intersect(@ball.boundingbox,@cpu_paddle.boundingbox) == true)      @ball.x = (@cpu_paddle.x - 4 - @ball_speed)      @ball_side_x = 0      @ball_direction = (-50 + ((@ball.y+2)-@cpu_paddle.y)*4)      if ((@ball.y+4)-@cpu_paddle.y) < 16        @ball_side_y = 1      end      if ((@ball.y+4)-@cpu_paddle.y) > 16        @ball_side_y = 1      end    end      end    #-----------------------------------------------------------------------------  # If 2 rectangle interset return true  #-----------------------------------------------------------------------------  def rectangle_intersect(r1,r2)    if ((r1.x+r1.width > r2.x) && (r1.x < r2.x+r2.width) &&       (r1.y+r1.height > r2.y) && (r1.y < r2.y+r2.height))      return true    end    return false  end    def degtorad(deg)    return (deg * Math::PI / 180)  end  end

 


 
Space Explorer
#==============================================================================#SpaceExplorer V0.1#Author : Zarby - No Credit Required, free to use#Go the furthest you can !#==============================================================================#==============================================================================# ** Game_Images#------------------------------------------------------------------------------#  This Module handles Image Creations. #==============================================================================module Game_Images  #--------------------------------------------------------------------------  # * Paddle Image  #--------------------------------------------------------------------------  def self.spaceship    b = Bitmap.new(16,8)    b.fill_rect(1,1,3,1, Color.new(255,255,255))    b.fill_rect(5,1,2,1, Color.new(255,255,255))    b.fill_rect(7,0,2,2, Color.new(255,255,255))    b.fill_rect(9,0,2,1, Color.new(255,255,255))    b.fill_rect(11,1,2,1, Color.new(255,255,255))    b.fill_rect(13,2,1,1, Color.new(255,255,255))    b.fill_rect(14,3,1,3, Color.new(255,255,255))    b.fill_rect(4,5,10,2, Color.new(255,255,255))    b.fill_rect(2,2,8,4, Color.new(255,255,255))    b.fill_rect(6,4,5,4, Color.new(255,255,255))    b.fill_rect(1,3,1,1, Color.new(255,255,255))    b.fill_rect(1,5,1,1, Color.new(255,255,255))    return b  end  #272x208 x2end#==============================================================================# ** Scene_SpaceExplorer#------------------------------------------------------------------------------#  This Class perform the game processing "SpaceExplorer"#==============================================================================class Scene_SpaceExplorer < Scene_Base  #--------------------------------------------------------------------------  #SETTINGS  ReturnVariable = 10  #Return the score to the variable  #--------------------------------------------------------------------------    #--------------------------------------------------------------------------  # * Start Processing  #--------------------------------------------------------------------------  def start    super    @map = []    @space_between = 32    create_map    create_sprites    @score = 0    @lastvalue = 104    @lastdirectiontimer = 0    @lastdirection = 0    @scoretimer = 0    @deadtimer = 0    @pause = false    @dead = false  end    def create_sprites    @spaceship_spr = Sprite.new()    b = Bitmap.new(32,16)    b.stretch_blt(Rect.new(0,0,32,16), Game_Images.spaceship, Rect.new(0,0,16,8))     @bgr_bitmap = Bitmap.new(288,208)    @bgr_spr = Sprite.new()    @spaceship_spr.bitmap = b    @spaceship_spr.x = 16*2    @spaceship_spr.y = 104*2    @sprite_score = Sprite.new    @sprite_score.x = 544/2-(5*7)    @sprite_score.y = 400    update_image  end  #--------------------------------------------------------------------------  # * Update Processing  #--------------------------------------------------------------------------  def update    super    if (@pause == false)      @bgr_spr.x-=4;      @scoretimer+=1      if (@scoretimer >= 15)        @score+=1        @scoretimer = 0        b = Bitmap.new(64,16)        b.fill_rect(0,0,64,16,Color.new(0,0,0))        b.draw_custom_text(sprintf('%08d',@score),4,2)        @sprite_score.bitmap = b      end          if ((@spaceship_spr.y / 2) <= (@map[2]-@space_between))        @pause = true        @dead = true      end      if ((@spaceship_spr.y / 2) <= (@map[3]-@space_between))        @pause = true        @dead = true      end          if ((@spaceship_spr.y / 2)+8 >= (@map[2]+@space_between))        @pause = true        @dead = true      end      if ((@spaceship_spr.y / 2)+8 >= (@map[3]+@space_between))        @pause = true        @dead = true      end            if (@bgr_spr.x <=-16)        update_map        update_image        @bgr_spr.x = 0      end      player_control    else      if (@dead == true)        @deadtimer +=1        if (@deadtimer == 120)          dispose        end      end    end        if (Input.trigger?(:X))      if (@pause == false)        @pause = true      elsif(@pause == true)        @pause = false      end    end          end#update end    def create_map    m = 0    for i in 0..36      @map[i] = 104    end  end    def dispose    $game_variables[ReturnVariable] = @score    @bgr_spr.dispose    @spaceship_spr.dispose    @sprite_score.dispose    SceneManager.goto(Scene_Map)  end    def update_map    @space_between = 32    @lastdirectiontimer+=1    rand = Random.new()    if (@lastdirectiontimer >=rand.rand(0..3))            a = rand.rand(-1..1)      @lastdirection = 0      if (a == -1)        if (@lastvalue >= @space_between+8)          @lastvalue-=4;          @lastdirection = -1        else          @lastdirection = 1        end               end      if (a == 1)        if (@lastvalue <= 180-@space_between)          @lastvalue+=4;          @lastdirection = 1        else          @lastdirection = -1        end      end        @lastdirectiontimer = 0    end    r = rand.rand(0..100)        if (@lastdirection == -1)      @lastvalue-=4      if (r >= 75)        @lastvalue-=4      end    end    if (@lastdirection == 1)      @lastvalue+=4      if (r >= 75)        @lastvalue+=4      end    end                oldmap = @map    for i in 0..36      if (i != 36)        @map[i] = oldmap[i+1]      else        @map[i] = @lastvalue      end    end      end      #-----------------------------------------------------------------------------  # Control if the player is pressing a key  #-----------------------------------------------------------------------------  def player_control    if (Input.press?(:UP))      @spaceship_spr.y -=2      if (@spaceship_spr.y < 0)        @spaceship_spr.y = 0      end    end    if (Input.press?(:DOWN))      @spaceship_spr.y +=2      if (@spaceship_spr.y > 416-8)        @spaceship_spr.y = 416-8      end    end  end      def update_image    @bgr_bitmap = Bitmap.new(288,208)    for i in 0..36      mn = (@map[i]-@space_between)      mp = (@map[i]+@space_between)      @bgr_bitmap.fill_rect(i*8,0,8,mn,Color.new(132,68,20))      @bgr_bitmap.fill_rect(i*8,mp,8,288-mp,Color.new(132,68,20))         end    stretchedbmp = Bitmap.new(576,416)    stretchedbmp.stretch_blt(Rect.new(0,0,576,416), @bgr_bitmap, Rect.new(0,0,288,208))     @bgr_spr.bitmap = stretchedbmp  end    end

 

Basic Game Time + Night/Day

$
0
0

Basic Game Time + Night/Day v1.6

by V.M.

Introduction

Provides a series of functions to set and recall a new variable known as game time, as well custom tints based on current game time to give the appearance of night and day.

Features

- Game Time, complete with unfancy little clock

- Night and Day cycle with custom tints and timing

Screenshots

GameTime.png

How to Use

Plug and play and customize if needed

Script

Convenient Pastebin: Here

FAQ

None at the moment

Credit and Thanks

- By V.M.

- Free to use in any project with credit given

Author's Notes

Hopefully nothing explodes

V1.6: Added function to hide and show clock with script call

V1.5: Added functions to stop time or tinting

V1.4: Fixed bug where toggling game clock with it unused would crash game

Party Leader Quick Swap

$
0
0

Party Leader Quick Swap

Version 0.10

 

Quickly change party leaders with the push of a single button.

 

Features:

  • Quickly Swap Party Leaders on the Map
  • Lightweight Plug-n-Play
  • Adjustable Key-Bind

 

Screenshots:

None.

 

Download:

Personal Website

 

Credit:

XPBYTE7

Tales of Graces Title System

$
0
0

Tales of Graces Title System
Script by Mr. Bubble
 
titles1.pngtitles3.png

More Screenshots

titles2.pngtitles4.png
titles5.pngtitles6.png
titles7.pngtitles8.png

 
Summary
This script replicates the Title system from the Wii/PS3 game “Tales of Graces”. It’s a somewhat unique system which performs like an alternative leveling system.

This script has a high learning curve. Please read the documentation and study the examples I’ve provided in “Titles Volume 1: Basic Package” for information on how to create your own custom titles.

This script modifies actor “Nicknames”. Any Nicknames defined in your database will not be used.

 

And as a general rule of thumb: always assume a syntax error is your fault.

 
Script
Can be found here: http://wp.me/PxlCT-uY
 
Installation
Paste this script into its own page within the "Materials" section in the script editor of your project. Also be sure to install the Predefined Title scripts.
 
How to Use
This script has a high learning curve. Read the script comments carefully. Use the examples I've provided for making your own titles.
 
Compatibility
This script aliases some default VXA methods. There are no default method overwrites.
 
Requests for compatibility with other scripts are encouraged and welcome.
 
Terms and Conditions
Free for non-commercial use. For commercial use, contact me first.
 
If you wish to use this for commercial games, contact me first.
 
Please feel free to post coding and efficiency suggestions, script features suggestions, and bug reports.

Bestiary Logbook v1.8 - updated 1/21/2014

$
0
0

Bestiary Logbook
by Venka

Description:

This is a scene you can access via the menu that will let you keep track of enemies you've encountered. You can learn things about the enemy with a scan skill that is built into the script. You can customize many of the features in the script. You can create enemy descriptions that automatically change as you reach certain kill counts on the enemy or you can set it with a script call at any time. You can also various information to be shown after a set amount of kills.

Screen Shots:


post-2313-0-21931500-1411253515_thumb.pn post-2313-0-75069400-1411592726_thumb.pn

post-2313-0-80975100-1411592928_thumb.pn post-2313-0-76993400-1411592964_thumb.pn

post-2313-0-35275500-1411593198_thumb.pn post-2313-0-83829000-1411593256_thumb.pn

 

Add on info:

Actors Quotes Addon

Lets actors add some extra info about a scanned target. You can set multiple quotes by actor for each enemy. For example, Eric could have 2 quotes to say about slimes and Terence could have 5 things to say about them. The script will randomly pick one quote to show. Once a quote has been viewed, it is then saved to the bestiary and can be viewed there with a key stroke you can set.

post-2313-0-78299400-1413607181.png

 

post-2313-0-93174000-1413607411.png

 

post-2313-0-72357800-1413607504.png

 

Change Log:

#------------------------------------------------------------------------------# - Changelog -#------------------------------------------------------------------------------# 01/21/2014 - Added in a section for debuff resistances.#            - Fixed display issue when a resistance was set to 120%#            - Added compatibility with Yanfly's Element Absorb script#            - Added a spot to set the text color for Immunity and Absorbtion#            - Fixed a bug that wasn't displaying state immunities.# 12/05/2014 - Stats will now correct if passive stats boost them for states #              and elements as well.# 12/03/2014 - Stats will now correct if passive stats boost them# 11/30/2014 - Fixed issue with manually adding enemy entries.# 11/09/2014 - Added in a scroll speed setting so you can speed up the scroll#              when viewing information about an enemy.#            - Added in stats revealed by kill counts. You can set what #              information will be shown after you kill an enemy x amount of #              times# 10/27/2014 - Forgot to dispose of the instructions on the battle scene.# 10/14/2014 - Added ability to store quotes for the Actor's Input addon.#            - Added KilloZapit's Word Wrapper support# 09/24/2014 - Adjusted the contents of the bestiary stat windows so be able #              to show large amounts of elements and states. The window panes #              are now scrollable to view all the information.#            - The scan window in battle was also updated in the above way.# 09/21/2014 - Fixed a bug if no categories are set up in the enemy note tags.# 09/14/2014 - changed the name of one of the methods so it's compatiable with#              some of my other scripts.# 08/14/2014 - Released for code off challenge#------------------------------------------------------------------------------

 

Terms of Use:
I must receive credit for the script. It can be in a text file with the project or credits that roll at the end of them. Whatever, I'm not picky, just want credit for the time it took to write the script.

It is fine if you want to use this script in a commercial project, but I'd like a link to the project when it's in it's demo/finished phase just cause I'd like to see it in use :) A free copy of the game would even be awesome if it's doable, but this is NOT a requirement.

 

Download Links:

Dropbox Demo - this is a compressed demo project

MediaFire rar - this is a zipped project folder of the demo

 

Links to the scripts without the demo:

Main Script

KilloZapit's Word Wrapper

Books Addon

Actor Input Addon

 

Thanks:
Thanks to the Code Off Challenge to get my off my butt and finally script a bestiary. I had been meaning to do one for ages and was being lazy.


Wing MMORPG Maker

$
0
0
KYZTnsT.png

 

I bring here as promised Wing MMORPG Maker for everyone.  Finally!


Introduction
Wing MMORPG Maker is nothing more than the source code of Wing Of Misadventure project.  An adaptation or transformation of RPG Maker VX Ace an MMO Maker potential.  What will ensure that everyone can develop your MMOs with the stability and security that such games really need. Basically, all who love MMOs now have a super ally by your side! And for those who are studying game programming, look there, there 's no better source. ;)

Basically, it is unlike any online base you have ever seen.  This includes Netplay's Eclipse Origins, Elysium and CIA.  That why Wing Of Misadventure was initially a REAL game and TESTED online for months, without incurring in any problem or security invasion.  With unique systems and unlimited possibilities.
 
For those who are confused. Wing MMORPG Maker is a combination of scripts and external resources that enable the creation of an MMO.
Yeah, it's a GIANT PROJECT!
 
 

Informations for programmers
Well, there is a lot of complexity in creating the WOM project.
The server is developed in C #, and goes along with the Game.exe also developed in C#.
There is a DLL called WOM 32 developed in C ++ that brings some new features and methods for the use of ruby and script within the RPG Maker, besides the actual script in Ruby that was almost COMPLETELY MODIFIED.
 
NO ENTERBRAIN FILE HAS BEEN MODIFIED

 
VIDEO OF THE PROJECT
IMAGE
jHXRbKp.jpg
 
 
And more!
 
newloo10.png

project by Allyson S Bacon and http://www.tabernarpg.com/

 

GITHUB!

Keyboard Text Input

$
0
0

Text_Input 1.0
Author: erpicci

 

Introduction

This script allows the player to insert a medium-sized text by typing directly with the keyboard. Inserted text is returned as a string.

Requires Neon Black's Keyboard Input Script to work.

It is completely free, both for commercial and non-commercial use. All you are asked to do is to give me credits for the script.

 

Features

  • Plug and play
  • Type directly from keyboard
  • Use enter to confirm your input
  • Use backspace to delete last character
  • Use "Esc" to quit the input mode (input process will result in an empty string)
  • No known compatibility issues
  • Integrates seamlessly with window system

 

Screenshots
As simple as calling a script. These shots shows how to implement an echo message.

Spoiler

input.jpgecho.jpg

 

How to Use

Be sure to have Neon Black's Keyboard Input Script installed.

Place this script in the "Materials" section of the scripts above main.

 

To insert a text using an event, create a script event like:

text_var = text_input("Window Title")

To have a script call the text input, use:

text_var = Scene_Text.read("Window Title")

Only window title is mandatory. As optional arguments, you can set:

  • alignment: "center" (default), "left", "right"
  • maximum number of character: default is 104
  • left-to-right: default is true, use false to get a right-to-left input

Examples:

# Open a window whose title is "Talk to Bobby", text is centered, allows to enter up to 20 characters, writing is right-to-left
variable = Scene_Text.read("Talk to Bobby", "center", 20, false)

# Open a window whose title is "Tell me something", text is aligned to right, allows to enter up to 88 characters, writing is left-to-right (default)
variable = Scene_Text.read("Tell me something", "center", 88)

# Open a window whose title is "Insert text", text is centered (default), accepts up to 104 characters (default), writing is left-to-right (default)
variable = Scene_Text.read("Insert text")

Script

Spoiler

#==============================================================================
# ** Text Input script
#------------------------------------------------------------------------------
# author:  erpicci
# version: 1.0
# require: CP Keyboard Input script  by Neon Black
# 
#------------------------------------------------------------------------------
# * Introduction
#------------------------------------------------------------------------------
# This script allows the player to insert a medium-sized text by typing
# directly from the keyboard. Inserted text is returned as a string.
# 
# Requires Neon Black's Keyboard Input Script to work.
# 
# It is completely free, both for commercial and non-commercial use. All you
# are asked to do is to give me credits for the script.
# 
#------------------------------------------------------------------------------
# * Installation
#------------------------------------------------------------------------------
# Be sure to have Neon Black's Keyboard Input Script installed.
# Place this script in the "Materials" section of the scripts above main.
# 
# To insert a text using an event, create a script event like:
#   text_var = text_input("Window Title")
# 
# To have a script call the text input, use:
#   text_var = Scene_Text.read("Window Title")
# 
# Only window title is mandatory. As optional arguments, you can set:
#  * alignment: "center" (default), "left", "right"
#  * maximum number of character: default is 104
#  * left-to-right: default is true, use false to get a right-to-left input
# 
#------------------------------------------------------------------------------
# * Examples
#------------------------------------------------------------------------------
#   # Open a window whose title is "Talk to Bobby", text is centered, allows
#   # to enter up to 20 characters, writing is right-to-left
#   variable = Scene_Text.read("Talk to Bobby", "center", 20, false)
# 
#   # Open a window whose title is "Tell me something", text is aligned to
#   # right, allows to enter up to 88 characters, writing is left-to-right
#   # (default)
#   variable = Scene_Text.read("Talk to Bobby", "center", 20)
# 
#   # Open a window whose title is "Insert text", text is centered (default),
#   # accepts up to 104 characters (default), writing is left-to-right (default)
#   variable = Scene_Text.read("Talk to Bobby")
#==============================================================================

module Text_Input
  ACCEPTED_KEYS = {
    :k0 => 48, :k1 => 49, :k2 => 50, :k3 => 51, :k4 => 52,
    :k5 => 53, :k6 => 54, :k7 => 55, :k8 => 56, :k9 => 57,
    
    :kA => 65, :kB => 66, :kC => 67, :kD => 68, :kE => 69, :kF => 70,
    :kG => 71, :kH => 72, :kI => 73, :kJ => 74, :kK => 75, :kL => 76,
    :kM => 77, :kN => 78, :kO => 79, :kP => 80, :kQ => 81, :kR => 82,
    :kS => 83, :kT => 84, :kU => 85, :kV => 86, :kW => 87, :kX => 88,
    :kY => 89, :kZ => 90,
    
    :kCOLON     => 186, :kQUOTE     => 222, :kSPACE      => 32,
    :kCOMMA     => 188, :kPERIOD    => 190, :kSLASH      => 191,
    :kBACKSLASH => 220, :kLEFTBRACE => 219, :kRIGHTBRACE => 221,
    :kMINUS     => 189, :kEQUAL     => 187, :kTILDE      => 192,          
  }
end



#==============================================================================
# ** Scene_Text
#------------------------------------------------------------------------------
#  This class shows an input field for the player.
#==============================================================================

class Scene_Text < Scene_MenuBase
  ALIGN    = "center"
  MAX_CHAR = 104
  LTR      = true
  
  #--------------------------------------------------------------------------
  # * Show a dialog window to the player
  #--------------------------------------------------------------------------
  def self.read(title, align = ALIGN, max_char = MAX_CHAR, ltr = LTR)
    @@text     = ""
    @@title    = title
    @@align    = align
    @@max_char = max_char
    @@ltr      = ltr
    SceneManager.call(Scene_Text)
    Fiber.yield while SceneManager.scene_is?(Scene_Text)
    return @@text
  end
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  def start
    super
    @edit_window  = Window_TextEdit.new(@@title, @@align, @@max_char, @@ltr)
    @edit_window.set_handler(:ok, method(:on_input_ok))
  end
  #--------------------------------------------------------------------------
  # * Set text when done
  #--------------------------------------------------------------------------
  def on_input_ok
    @@text = @edit_window.text
    return_scene
  end
end



#==============================================================================
# ** Window_TextEdit
#------------------------------------------------------------------------------
#  This window allows to edit a text.
#==============================================================================

class Window_TextEdit < Window_Selectable
  include Text_Input
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :text
  
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(title, align = "center", max_char = 104, ltr = true)
    x = 0
    y = Graphics.height - fitting_height(6)
    super(x, y, Graphics.width, fitting_height(6))
    @text     = ""
    @title    = title
    @align    = align
    @max_char = max_char
    @ltr      = ltr
    @index    = @text.size
    activate
    refresh
  end
  #--------------------------------------------------------------------------
  # * Revert to Default Text
  #--------------------------------------------------------------------------
  def restore_default
    @text = ""
    @index = @text.size
    refresh
    return !@text.empty?
  end
  #--------------------------------------------------------------------------
  # * Get Character Width
  #--------------------------------------------------------------------------
  def char_width
    text_size($game_system.japanese? ? "‚ " : "A").width 
  end
  #--------------------------------------------------------------------------
  # * Get Number of Columns
  #--------------------------------------------------------------------------
  def max_col
    [(Graphics.width - 32) / char_width, @max_char].min
  end
  #--------------------------------------------------------------------------
  # * Get Left Padding
  #--------------------------------------------------------------------------
  def left(n)
    return 10                                if @align == "left"
    return (width - 32 - n * char_width)     if @align == "right"
    return (width - 32 - n * char_width) / 2 # if align == "center"
  end
  #--------------------------------------------------------------------------
  # * Get Rectangle for Displaying Item
  #--------------------------------------------------------------------------
  def item_rect(index)
    index -= 1 if index == @max_char
    x = index % max_col
    y = index / max_col
    n = [(@max_char - y * max_col), max_col].min
    
    x = left(n) + x * char_width
    x = width - x - 48 if not @ltr
    y = 24      + y * (line_height + 4)
    Rect.new(x, y, char_width, line_height)
  end
  #--------------------------------------------------------------------------
  # * Get Underline Rectangle
  #--------------------------------------------------------------------------
  def underline_rect(index)
    rect = item_rect(index)
    rect.x += 1
    rect.y += rect.height
    rect.width -= 2
    rect.height = 2
    rect
  end
  #--------------------------------------------------------------------------
  # * Get Underline Color
  #--------------------------------------------------------------------------
  def underline_color
    color = normal_color
    color.alpha = 48
    color
  end
  #--------------------------------------------------------------------------
  # * Draw Underline
  #--------------------------------------------------------------------------
  def draw_underline(index)
    contents.fill_rect(underline_rect(index), underline_color)
  end
  #--------------------------------------------------------------------------
  # * Draw Text
  #--------------------------------------------------------------------------
  def draw_char(index)
    rect       = item_rect(index)
    rect.x     += 4
    rect.width += 4
    change_color(normal_color)
    draw_text(rect, @text[index] || "")
  end
  #--------------------------------------------------------------------------
  # * Draw Title
  #--------------------------------------------------------------------------
  def draw_title
    draw_text(0, 0, self.width, line_height, @title, 1)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_title
    @text.size.times {|i| draw_char(i) }
    @max_char.times  {|i| draw_underline(i) }
    cursor_rect.set(item_rect(@index))
  end
  #--------------------------------------------------------------------------
  # * Handle Process
  #--------------------------------------------------------------------------
  def process_handling
    return unless open? && active
    process_delete if Input.repeat?(:kBACKSPACE)
    process_abort  if Input.trigger?(:kESC)
    process_ok     if Input.trigger?(:kENTER)
    process_keyboard
  end
  #--------------------------------------------------------------------------
  # * Check Input From Keyboard
  #--------------------------------------------------------------------------
  def process_keyboard
    ACCEPTED_KEYS.each {|key|
      if Input.repeat?(key[0])
        c = (key[0] != :kSPACE) ? Keyboard.add_char(Ascii::SYM[key[0]]) : " "
        process_add(c)
        Sound.play_ok
      end
    }
  end
  #--------------------------------------------------------------------------
  # * Add One Character
  #--------------------------------------------------------------------------
  def process_add(c)
    return if @index > @max_char
    if @index == @max_char
      @text[@index - 1] = c
    else
      @text  += c
      @index += 1
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # * Delete One Character
  #--------------------------------------------------------------------------
  def process_delete
    return if @index == 0
    @index -= 1
    @text  = @text[0, @index]
    Sound.play_cancel
    refresh
  end
  #--------------------------------------------------------------------------
  # * Abort Text Input
  #--------------------------------------------------------------------------
  def process_abort
    restore_default
    Sound.play_cancel
    call_ok_handler
  end
  #--------------------------------------------------------------------------
  # * Complete Text Input
  #--------------------------------------------------------------------------
  def process_ok
    Sound.play_ok
    call_ok_handler
  end
end





#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
#  An interpreter for executing event commands. This class is used within the
# Game_Map, Game_Troop, and Game_Event classes.
#==============================================================================

class Game_Interpreter
  #--------------------------------------------------------------------------
  # * Insert a text
  #--------------------------------------------------------------------------
  def text_input(title, align = "center", max_char = 103, ltr = true)
    Scene_Text.read(title, align, max_char, ltr)
  end
end

 

This script is also available on Pastebin: http://pastebin.com/TYtbDDPy.

 

FAQ

Q: How do I store the inserted text into a game variable?

A: See this comment.

 

Q: How do I insert newlines?

A: This is currently not supported. A workaround is explained in this comment.

 

Q: How do I check inserted text to prepare a response?

A: You can use the script to store inserted text into a variable, then you can perform any check you like. For an example, see this comment.



Credit and Thanks
- erpicci
- Neon Black, for his Keyboard Input Script
- Tsukihime, for his Simple Text Input script, which I studied to make my own

Multiple Windowskins v. 1.0

$
0
0

Multiple Windowskins v. 1.0

Crimson Rose

 

Introduction

This script is basically what the name implies: A script that allows you to use multiple windowskins in the same game. It has options for changing every default window, and custom windows will use the default skin.

 

Screenshots

post-39969-0-76887300-1405608064_thumb.p

 

How To Use

Just plug in the script and use the configuration to change the windowskins to your liking.

############################################################Multiple Windowskins v 1.0#by Crimson Rose###########################################################module CR_MultipleWindowSkins    #The Skin that is used for any windows other than the ones listed below.  #Included for compatibility. Do not remove, but feel free to change the  #windowskin given.  DEFAULT_WINDOW_SKIN = "Window"    #If this is true, then you don't need to bother with the next array.  ALL_DEFAULT = false    $windowskins = [                    "Window", #Help Window                    "Window", #Gold Window                    "Window2", #Menu Command                    "Window", #Window_MenuStatus                    "Window", #Window_MenuActor                    "Window", #Window_ItemCategory                    "Window", #Window_ItemList                    "Window", #Window_SkillCommand                    "Window", #Window_SkillStatus                    "Window", #Window_SkillList                    "Window", #Window_EquipStatus                    "Window", #Window_EquipCommand                    "Window", #Window_EquipSlot                    "Window", #Window_EquipItem                    "Window", #Window_Status                    "Window", #Window_SaveFile                    "Window", #Window_ShopCommand                    "Window", #Window_ShopBuy                    "Window", #Window_ShopSell                    "Window", #Window_ShopNumber                    "Window", #Window_ShopStatus                    "Window", #Window_NameEdit                    "Window", #Window_NameInput                    "Window", #Window_ChoiceList                    "Window", #Window_NumberInput                    "Window", #Window_KeyItem                    "Window", #Window_Message                    "Window", #Window_ScrollText                    "Window", #Window_MapName                    "Window", #Window_BattleLog                    "Window", #Window_PartyCommand                    "Window", #Window_ActorCommand                    "Window", #Window_BattleStatus                    "Window", #Window_BattleActor                    "Window", #Window_BattleEnemy                    "Window", #Window_BattleSkill                    "Window", #Window_BattleItem                    "Window", #Window_TitleCommand                    "Window", #Window_GameEnd                    "Window"  #Skin no. 39                 ]                    #If you wish to add more for custom windows, just   #extend the array to include them and make sure to   #pass the name of the windowskin to the Window's parent.      #The last element in this array is 38, so any more windows   #that you would add would be greater or equal to 39.      #Just add your windowskin to the array, and when calling super in your   #new window, make sure to pass the following variable at the end of the other   #variables you're giving:      #CR_MultipleWindowSkins::getSkin(the windowskin position in the array)                                    ##### DO NOT EDIT PAST THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING!                 def self.getSkin(num)    return $windowskins[num] unless ALL_DEFAULT    return DEFAULT_WINDOW_SKIN  endend               class Window_Base < Window  alias CR_MultipleWindowSkins_WindowBase_Initialize initialize  def initialize(x, y, width, height, skin = CR_MultipleWindowSkins::DEFAULT_WINDOW_SKIN)    CR_MultipleWindowSkins_WindowBase_Initialize(x,y,width,height)    self.windowskin = Cache.system(skin)  end  endclass Window_Selectable < Window_Base  #--------------------------------------------------------------------------  # * Object Initialization  #-------------------------------------------------------------------------  def initialize(x, y, width, height, skin=CR_MultipleWindowSkins::DEFAULT_WINDOW_SKIN)    super(x,y,width,height,skin)    @index = -1    @handler = {}    @cursor_fix = false    @cursor_all = false    update_padding    deactivate  endendclass Window_Command < Window_Selectable  def initialize(x, y, skin = CR_MultipleWindowSkins::DEFAULT_WINDOW_SKIN)        clear_command_list    make_command_list    super(x,y,window_width,window_height,skin)    refresh    select(0)    activate          endend###################################################class Window_Help < Window_Base  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(line_number = 2, skin = CR_MultipleWindowSkins::getSkin(0))    super(0, 0, Graphics.width, fitting_height(line_number), skin)  endendclass Window_Gold < Window_Base  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(skin = CR_MultipleWindowSkins::getSkin(1))    super(0, 0, window_width, fitting_height(1),skin)    refresh  endendclass Window_MenuCommand < Window_Command  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(skin = CR_MultipleWindowSkins::getSkin(2))    super(0, 0, skin)    select_last  endendclass Window_MenuStatus < Window_Selectable  #--------------------------------------------------------------------------  # * Public Instance Variables  #--------------------------------------------------------------------------  attr_reader   :pending_index            # Pending position (for formation)  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(x, y, skin = CR_MultipleWindowSkins::getSkin(3))    super(x, y, window_width, window_height, skin)    @pending_index = -1    refresh  endendclass Window_MenuActor < Window_MenuStatus  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize (skin = CR_MultipleWindowSkins::getSkin(4))    super(0, 0, skin)    self.visible = false  endendclass Window_ItemCategory < Window_HorzCommand  def initialize(skin = CR_MultipleWindowSkins::getSkin(5))    super(0, 0, skin)  endendclass Window_ItemList < Window_Selectable  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(x, y, width, height, skin = CR_MultipleWindowSkins::getSkin(6))    super(x,y,width,height, skin)    @category = :none    @data = []  endendclass Window_SkillCommand < Window_Command  def initialize(x, y, skin = CR_MultipleWindowSkins::getSkin(7))    super(x, y, skin)    @actor = nil  endendclass Window_SkillStatus < Window_Base  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(x, y, skin = CR_MultipleWindowSkins::getSkin(8))    super(x, y, window_width, fitting_height(4), skin)    @actor = nil  endendclass Window_SkillList < Window_Selectable  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(x, y, width, height, skin = CR_MultipleWindowSkins::getSkin(9))    super(x,y,width,height, skin)    @actor = nil    @stype_id = 0    @data = []  endendclass Window_EquipStatus < Window_Base  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(x, y, skin = CR_MultipleWindowSkins::getSkin(10))    super(x, y, window_width, window_height, skin)    @actor = nil    @temp_actor = nil    refresh  endendclass Window_EquipCommand < Window_HorzCommand  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(x, y, width, skin=CR_MultipleWindowSkins::getSkin(11))    @window_width = width    super(x, y, skin)  endendclass Window_EquipSlot < Window_Selectable  def initialize(x, y, width, skin = CR_MultipleWindowSkins::getSkin(12))    super(x, y, width, window_height, skin)    @actor = nil    refresh  endendclass Window_EquipItem < Window_ItemList  def initialize(x, y, width, height, skin = CR_MultipleWindowSkins::getSkin(13))    super(x,y,width,height, skin)    @actor = nil    @slot_id = 0  endendclass Window_Status < Window_Selectable  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(actor, skin=CR_MultipleWindowSkins::getSkin(14))    super(0, 0, Graphics.width, Graphics.height, skin)    @actor = actor    refresh    activate  endendclass Window_SaveFile < Window_Base  def initialize(height, index, skin = CR_MultipleWindowSkins::getSkin(15))    super(0, index * height, Graphics.width, height, skin)    @file_index = index    refresh    @selected = false  endendclass Window_ShopCommand < Window_HorzCommand  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(window_width, purchase_only, skin = CR_MultipleWindowSkins::getSkin(16))    @window_width = window_width    @purchase_only = purchase_only    super(0, 0, skin)  endendclass Window_ShopBuy < Window_Selectable  def initialize(x, y, height, shop_goods, skin = CR_MultipleWindowSkins::getSkin(17))    super(x, y, window_width, height, skin)    @shop_goods = shop_goods    @money = 0    refresh    select(0)  endendclass Window_ShopSell < Window_ItemList  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(x, y, width, height, skin = CR_MultipleWindowSkins::getSkin(18))    super(x, y, width, height, skin)  endendclass Window_ShopNumber < Window_Selectable  def initialize(x, y, height, skin = CR_MultipleWindowSkins::getSkin(19))    super(x, y, window_width, height, skin)    @item = nil    @max = 1    @price = 0    @number = 1    @currency_unit = Vocab::currency_unit  endendclass Window_ShopStatus < Window_Base  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(x, y, width, height, skin = CR_MultipleWindowSkins::getSkin(20))    super(x, y, width, height, skin)    @item = nil    @page_index = 0    refresh  endendclass Window_NameEdit < Window_Base  def initialize(actor, max_char, skin = CR_MultipleWindowSkins::getSkin(21))    x = (Graphics.width - 360) / 2    y = (Graphics.height - (fitting_height(4) + fitting_height(9) + 8)) / 2    super(x, y, 360, fitting_height(4), skin)    @actor = actor    @max_char = max_char    @default_name = @name = actor.name[0, @max_char]    @index = @name.size    deactivate    refresh  endendclass Window_NameInput < Window_Selectable  def initialize(edit_window, skin = CR_MultipleWindowSkins::getSkin(22))    super(edit_window.x, edit_window.y + edit_window.height + 8,          edit_window.width, fitting_height(9), skin)    @edit_window = edit_window    @page = 0    @index = 0    refresh    update_cursor    activate  endendclass Window_ChoiceList < Window_Command  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(message_window,skin=CR_MultipleWindowSkins::getSkin(23))    @message_window = message_window    super(0, 0, skin)    self.openness = 0    deactivate  endendclass Window_NumberInput < Window_Base  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(message_window, skin=CR_MultipleWindowSkins::getSkin(24))    @message_window = message_window    super(0, 0, 0, 0, skin)    @number = 0    @digits_max = 1    @index = 0    self.openness = 0    deactivate  endendclass Window_KeyItem < Window_ItemList  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(message_window, skin=CR_MultipleWindowSkins::getSkin(25))    @message_window = message_window    super(0, 0, Graphics.width, fitting_height(4), skin)    self.openness = 0    deactivate    set_handler(:ok,     method(:on_ok))    set_handler(:cancel, method(:on_cancel))  endendclass Window_Message < Window_Base  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(skin = CR_MultipleWindowSkins::getSkin(26))    super(0, 0, window_width, window_height, skin)    self.z = 200    self.openness = 0    create_all_windows    create_back_bitmap    create_back_sprite    clear_instance_variables  endendclass Window_ScrollText < Window_Base  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(skin = CR_MultipleWindowSkins::getSkin(27))    super(0, 0, Graphics.width, Graphics.height, skin)    self.opacity = 0    self.arrows_visible = false    hide  endendclass Window_MapName < Window_Base  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(skin = CR_MultipleWindowSkins::getSkin(28))    super(0, 0, window_width, fitting_height(1), skin)    self.opacity = 0    self.contents_opacity = 0    @show_count = 0    refresh  endendclass Window_BattleLog < Window_Selectable  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(skin = CR_MultipleWindowSkins::getSkin(29))    super(0, 0, window_width, window_height, skin)    self.z = 200    self.opacity = 0    @lines = []    @num_wait = 0    create_back_bitmap    create_back_sprite    refresh  endendclass Window_PartyCommand < Window_Command  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(skin = CR_MultipleWindowSkins::getSkin(30))    super(0, 0, skin)    self.openness = 0    deactivate  endendclass Window_ActorCommand < Window_Command  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(skin = CR_MultipleWindowSkins::getSkin(31))    super(0, 0, skin)    self.openness = 0    deactivate    @actor = nil  endendclass Window_BattleStatus < Window_Selectable  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(skin = CR_MultipleWindowSkins::getSkin(32))    super(0, 0, window_width, window_height, skin)    refresh    self.openness = 0  endendclass Window_BattleActor < Window_BattleStatus  #--------------------------------------------------------------------------  # * Object Initialization  #     info_viewport : Viewport for displaying information  #--------------------------------------------------------------------------  def initialize(info_viewport, skin = CR_MultipleWindowSkins::getSkin(33))    super(skin)    self.y = info_viewport.rect.y    self.visible = false    self.openness = 255    @info_viewport = info_viewport  endendclass Window_BattleEnemy < Window_Selectable  #--------------------------------------------------------------------------  # * Object Initialization  #     info_viewport : Viewport for displaying information  #--------------------------------------------------------------------------  def initialize(info_viewport, skin = CR_MultipleWindowSkins::getSkin(34))    super(0, info_viewport.rect.y, window_width, fitting_height(4), skin)    refresh    self.visible = false    @info_viewport = info_viewport  endendclass Window_BattleSkill < Window_SkillList  #--------------------------------------------------------------------------  # * Object Initialization  #     info_viewport : Viewport for displaying information  #--------------------------------------------------------------------------  def initialize(help_window, info_viewport, skin=CR_MultipleWindowSkins::getSkin(35))    y = help_window.height    super(0, y, Graphics.width, info_viewport.rect.y - y, skin)    self.visible = false    @help_window = help_window    @info_viewport = info_viewport  endendclass Window_BattleItem < Window_ItemList  #--------------------------------------------------------------------------  # * Object Initialization  #     info_viewport : Viewport for displaying information  #--------------------------------------------------------------------------  def initialize(help_window, info_viewport, skin = CR_MultipleWindowSkins::getSkin(36))    y = help_window.height    super(0, y, Graphics.width, info_viewport.rect.y - y, skin)    self.visible = false    @help_window = help_window    @info_viewport = info_viewport  endendclass Window_TitleCommand < Window_Command  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(skin = CR_MultipleWindowSkins::getSkin(37))    super(0, 0, skin)    update_placement    select_symbol(:continue) if continue_enabled    self.openness = 0    open  end  endclass Window_GameEnd < Window_Command  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize(skin = CR_MultipleWindowSkins::getSkin(38))    super(0, 0, skin)    update_placement    self.openness = 0    open  endend

Credit

Just me.

 

Terms of Use

Make sure you credit me. You can use in free or commercial games, though with commercial games I would like a free copy of the finished result.

Battle Engine Symphony

$
0
0

Battle Engine Symphony


Introduction
A new battle system for RPG Maker VX Ace. At the moment, It's providing a sideview battle and a language for customizing skills. There will be many add-on in the future to make it better.

Features
- Visualize Battles
- Customize Skills
- Easily Install
- Many add-on
- Free for using and redistributing

Screenshots



Download & Manual
Symphony script: https://github.com/suppayami/rmvxa-collection/blob/master/battle-symphony/battle-symphony-116e.rb

 

Github Repositoryhttps://github.com/suppayami/Battle-Symphony

Battle Engine Manual: https://docs.google.com/document/d/16zEipBx4p4iL_ty8LGf2z3ldFUzlBEfdM9QkSu-zXyY/edit#heading=h.vlqeekpclgdk

Battle Engine Wiki:https://github.com/suppayami/Battle-Symphony/wiki (will be updated in the future)

Credit
Yami
Yanfly (for his ideas from Melody)
Nessiah & EvilEagles (some other ideas)
Many testing guys

Note
- The original language is Melody Language from Yanfly Engine Melody. Be sure to credit him in your games if You use this Battle System.
- All Add-on can be found in Github Repository.
- This battle system follows MIT License. tl;dr: It's free.

Gamepad Extender (v1.1, 2/20/2015)

$
0
0

Gamepad Extender
version 1.1
by Lone Wolf

Introduction:
By default, RGSS3 uses DirectInput to make only 8 buttons available to scripters. This script provides an alternate, XInput-based gamepad interface, giving scripters access to all 16 buttons on a modern gamepad, as well as dual-analog sticks, analog triggers, and force-feedback controls. Also enables multiplayer for up to four players with compatible gamepads.

Features:

  • Doubles the number of available buttons.
  • Easy access to analog sticks and triggers.
  • Basic force-feedback control.
  • Support for up to four controllers simultaneously.
  • NEW: analog stick directions can now be treated like individual buttons

Video:

Spoiler


Analog movement in action. Pixel-movement, dynamic lighting, etc. all sold separately.

 


How to Use:

 

  • Paste in Materials (or Modules) section.
  • Configure to your liking.

Demo:
None. It's a scripting tool only.

Script:

Spoiler

#==============================================================================
# Gamepad Extender v1.1 (2/20/15)
# 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. 
# Some knowledge of RGSS is required for proper use.
#
# Instructions:
#	 1) Paste in the Materials section
#  2) Replace button calls in (other) scripts to use gamepad buttons as needed
#        (see Command Reference below)
# Optional:
#	 2) Use the PadConfig section to specify button differences between
#		  Gamepad and Keyboard (for players without gamepads)
#	 3) Replace direct button calls in your scripts (and the defaults) with
#		  PadConfig calls or these will do nothing
#        (see Command Reference below)
#------------------------------------------------------------------------------
# Command Reference:
#------------------------------------------------------------------------------
# All calls to extended buttons on Pad 1 can be made through the Input module.
# When using multiple pads, send calls to WolfPad with pad number (0...3)
#	as the final parameter. (i.e.  WolfPad.press?(:A, 3)  )
#
# The current list of mappable buttons is as follows:
#
#	 :A, :B, :X, :Y     - XBOX 360 standard face buttons.
#	 :L1, :L2, :R1, :R2 - Four triggers (LB, LT, RB, RT)
#	 :SELECT, :START    - Back and Start buttons
#	 :L3, :R3				    - Clickable Analog buttons
#
#	 :UP, :DOWN,
#	 :LEFT, :RIGHT	    - D-Pad buttons
#
#  :L_UP, :L_DOWN
#  :L_LEFT, :L_RIGHT  - Left stick directions
#
#  :R_UP, :R_DOWN
#  :R_LEFT, :R_RIGHT  - Right stick directions
#
# NON-STANDARD MAPPINGS WILL DO NOTHING without a compatible gamepad.
# To that end, use calls to PadConfig to remap non-standard keys into
# the standard domain where possible.
#
#		 for example:    Input.trigger?(PadConfig.page_down)
#		 will return :R1 if a gamepad is plugged in, but :R otherwise
#
# Analog values can be referenced with the following commands:
#	 left_stick
#	 right_stick
#	 left_trigger
#	 right_trigger
#
# Directional values of analog sticks can be referenced with these:
#	 lstick4
#	 lstick8
#	 rstick4
#	 rstick8
#
# Controller vibration can be accessed with these:
#	 vibrate(left_motor, right_motor, frame_duration)
#	 set_motors(left_motor, right_motor)
#
# All functions take an optional gamepad id (0-3) as their final parameter.
#
#------------------------------------------------------------------------------
# Terms of Use:
#------------------------------------------------------------------------------
#	 If you use it, give credit. With a few caveats:
#
#	 Can't call it alpha nay more, but I consider this script in-development.
#	 I make no guarantees of compatibility with other scripts.
#
#  Contact me via PM is you plan on using this in a commercial game.
#  I probably won't charge anything, but I will want to know it's out there.
#
#	 This script was posted at the official RPG Maker forums.
#	 Do modify or redistribute this script by itself, though you may
#	 include a configured version with your own script demos provided
#	 you inclide this header in its entirety.
#------------------------------------------------------------------------------
# Contact Info:
#------------------------------------------------------------------------------
# I can be reached via PM only at the RPG Maker Web forums.
#		(http://forums.rpgmakerweb.com)
#
# PM'ing the user Lone Wolf at other RPG Maker sites may have...
# unpredicatable results. I made someone really happy the day I registered...
#------------------------------------------------------------------------------
# Credits:
# Lone Wolf (99% of the code)
# raulf17 (directional movement bug fix; now obsolete)
#------------------------------------------------------------------------------
# 翻訳したいんですか?いいんだが、まだ未完成です。
#==============================================================================
module PadConfig
  # Basic configuration settings:
  # static:
  CONTROLLERS = 1 # can be any number from 1-4, higher values may cause errors
  
  # can be redefined by other scripts and changed in-game:
  def self.deadzone # Deadzone for axis input (%), may require adjusting
    0.1
  end
  def self.move_with_stick  # Use left-analog stick with dir4 and dir8
    true
  end
  def self.enable_vibration # Enable force-feedback
    true
  end
  
  # Use this section to write flexible button-mappings for your scripts.
  # Add additional methods as needed.
  # Format:   
  #      WolfPad.plugged_in? ? (gamepad binding) : (fallback binding)
  def self.confirm
    WolfPad.plugged_in? ? :A : :C
  end
  def self.cancel
    WolfPad.plugged_in? ? :B : :B
  end
  def self.dash
    WolfPad.plugged_in? ? :X : :A
  end
  def self.menu
    WolfPad.plugged_in? ? :Y : :B
  end
  def self.page_up
    WolfPad.plugged_in? ? :L1 : :L
  end
  def self.page_down
    WolfPad.plugged_in? ? :R1 : :R
  end
  def self.debug
    WolfPad.plugged_in? ? :L2 : :CTRL
  end
  def self.debug2
    WolfPad.plugged_in? ? :R3 : :F9
  end
end
# Main module:
module WolfPad
  def self.update
    for pad_index in 0...PadConfig::CONTROLLERS
      input = get_state(pad_index)
      if @packet[pad_index] == input[0]
      set_holds(pad_index)
      next
      end
      @packet[pad_index] = input[0]
      @buttons[pad_index] = (input[1] | 0x10000).to_s(2)
      @triggers[pad_index] = [input[2], input[3]]
      @lstick[pad_index] = [constrain_axis(input[4]), -constrain_axis(input[5])]
      @rstick[pad_index] = [constrain_axis(input[6]), -constrain_axis(input[7])]
      set_holds(pad_index)
    end
    update_vibration
    # Extra readout functions go here.
    #dircheck
  end
  def self.test # Prints no. of detected controllers (debugging use only)
    detected = 0
    for i in 0...PadConfig::CONTROLLERS
      self.update
      detected += plugged_in?(i) ? 1 : 0
    end
    puts sprintf("%d XInput controller(s) in use.", detected)
  end
  def self.readout # prints a range from the holds table (debugging use only)
    for i in 00...16
      print sprintf(" %d", @holds[0, i])
      print sprintf(" %d", @holds[1, i])
    end
    puts ";"
  end
  def self.dircheck
    for i in 0...PadConfig::CONTROLLERS
      print sprintf(" %d", key_holds(:UP, i))
      print sprintf(" %d", key_holds(:LEFT, i))
      print sprintf(" %d", key_holds(:DOWN, i))
      print sprintf(" %d", key_holds(:RIGHT, i))
      print " : "
    end
    puts ";"
  end
  # Basic vibration call.
  # For simplicity, motor values should be floats from 0.0 to 1.0
  def self.vibrate(left, right, duration, pad_index = 0)
    return unless PadConfig.enable_vibration
    set_motors(left, right, pad_index)
    @vibrations[pad_index] = duration
  end
  # Counts down vibration event timers
  def self.update_vibration
    for pad in 0...PadConfig::CONTROLLERS
       next if @vibrations[pad] == -1
       @vibrations[pad] -= 1
       if @vibrations[pad] == 0
          @vibrations[pad] = -1
          set_motors(0, 0, pad)
       end
    end
  end
  # Set left and right motor speeds. Vibration continues until stopped.
  # Repeated calls with different values can create vibration effects.
  # For simplicity, input values should be floats from 0.0 to 1.0
  def self.set_motors(left, right, pad_index = 0)
    return unless (PadConfig.enable_vibration) || (left == 0 && right == 0)
    left_v = [left * 65535, 65535].min
    right_v = [right * 65535, 65535].min
    vibration = [left_v, right_v].pack("SS")
    @set_state.call(pad_index, vibration)
  end
  def self.press?(button, pad_index = 0)
    key_holds(button, pad_index) > 0
  end
  def self.trigger?(button, pad_index = 0)
    key_holds(button, pad_index) == 1
  end
  def self.repeat?(button, p_i = 0)
    return true if key_holds(button, p_i) == 1
    return true if key_holds(button, p_i) > 30 && key_holds(button, p_i) % 5 == 0
  end
  # Returns left stick as a pair of floats [x, y] between -1.0 and 1.0
  def self.left_stick(pad_index = 0)
    @lstick[pad_index]
  end
  # Returns right stick as a pair of floats [x, y] between -1.0 and 1.0
  def self.right_stick(pad_index = 0)
    @rstick[pad_index]
  end
  # Returns left trigger as float between 0.0 to 1.0
  def self.left_trigger(pad_index = 0)
    @triggers[pad_index][0] / 255.0
  end
  # Returns right trigger as float between 0.0 to 1.0
  def self.right_trigger(pad_index = 0)
    @triggers[pad_index][1] / 255.0
  end
  def self.dir4(p_i = 0)
    return lstick4(p_i) if PadConfig.move_with_stick
    if press?(:UP, p_i)
     8
    elsif press?(:RIGHT, p_i)
     6
    elsif press?(:LEFT, p_i)
     4
    elsif press?(:DOWN, p_i)
     2
    else
     0
    end
  end
  def self.dir8(p_i = 0)
    return lstick8(p_i) if PadConfig.move_with_stick
    if press?(:UP, p_i) and press?(:LEFT, p_i)
     7
    elsif press?(:UP, p_i) and press?(:RIGHT, p_i)
     9
    elsif press?(:DOWN, p_i) and press?(:LEFT, p_i)
     1
    elsif press?(:DOWN, p_i) and press?(:RIGHT, p_i)
     3
    else
     dir4(p_i)
    end
  end
  # Left-stick direction
  def self.lstick8(p_i = 0)
      flags_to_dir8(key_holds(:L_RIGHT, p_i),key_holds(:L_LEFT, p_i),
                    key_holds(:L_DOWN, p_i),key_holds(:L_UP, p_i))
  end
  def self.lstick4(p_i = 0)
      flags_to_dir4(key_holds(:L_RIGHT, p_i),key_holds(:L_LEFT, p_i),
                    key_holds(:L_DOWN, p_i),key_holds(:L_UP, p_i))
  end
  # Right-stick direction
  def self.rstick8(p_i = 0)
      flags_to_dir8(key_holds(:R_RIGHT, p_i),key_holds(:R_LEFT, p_i),
                    key_holds(:R_DOWN, p_i),key_holds(:R_UP, p_i))
  end
  def self.rstick4(p_i = 0)
      flags_to_dir4(key_holds(:R_RIGHT, p_i),key_holds(:R_LEFT, p_i),
                    key_holds(:R_DOWN, p_i),key_holds(:R_UP, p_i))
  end
  def self.plugged_in?(pad_index = 0)
    @packet[pad_index] && @packet[pad_index] > 0
  end
  def self.keyboard_key?(button)
    !@keys.has_key?(button)
  end

  #Helper functions:
  # convert signed half-word axis state to float
  def self.constrain_axis(axis)
    val = axis.to_f / 2**15
    val.abs > PadConfig.deadzone ? val : 0
  end
  
  # derives a dir8 value from directional hold values
  def self.flags_to_dir8(right, left, down, up)
    x = right == left ? 0 : (right > left ? 1 : 2)
    y = down == up ? 0 : (down > up ? 1 : 2)
    table = [[5, 2, 8],
            [ 6, 3, 9],
            [ 4, 1, 7]]
    return table[x][y]
  end
  # derives a dir4 value from directional hold values
  def self.flags_to_dir4(right, left, down, up)
    selection = [right, left, down, up].max
    table = [0,0,down,0,left,0,right,0,up]
    return table.index(selection)
  end
  
  # calculates the precise geometric angle from stick axis values [x,y]
  def self.axis_to_angle(axis)
    cy = -axis[1]
    cx = -axis[0]
    return -1 if cy == 0 && cx == 0
    angle = Math.atan2(cx, cy) * 180 / Math::PI
    angle = angle < 0 ? angle + 360 : angle
    return angle
  end
  
  # Original angle-conversion handlers for analog sticks
  # OBSOLETE: preserved for reference only
  def self.axis_to_dir8(axis)
    angle_to_dir8(axis_to_angle(axis))
  end
  def self.axis_to_dir4(axis)
    angle_to_dir4(axis_to_angle(axis))
  end

  def self.angle_to_dir8(angle)
    return 0 if angle == -1
    d = 0
    if angle < 22.5 || angle >= 337.5
     d = 8
    elsif angle < 67.5
     d = 7
    elsif angle < 112.5
     d = 4
    elsif angle < 157.5
     d = 1
    elsif angle < 202.5
     d = 2
    elsif angle < 247.5
     d = 3
    elsif angle < 292.5
     d = 6
    elsif angle < 337.5
     d = 9
    end
    return d
  end
  def self.angle_to_dir4(angle)
    return 0 if angle == -1
    d = 0
    if angle < 45 || angle >= 315
     d = 8
    elsif angle < 135
     d = 4
    elsif angle < 225
     d = 2
    elsif angle < 315
     d = 6
    end
    return d
  end
  
  private # methods past here can't be called from outside
  # This hash correlates RM's Input to XInput keys. Experienced Users only!
  # The Input module will handle any keys not listed here (i.e. :CTRL) itself.
  # Integers refer to specific gamepad button IDs.
  @keys = {
    :UP	=> 15, #d-pad up
    :DOWN => 14, #d-pad left
    :LEFT => 13, #d-pad down
    :RIGHT => 12, #d-pad right
    :A	 => 3, #lower face button
    :B	 => 2, #right face button
    :X	 => 1, #left face button
    :Y	 => 0, #upper face button
    :L1	=> 7, #upper left trigger
    :R1	=> 6, #upper right trigger
    :START => 11,
    :SELECT => 10,
    :L3	=> 9, #left thubstick button
    :R3	=> 8, #right thubstick button
    :L2	=> 16, #lower left trigger (press only)
    :R2	=> 17, #lower right trigger (press only)
    :L_UP	=> 21,
    :L_DOWN	=> 20,
    :L_LEFT	=> 19,
    :L_RIGHT	=>18,
    :R_UP	=> 25,
    :R_DOWN	=> 24,
    :R_LEFT	=> 23,
    :R_RIGHT	=> 22
    }
  #Win32API calls. Leave these alone.
  @set_state = Win32API.new("XINPUT9_1_0", "XInputSetState", "IP", "V")
  @get_state = Win32API.new("XINPUT9_1_0", "XInputGetState", "IP", "L")
  #Initializers
  # Will store data for number of gamepads in use.
  @packet = Array.new(PadConfig::CONTROLLERS)
  @buttons = Array.new(PadConfig::CONTROLLERS)
  @triggers = Array.new(PadConfig::CONTROLLERS)
  @lstick = Array.new(PadConfig::CONTROLLERS)
  @rstick = Array.new(PadConfig::CONTROLLERS)
  # tracks how long buttons have been pressed
  @holds = Table.new(PadConfig::CONTROLLERS, 26)
  # stores vibration event timers
  @vibrations = Array.new(PadConfig::CONTROLLERS, -1)
  def self.key_holds(symbol, pad_index)
    return 0 if keyboard_key?(symbol)
    @holds[pad_index, @keys[symbol]]
  end
  def self.get_state(pad_index)
    state = "\0" * 16
    @get_state.call(pad_index, state)
    return state.unpack("LSCCssss")
  end
  def self.set_holds(p_i)
    for i in 1...17
     @holds[p_i, i-1] = @buttons[p_i][i].to_i > 0 ? @holds[p_i, i-1] + 1 : 0
    end
    @holds[p_i, 16] = left_trigger(p_i) >= 0.5 ? @holds[p_i, 16]+1 : 0
    @holds[p_i, 17] = right_trigger(p_i) >= 0.5 ? @holds[p_i, 17]+1 : 0
    @holds[p_i, 18] = left_stick(p_i)[0] >= 0.5 ? @holds[p_i, 18]+1 : 0
    @holds[p_i, 19] = left_stick(p_i)[0] <= -0.5 ? @holds[p_i, 19]+1 : 0
    @holds[p_i, 20] = left_stick(p_i)[1] >= 0.5 ? @holds[p_i, 20]+1 : 0
    @holds[p_i, 21] = left_stick(p_i)[1] <= -0.5 ? @holds[p_i, 21]+1 : 0
    @holds[p_i, 22] = right_stick(p_i)[0] >= 0.5 ? @holds[p_i, 22]+1 : 0
    @holds[p_i, 23] = right_stick(p_i)[0] <= -0.5 ? @holds[p_i, 23]+1 : 0
    @holds[p_i, 24] = right_stick(p_i)[1] >= 0.5 ? @holds[p_i, 24]+1 : 0
    @holds[p_i, 25] = right_stick(p_i)[1] <= -0.5 ? @holds[p_i, 25]+1 : 0
  end
end
# Aliases to tie the above into VXAce's Input module
module Input
  class <<self
    alias :vxa_update :update
    alias :vxa_press? :press?
    alias :vxa_trigger? :trigger?
    alias :vxa_repeat? :repeat?
    alias :vxa_dir4 :dir4
    alias :vxa_dir8 :dir8
  end
  def self.update
    WolfPad.update
    vxa_update
  end
  def self.press?(button)
    return vxa_press?(button) if WolfPad.keyboard_key?(button)
    return WolfPad.press?(button) if WolfPad.plugged_in?
    return vxa_press?(button)
  end
  def self.trigger?(button)
    return vxa_trigger?(button) if WolfPad.keyboard_key?(button)
    return WolfPad.trigger?(button) if WolfPad.plugged_in?
    return vxa_trigger?(button)
  end
  def self.repeat?(button)
    return vxa_repeat?(button) if WolfPad.keyboard_key?(button)
    return WolfPad.repeat?(button) if WolfPad.plugged_in?
    return vxa_repeat?(button)
  end
  def self.dir4
    WolfPad.plugged_in? ? WolfPad.dir4 : vxa_dir4
  end
  def self.dir8
    WolfPad.plugged_in? ? WolfPad.dir8 : vxa_dir8
  end
end

 

 


FAQ:
Q: What controllers will work?
A: Any PC-specific USB controller made in the last five years should work without issue. Older controllers, console controller adapters, etc. will need XInput drivers or an XInput emulator. Google is your friend.

Q: No Guide button?
A: No Guide button. It uses a separate interface from XInput and is generally reserved by the system.

Q: Can you make this work in...?
A: This is the VX Ace version. An outdated VX port can be found here. I am not planning any further ports at this time.

Q: I installed this script, so why doesn't my gamepad work?
A: This script adds a new module to handle input from modern gamepads, but doesn't change any of the script core's default button calls. To actually use any of the new possible mappings (or the additional PadConfig module's bindings), you need to manually edit the input related functions in the default scripts (Game_Player and Window_Selectable are good places to start). Comments for specific functions are included in the main script body.

Credit and Tanks:
-Lone Wolf
-An old forum post on Win32API I clearly should have bookmarked.

Author's Notes:
This script is still a work-in-progress. Feel free to suggest features and fixes.

Updates:

 

(2/20/15) - First update in two years! Optimized analog stick directional handling.

(3/8/13) - Script update. Fixed a bug, updated documentation,  cleaned a few typos, and laid groundwork for writing add-ons.
(1/9/13) - Updated main post. No changes to script.
(7/25/12) - Fixed input refresh bug on controllers handling update packets correctly. This one's my bad.
(6/13/12) - Updated main post. No changes to script.
(4/10/12) - Fixed a bug with multiple controllers where update_vibration would be skipped if gamepad detection failed.

Viewing all 416 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>