Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Wecoc

1
RMXP Script Database / [XP] Grid-Free Doodads
January 28, 2017, 03:47:09 pm
Grid-Free Doodads
Authors: Wecoc
Version: 1.01
Type: Doodad System
Key Term: Game Utility



Introduction

Grid-Free Doodads is a system that implements on your game the use of Doodads, in other words, tiles which are not fixed on the default editor grid.

With this you can get an effect very similar to those made with parallax mapping but this time controlled on the game, with extra options. Also, the size of the game file will be much lower, solving this way the main problem found on games that use parallax.

This system was inspired by the Grid-Free Doodads plugin for RPG maker MV, made by Yanfly.
It contains a total of 7 scripts: Mouse and Keyboard support, a script containing all the info you need to know to use this system in your game, and the system by itself divided in 4 parts.


Features


  • Unlimited Doodads per map

  • You can see the Doodads on the project as normal tiles (not on the Editor)

  • Area Support to use Regions like in VX/Ace/MV --> No passable Doodads

  • Animated Doodads with unlimited frames, yay!

  • Doodads which appear under a condition




Screenshots

Spoiler: ShowHide













Demo

Grid-Free Doodads 1.01 (English)
Grid-Free Doodads 1.01 (Español)


Script

You will find the 7 scripts in the demo, place them in your game (first you should save a copy of you game on its current state). Place them over main and over other custom scripts. You will find more detailed Instalation info inside the script Doodad Info.


Instructions

Inside the script Doodad Info

Spoiler: ShowHide
#==============================================================================
# ** [XP] Grid-Free Doodads v1.01 ENG
#------------------------------------------------------------------------------
# ** PART 0 - Doodad Info
#------------------------------------------------------------------------------
#  Grid-Free Doodads is a system that allows the use of Doodads, in other
#  words, tiles which are not fixed on the default editor grid.
#
#  This allows an effect very similar to parallax mapping but controlled on the
#  game, with extra options. Furthermore the size of the game file will be
#  much lower, which is the main problem on games that use parallax.

#  This script was inspired by the 'Grid-Free Doodads' in MV, made by Yanfly.
#  Version: 1.01 (English)
#------------------------------------------------------------------------------
# Features:
#
# - You can see the Doodads on the project as normal tiles, but not on the editor
# - Doodads are placed and configured in Debug Mode.
# - The system consists of 7 scripts (4 parts + info + Mouse & Keyboard support)
# - This system has integrated an Area Support.
# - This demo contains Doodads inside the Graphics/Doodads/ folder.
#   There you can define your own Doodads, inside folders and sub-folders.
#
#------------------------------------------------------------------------------
# Credits:
#
#   Wecoc - Grid-Free Doodads
#   Glitchfinder - Key Input & Mouse
#
#------------------------------------------------------------------------------
# Installation:
#
# 1. Copy the 7 demo scripts to your project in the same order (you should first
#    save a copy of your project in its current state)
#    The scripts must be placed over main and over the other custom scripts.
# 2. Copy the folder Doodads of this demo inside the folder Graphics of your
#    project.
# 3. If you are not using RTP, define the icon used to show folders in the game,
#    in the very start of the script Doodad Setup.
#
#------------------------------------------------------------------------------
# Tutorial:
#
#  Once you have installed Grid-Free Doodads, you can access the main menu by
#  pressing F8 in Debug mode.
#
# 1. Place a Doodad
#
#  To place a Doodad on the map, go to the Place Doodads option in the setup
#  main menu. The list of folders inside the folder Doodads will be displayed.
#  You can create as many folders and sub-folders as you want.
#
#  After selecting the doodad you want to insert, you can place it on the map
#  using the Mouse.
#
# - If you press the arrow keys you will scroll the screen over the entire map.
#
# - If you press Q/W you change the Doodad priority. Priority is the height of
#   the Doodad on the map, and works exactly like tiles (0-5), but they have an
#   extra priority (-1) so you can place them under the player and events.
#
# - If you press CTRL you can fix the doodad in a 16x16 grid. The length of the
#   grid is defined on the script Doodad Setup.
#
# - If you press E you will access to the Doodad configuration.
#
# - If you click with the Mouse, the Doodad will be placed on its current place,
#   and you will instantly have the possibility to insert the next one.
#
# - If you press CTRL + Z the last Doodad will be removed.
#
# - Finally if you press Cancel (X) you will back to the main setup menu.
#
# 2. Edit a Doodad
#
#  To edit a Doodad go to the Edit Doodads option in the setup main menu.
#  The number of doodads and priority categories will be displayed.
#
#  After selecting your category a list of all doodads on that category will
#  be displayed. On the map, the current selected Doodad will blink.
#  If the selected one is under the window, place the mouse over the window
#  and its opacity will decrease.
#
#  Once you select your Doodad the edit options list will appear.
#
# - Edit Position allows you to define X, Y and priority of the Doodad again.
#
# - Hue will change the hue of the Doodad bitmap. This proccess is the most
#   time consuming and will decrease the color quality of the Doodad after some
#   changes, but no need to worry about that, once you exit the editor its
#   colors will look fine.
#
# - You can also change the Opacity and Zoom of your Doodad.
#
# - Anchor X and Y are used to define the doodad center points.
#   That's used to calculate when the Doodad is in front or back of the player
#   and events in priority 0, or of other doodads and tiles in any priority.
#
# - Blend, Bush and Mirror work exactly the same way as always.
#
# - Angle is used to rotate the Doodad. If you press CTRL its value will
#   increase or decrease faster.
#
# - Animation allows to asign a loop animation ID on the sprite of the Doodad.
#   Its position depends on Anchor X and Y.
#
# - Set Tone opens a window where you can control the tone RGB of the Doodad.
#   The values are between -255 and 255. You can save the current tone to select
#   it directly on any other Doodad, that info will be stored in TONE.txt inside
#   the Doodads folder of your project. You can change there the name of the
#   tones and define as may as you want, but do not alter the tabulation format
#   of the file, or the tone won't be read properly.
#
# - Condition is the last opcion, only for scripters, and it's disabled if you
#   access the edit window from the Place Doodads mode (E).
#   Condition allows to write an eval to restrict the appearing condition of
#   the Doodad. If the eval is well-written, Condition will be displayed green,
#   but red if not.
#
# 3. Delete a Doodad
#
#  To delete a doodad go to the Clear Doodads option, the same list of doodads
#  as in Edit Doodads will appear.
#
# 4. Impassable Doodads
#
#  The only way to make a no passable Doodad is using Areas to define the
#  passability of a tile on the map. You can configure it on the script Area
#  Support, but by default 10 is no passable, 11 is always passable, 12 has
#  bush effect and 13 disabled the bush effect.
#
# 5. Animated Doodads
#
#  Yes, you can also make animated Doodads. To define the frames of a Doodad
#  its graphic name must end with [X,Y] where X are the horizontal frames and
#  Y the vertical frames. You can later define its speed on the game.
#
#==============================================================================



Compatibility

If you are using other Mouse and Key support scripts in your game you can use them instead of the ones found in the demo, but you will have to edit the last script (Doodad Setup) to adapt it to your scripts.

You will probably get an error if you try to load a save file of your game, if you saved it before inserting Grid-Free Doodads.

No other compatibility issues were found.



Credits and Thanks


  • Wecoc - Grid-Free Doodads

  • Glitchfinder - Key Input & Mouse




Author's Notes

This is for rebels who still use RPG maker XP but want Doodads because f*ck, they are great.
Enjoy~
2
Resource Database / [XP] Edits of the chara template
April 21, 2016, 09:18:59 pm
I made some edits on the chara template so you have more variety. You can use to create your characters for your projects. Credits are not necessary.



- Male (default)
- Hunk
- Tall
- Big dude
- Female (default)
- Chubby
- Alternative ("girly") legs
- Alternative ("manly") arms

And here you can see a collection of some of the RTP faces, and some new ones.



New! An obese guy



I will maybe make more, soon.
3
Resource Database / [XP] Wecoc's RTP character edits
April 21, 2016, 09:04:32 pm
Some characters I made using the RTP characters or the RTP chara template. Credits are not required.

Human: ShowHide


Others: ShowHide






4
The RMXP RTP has a lot of floor tiles. Some have a shadow and a bright version, but there's never an autotile with their combination... So I made them all. Also, some tile combinations are interesting to put on an autotile. I made some templates, which I used to make my autotiles and you can use to make your own ones. No credits needed!

Shadows and lights: ShowHide



Others: ShowHide


Templates: ShowHide
5
Resources / RMXP Wallpaper characters
August 24, 2015, 07:42:08 am
Enterbrain never includes the characters of the program cover on the RTP. Also, I looked for them and looks like anyone made them before.
That's why I've made these four sprites so you can have them on your projects, if you want.



Spoiler: ShowHide


Credits not required.
6
Event System Database / [XP] Battle by Layers
September 14, 2014, 12:25:37 pm
Battle by Layers
Version: 1.0
Type: Boss Battle Engine



Introduction

This engine simulates an absolutely picture-based boss battle in map. It's a base with which you could do many other things.


Features


  • Default damage display.
  • New support for pictures: animation display, collapse...



Screenshots

Spoiler: ShowHide




Demo

Battle by Layers.zip


Instructions

It requires all these to work:
- 2 switches --> "Battle" to activate the engine and "Dead" when the hero or the enemy are dead (end of the demo)
- 5 variables --> Basically for damage calculation and HP.
- 14 pictures --> Background (1) , Enemy (3), Terrain (1) and Actor (9)
- 1 script --> New support for pictures. Place over main and under the other scripts. It's compatible with most scripts.
- 2 common events --> hero damage and enemy damage
- 5 map events --> everything else

The script doesn't have configuration changes, all the configuration is inside the engine.



Credits and Thanks


  • Wecoc



Author's Notes

Difficulty: Medium / High
7
I'm not sure if there is an official 2.4 version (I was searching for it and I didn't found anything) but the old version 2.3 had some bugs so I decided to fix them. Also, I added some easy features.

Bugfixes:

- Underline and Strikethrough were not working properly
- Align feature now compatible with underline and strikethrough
- Gradient text was being drawn over a normal text (alpha problems)

Addons:

- Underline and Strikethrough 'height' feature
- Underline and Strikethrough 'double' feature
- Shadow 'x' / 'y' (default: 2, 2)
- Array method missing ; if you call a missing method to an array it will check if it can be applied in any object inside the array

And that's all, I know it's not so much. There could be more bugs to fix, if you know any please contact me.

MACL Complete 2.4.txt

MACL is full of interesting methods for hidden classes. I have thousands of them too, in a compilation I did for my own (some are written by me). Some of them could be added on MACL, but I should have to check them between the current ones, and I CAN'T do that.

I will probably choose the interesting ones and post on another project, but not sure when I will be able to do it.

If there is any problem with this post or the MACL author's rules or... ANYTHING, please sorry.

If you use this version don't credit me, but the real authors.
8
RMXP Script Database / [XP] ACE WF
September 01, 2014, 10:58:22 pm
VX Ace Wecoc Features
Authors: Wecoc
Version: 1.1
Type: Add-on Collection
Key Term: Add-on Collection



Introduction

I did a pack of little scripts and I'm glad to share it to you.
It gets on RPG maker XP some functions from RPG maker VX Ace, that's why it's called VX Ace Wecoc Features (ACE WF)

The pack contains 34 individual scripts and some Scene edits. You can use any of the scripts separately except the Scene ones.
All the scripts are catalogued in the same way; with a number, a short name, its requirements, the known incompatibilities, the author and a description of usage.

Every little script includes at least an specific global inside module ACE_WF. That global is not used in the script, but in others to identify if the script is being used so please DON'T REMOVE IT.


Features


  • 001 Alias - Allows to add an alias for a character.

  • 002 Description  - Allows to add a description for an actor, class, state, enemy or map.

  • 003 Learnings - Allows to have a better control of the learnings (easily add or remove them).

  • 004 Element Rate - Changes element rate configuration.

  • 005 State Rate - Changes state rate configuration.

  • 006 Enconter Rate - Adds a new variable to actor, item, weapon, armor or state which will alter the rate of encounters.

  • 007 Victory Rates - Adds some new variables to actors, items, weapons, armors and states which affect on some battle victory features.

  • 008 Multi-drop - Changes the victory window so if there's any repeated item, it will be shown only once with a multiplicator.

  • 009 Battler States - With this script plus_state_set and minus_state_set are also modificable by actor, enemy and armors.

  • 010 Pretty Numbers - Before big numbers were written "1000000000" and now "1,000,000,000".

  • 011 Escape Rate - Adds a new variable to actor, item, weapon, armor, state or enemy which affects on the probability to escape a battle.

  • 012 Item Type - Assigns different types of items, and also special items.

  • 013 Skill Type - Assigns different types of skills.

  • 014 Weapon Type - Assigns different types of weapons.

  • 015 Armor Type - Assigns different types of each kind of armor.

  • 016 Equip Optimize - Allows to directly optimize the equipment of an actor.

  • 017 Notes - Adds the option to add notes to actor, class, enemy, state, item, skill, weapon and armor. This notes are evaluated via script.

  • 018 Windowskin Colors - Allows to obtain colors from a windowskin and set them as a font color, so every windowskin has its specific colors.

  • 019 Formulas - This script gives the option of assigning damage formulas to actors, enemies and skills.

  • 020 Message Codes - Very simple Message System with some of the Ace's message codes.

  • 021 Resistence State - An actor or an enemy can be totally resistant to a state.

  • 022 Die Effect - Allows to select the die 'collapse' effect of an actor or enemy.

  • 023 Exp curve - The default XP experience curve is generated using 2 values. With this script you can create it with 2 extra values ("acc").

  • 024 Battle Scope - Adds new 'random' scope options to items and skills.

  • 025 Effect Edits - Adds new damage options for items and skills.

  • 026 Strategy - Adds two new types of target strategy for enemies, to the strongest and to the weakest.

  • 027 Step State - A state can be removed after a certain number of footsteps.

  • 028 Showing Name - Assigns a new map name to be displayed in windows instead of the default name.

  • 029 Choice Window - Changes the way choices are shown, displaying them in a separete window.

  • 030 Scroll Text - Allows to add a message box that scrolls up.

  • 031 Draw Character - Allows applying other features when you draw a character.

  • 032 Scene Calling - The same as menu_calling and save_calling but for any scene.

  • 033 Screen Color - Allows to change the Screen Color in the same way than Screen Tone.

  • 034 Screen Brightness - Allows to change the Screen Brightness.




Screenshots

Spoiler: ShowHide










Demo

ACE WF 1.1.zip


Instructions

Inside the demo and each script.


Compatibility

I tested with some engines, here's an approximate percentage of compatibility with them:

Drago Core Engine - 100%
Blizz-Abs - 90%
Tons of AddOns - 90%
SDK 1.x - 90%
SDK 2.x - 70%



Credits and Thanks


  • Wecoc




Author's Notes

You can contribute to make it better!
9
Wecoc's Dynamic File System
Authors: Wecoc
Version: 1.2
Type: Save / Load Add-on
Key Term: Title / Save / Load / GameOver Add-on



Introduction

The script rewrites all the load/save system.

I created this basis so you can make your own load / save system with dynamic functions in your own way.
My recommendation is not use it alone because the interface is not pretty, but it will work anyway.



Features


  • The player can name the Save file in the same way like actors.

  • It has no max on the number of files.

  • New folder for save files. If it does not exist it will be created automatically.

  • (Not used but done) Delete save files from the game.

  • (Not used but done) Get the last saved game directly by mtime

  • Get the actual file you are playing, with $game_temp.playing_file ("" if none)




Screenshots

These are from the default interface. As I said, it's not so cool.

Screen01
Screen02
Screen03



Script

Put this script over main
Spoiler: ShowHide

#==============================================================================
# ** [XP] Wecoc's Dynamic File System v1.2
#------------------------------------------------------------------------------
# by: Wecoc
#==============================================================================

module Save_Module

 FOLDER = "Save"

 def self.folder
   save_folder = FOLDER
   if FOLDER == "" or FOLDER == nil
     save_folder = Dir.getwd
   end
   return save_folder
 end
end

class Dir
 def Dir.get_extension_files(dirname)
   Dir.open(dirname) do |d|
     if dirname == Dir.getwd
       return d.select {|ent| File.file?("#{ent}")}
     else
       return d.select {|ent| File.file?("#{dirname}/#{ent}")}
     end
   end
 end

 def Dir.get_save_files(dirname)
   folder_files = Dir.get_extension_files(dirname)
   folder_files = folder_files.select {|d| d.include?(".rxdata")}
   folder_files.each do |d|
     d.chomp!(".rxdata")
   end
   return folder_files
 end

 def Dir.last_file_played
   array = []
   Dir.get_extension_files(Save_Module.folder).each do |last|
     file = File.open("#{Save_Module.folder}/#{last}", "r")
     array.push [last, file.mtime]
   end
   array.sort! {|a, b| b[1] <=> a[1] }
   return array[0][0]
 end
end

#==============================================================================
# ** Window_VariableNameEdit
#==============================================================================

class Game_Temp
 attr_accessor :var_max_char
 attr_accessor :playing_file
 alias var_max_char_ini initialize unless $@
 def initialize
   var_max_char_ini
   @var_max_char = 16
   @playing_file = ""
 end
end

class Window_VariableNameEdit < Window_Base
 attr_reader  :name
 attr_reader  :index

 def initialize(max_char)
   super(0, 0, 640, 128)
   self.contents = Bitmap.new(width - 32, height - 32)
   @max_char = max_char
   @name = ""
   @index = 0
   refresh
   update_cursor_rect
 end

 def refresh
   self.contents.clear
   name_array = @name.split(//)
   for i in 0...@max_char
     c = name_array[i]
     if c == nil
       c = "_"
     end
     x = 320 - @max_char * 14 + i * 28
     self.contents.draw_text(x, 32, 28, 32, c, 1)
   end
 end

 def add(character)
   if @index < @max_char and character != ""
     @name += character
     @index += 1
     refresh
     update_cursor_rect
   end
 end

 def back
   if @index > 0
     name_array = @name.split(//)
     @name = ""
     for i in 0...name_array.size-1
       @name += name_array[i]
     end
     @index -= 1
     refresh
     update_cursor_rect
   end
 end

 def update_cursor_rect
   x = 320 - @max_char * 14 + @index * 28
   self.cursor_rect.set(x, 32, 28, 32)
 end

 def restore_default
   refresh
   update_cursor_rect
 end
 
 def update
   super
   update_cursor_rect
 end
end

#==============================================================================
# ** Scene_Variable_Name
#==============================================================================

class Scene_Variable_Name
 attr_accessor :variable

 def main
   @edit_window = Window_VariableNameEdit.new($game_temp.var_max_char)
   @input_window = Window_NameInput.new
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   Graphics.freeze
   @edit_window.dispose
   @input_window.dispose
 end

 def update
   @edit_window.update
   @input_window.update
   if Input.repeat?(Input::B)
     if @edit_window.index == 0
       $game_system.se_play($data_system.cancel_se)
       $scene = Scene_Save.new(false)
       return
     end
     $game_system.se_play($data_system.cancel_se)
     @edit_window.back
     return
   end
   if Input.trigger?(Input::C)
     if @input_window.character == nil
       if @edit_window.name == ""
         @edit_window.restore_default
         if @edit_window.name == ""
           $game_system.se_play($data_system.buzzer_se)
           return
         end
         $game_system.se_play($data_system.decision_se)
         return
       end
       $save_variable = @edit_window.name
       $game_system.se_play($data_system.decision_se)
       $scene = Scene_Save.new(true) ##
       return
     end
     if @edit_window.index == $game_temp.var_max_char
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     if @input_window.character == ""
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     $game_system.se_play($data_system.decision_se)
     @edit_window.add(@input_window.character)
     return
   end
 end
end

#==============================================================================
# ** Window_Confirm
#==============================================================================

class Window_Confirm < Window_Selectable
 attr_accessor :question
 attr_accessor :yes_string
 attr_accessor :no_string

 def initialize(question, yes_string, no_string, column_max=1)
   super(0, 0, 120, 160 - (column_max * 32))
   self.contents = Bitmap.new(self.width - 32, self.height - 32)
   w1 = self.contents.text_size(question).width
   w2 = self.contents.text_size(yes_string).width
   w3 = self.contents.text_size(no_string).width
   if column_max == 1
     self.width = [w1, w2, w3].max + 36
   else
     self.width = [w1, w2 + w3].max + 36
   end
   self.contents = Bitmap.new(self.width - 32, self.height - 32)
   @column_max = column_max
   @item_max = 2
   @index = 1
   @question = question
   @yes_string = yes_string
   @no_string = no_string
   draw_strings
 end

 def refresh
   self.contents.clear
   draw_strings
 end

 def draw_strings
   self.contents.draw_text(2, 0, self.width - 32, 32, @question)
   self.contents.draw_text(2, 32, self.width - 32, 32, @yes_string)
   case @column_max
   when 1
     x = 2
     y = 64
     width = self.width - 32
   when 2
     x = (self.width - 32) / 2
     y = 32
     width = (self.width - 32) / 2
   end
   self.contents.draw_text(x, y, width, 32, @no_string)
 end

 def update_cursor_rect
   if @index < 0
     self.cursor_rect.empty
     return
   end
   row = @index / @column_max
   if row < self.top_row
     self.top_row = row
   end
   if row > self.top_row + (self.page_row_max - 1)
     self.top_row = row - (self.page_row_max - 1)
   end
   cursor_width = self.width / @column_max - 32
   x = @index % @column_max * (cursor_width + 32)
   y = @index / @column_max * 32 - self.oy
   self.cursor_rect.set(x, y + 32, cursor_width, 32)
 end
end

#==============================================================================
# ** Window_File
#==============================================================================

class Window_File < Window_Selectable
 def initialize
   super(0, 64, 640, 352)
   @column_max = 1
   refresh
   self.index = 0
 end

 def item
   return @data[self.index]
 end

 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   @data = []
   # Add item
   save_files = Dir.get_save_files(Save_Module.folder)
   for i in 0...save_files.size
     @data.push(save_files[i])
   end
   # If item count is not 0, make a bit map and draw all items
   @item_max = @data.size
   if @item_max > 0
     self.contents = Bitmap.new(width - 32, row_max * 32)
     for i in 0...@item_max
       draw_item(i)
     end
   end
 end

 def draw_item(index)
   item = @data[index]
   # x = 4 + index % 2 * (288 + 32)
   # y = index / 2 * 32
   x = 4
   y = index * 32
   rect = Rect.new(x, y, self.width / @column_max - 32, 32)
   self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
   self.contents.draw_text(x, y, 640, 32, item)
 end
end

#==============================================================================
# ** Scene_Title
#==============================================================================

class Scene_Title
 def main
   if $BTEST
     battle_test
     return
   end
   $data_actors        = load_data("Data/Actors.rxdata")
   $data_classes       = load_data("Data/Classes.rxdata")
   $data_skills        = load_data("Data/Skills.rxdata")
   $data_items         = load_data("Data/Items.rxdata")
   $data_weapons       = load_data("Data/Weapons.rxdata")
   $data_armors        = load_data("Data/Armors.rxdata")
   $data_enemies       = load_data("Data/Enemies.rxdata")
   $data_troops        = load_data("Data/Troops.rxdata")
   $data_states        = load_data("Data/States.rxdata")
   $data_animations    = load_data("Data/Animations.rxdata")
   $data_tilesets      = load_data("Data/Tilesets.rxdata")
   $data_common_events = load_data("Data/CommonEvents.rxdata")
   $data_system        = load_data("Data/System.rxdata")
   $game_system = Game_System.new
   @sprite = Sprite.new
   @sprite.bitmap = RPG::Cache.title($data_system.title_name)
   s1 = "New Game"
   s2 = "Continue"
   s3 = "Shutdown"
   @command_window = Window_Command.new(192, [s1, s2, s3])
   @command_window.back_opacity = 160
   @command_window.x = 320 - @command_window.width / 2
   @command_window.y = 288
   if Save_Module.folder != Dir.getwd
     if not Dir.entries(Dir.getwd).include?(Save_Module.folder)
       Dir.mkdir(Save_Module.folder)
     end
   end
   @continue_enabled = false
   if Dir.get_save_files(Save_Module.folder).size > 0
     @continue_enabled = true
   end
   if @continue_enabled
     @command_window.index = 1
   else
     @command_window.disable_item(1)
   end
   $game_system.bgm_play($data_system.title_bgm)
   Audio.me_stop
   Audio.bgs_stop
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   Graphics.freeze
   @command_window.dispose
   @sprite.bitmap.dispose
   @sprite.dispose
 end
end

#==============================================================================
# ** Scene_File
#==============================================================================

class Scene_File
 def make_filename(name)
   return "#{Save_Module.folder}/#{name.to_s}.rxdata"
 end

 def delete_file(filename)
   $game_system.se_play($data_system.save_se)
   File.delete(filename)
 end

 def write_save_data(file)
   characters = []
   for i in 0...$game_party.actors.size
     actor = $game_party.actors[i]
     characters.push([actor.character_name, actor.character_hue])
   end
   Marshal.dump(characters, file)
   Marshal.dump(Graphics.frame_count, file)
   $game_system.save_count += 1
   $game_system.magic_number = $data_system.magic_number
   Marshal.dump($game_system, file)
   Marshal.dump($game_switches, file)
   Marshal.dump($game_variables, file)
   Marshal.dump($game_self_switches, file)
   Marshal.dump($game_screen, file)
   Marshal.dump($game_actors, file)
   Marshal.dump($game_party, file)
   Marshal.dump($game_troop, file)
   Marshal.dump($game_map, file)
   Marshal.dump($game_player, file)
 end

 def read_save_data(file)
   characters = Marshal.load(file)
   Graphics.frame_count = Marshal.load(file)
   $game_system        = Marshal.load(file)
   $game_switches      = Marshal.load(file)
   $game_variables     = Marshal.load(file)
   $game_self_switches = Marshal.load(file)
   $game_screen        = Marshal.load(file)
   $game_actors        = Marshal.load(file)
   $game_party         = Marshal.load(file)
   $game_troop         = Marshal.load(file)
   $game_map           = Marshal.load(file)
   $game_player        = Marshal.load(file)
   if $game_system.magic_number != $data_system.magic_number
     $game_map.setup($game_map.map_id)
     $game_player.center($game_player.x, $game_player.y)
   end
   $game_party.refresh
 end
end

#==============================================================================
# ** Scene_Save
#==============================================================================

class Scene_Save < Scene_File
 def initialize(from_name=false)
   @from_name = from_name
   if @from_name == false
     $save_variable = ""
   end
 end

 def main
   a1 = "Create new file"
   a2 = "Overwrite file"
   a3 = "Cancel"
   @command_window = Window_Command.new(300, [a1, a2, a3])
   @command_window.index = 0
   @continue_enabled = false
   if Dir.get_save_files(Save_Module.folder).size > 0
     @continue_enabled = true
   end
   unless @continue_enabled
     @command_window.disable_item(1)
   end
   b1 = "This file already exists!"
   b2 = "Overwrite"
   b3 = "Cancel"
   @confirm_window = Window_Confirm.new(b1, b2, b3)
   @confirm_window.x = 20
   @confirm_window.y = 160
   @confirm_window.visible = false
   @confirm_window.active = false
   @save_window = Window_File.new
   @save_window.y = 128
   @save_window.visible = false
   @save_window.active = false
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   Graphics.freeze
   @command_window.dispose
   @confirm_window.dispose
   @save_window.dispose
 end

 def update
   @command_window.update
   @confirm_window.update
   @save_window.update
   if @from_name == true
     @from_name = false
     filename = make_filename($save_variable)
     if FileTest.exist?(filename)
       to_confirm
       return
     end
     $game_temp.playing_file = $save_variable
     create_file(filename)
     return
   end
   if @command_window.active
     update_command
     return
   end
   if @confirm_window.active
     update_confirm
     return
   end
   if @save_window.active
     update_save
     return
   end
 end

 def update_command
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     if $game_temp.save_calling
       $game_temp.save_calling = false
       $scene = Scene_Map.new
       return
     end
     $scene = Scene_Menu.new(4)
   end
   if Input.trigger?(Input::C)
     case @command_window.index
     when 0 # "Create new file"
       $game_system.se_play($data_system.decision_se)
       $scene = Scene_Variable_Name.new
     when 1 # "Overwrite file"
       if Dir.get_save_files(Save_Module.folder).size == 0
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       $game_system.se_play($data_system.decision_se)
       # save_files = Dir.get_save_files(Save_Module.folder)
       @save_window.refresh
       @command_window.active = false
       @confirm_window.active = false
       @save_window.visible = true
       @save_window.active = true
     when 2 # "Cancel"
       $game_system.se_play($data_system.cancel_se)
       if $game_temp.save_calling
         $game_temp.save_calling = false
         $scene = Scene_Map.new
         return
       end
       $scene = Scene_Menu.new(4)
     end
   end
 end

 def update_confirm
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     @command_window.index = 0
     @command_window.active = true
     @confirm_window.visible = false
     @confirm_window.active = false
     return
   end
   if Input.trigger?(Input::C)
     case @confirm_window.index
     when 0 # Yes
       filename = make_filename($save_variable)
       $game_temp.playing_file = $save_variable
       create_file(filename)
     when 1 # No
       $game_system.se_play($data_system.cancel_se)
       @command_window.index = 0
       @command_window.active = true
       @confirm_window.visible = false
       @confirm_window.active = false
     end
   end
 end

 def update_save
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     @command_window.active = true
     @save_window.visible = false
     @save_window.active = false
     return
   end
   if Input.trigger?(Input::C)
     $save_variable = @save_window.item
     to_confirm
   end
 end

 def to_confirm
   $game_system.se_play($data_system.cursor_se)
   @command_window.active = false
   @save_window.active = false
   @save_window.visible = false
   @confirm_window.visible = true
   @confirm_window.active = true
 end

 def create_file(filename)
   $game_system.se_play($data_system.save_se)
   file = File.open(filename, "wb")
   write_save_data(file)
   file.close
   if $game_temp.save_calling
     $game_temp.save_calling = false
     $scene = Scene_Map.new
     return
   end
   $scene = Scene_Menu.new(4)
 end
end

#==============================================================================
# ** Scene_Load
#==============================================================================

class Scene_Load < Scene_File
 def initialize
   $game_temp = Game_Temp.new
 end

 def main
   a1 = "Load file"
   a2 = "Cancel"
   @command_window = Window_Command.new(300, [a1, a2])
   @command_window.index = 0
   @load_window = Window_File.new
   @load_window.y = 128
   @load_window.visible = false
   @load_window.active = false
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   Graphics.freeze
   @command_window.dispose
   @load_window.dispose
 end

 def update
   @command_window.update
   @load_window.update
   if @command_window.active
     update_command
     return
   end
   if @load_window.active
     update_load
     return
   end
 end

 def update_command
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Title.new
     return
   end
   if Input.trigger?(Input::C)
     case @command_window.index
     when 0 # "Load file"
       $game_system.se_play($data_system.decision_se)
       # save_files = Dir.get_save_files(Save_Module.folder)
       @load_window.refresh
       @command_window.active = false
       @load_window.visible = true
       @load_window.active = true
     when 1 # "Cancel"
       $game_system.se_play($data_system.cancel_se)
       $scene = Scene_Title.new
     end
   end
 end

 def update_load
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     @command_window.active = true
     @load_window.visible = false
     @load_window.active = false
     return
   end
   if Input.trigger?(Input::C)
     $game_temp.playing_file = @load_window.item
     filename = make_filename(@load_window.item)
     load_file(filename)
   end
 end

 def load_file(filename)
   $game_system.se_play($data_system.load_se)
   file = File.open(filename, "rb")
   read_save_data(file)
   file.close
   $game_system.bgm_play($game_system.playing_bgm)
   $game_system.bgs_play($game_system.playing_bgs)
   $game_map.update
   $scene = Scene_Map.new
 end
end


Eron made an addon for this script which uses the default interface instead of the new. Place it under mine if you want to use that.
Spoiler: ShowHide

#==============================================================================
# [XP] Default Interface for Wecoc's Dynamic File System
#------------------------------------------------------------------------------
# by: Eron
#==============================================================================

module Save_Module
 FW_FIT = 4 # Number of file windows that fit on screen
 FW_MIN = 4 # Minimum number of file windows. It should be the same as FW_FIT
 FW_MAX = 4 # Maximum number of save files. Set it nil to have no limits.
 EMPTY = "- Empty -" # Window's name when empty
end

class Dir
 def Dir.save_files_by(sym)
   array = []
   Dir.get_save_files(Save_Module.folder).each do |last|
     file = File.open("#{Save_Module.folder}/#{last}.rxdata", "r")
     array.push [last, file.send(sym)]
   end
   array.sort! {|a, b| b[1] <=> a[1] }
   return array
 end

 def Dir.last_file_played
   files = Dir.save_files_by(:mtime)
   return files[0][0]
 end
end

#==============================================================================
# ** Window_SaveFile
#==============================================================================

class Window_SaveFile < Window_Base

 attr_reader :file_index
 attr_reader :filename
 attr_reader :file_exist

 def initialize(file_index, filename, file_exist=true)
   super(0, 0, 640, (480 - 64) / Save_Module::FW_FIT)
   self.contents = Bitmap.new(width - 32, height - 32)
   @file_index = file_index
   @filename = filename
   @file_exist = file_exist
   @time_stamp = Time.at(0)
   @name_width = 0
   if @file_exist
     file = File.open("#{Save_Module.folder}/#{filename}.rxdata", "r")
     @time_stamp = file.mtime
     @characters         = Marshal.load(file)
     @frame_count        = Marshal.load(file)
     @game_system        = Marshal.load(file)
     @game_switches      = Marshal.load(file)
     @game_variables     = Marshal.load(file)
     @game_self_switches = Marshal.load(file)
     @game_screen        = Marshal.load(file)
     @game_actors        = Marshal.load(file)
     @game_party         = Marshal.load(file)
     @game_troop         = Marshal.load(file)
     @game_map           = Marshal.load(file)
     @game_player        = Marshal.load(file)
     @total_sec = @frame_count / Graphics.frame_rate
     file.close
   end
   refresh
   @selected = false
 end

 def refresh
   self.contents.clear
   self.contents.font.color = normal_color
   if @filename == Save_Module::EMPTY
     self.contents.font.color = disabled_color
   end
   name = @filename
   self.contents.draw_text(4, 0, 600, 32, name)
   @name_width = contents.text_size(name).width
   if @file_exist
     for i in 0...@characters.size
       # Actor's graphic
       bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
       cw = bitmap.rect.width / 4
       ch = bitmap.rect.height / 4
       src_rect = Rect.new(0, 0, cw, ch)
       x = 300 - @characters.size * 32 + i * 64 - cw / 2
       self.contents.blt(x, 68 - ch, bitmap, src_rect)
       ## Actor's name
       # draw_actor_name(@game_party.actors[i], x - 16, 8)
       ## Actor's level
       # draw_actor_level(@game_party.actors[i], x - 16, 24)
       ## Actor's states
       # draw_actor_state(@game_party.actors[i], x - 16, 48)
     end
     # Draw play time
     hour = @total_sec / 60 / 60
     min = @total_sec / 60 % 60
     sec = @total_sec % 60
     time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
     self.contents.font.color = normal_color
     self.contents.draw_text(4, 8, 600, 32, time_string, 2)
     # Draw timestamp
     self.contents.font.color = normal_color
     time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
     self.contents.draw_text(4, 40, 600, 32, time_string, 2)
     ## Gold
     # cx = contents.text_size($data_system.words.gold).width
     # self.contents.font.color = normal_color
     # self.contents.draw_text(4, 8, 120-cx-2, 32, @game_party.gold.to_s, 2)
     # self.contents.font.color = system_color
     # self.contents.draw_text(124-cx, 8, cx, 32, $data_system.words.gold, 2)
     ## Variable
     # self.contents.font.color = system_color
     # self.contents.draw_text(4, 8, 120, 32, "Capítulo")
     # self.contents.font.color = normal_color
     # self.contents.draw_text(100, 8, 48, 32, @game_variables[1].to_s)
     ## Map name
     # self.contents.font.color = normal_color
     # self.contents.draw_text(4, 40, 320, 32, @game_map.map_name)
   end
 end
end

class Game_Map
attr_reader  :map_id
 def map_name
   @mpn = load_data("Data/MapInfos.rxdata")
 return @mpn[@map_id].name
 end
end

#==============================================================================
# ** Scene_File
#==============================================================================

class Scene_File
 def refresh
   if @savefile_windows != nil
     for i in @savefile_windows
       i.dispose
     end
   end
   @savefile_windows = []
   save_files = Dir.save_files_by(:mtime)
   size = save_files.size
   for i in 0...size
     @savefile_windows.push(Window_SaveFile.new(i, save_files[i][0]))
   end
   if self.is_a?(Scene_Save)
     if Save_Module::FW_MAX == nil or size < Save_Module::FW_MAX
       @savefile_windows.push(Window_SaveFile.new(size, "New File", false))
     end
   end
   loop do
     if @savefile_windows.size < Save_Module::FW_MIN
       size = @savefile_windows.size
       empty = Save_Module::EMPTY
       @savefile_windows.push(Window_SaveFile.new(size, empty, false))
     else
       break
     end
   end
   @file_index = 0
   @first_window = 0
   @savefile_windows[@file_index].selected = true
   window_refresh
 end
 
 def window_refresh
   for window in 0...@savefile_windows.size
     @savefile_windows[window].y = 64
     @savefile_windows[window].visible = false
     window_index = (window - @first_window)
     if (0..3).include?(window_index)
       height = (480 - 64) / Save_Module::FW_FIT
       @savefile_windows[window].y = 64 + window_index * height
       @savefile_windows[window].visible = true
     end
   end
 end
end

#==============================================================================
# ** Scene_Save
#==============================================================================

class Scene_Save < Scene_File
 def main
   @help_window = Window_Help.new
   @help_window.set_text("Which file would you like to save to?")
   refresh
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   Graphics.freeze
   @help_window.dispose
   for i in @savefile_windows
     i.dispose
   end
 end

 def update
   @help_window.update
   for i in @savefile_windows
     i.update
   end

   if @from_name == true
     @from_name = false
     filename = make_filename($save_variable)
     if FileTest.exist?(filename)
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     $game_temp.playing_file = $save_variable
     create_file(filename)
     return
   end

   if Input.trigger?(Input::C)
     if @savefile_windows[@file_index].filename == Save_Module::EMPTY
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     $game_system.se_play($data_system.decision_se)
     if @savefile_windows[@file_index].file_exist == false
       $scene = Scene_Variable_Name.new
       return
     else
       filename = make_filename(@savefile_windows[@file_index].filename)
       $game_temp.playing_file = @savefile_windows[@file_index].filename
       create_file(filename)
       return
     end
   end

   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     if $game_temp.save_calling
       $game_temp.save_calling = false
       $scene = Scene_Map.new
       return
     end
     $scene = Scene_Menu.new(4)
   end

   max_files = @savefile_windows.size

   if Input.repeat?(Input::DOWN)
     if Input.trigger?(Input::DOWN) or @file_index < max_files - 1
       $game_system.se_play($data_system.cursor_se)
       @savefile_windows[@file_index].selected = false
       @file_index += 1
       if @file_index == max_files
         @file_index = 0
         @first_window = 0
       elsif @file_index - @first_window > (Save_Module::FW_FIT - 1)
         @first_window += 1
       end
       window_refresh
       @savefile_windows[@file_index].selected = true
       return
     end
   end

   if Input.repeat?(Input::UP)
     if Input.trigger?(Input::UP) or @file_index > 0
       $game_system.se_play($data_system.cursor_se)
       @savefile_windows[@file_index].selected = false
       @file_index -= 1
       if @file_index == -1
         @file_index = max_files - 1
         @first_window = @file_index - (Save_Module::FW_FIT - 1)
       elsif @first_window - @file_index > 0
         @first_window -= 1
       end
       window_refresh
       @savefile_windows[@file_index].selected = true
       return
     end
   end
 end

 def create_file(filename)
   $game_system.se_play($data_system.save_se)
   file = File.open(filename, "wb")
   write_save_data(file)
   file.close
   if $game_temp.save_calling
     $game_temp.save_calling = false
     $scene = Scene_Map.new
     return
   end
   refresh
 end
end

#==============================================================================
# ** Scene_Load
#==============================================================================

class Scene_Load < Scene_File
 def initialize
   $game_temp = Game_Temp.new
 end

 def main
   @help_window = Window_Help.new
   @help_window.set_text("Which file would you like to load?")
   refresh
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   Graphics.freeze
   @help_window.dispose
   for i in @savefile_windows
     i.dispose
   end
 end

 def update
   @help_window.update
   for i in @savefile_windows
     i.update
   end

   if Input.trigger?(Input::C)
     if @savefile_windows[@file_index].filename == Save_Module::EMPTY
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     $game_system.se_play($data_system.decision_se)
     $game_temp.playing_file = @savefile_windows[@file_index].filename
     filename = make_filename(@savefile_windows[@file_index].filename)
     load_file(filename)
   end
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Title.new
   end

   max_files = @savefile_windows.size

   if Input.repeat?(Input::DOWN)
     if Input.trigger?(Input::DOWN) or @file_index < max_files - 1
       $game_system.se_play($data_system.cursor_se)
       @savefile_windows[@file_index].selected = false
       @file_index += 1
       if @file_index == max_files
         @file_index = 0
         @first_window = 0
       elsif @file_index - @first_window > (Save_Module::FW_FIT - 1)
         @first_window += 1
       end
       window_refresh
       @savefile_windows[@file_index].selected = true
       return
     end
   end

   if Input.repeat?(Input::UP)
     if Input.trigger?(Input::UP) or @file_index > 0
       $game_system.se_play($data_system.cursor_se)
       @savefile_windows[@file_index].selected = false
       @file_index -= 1
       if @file_index == -1
         @file_index = max_files - 1
         @first_window = @file_index - (Save_Module::FW_FIT - 1)
       elsif @first_window - @file_index > 0
         @first_window -= 1
       end
       window_refresh
       @savefile_windows[@file_index].selected = true
       return
     end
   end
 end
end




Instructions

The script uses a new folder to save all the files inside. If it does not exist it will be created automatically. If you have files already, you will have to move them to the new folder.
To change the folder name, find on the very start of the script this line and change it there:
FOLDER = "Save"

If you name it "" or nil, the files will be saved in the game's folder as always.



Compatibility

Not tested. If there is any problem you can contact me.
I had to rewrite the method :main of Scene_Title, so if you use a modification of the Title beware with this. Practically this is the only incompatibility that can give you problems if you are not careful.


Credits and Thanks


  • Wecoc - The WDSF script basis

  • Eron - Default Interface Script

10
Weapon Attacks by Skill or Item
Authors: Wecoc
Version: 1.0
Type: Attack Add-on
Key Term: Battle Add-on



Introduction

This script allows certain weapons to attack using a skill or an item. It can be usefull for example because weapons can't call common events but items and skills can.



Features


  • Use a default attack, or attack using item, skill or both

  • Use it to add special features to the attack for example to call a common event

  • Avoid attacks without weapon and defense without shield.




Screenshots

N/A


Script

Spoiler: ShowHide

#==============================================================================
# ** Weapon Attacks by Skill or Item
#------------------------------------------------------------------------------
#  Author: Wecoc
#==============================================================================

module SpecialWeapons
   # ID Weapon => [ID Skill, sp cost?]
 SKILLS =  {1 => [7, true],
            2 => [8, false],
           }
   # ID Weapon => [ID Item, item cost?]
 ITEMS =   {3 => [1, true],
           }
end
       
#==============================================================================
# ** Scene_Battle : Attack edit
#==============================================================================

class Scene_Battle
 def make_basic_action_result
   # If attack
   if @active_battler.current_action.basic == 0
     skill_hash = SpecialWeapons::SKILLS
     item_hash = SpecialWeapons::ITEMS
     # Skill attack
     if skill_hash.keys.include?(@active_battler.weapon_id)
       @skill = $data_skills[skill_hash[@active_battler.weapon_id][0]]
       sp_cost = skill_hash[@active_battler.weapon_id][1]
       if sp_cost
         @active_battler.sp -= @skill.sp_cost
         @status_window.refresh
       end
       @animation1_id = @skill.animation1_id
       @animation2_id = @skill.animation2_id
       @common_event_id = @skill.common_event_id
       set_target_battlers(@skill.scope)
       for target in @target_battlers
         target.skill_effect(@active_battler, @skill)
       end
     # Item attack
     elsif item_hash.keys.include?(@active_battler.weapon_id)
       @item = $data_items[item_hash[@active_battler.weapon_id][0]]
       item_cost = item_hash[@active_battler.weapon_id][1]
       if @item.consumable and item_cost
         $game_party.lose_item(@item.id, 1)
       end
       @animation1_id = @item.animation1_id
       @animation2_id = @item.animation2_id
       @common_event_id = @item.common_event_id
       index = @active_battler.current_action.target_index
       target = $game_party.smooth_target_actor(index)
       set_target_battlers(@item.scope)
       for target in @target_battlers
         target.item_effect(@item)
       end
     # Default attack
     else
       @animation1_id = @active_battler.animation1_id
       @animation2_id = @active_battler.animation2_id
       if @active_battler.is_a?(Game_Enemy)
         if @active_battler.restriction == 3
           target = $game_troop.random_target_enemy
         elsif @active_battler.restriction == 2
           target = $game_party.random_target_actor
         else
           index = @active_battler.current_action.target_index
           target = $game_party.smooth_target_actor(index)
         end
       end
       if @active_battler.is_a?(Game_Actor)
         if @active_battler.restriction == 3
           target = $game_party.random_target_actor
         elsif @active_battler.restriction == 2
           target = $game_troop.random_target_enemy
         else
           index = @active_battler.current_action.target_index
           target = $game_troop.smooth_target_enemy(index)
         end
       end
       @target_battlers = [target]
       for target in @target_battlers
         target.attack_effect(@active_battler)
       end
       return
     end
   end
   # If guard
   if @active_battler.current_action.basic == 1
     @help_window.set_text($data_system.words.guard, 1)
     return
   end
   # If escape
   if @active_battler.is_a?(Game_Enemy) and
     @active_battler.current_action.basic == 2
     @help_window.set_text("Escape", 1)
     @active_battler.escape
     return
   end
   # If doing nothing
   if @active_battler.current_action.basic == 3
     $game_temp.forcing_battler = nil
     @phase4_step = 1
     return
   end
 end
end

#==============================================================================
# ** Scene_Battle : Disable Attack & Guard
#==============================================================================

class Scene_Battle

 WEAPON_ATTACK = false # If true, the actor won't attack without weapon
 SHIELD_GUARD = false  # If true, the actor won't defend without shield

 alias phase3_setup_disabled phase3_setup_command_window unless $@
 def phase3_setup_command_window
   phase3_setup_disabled
   @disabled_attack = false
   @actor_command_window.enable_item(0)
   @disabled_guard = false
   @actor_command_window.enable_item(2)
   actor = $game_party.actors[@actor_index]
   skill_hash = SpecialWeapons::SKILLS
   item_hash = SpecialWeapons::ITEMS
   if WEAPON_ATTACK
     if actor.weapon_id == 0
       @disabled_attack = true
       @actor_command_window.disable_item(0)
     end
   end
   if SHIELD_GUARD
     if actor.armor1_id == 0
       @disabled_guard = true
       @actor_command_window.disable_item(2)
     end
   end
   if skill_hash.keys.include?(actor.weapon_id)
     if skill_hash[actor.weapon_id][1] == true # sp cost
       skill = $data_skills[skill_hash[actor.weapon_id][0]]
       if skill.sp_cost > actor.sp
         @disabled_attack = true
         @actor_command_window.disable_item(0)
       end
     end
   end
   if item_hash.keys.include?(actor.weapon_id)
     if skill_hash[actor.weapon_id][1] == true # item cost
       item_id = skill_hash[actor.weapon_id][0]
       if $game_party.item_number(item_id) == 0
         @disabled_attack = true
         @actor_command_window.disable_item(0)
       end
     end
   end
 end

 def update_phase3_basic_command
   # If B button was pressed
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     phase3_prior_actor
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     case @actor_command_window.index
     when 0  # attack
       if @disabled_attack
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       $game_system.se_play($data_system.decision_se)
       @active_battler.current_action.kind = 0
       @active_battler.current_action.basic = 0
       start_enemy_select
     when 1  # skill
       $game_system.se_play($data_system.decision_se)
       @active_battler.current_action.kind = 1
       start_skill_select
     when 2  # guard
       if @disabled_guard
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       $game_system.se_play($data_system.decision_se)
       @active_battler.current_action.kind = 0
       @active_battler.current_action.basic = 1
       phase3_next_actor
     when 3  # item
       $game_system.se_play($data_system.decision_se)
       @active_battler.current_action.kind = 2
       start_item_select
     end
     return
   end
 end
end

class Window_Command < Window_Selectable
 def enable_item(index)
   draw_item(index, normal_color)
 end
end



Instructions

In the start of the script there are two hashes.
The first one (SKILLS) works in that way:

1 => [7, true]


That means the weapon with ID 1 uses the skill with ID 7 (it doesn't matter if the character doesn't have that skill). The true / false indicates whether SP is spent or not. If true, the skill will spend SP so if the character has not enough he/she will not be able to attack.

Example: Fire Weapon. When you attack, it will do a fire effect. It does not depend on actor's skills, it does the fire effect only because of the weapon type.

The second hash (ITEMS) is so similar:

1 => [7, true]


That means the weapon with ID 1 uses the item with ID 7. The true / false indicates if  the item is spent or not. If false, the party can have none.

Example: Bow and arrows. If you have no arrows you can't use the bow.



Compatibility

It was done for the default battle. Still, it shouldn't be difficult to adapt to other systems.


Credits and Thanks


  • Wecoc




Author's Notes

I have to learn English properly, I find it harder to publish the scripts than to make them.
Also, some of you are so great that most of my scripts give pain in comparison xDD
You can improve the script if you want.
11
RMXP Script Database / [XP] Game Map Simple AddOns
August 23, 2014, 08:29:54 pm
Game Map Simple AddOns
Authors: Wecoc
Version: 1.0
Type: Map / Picture Add-on
Key Term: Misc Add-on



Introduction

It gives more usable methods for Game_Map, especially useful new calls for Call Script. And that's it.
Put over main and don't give credits for it.



Features


  • Manage scrolls and zooms more efficiently

  • Parallax variable




Screenshots

N/A for this type of script


Script

Spoiler: ShowHide

#==============================================================================
# ** Game Map Simple AddOns
#==============================================================================

#==============================================================================
# ** Game_System
#==============================================================================

class Game_System
  attr_accessor :parallax_game
  alias parallax_game_initialize initialize unless $@
  def initialize
    parallax_game_initialize
    @parallax_game = false
  end
end

#==============================================================================
# ** Game_Map
#==============================================================================

class Game_Map

  attr_accessor :tilemap_display_x
  attr_accessor :tilemap_display_y
  attr_accessor :weather_display_x
  attr_accessor :weather_display_y

  attr_accessor :panorama_zoom_x
  attr_accessor :panorama_zoom_y
  attr_accessor :panorama_display_x
  attr_accessor :panorama_display_y

  attr_accessor :fog_zoom_x
  attr_accessor :fog_zoom_y
  attr_accessor :fog_display_x
  attr_accessor :fog_display_y

  alias wecoc_addons_setup setup unless $@
  def setup(map_id)
    wecoc_addons_setup(map_id)
    if $game_system.parallax_game == true
      set_parallax_display
    else
      set_default_display
    end
    @panorama_zoom_x = 100.0
    @panorama_zoom_y = 100.0
    @fog_zoom_x = @fog_zoom
    @fog_zoom_y = @fog_zoom
  end

  def tilemap_display
    return @tilemap_display_x
  end

  def tilemap_display=(value)
    @tilemap_display_x = value
    @tilemap_display_y = value
  end

  def weather_display
    return @weather_display_x
  end

  def weather_display=(value)
    @weather_display_x = value
    @weather_display_y = value
  end

  def panorama_zoom
    return @panorama_zoom_x
  end

  def panorama_zoom=(zoom)
    @panorama_zoom_x = zoom
    @panorama_zoom_y = zoom
  end

  def panorama_display
    return @panorama_display_x
  end

  def panorama_display=(value)
    @panorama_display_x = value
    @panorama_display_y = value
  end

  def fog_zoom=(zoom)
    @fog_zoom = zoom
    @fog_zoom_x = zoom
    @fog_zoom_y = zoom
  end

  def fog_display
    return @fog_display_x
  end

  def fog_display=(value)
    @fog_display_x = value
    @fog_display_y = value
  end

  def set_default_display
    @tilemap_display_x = 4
    @tilemap_display_y = 4
    @weather_display_x = 4
    @weather_display_y = 4
    @panorama_display_x = 8
    @panorama_display_y = 8
    @fog_display_x = 4
    @fog_display_y = 4
  end

  def set_parallax_display
    @tilemap_display_x = 4
    @tilemap_display_y = 4
    @weather_display_x = 4
    @weather_display_y = 4
    @panorama_display_x = 4
    @panorama_display_y = 4
    @fog_display_x = 4
    @fog_display_y = 4
  end
end

#==============================================================================
# ** Game_Picture
#==============================================================================

class Game_Picture

  attr_accessor  :display_x
  attr_accessor  :display_y

  alias wecoc_display_ini initialize unless $@
  def initialize(number)
    wecoc_display_ini(number)
    @display_x = 0
    @display_y = 0
  end

  def display
    return @display_x
  end

  def display=(value)
    @display_x = value
    @display_y = value
  end

  def erase
    @name = ""
    self.display = 0
  end
end

class Sprite_Picture
  def display
    return @picture.display
  end

  def display=(value)
    @picture.display = value
  end

  def display_x
    return @picture.display_x
  end

  def display_y
    return @picture.display_y
  end

  def display_x=(value)
    @picture.display_x = value
  end

  def display_y=(value)
    @picture.display_y = value
  end
end

#==============================================================================
# ** Spriteset_Map
#==============================================================================

class Spriteset_Map
  def update
    if @panorama_name != $game_map.panorama_name or
      @panorama_hue != $game_map.panorama_hue
      @panorama_name = $game_map.panorama_name
      @panorama_hue = $game_map.panorama_hue
      if @panorama.bitmap != nil
        @panorama.bitmap.dispose
        @panorama.bitmap = nil
      end
      if @panorama_name != ""
        @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)
      end
      Graphics.frame_reset
    end

    if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
      @fog_name = $game_map.fog_name
      @fog_hue = $game_map.fog_hue
      if @fog.bitmap != nil
        @fog.bitmap.dispose
        @fog.bitmap = nil
      end
      if @fog_name != ""
        @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
      end
      Graphics.frame_reset
    end

    @tilemap.ox = $game_map.display_x / $game_map.tilemap_display_x
    @tilemap.oy = $game_map.display_y / $game_map.tilemap_display_y
    @tilemap.update

    @panorama.ox = $game_map.display_x / $game_map.panorama_display_x
    @panorama.oy = $game_map.display_y / $game_map.panorama_display_y
    @panorama.zoom_x = $game_map.panorama_zoom_x / 100.0
    @panorama.zoom_y = $game_map.panorama_zoom_y / 100.0
   
    @fog.zoom_x = $game_map.fog_zoom_x / 100.0
    @fog.zoom_y = $game_map.fog_zoom_y / 100.0
    @fog.opacity = $game_map.fog_opacity
    @fog.blend_type = $game_map.fog_blend_type
    @fog.ox = $game_map.display_x / $game_map.fog_display_x + $game_map.fog_ox
    @fog.oy = $game_map.display_y / $game_map.fog_display_y + $game_map.fog_oy
    @fog.tone = $game_map.fog_tone

    for sprite in @character_sprites
      sprite.update
    end

    @weather.type = $game_screen.weather_type
    @weather.max = $game_screen.weather_max
    @weather.ox = $game_map.display_x / $game_map.weather_display_x
    @weather.oy = $game_map.display_y / $game_map.weather_display_y
    @weather.update

    for sprite in @picture_sprites
      sprite.update
      if sprite.display_x != 0
        sprite.x -= $game_map.display_x / sprite.display_x
        sprite.y -= $game_map.display_y / sprite.display_y
      end
    end

    @timer_sprite.update

    @viewport1.tone = $game_screen.tone
    @viewport1.ox = $game_screen.shake

    @viewport3.color = $game_screen.flash_color

    @viewport1.update
    @viewport3.update
  end
end



Instructions

In the very beginning of the script you can see this line:
@parallax_game = false
Set it true and panoramas will automatically scroll in the map speed (parallax mapping)

You can change that in-game using $game_system.parallax_game = true // false

$game_map.tilemap_display = value
$game_map.tilemap_display_x = value
$game_map.tilemap_display_y = value

Changes the tileset's scroll speed when the player moves around the map. The higher value, the slower it goes. Default value: 4
The other methods are the same but for specific axis.

$game_map.weather_display = value
$game_map.weather_display_x = value
$game_map.weather_display_y = value

Changes the weather's scroll speed. Default value: 4

$game_map.panorama_display = value
$game_map.panorama_display_x = value
$game_map.panorama_display_y = value

Changes the panorama's scroll speed. Default value: 8 (or 4 if @parallax_game is activated)

$game_map.fog_display = value
$game_map.fog_display_x = value
$game_map.fog_display_y = value

Changes the fog's scroll speed. Default value: 4

$game_screen.pictures[id].display = value
$game_screen.pictures[id].display_x = value
$game_screen.pictures[id].display_y = value

Changes the scroll speed of an specific picture. Default value: 0 (it doesn't scroll by default)

$game_map.panorama_zoom = value
$game_map.panorama_zoom_x = value
$game_map.panorama_zoom_y = value

Changes the panorama zoom. Default value: 100

$game_map.fog_zoom = value
$game_map.fog_zoom_x = value
$game_map.fog_zoom_y = value

Changes the fog zoom. It works like on default but with the axis-specific implementation. Default value: 100



Compatibility

It's a simple Add-on so it should not have huge incompatibility problems.


Credits and Thanks


  • Wecoc - But don't give me credits for this.

12
Resources / My 'VX style' small iconset
August 19, 2014, 08:11:48 pm
I was a bit bored so I made some icons trying to imitate the style of VX and the very well-known huge iconset, very used in RPG maker.
No credits needed, enjoy them for free!



It corresponds to only 1.1% of the big set but I'm not japanese so please, you have to understand it.
Hope you like! ~
13
Animations with Eval
Authors: Wecoc
Version: 1.2
Type: Animation Add-on
Key Term: Misc Add-on



Introduction

By default on animations you can assign a sound, screen flash, target flash or delete the target in a specific frame.

This script allows to add eval, ie "Call Script" in the animations.
With this you will be able to do things not possible until now.
I also added some shortcuts to make the eval a bit more easy, they are inside the module Skill_Shortcuts and you can create more there.
So basically you can add inside an animation whatever a Script Call supports. On Features I will list only the default 'shortcut' functions made on the script.



Features


  • SE play (with no limits on volume and frequence)

  • Screen flash, Target flash and Target erase (now you can use variables for parameters)

  • Screen Shake

  • Screen Tone (with memorize / restore functions)

  • Sprite x / y displacement




Demo

Animations with Eval 1.2



Script

#------------------------------------------------------------------------------
# Game_Animation with Eval Support
# Version: 1.2
# Author: Wecoc
#------------------------------------------------------------------------------
# o DESCRIPTION
#
# By default on animations you can assign a sound, screen flash, target flash
# or delete the target in a specific frame.
#
# This script allows to add eval, ie "Call Script" in the animations.
# With this you will be able to do things not possible until now.
# I also added some shortcuts to make the eval a bit more easy, they are
# inside the module Skill_Shortcuts and you can create more there.
#
# With this new version of the script, all the changes you do will be saved.
# So you can assign all the evals in the first map and they will be kept fixed.
#
#------------------------------------------------------------------------------
# o COMPATIBILITY
#
# CAUTION - If you use other scripts there may be two types of incompatibilities
#
# 1) Aliased methods
#
#     - RPG::Sprite :update_animation (alias), :update_loop_animation (alias)
#     - Scene_Title :command_new_game (alias), :battle_test (alias)
#     - Scene_Save :write_save_data (alias)
#     - Scene_Load :read_save_data (alias)
#     - Sprite_Character :update (alias)
#     - Sprite_Battler :update (alias)
#
# 2) $data_animations
#
#     Although $data_animations still works it will do without the evals.
#     To call an animation with its included evals you have to use
#     $game_animations in all the not default scripts.
#
#------------------------------------------------------------------------------
# o INSTRUCTIONS
#
# How to set a new eval:
# $game_animations[id].add_effect(frame, 'text', condition)
#  text - Code to eval
#  condition - 0 - Always, 1 - Hit, 2 - Miss ; optional, 0 by default
#
# / Example: $game_animations[1].add_effect(5, '$game_switches[1] = true', 1)
#
# How to clear all the added evals of an animation
# $game_animations[id].clear_effects
#------------------------------------------------------------------------------
# o SHORTCUTS
#
# Shortcuts are defined inside Skill_Shortcuts and you can add all you want.
# This is what will be used within the above described as 'text' but actually
# you can use them in any eval.
#==============================================================================

#==============================================================================
# Skill_Shortcuts
#==============================================================================

module Skill_Shortcuts

  # SE play
  def se_play(name, volume, pitch)
    Audio.se_play("Audio/SE/" + name, volume, pitch)
  end

  # Screen Flash
  def flash_screen(color, time)
    self.viewport.flash(color, time)
  end

  # (Use flash method for target flash)

  # Erase Target
  def hide(time)
    self.flash(nil, time)
  end

  # Shake Screen (I don't like how it looks in battle)
  def shake(power, speed, duration)
    $game_screen.start_shake(power, speed, duration)
  end

  # Memorize the current screen tone
  def get_tone
    @screen_tone = $game_screen.tone.clone
  end

  # Change the screen tone
  def set_tone(tone, time)
    $game_screen.start_tone_change(tone, time)
  end

  # Restore the memorized screen tone
  def restore_tone(time)
    @screen_tone ||= Tone.new(0, 0, 0, 0)
    $game_screen.start_tone_change(@screen_tone, time)
  end

  # Change the screen tone (it depends on the actual tone)
  def change_tone(tone, time)
    @screen_tone ||= Tone.new(0, 0, 0, 0)
    new_tone = @screen_tone.clone
    new_tone.red += tone.red
    new_tone.green += tone.green
    new_tone.blue += tone.blue
    new_tone.gray += tone.gray
    $game_screen.start_tone_change(new_tone, time)
  end

  # Change the x of the sprite
  def change_ani_x(new_x, duration=0)
    return @ani_x = new_x if duration == 0
    @ani_x_new = new_x
    @ani_x_duration = duration
  end

  # Change the y of the sprite
  def change_ani_y(new_y, duration=0)
    return @ani_y = new_y if duration == 0
    @ani_y_new = new_y
    @ani_y_duration = duration
  end
end

#==============================================================================
# RPG::Animation & RPG::Sprite Edits
#==============================================================================

class RPG::Animation::Frame
  define_method(:text_array) { @text_array ||= []}
end

class RPG::Sprite < ::Sprite
 
  alias update_animation_eval_hit update_animation unless $@
  alias update_loop_animation_eval_hit update_loop_animation unless $@
 
  def update_animation(*args)
    if @_animation_duration > 0
      frame_index = @_animation.frame_max - @_animation_duration
      text_array = @_animation.frames[frame_index].text_array
      for text_pair in text_array
        text = text_pair[0]
        cond = text_pair[1]
        hit = @_animation_hit
        if (cond == 0) or (cond == 1 and hit) or (cond == 2 and !hit)
          result = eval(text)
        end
      end
    end
    update_animation_eval_hit(*args)
  end

  def update_loop_animation(*args)
    frame_index = @_loop_animation_index
    text_array = @_animation.frames[frame_index].text_array
    for text_pair in text_array
      text = text_pair[0]
      cond = text_pair[1]
      hit = @_animation_hit
      if (cond == 0) or (cond == 1 and hit) or (cond == 2 and !hit)
        class_eval(text)
      end
    end
    update_loop_animation_eval_hit(*args)
  end
end

#==============================================================================
# Game_Animation & Game_Animations ($game_animations)
#==============================================================================

class Game_Animation
 
  attr_reader :animation_id
  attr_reader :name
  attr_reader :animation_name
  attr_reader :animation_hue
  attr_reader :position
  attr_reader :frame_max
  attr_reader :timings
  attr_reader :frames
 
  def initialize(animation_id)
    setup(animation_id)
  end
 
  def setup(animation_id)
    @animation_id = animation_id
    animation = $data_animations[animation_id]
    @name = animation.name
    @animation_name = animation.animation_name
    @animation_hue = animation.animation_hue
    @position = animation.position
    @frame_max = animation.frame_max
    @timings = animation.timings
    @frames = animation.frames
  end
 
  def id
    @animation_id
  end
 
  def add_effect(frame, text, condition=0)
    return false if frame > @frame_max
    @frames[frame].text_array.push([text, condition])
    @frames[frame].text_array.uniq!
    return true
  end

  def clear_effects(frame=nil)
    frames = frame.nil? ? @frames[0...@frame_max] : [@frames[frame]]
    frames.each {|f| f.text_array.clear}
    return true
  end
end

class Game_Animations

  def [](animation_id)
    return nil if animation_id > 999 or $data_animations[animation_id] == nil
    (@data||=[])[animation_id] ||= Game_Animation.new(animation_id)
  end
end

#==============================================================================
# $game_animations load/save
#==============================================================================

class Scene_Title
 
  alias animation_fix_new_game command_new_game unless $@
  alias animation_fix_battle battle_test unless $@
 
  def command_new_game
    $game_animations = Game_Animations.new
    animation_fix_new_game
  end
 
  def battle_test
    $game_animations = Game_Animations.new
    animation_fix_battle
  end
end

class Scene_Save < Scene_File
  alias animation_fix_write write_save_data unless $@
  def write_save_data(file)
    $game_system.game_animations = $game_animations
    animation_fix_write(file)
  end
end

class Scene_Load < Scene_File
  alias animation_fix_read read_save_data unless $@
  def read_save_data(file)
    animation_fix_read(file)
    $game_animations = $game_system.game_animations || Game_Animations.new
  end
end

class Game_System
  attr_accessor :game_animations
end 
#==============================================================================
# Sprite_Character & Sprite_Battler Edits
#==============================================================================

class Sprite_Character < RPG::Sprite
  include Skill_Shortcuts

  attr_accessor :ani_x
  attr_accessor :ani_y
 
  alias animation_fix_upd update unless $@
 
  def update(*args)
    pre_update_animation_effect
    animation_fix_upd(*args)
    update_animation_position_effect
  end
 
  def pre_update_animation_effect
    if @character && @character.animation_id != 0
      animation = $game_animations[@character.animation_id]
      animation(animation, true)
      @character.animation_id = 0
    end
  end
   
  def update_animation_position_effect
    return if @character.nil?
    if (@ani_x_duration ||= 0) >= 1
      d = @ani_x_duration
      @ani_x = ((@ani_x || 0) * (d - 1) + (@ani_x_new ||= 0)) / d
      @ani_x_duration -= 1
    end
    if (@ani_y_duration ||= 0) >= 1
      d = @ani_y_duration
      @ani_y = ((@ani_y || 0) * (d - 1) + (@ani_y_new ||= 0)) / d
      @ani_y_duration -= 1
    end
    self.x = @character.screen_x + (@ani_x ||= 0)
    self.y = @character.screen_y + (@ani_y ||= 0)
  end
end

class Sprite_Battler < RPG::Sprite
  include Skill_Shortcuts

  attr_accessor :ani_x
  attr_accessor :ani_y

  alias animation_fix_upd update unless $@
 
  def update(*args)
    pre_update_animation_effect
    animation_fix_upd(*args)
    update_animation_position_effect
  end
 
  def pre_update_animation_effect
    if @battler.nil?
      @battler_name = nil
    else     
      if @battler.damage.nil? and
        @battler.state_animation_id != @state_animation_id
        @state_animation_id = @battler.state_animation_id
        animation = $game_animations[@state_animation_id]
        loop_animation(animation)
      end
      if @battler_visible && @battler.animation_id != 0
        animation = $game_animations[@battler.animation_id]
        animation(animation, @battler.animation_hit)
        @battler.animation_id = 0
      end
    end
  end
 
  def update_animation_position_effect
    return if @battler.nil?
    if (@ani_x_duration ||= 0) >= 1
      d = @ani_x_duration
      @ani_x = ((@ani_x || 0) * (d - 1) + (@ani_x_new ||= 0)) / d
      @ani_x_duration -= 1
    end
    if (@ani_y_duration ||= 0) >= 1
      d = @ani_y_duration
      @ani_y = ((@ani_y || 0) * (d - 1) + (@ani_y_new ||= 0)) / d
      @ani_y_duration -= 1
    end
    self.x = @battler.screen_x + (@ani_x ||= 0)
    self.y = @battler.screen_y + (@ani_y ||= 0)
  end
end



Instructions

They are all in the code.


Compatibility

This part is explained in the code. It has some possible incompatibilities.


Author's Notes

Do you need help to add a new shortcut? Contact me and I will try to help.
14
RPG Maker Scripts / About RPG maker's internal bugs
August 15, 2014, 08:29:43 pm
RPG maker are full of internal bugs. Some have a known solution and others not yet. That's why I decided to make some sort of a compilation of them and I tried also to fix some.
I will post some of them, you can do the same.

Here's a template

[size=18pt][b][u][Maker] Bug's name[/u][/b][/size]

[size=14pt][b]Description[/b][/size]

> Short description of the bug <

[size=14pt][b]Examples[/b][/size]

> Examples about the problem (optional) <

[size=14pt][b]Screenshots[/b][/size]

> Only if it's necessary to understand the bug <

[size=14pt][b]Solution[/b][/size]

> If there is not a solution specify it <





[XP] Interpreter Script Call Bug

Description

On Script Call from events, when the final eval is 'false' the game crashes.

Examples

a = false

$game_system.timer_working = false


There are some ways to avoid it but it's not a real solution for the bug

a = false
result = true

a = false ; true


Solution

There is an official bugfix for this internal bug; Interpreter Script Call Fix




[XP] Float Speed Bug

Description

If you change the speed of the player to a float, the map and the events do not scroll exactly overlapped.

Screenshots

Spoiler: ShowHide


Solution

There is not a known solution for this bug.




[XP] F12 Stack Level Too Deep

Description

If you press F12 in-game the game has to stop and go to the Title Screen. But sometimes the game will crash with a 'stack level too deep' exception.

Solution

It's an alias problem. What you have to do is simple; look for all the 'alias' in your scripts, for example

alias nmode7_setup setup


and add 'unless $@' on the back.

alias nmode7_setup setup unless $@





[XP] The 'Remove and restore Sprite Battler' problem

Description

On battle, if you call a common event to remove an actor and later you call another common event (for example with an item) to get him again to the party (easy way to do an invocation system) its sprite reappears in the same place as before and it should not (I didn't found this bug and I don't understand exactly how it's supposed to work, sorry)

Solution

Quote from: OrochiiI found the problem. That is solved with one line of code in the right place...

Find this on Sprite_Battler:
#--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    # If battler is nil
    if @battler == nil
      self.bitmap = nil
      loop_animation(nil)
      return
    end


And replace that with this:
#--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    # If battler is nil
    if @battler == nil
      @battler_name = nil
      self.bitmap = nil
      loop_animation(nil)
      return
    end


This solves the problem. What happens is that the game deletes the image but not the variable that tells which image is loaded. So when you restore the same hero the script does not reload the image because it thinks the image was already loaded. I added @battler_name = nil so the variable is cleared too.


The new bugfix of 'Screen animation to multiple sprites' by LittleDrago fixes this one too.




[XP] The 'Teleport and Collision' weird problem

Description

You are in a map (Map1) which has an event that teleports you wherever in the Map2. In the same coordinates than the event but in Map2 there's another event with collision condition which does whatever. That second event should not be activated, but it is.

Solution

Put this above main:

class Game_Event
  alias transferring_fix_cet_auto check_event_trigger_auto unless $@
  def check_event_trigger_auto
    if @trigger == 2 and $game_temp.transition_processing
      return
    end
    transferring_fix_cet_auto
  end
end





[XP] Parallel process in the first map

Description

When you initialize a new game from the title things are loaded is that sequence:
1) Events with Parallel Process start working
2) Transition from Title Screen to the game (20 frames)
3) $game_map and all its things are loaded
4) Auto-start Events, map's music, etc. start working

The problem is, if you start a parallel process which uses something related to the map, $game_map was not loaded yet when it starts so the game crashes, and if you use an Auto-start to solve that, it starts when the transition was done so maybe it will look bad. Also if you use a script call with 'if $scene.is_a?(Scene_Map)' or you use a 'Wait x frames', to try to solve the problem.

Solution

I did an script for an engine of my game and by chance this fixes the problem, but the fix by LittleDrago is much more concise.
Put the script above main:

#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # * Constant
  #--------------------------------------------------------------------------
  Nothing = Struct.new(:update,:dispose)
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  $@ || alias_method(:main_parallel_process_fix, :main)
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    init_parallel_process_fix
    main_parallel_process_fix
  end
  #--------------------------------------------------------------------------
  # * init_parallel_process_fix
  #--------------------------------------------------------------------------
  def init_parallel_process_fix
    @spriteset = Nothing.new
    update_systems
    transfer_player                    if $game_temp.player_transferring
    return $scene = Scene_Gameover.new if $game_temp.gameover
    return $scene = Scene_Title.new    if $game_temp.to_title
  end
  #--------------------------------------------------------------------------
  # * update_systems
  #--------------------------------------------------------------------------
  def update_systems
    $game_map.update
    $game_system.map_interpreter.update
    $game_player.update
    $game_system.update
    $game_screen.update
  end
end





[XP] Screen animation to multiple sprites

Description

When a screen animation (position == 3) is shown to different sprites at the same time, it is displayed overlapping itself and it should be displayed just once.

Solution

Edit: New script by LiTTleDRAgo

Put the script above main:

#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
#  This sprite is used to display the battler.It observes the Game_Character
#  class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Battler
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  $@ || alias_method(:update_fix_animation, :update)
  $@ || alias_method(:animation_set_sprites_fix, :animation_set_sprites)
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update(*args)
    if @battler.nil?
      @battler_name = nil
    elsif @battler_visible && @battler.animation_id != 0
      @disable_animation = @battler.instance_variable_get(:@disable_animation)
    end
    update_fix_animation(*args)
  end
  #--------------------------------------------------------------------------
  # * Animation Set Sprites
  #--------------------------------------------------------------------------
  def animation_set_sprites(sp, *args)
    return sp[0..15].each {|s| s && s.visible = false } if @disable_animation
    animation_set_sprites_fix(sp, *args)
  end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  $@ || alias_method(:update_phase4_step4_fix, :update_phase4_step4)
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 4 : animation for target)
  #--------------------------------------------------------------------------
  def update_phase4_step4(*args)
    if @animation2_id != 0
      @target_battlers.each_with_index do |s,i|
        s.instance_variable_set(:@disable_animation,false)
        if i > 0 && $data_animations[@animation2_id].position == 3
          s.instance_variable_set(:@disable_animation,true)
        end
      end
    end
    update_phase4_step4_fix(*args)
  end
end





[XP] Disabling skills State bug

Description

There's a type of states restriction which disables the usage of skills to the actor (usually used as the "silence" state). But it doesn't work in the menu because the variable restriction when disabling skills equals 1 and the Skills on menu is disabled when it equals >= 2 by default (so it's so easy, if you change that to >= 1 it will work well). But the problem is the next one: You can go to the Skills scene from an actor who has not the state and with Q / W change to another actor who has the state.

Solution

Put this LiTTleDRAgo's script above main:

#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================
class Scene_Menu
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  $@ || alias_method(:update_status_fix, :update_status)
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status(*args)
    if Input.trigger?(Input::C)
      case @command_window.index
      when 1  # skill
        restrict = $game_party.actors[@status_window.index].restriction >= 1
        return $game_system.se_play($data_system.buzzer_se) if restrict
        $game_system.se_play($data_system.decision_se)
        return $scene = Scene_Skill.new(@status_window.index)
      end
    end
    update_status_fix(*args)
  end
end

#==============================================================================
# ** Scene_Skill
#------------------------------------------------------------------------------
#  This class performs skill screen processing.
#==============================================================================
class Scene_Skill
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  $@ || alias_method(:update_skill_fix, :update_skill)
  #--------------------------------------------------------------------------
  # * Frame Update (if skill window is active)
  #--------------------------------------------------------------------------
  def update_skill(*args)
    return update_skill_lr(1)  if Input.trigger?(Input::R)
    return update_skill_lr(-1) if Input.trigger?(Input::L)
    update_skill_fix(*args)
  end
  #--------------------------------------------------------------------------
  # * update_skill_lr
  #--------------------------------------------------------------------------
  def update_skill_lr(type = 1)
    return if $game_party.actors.size == 1
    actor = @actor_index
    loop do
      @actor_index = (@actor_index + type) % $game_party.actors.size
      break unless $game_party.actors[@actor_index].restriction >= 1
      break if @actor_index == actor
    end
    return $game_system.se_play($data_system.buzzer_se) if @actor_index == actor
    $game_system.se_play($data_system.cursor_se)
    $scene = Scene_Skill.new(@actor_index)
  end
end





[XP] Enemy Action Regarding Skills

Description

If any enemy has the ability to use a skill, it will add it as a potential action it can make regardless if the enemy is even capable of using the skill in the first place (e.g. not enough SP, silenced, etc.).

Examples

Give an enemy the ability to do a normal attack and use a skill that requires SP. Make it so that the enemy has enough SP to only use the skill once. Make sure both actions have a similar priority. Go into battle and notice that the enemy sometimes skips their turn.

Solution

In Game_Enemy, find the method make_action and replace EVERYTHING below it with this:

  def make_action
    # Clear current action
    self.current_action.clear
    # If unable to move
    unless self.movable?
      # End Method
      return
    end
    # Extract current effective actions
    available_actions = []
    rating_max = 0
    for action in self.actions
      # Confirm can use skill
      if action.kind == 1 && !skill_can_use?(action.skill_id)
        next
      end
      # Confirm turn conditions
      n = $game_temp.battle_turn
      a = action.condition_turn_a
      b = action.condition_turn_b
      if (b == 0 and n != a) or
         (b > 0 and (n < 1 or n < a or n % b != a % b))
        next
      end
      # Confirm HP conditions
      if self.hp * 100.0 / self.maxhp > action.condition_hp
        next
      end
      # Confirm level conditions
      if $game_party.max_level < action.condition_level
        next
      end
      # Confirm switch conditions
      switch_id = action.condition_switch_id
      if switch_id > 0 and $game_switches[switch_id] == false
        next
      end
      # Add this action to applicable conditions
      available_actions.push(action)
      if action.rating > rating_max
        rating_max = action.rating
      end
    end
    # Calculate total with max rating value at 3 (exclude 0 or less)
    ratings_total = 0
    for action in available_actions
      if action.rating > rating_max - 3
        ratings_total += action.rating - (rating_max - 3)
      end
    end
    # If ratings total isn't 0
    if ratings_total > 0
      # Create random numbers
      value = rand(ratings_total)
      # Set things that correspond to created random numbers as current action
      for action in available_actions
        if action.rating > rating_max - 3
          if value < action.rating - (rating_max - 3)
            self.current_action.kind = action.kind
            self.current_action.basic = action.basic
            self.current_action.skill_id = action.skill_id
            self.current_action.decide_random_target_for_enemy
            return
          else
            value -= action.rating - (rating_max - 3)
          end
        end
      end
    end
  end
end





[XP][VX][VXA] Testing for File Existence in Encrypted Games

Description

Encrypted games cannot use methods like FileTest.exist? or File.open.

Examples

If using RMXP, add
print FileTest.exist?("Data/Scripts.rxdata")
to the top of Main. Encrypt your game. Then run the encrypted game. It should say false.

Solution

LiTTleDRAgo provided a work-around here: https://pastebin.com/krvZgfPj
15
To confirm if the rumors around this tileset are true, I tried to make a decent boat with RPG maker XP and... it's... IT'S JUST IMPOSSIBLE, MAN!

So I decided to diassemble all parts of the ship tileset and I left them free so the mapper can use them properly. It still being pretty complex to make a decent ship (naval architecture is not a joke) but at least now you can do things that look like a boat xD Whoopee!

Credits not required.

TILESET (Ship01)
Spoiler: ShowHide


TILESET (Ship02)
Spoiler: ShowHide


BONUS (Ship01)
Spoiler: ShowHide


Let me know any problem you may have.
16
RMVX Ace Script Database / [VXA] Caterpillar Jump Fix
August 10, 2014, 10:50:29 am
Caterpillar Jump Fix
Authors: Wecoc
Version: 1.0
Type: Movement Bugfix
Key Term: Movement Add-on



Introduction

On RPG Maker VX Ace default caterpillar when the player jumps the followers don't jump with him, they walk magically through the wall or over the swamp...

This script is a partial rewrite of the Caterpillar system to avoid this type of bugs.


Features


  • The followers don't follow the player, they "imitate" him (so it avoids a lot of bugs)

  • Still being friendly for huge parties




Screenshots

N/A for this type of script, maybe a gif would be good but anyway it's easy to imagine.


Script

Spoiler: ShowHide

#==============================================================================
# [ACE] Caterpillar Jump Fix v1.0
#==============================================================================

class Game_Player < Game_Character

 attr_accessor :player_route
 def init_private_members
   super
   @player_route = []
 end

 def move_straight(d, turn_ok = true)
   push_straight_route(d) if passable?(@x, @y, d)
   super
 end

 def move_diagonal(horz, vert)
   push_diagonal_route(horz, vert) if diagonal_passable?(@x, @y, horz, vert)
   super
 end

 def push_straight_route(d)
   case d
     when 1 then @player_route.push([ROUTE_MOVE_LOWER_L])
     when 2 then @player_route.push([ROUTE_MOVE_DOWN])
     when 3 then @player_route.push([ROUTE_MOVE_LOWER_R])
     when 4 then @player_route.push([ROUTE_MOVE_LEFT])
     when 6 then @player_route.push([ROUTE_MOVE_RIGHT])
     when 7 then @player_route.push([ROUTE_MOVE_UPPER_L])
     when 8 then @player_route.push([ROUTE_MOVE_UP])
     when 9 then @player_route.push([ROUTE_MOVE_UPPER_R])
   end
 end

 def push_diagonal_route(horz, vert)
   d = case [horz, vert]
     when [4, 2] then 1
     when [6, 2] then 3
     when [4, 8] then 7
     when [6, 8] then 9
   end
   push_straight_route(d)
 end

 alias wecoc_fix_jump jump unless $@
 def jump(x_plus, y_plus)
   wecoc_fix_jump(x_plus, y_plus)
   @player_route.push([ROUTE_JUMP, x_plus, y_plus])
 end
end

class Game_Follower < Game_Character

 attr_accessor :player_route
 def init_private_members
   super
   @player_route = []
 end

 def move_straight(d, turn_ok = true)
   push_straight_route(d) if passable?(@x, @y, d)
   super
 end

 def move_diagonal(horz, vert)
   push_diagonal_route(horz, vert) if diagonal_passable?(@x, @y, horz, vert)
   super
 end

 def push_straight_route(d)
   case d
     when 1 then @player_route.push([ROUTE_MOVE_LOWER_L])
     when 2 then @player_route.push([ROUTE_MOVE_DOWN])
     when 3 then @player_route.push([ROUTE_MOVE_LOWER_R])
     when 4 then @player_route.push([ROUTE_MOVE_LEFT])
     when 6 then @player_route.push([ROUTE_MOVE_RIGHT])
     when 7 then @player_route.push([ROUTE_MOVE_UPPER_L])
     when 8 then @player_route.push([ROUTE_MOVE_UP])
     when 9 then @player_route.push([ROUTE_MOVE_UPPER_R])
   end
 end

 def push_diagonal_route(horz, vert)
   array = [horz, vert]
   d = case array
     when [4, 2] then 1
     when [6, 2] then 3
     when [4, 8] then 7
     when [6, 8] then 9
   end
   push_straight_route(d)
 end

 alias wecoc_fix_jump jump unless $@
 def jump(x_plus, y_plus)
   wecoc_fix_jump(x_plus, y_plus)
   @player_route.push([ROUTE_JUMP, x_plus, y_plus])
 end

 alias wecoc_fix_upd update unless $@
 def update
   unless self.moving? or self.jumping?
     if @preceding_character.moving? or @preceding_character.jumping?
       if @preceding_character.player_route.size != 0
         movement = @preceding_character.player_route[0]
         new_x = @x
         new_y = @y
         case movement[0]
         when ROUTE_MOVE_LOWER_L
           new_x -= 1
           new_y += 1
         when ROUTE_MOVE_DOWN
           new_y += 1
         when ROUTE_MOVE_LOWER_R
           new_x += 1
           new_y += 1
         when ROUTE_MOVE_LEFT
           new_x -= 1
         when ROUTE_MOVE_RIGHT
           new_x += 1
         when ROUTE_MOVE_UPPER_L
           new_x -= 1
           new_y -= 1
         when ROUTE_MOVE_UP
           new_y -= 1
         when ROUTE_MOVE_UPPER_R
           new_x += 1
           new_y -= 1
         when ROUTE_JUMP
           new_x += movement[1]
           new_y += movement[2]
         end
         p_cords = [@preceding_character.x, @preceding_character.y]
         if  p_cords != [new_x, new_y]
           case movement[0]
             when ROUTE_MOVE_LOWER_L then move_diagonal(4, 2)
             when ROUTE_MOVE_DOWN    then move_straight(2)
             when ROUTE_MOVE_LOWER_R then move_diagonal(6, 2)
             when ROUTE_MOVE_LEFT    then move_straight(4)
             when ROUTE_MOVE_RIGHT  then move_straight(6)
             when ROUTE_MOVE_UPPER_L then move_diagonal(4, 8)
             when ROUTE_MOVE_UP      then move_straight(8)
             when ROUTE_MOVE_UPPER_R then move_diagonal(6, 8)
             when ROUTE_JUMP then jump(movement[1], movement[2])
           end
           @preceding_character.player_route.shift
         end
       end
     end
   end
   wecoc_fix_upd
 end
end

class Game_Followers
 alias wecoc_syn synchronize unless $@
 def synchronize(x, y, d)
   wecoc_syn(x, y, d)
   restore_route
 end

 def restore_route
   each do |follower|
     follower.player_route = []
   end
   $game_player.player_route = []
 end
end

class Game_Interpreter
 #--------------------------------------------------------------------------
 # * Gather Followers
 #--------------------------------------------------------------------------
 alias wecoc_command_217 command_217 unless $@
 def command_217
   wecoc_command_217
   $game_player.followers.restore_route
 end
end



Instructions

Put the script above main and it will work automatically.


Compatibility

No idea about this, if there is some type of incompatibility with any well-known system, post about it and I will try to fix it.


Credits and Thanks


  • Wecoc - Script author, ehehe

  • Pokaranero - He gave me the idea (and he also was a good tester)




Author's Notes

The script is a fix for a internal bug so it does not require credits but please don't attribute the credit to you.
You can distribute this code anywhere.
17
RMXP Script Database / [XP] Palette Script
July 28, 2014, 11:31:05 am
Palette Script
Authors: Wecoc
Version: 1.1
Type: Misc Add-on
Key Term: Misc Add-on



Introduction

This script allows to obtain and modify a bitmap palette in-game.
This new property will be stored in $game_system so it will be saved when you save the game.



Features


  • Gets the palette of any type of graphic

  • Graphics are not modified, only its display on the game




Screenshots

Spoiler: ShowHide

Default Aluxes with an alternative palette changed in-game




Demo

Palette Script v1.1

Instructions

Configuration and callers on the script. It's easy to use!
18
Script Requests / [XP] Change "Save files" icon?
July 17, 2014, 01:12:28 am
Hi all, I want to request a probably impossible script but you guys are geniuses so I have to try.

Someone asked me if there was any way, using API, dll, executables or whatever, to change the icon of the Save files for an specific XP game.

I think it's impossible because ResHacker allows to change those Save files icon from the program executor, and it's obviously not included in the game folder.
I'm almost sure the program executor is the only responsible for that icons because those who play RPG maker games without the program can't see the icon.

But I want to be sure.
19
RMXP Script Database / [XP] Gravity Jump by Layer
July 10, 2014, 10:21:15 am
Gravity Jump by Layer
Authors: Wecoc
Version: 1.0
Type: Jump Add-on
Key Term: Movement Add-on



Introduction

This script adds gravity to the map.

Maybe you know a script called Gravity by LiTTleDRAgo.
This is the same but with another method, a bit easier to use.

It changes the jump coordinates if there is a height difference.
You will have to make a "height map" picture, I explained how to do that on the code instructions.



Features


  • Jump down a cliff without breaking your head

  • Panorama is passable but you can't jump on it (no more Skywalkers)




Demo

Gravity Jump by Layer


Instructions

All the operating instructions are on the script.
If you still not understanding what this script does (probably because of my english), read the example on the spoiler:

Example: ShowHide

The square represents where the player would jump without the script.
The cross represents where the player would try to jump
And the round represents where the player will jump WITH the script.






Author's Notes

Everything else.
I mean... Enjoy ~
20
RMXP Script Database / [XP] Oldschool Menu
July 08, 2014, 11:10:03 am
Oldschool Menu
Authors: Wecoc
Version: 1.0
Type: Custom Menu System
Key Term: Custom Menu System



Introduction

The menu is displayed in a similar way as the message window in a very simple and oldschool format.
Modifies the main menu and its internal scenes, except Scene_Status and Scene_Save.



Features


  • Control its position in the same way as with the message box

  • Change some of the internal features using the menu globals

  • You can control the menu commands using an array (saved on Game_System)




Screenshots

http://s21.postimg.org/5yxco1r13/menu1.png
http://s21.postimg.org/6n676zpqv/menu2.png
http://s21.postimg.org/clk0h88pj/menu3.png
http://s21.postimg.org/gj7a6mviv/menu4.png



Script

Above main as all.
Spoiler: ShowHide

#==============================================================================
# ** OldSchool Menu v1.0
#------------------------------------------------------------------------------
#  The menu is displayed in a similar way as the message window.
#  Modifies the main menu and its internal scenes.
#  Author: Wecoc (no credits needed)
#------------------------------------------------------------------------------
#  As the message box, it has a few options;
#  * Position
#    $game_system.menu_position = n
#      ( n -> 0 (up), 1 (middle), 2 (down) )
#  * Visibility
#    $game_system.menu_frame = n
#      ( n -> 0 (visible), 1 (invisible) )
#  * Back opacity
#    $game_system.menu_back_opacity = n
#      (n = 160 if you want it like the Message box)
#  * Commands
#    $game_system.menu_commands = [commands]
#==============================================================================

class Game_System
  attr_accessor :menu_position
  attr_accessor :menu_frame
  attr_accessor :menu_back_opacity
  attr_accessor :menu_commands

  alias menu_oldschool initialize unless $@
  def initialize
    menu_oldschool
    @menu_position = 2
    @menu_frame = 0
    @menu_back_opacity = 255
    @menu_commands = ["Item", "Skill", "Equip", "Status", "Save", "End Game"]
  end

  def mes_to_menu
    @menu_position = @message_position
    @menu_frame = @message_frame
  end
end

module OLDSCHOOL
 
  # Menu Globals
 
  ONLY_ITEMS = true # In Window_Item only Items are shown (no Weapons or Armors)

  BATTLE_SKILLS = true # Battle skills are also shown in the Menu Window_Skill

  ALL_EQUIP = false # All the equip is displayed in the Window_Equip, not only
                    # the equippable by the actual actor
                   
  SHOW_ICONS = true # Items are drawn with their icon

  PARENTHESIS = true # The item's number is displayed "(n)", no ": n"

  SPHELP_ITEM = true # When you use an item, SPHelp is activated

  SPHELP_SKILL = true # When you use a skill, SPHelp is activated

  SPHELP_EQUIP = true # When you change your equip, SPHelp is activated

  ACTOR_SEL = true # You select Skill, Equip o Status by actor (as always)

  GOLD = true # When you are in Window_Item the Gold window is displayed
end

class Window_Item < Window_Selectable
  def initialize
    super(82 + 32, 64, 248, 192)
    @column_max = 1
    refresh
    self.index = 0
  end

  def item
    return @data[self.index]
  end

  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add item
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i])
      end
    end
    unless OLDSCHOOL::ONLY_ITEMS
      # Also add weapons and items if outside of battle
      unless $game_temp.in_battle
        for i in 1...$data_weapons.size
          if $game_party.weapon_number(i) > 0
            @data.push($data_weapons[i])
          end
        end
        for i in 1...$data_armors.size
          if $game_party.armor_number(i) > 0
            @data.push($data_armors[i])
          end
        end
      end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end

  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    if OLDSCHOOL::SHOW_ICONS
      bitmap = RPG::Cache.icon(item.icon_name)
      opacity = self.contents.font.color == disabled_color ? 128 : 255
      self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
      self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    else
      self.contents.draw_text(x, y, 212, 32, item.name, 0)
    end
    if OLDSCHOOL::PARENTHESIS
      self.contents.draw_text(x + 156, y, 48, 32, "(#{number.to_s})", 2)
    else
      self.contents.draw_text(x + 156, y, 48, 32, ": #{number.to_s}", 2)
    end
  end
end

class Window_Skill < Window_Selectable
  attr_accessor :actor
  def initialize
    super(82 + 32, 64, 306, 192)
    @column_max = 1
    @actor = 0
    refresh
    self.index = 0
  end

  def item
    return @data[self.index]
  end

  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add skill
    for i in 0...$game_party.actors[@actor].skills.size
      skill = $data_skills[$game_party.actors[@actor].skills[i]]
      if skill != nil
        if OLDSCHOOL::BATTLE_SKILLS and skill.occasion == 1
          next
        end
        @data.push(skill)
      end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end

  def draw_item(index)
    skill = @data[index]
    if $game_party.actors[@actor].skill_can_use?(skill.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    if OLDSCHOOL::SHOW_ICONS
      bitmap = RPG::Cache.icon(skill.icon_name)
      opacity = self.contents.font.color == disabled_color ? 128 : 255
      self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
      self.contents.draw_text(x + 28, y, 212, 32, skill.name, 0)
    else
      self.contents.draw_text(x, y, 212, 32, skill.name, 0)
    end
    self.contents.draw_text(x + 212, y, 48, 32, skill.sp_cost.to_s, 2)
  end
end

class Window_Equip < Window_Selectable
  attr_accessor :choice_window
  attr_accessor :actor
  def initialize(actor)
    super(82 + 64, 64, 248, 192)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end

  def item
    return @data[self.index]
  end

  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    return if @choice_window.nil?
    @data = []
    actor = $game_party.actors[@actor]
    case @choice_window.index
    when 0 # Weapon
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0
          if OLDSCHOOL::ALL_EQUIP == false and not
            actor.equippable?($data_weapons[i])
            next
          end
          @data.push($data_weapons[i])
        end
      end
      if actor.weapon_id != 0
        @data.push($data_weapons[actor.weapon_id])
      end
    when 1 # Shield
      for i in 1...$data_armors.size
        next if $data_armors[i].kind != 0
        if $game_party.armor_number(i) > 0
          if OLDSCHOOL::ALL_EQUIP == false and not
            actor.equippable?($data_armors[i])
            next
          end
          @data.push($data_armors[i])
        end
      end
      if actor.armor1_id != 0
        @data.push($data_armors[actor.armor1_id])
      end
    when 2 # Helmet
      for i in 1...$data_armors.size
        next if $data_armors[i].kind != 1
        if $game_party.armor_number(i) > 0
          if OLDSCHOOL::ALL_EQUIP == false and not
            actor.equippable?($data_armors[i])
            next
          end
          @data.push($data_armors[i])
        end
      end
      if actor.armor2_id != 0
        @data.push($data_armors[actor.armor2_id])
      end
    when 3 # Body
      for i in 1...$data_armors.size
        next if $data_armors[i].kind != 2
        if $game_party.armor_number(i) > 0
          if OLDSCHOOL::ALL_EQUIP == false and not
            actor.equippable?($data_armors[i])
            next
          end
          @data.push($data_armors[i])
        end
      end
      if actor.armor3_id != 0
        @data.push($data_armors[actor.armor3_id])
      end
    when 4 # Accessor
      for i in 1...$data_armors.size
        next if $data_armors[i].kind != 3
        if $game_party.armor_number(i) > 0
          if OLDSCHOOL::ALL_EQUIP == false and not
            actor.equippable?($data_armors[i])
            next
          end
          @data.push($data_armors[i])
        end
      end
      if actor.armor4_id != 0
        @data.push($data_armors[actor.armor4_id])
      end
    end
    @data.sort!{|x,y| x.id <=> y.id }
    @data.uniq!
    @data.push(nil)
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end

  def draw_item(index)
    item = @data[index]
    actor = $game_party.actors[@actor]
    return if item.nil?
    self.contents.font.color = normal_color
    unless actor.equippable?(item)
      self.contents.font.color = disabled_color
    end
    if item.is_a?(RPG::Weapon)
      if actor.weapon_id == item.id
        self.contents.font.color = system_color
      end
    end
    if item.is_a?(RPG::Armor)
      if actor.armor1_id == item.id or actor.armor2_id == item.id or
        actor.armor3_id == item.id or actor.armor4_id == item.id
          self.contents.font.color = system_color
      end
    end
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    if OLDSCHOOL::SHOW_ICONS
      bitmap = RPG::Cache.icon(item.icon_name)
      opacity = self.contents.font.color == disabled_color ? 128 : 255
      self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
      self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    else
      self.contents.draw_text(x, y, 212, 32, item.name, 0)
    end
  end
end

class Window_SHelp < Window_Base
  attr_reader :line0
  attr_reader :line1
  attr_reader :line2
  attr_reader :line3

  def initialize
    super(80, 0, 480, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    @line0 = ""
    @line1 = ""
    @line2 = ""
    @line3 = ""
  end

  def refresh
    self.contents.clear
    self.contents.draw_text(4,  0, 480, 32, @line0, 0)
    self.contents.draw_text(4, 32, 480, 32, @line1, 0)
    self.contents.draw_text(4, 64, 480, 32, @line2, 0)
    self.contents.draw_text(4, 96, 480, 32, @line3, 0)
  end

  def draw_line(line, text)
    case line
      when 0 then @line0 = text
      when 1 then @line1 = text
      when 2 then @line2 = text
      when 3 then @line3 = text
    end
    refresh
  end

  def draw_next_line(text)
    if @line0 == ""
      draw_line(0, text)
    elsif @line1 == ""
      draw_line(1, text)
    elsif @line2 == ""
      draw_line(2, text)
    elsif @line3 == ""
      draw_line(3, text)
    end
  end

  def clear
    @line0 = ""
    @line1 = ""
    @line2 = ""
    @line3 = ""
    refresh
  end
end

class Scene_Menu
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end

  def main
    @spriteset = Spriteset_Map.new
    # Make command window
    @command_window = Window_Command.new(480, $game_system.menu_commands)
    @command_window.index = @menu_index
    @command_window.x = 80
    @command_window.height = 160
    @command_window.z = 100
    @command_window.back_opacity = $game_system.menu_back_opacity
    # Make command window
    actors_array = []
    for i in 0...$game_party.actors.size
      actors_array.push($game_party.actors[i].name)
    end
    @actors_window = Window_Command.new(160, actors_array)
    @actors_window.index = 0
    @actors_window.x = 80 + 16
    @actors_window.height = 160
    @actors_window.z = 120
    @actors_window.back_opacity = $game_system.menu_back_opacity
    @actors_window.visible = false
    @actors_window.active = false
    # Make Item window
    @item_window = Window_Item.new
    @item_window.back_opacity = $game_system.menu_back_opacity
    @item_window.z = 150
    @item_window.visible = false
    @item_window.active = false
    # Make Gold window
    @gold_window = Window_Gold.new
    @gold_window.back_opacity = $game_system.menu_back_opacity
    @gold_window.x = 380
    @gold_window.z = 120
    @gold_window.visible = false
    @gold_window.active = false
    # Make Skill window
    @skill_window = Window_Skill.new
    @skill_window.back_opacity = $game_system.menu_back_opacity
    @skill_window.z = 150
    @skill_window.visible = false
    @skill_window.active = false
    # Make Equip choice window
    equipch_array = ["Weapon", "Shield", "Helmet", "Body", "Accessor"]
    @equipch_window = Window_Command.new(160, equipch_array)
    @equipch_window.x = 80 + 32
    @equipch_window.z = 150
    @equipch_window.back_opacity = $game_system.menu_back_opacity
    @equipch_window.visible = false
    @equipch_window.active = false
    # Make Equip window
    @equip_window = Window_Equip.new(0)
    @equip_window.choice_window = @equipch_window
    @equip_window.z = 200
    @equip_window.back_opacity = $game_system.menu_back_opacity
    @equip_window.visible = false
    @equip_window.active = false
    # Make Special Help window
    @sphelp_window = Window_SHelp.new
    @sphelp_window.z = 100
    @sphelp_window.back_opacity = $game_system.menu_back_opacity
    @sphelp_window.visible = false
    @sphelp_window.active = false
    # Make End window
    end_array = ["To Title", "Shutdown", "Cancel"]
    @end_window = Window_Command.new(192, end_array)
    @end_window.x = 320 - @end_window.width / 2
    @end_window.y = 240 - @end_window.height / 2
    @end_window.z = 300
    @end_window.back_opacity = $game_system.menu_back_opacity
    @end_window.visible = false
    @end_window.active = false
    # Game System Features
    case $game_system.menu_position
    when 0  # up
      @command_window.y = 16
      @gold_window.y =    16 + 8
      @actors_window.y =  16 + 4
      @item_window.y =    16 + 8
      @skill_window.y =  16 + 8
      @equipch_window.y = 16 + 8
      @equip_window.y =  16 + 24
      @sphelp_window.y =  16
    when 1  # middle
      @command_window.y = 160
      @gold_window.y =    160 + 8
      @actors_window.y =  160 + 4
      @item_window.y =    160 + 8
      @skill_window.y =  160 + 8
      @equipch_window.y = 160 + 8
      @equip_window.y =  160 + 24
      @sphelp_window.y =  160
    when 2  # down
      @command_window.y = 304
      @gold_window.y =    304 - 24
      @actors_window.y =  304 - 16
      @item_window.y =    304 - 24
      @skill_window.y =  304 - 24
      @equipch_window.y = 304 - 24
      @equip_window.y =  304 - 48
      @sphelp_window.y =  304
    end
    if $game_system.menu_frame == 0
      @command_window.opacity = 255
      @actors_window.opacity = 255
      @item_window.opacity = 255
      @gold_window.opacity = 255
      @skill_window.opacity = 255
      @equipch_window.opacity = 255
      @equip_window.opacity = 255
      @sphelp_window.opacity = 255
      @end_window.opacity = 255
    else
      @command_window.opacity = 0
      @actors_window.opacity = 0
      @item_window.opacity = 0
      @gold_window.opacity = 0
      @skill_window.opacity = 0
      @equipch_window.opacity = 0
      @equip_window.opacity = 0
      @sphelp_window.opacity = 0
      @end_window.opacity = 0
    end
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable Item, Skill, Equip and Status
      for i in 0...$game_system.menu_commands.size
        if $game_system.menu_commands[i] == "Item" or
          $game_system.menu_commands[i] == "Skill" or
          $game_system.menu_commands[i] == "Equip" or
          $game_system.menu_commands[i] == "Status"

          @command_window.disable_item(i)
        end
      end
    end
    # If save is forbidden
    if $game_system.save_disabled
      # Disable Save
      for i in 0...$game_system.menu_commands.size
        if $game_system.menu_commands[i] == "Save"
          @command_window.disable_item(i)
        end
      end
    end
    # Execute transition
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    @command_window.dispose
    @actors_window.dispose
    @gold_window.dispose
    @item_window.dispose
    @skill_window.dispose
    @equipch_window.dispose
    @equip_window.dispose
    @end_window.dispose
    @sphelp_window.dispose
    @spriteset.dispose
  end

  def update
    @command_window.update
    @actors_window.update
    @item_window.update
    @skill_window.update
    @equipch_window.update
    @equip_window.update
    @end_window.update
    @sphelp_window.update
    @gold_window.update
    $game_map.update
    $game_system.map_interpreter.update
    $game_system.update
    $game_screen.update
    @spriteset.update
    if @command_window.active
      update_command
      return
    end
    if @actors_window.active
      update_actors
      return
    end
    if @item_window.active
      update_item
      return
    end
    if @skill_window.active
      update_skill
      return
    end
    if @equipch_window.active
      update_equipch
      return
    end
    if @equip_window.active
      update_equip
      return
    end
    if @sphelp_window.active
      update_sphelp
      return
    end
    if @end_window.active
      update_end
      return
    end
  end
   
  def disable_equipch
    @equipch_window.draw_item(0, @equipch_window.normal_color)
    @equipch_window.draw_item(1, @equipch_window.normal_color)
    @equipch_window.draw_item(2, @equipch_window.normal_color)
    @equipch_window.draw_item(3, @equipch_window.normal_color)
    @equipch_window.draw_item(4, @equipch_window.normal_color)
    actor = $data_actors[$game_party.actors[@actors_window.index].id]
    @equipch_window.disable_item(0) if actor.weapon_fix
    @equipch_window.disable_item(1) if actor.armor1_fix
    @equipch_window.disable_item(2) if actor.armor2_fix
    @equipch_window.disable_item(3) if actor.armor3_fix
    @equipch_window.disable_item(4) if actor.armor4_fix
  end

  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      if $game_party.actors.size == 0 and @command_window.index < 4
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case $game_system.menu_commands[@command_window.index]
      when "Item"
        $game_system.se_play($data_system.decision_se)
        @item_window.index = 0
        if OLDSCHOOL::GOLD
          @gold_window.visible = true
        end
        @item_window.visible = true
        @item_window.active = true
        @command_window.active = false
      when "Skill"
        $game_system.se_play($data_system.decision_se)
        if OLDSCHOOL::ACTOR_SEL
          @actors_window.index = 0
          @actors_window.visible = true
          @actors_window.active = true
        else
          @skill_window.index = 0
          @skill_window.visible = true
          @skill_window.active = true
        end
        @command_window.active = false
      when "Equip"
        $game_system.se_play($data_system.decision_se)
        if OLDSCHOOL::ACTOR_SEL
          @actors_window.index = 0
          @actors_window.visible = true
          @actors_window.active = true
        else
          @equipch_window.index = 0
          disable_equipch
          @equipch_window.visible = true
          @equipch_window.active = true
        end
        @command_window.active = false
      when "Status"
        $game_system.se_play($data_system.decision_se)
        if OLDSCHOOL::ACTOR_SEL
          @actors_window.index = 0
          @actors_window.visible = true
          @actors_window.active = true
          @command_window.active = false
        else
          $scene = Scene_Status.new(0)
        end
      when "Save"
        if $game_system.save_disabled
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Save.new
      when "End Game"
        $game_system.se_play($data_system.decision_se)
        @end_window.visible = true
        @end_window.active = true
        @command_window.active = false
      end
      return
    end
  end

  def update_actors
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = true
      @actors_window.visible = false
      @actors_window.active = false
      return
    end
    if Input.trigger?(Input::C)
      case $game_system.menu_commands[@command_window.index]
      when "Skill"
        $game_system.se_play($data_system.decision_se)
        @skill_window.actor = @actors_window.index
        @skill_window.refresh
        @skill_window.index = 0
        @skill_window.visible = true
        @skill_window.active = true
        @actors_window.active = false
      when "Equip"
        $game_system.se_play($data_system.decision_se)
        @equipch_window.refresh
        @equipch_window.index = 0
        disable_equipch
        @equipch_window.visible = true
        @equipch_window.active = true
        @actors_window.active = false
      when "Status"
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Status.new(@actors_window.index)
      end
      return
    end
  end

  def update_item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = true
      @item_window.visible = false
      @item_window.active = false
      @gold_window.visible = false
      return
    end
    if Input.trigger?(Input::C)
      item = @item_window.item
      unless item.is_a?(RPG::Item)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      unless $game_party.item_can_use?(item.id)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if item.scope >= 3
        if item.scope == 4 || item.scope == 6
          used = false
          for i in $game_party.actors
            used |= i.item_effect(item)
          end
        else
          used = $game_party.actors[0].item_effect(item)
        end
        if used
          $game_system.se_play(item.menu_se)
          if item.consumable
            $game_party.lose_item(item.id, 1)
            @item_window.refresh
          end
          if $game_party.all_dead?
            $scene = Scene_Gameover.new
            return
          end
          if item.common_event_id > 0
            $game_temp.common_event_id = item.common_event_id
            $scene = Scene_Map.new
            return
          end
          if OLDSCHOOL::SPHELP_ITEM
            @command_window.visible = false
            @gold_window.visible = false
            @item_window.visible = false
            @item_window.active = false
            @sphelp_window.visible = true
            @sphelp_window.active = true
            check_item_help(item)
            return
          end
        end
        unless used
          $game_system.se_play($data_system.buzzer_se)
        end
      else
        if item.common_event_id > 0
          $game_temp.common_event_id = item.common_event_id
          $game_system.se_play(item.menu_se)
          if item.consumable
            $game_party.lose_item(item.id, 1)
            @item_window.draw_item(@item_window.index)
          end
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
  end

  def update_skill
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      if OLDSCHOOL::ACTOR_SEL
        @actors_window.active = true
      else
        @command_window.active = true
      end
      @skill_window.visible = false
      @skill_window.active = false
      return
    end
    if Input.trigger?(Input::C)
      skill = @skill_window.skill
      actor = @skill_window.actor
      if skill == nil or not actor.skill_can_use?(skill.id)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if skill.scope >= 3
        if skill.scope == 4 || skill.scope == 6
          used = false
          for i in $game_party.actors
            used |= i.skill_effect(actor, skill)
          end
        else
          used = actor.skill_effect(actor, skill)
        end
        # If skill was used
        if used
          $game_system.se_play(skill.menu_se)
          actor.sp -= skill.sp_cost
          if $game_party.all_dead?
            $scene = Scene_Gameover.new
            return
          end
          if skill.common_event_id > 0
            $game_temp.common_event_id = skill.common_event_id
            $scene = Scene_Map.new
            return
          end
          if OLDSCHOOL::SPHELP_SKILL
            @command_window.visible = false
            @actors_window.visible = false
            @skill_window.visible = false
            @skill_window.active = false
            @sphelp_window.visible = true
            @sphelp_window.active = true
            check_skill_help(skill)
            return
          end
        end
        unless used
          $game_system.se_play($data_system.buzzer_se)
        end
        return
      else
        if skill.common_event_id > 0
          $game_temp.common_event_id = skill.common_event_id
          $game_system.se_play(skill.menu_se)
          actor.sp -= skill.sp_cost
          $scene = Scene_Map.new
          return
        end
      end
    end
  end

  def update_equipch
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      if OLDSCHOOL::ACTOR_SEL
        @actors_window.active = true
      else
        @command_window.active = true
      end
      @equipch_window.visible = false
      @equipch_window.active = false
      return
    end
    if Input.trigger?(Input::C)
      actor = $data_actors[$game_party.actors[@actors_window.index].id]
      case @equipch_window.index
      when 0 # Weapon
        if actor.weapon_fix
          $game_system.se_play($data_system.buzzer_se)
          return
        else
          $game_system.se_play($data_system.decision_se)
          @equip_window.actor = @actors_window.index
          @equip_window.refresh
          @equip_window.index = 0
          @equip_window.active = true
          @equip_window.visible = true
          @equipch_window.active = false
        end
      when 1 # Shield
        if actor.armor1_fix
          $game_system.se_play($data_system.buzzer_se)
          return
        else
          $game_system.se_play($data_system.decision_se)
          @equip_window.actor = @actors_window.index
          @equip_window.refresh
          @equip_window.index = 0
          @equip_window.active = true
          @equip_window.visible = true
          @equipch_window.active = false
        end
      when 2 # Helmet
        if actor.armor2_fix
          $game_system.se_play($data_system.buzzer_se)
          return
        else
          $game_system.se_play($data_system.decision_se)
          @equip_window.actor = @actors_window.index
          @equip_window.refresh
          @equip_window.index = 0
          @equip_window.active = true
          @equip_window.visible = true
          @equipch_window.active = false
        end
      when 3 # Body
        if actor.armor3_fix
          $game_system.se_play($data_system.buzzer_se)
          return
        else
          $game_system.se_play($data_system.decision_se)
          @equip_window.actor = @actors_window.index
          @equip_window.refresh
          @equip_window.index = 0
          @equip_window.active = true
          @equip_window.visible = true
          @equipch_window.active = false
        end
      when 4 # Accessor
        if actor.armor4_fix
          $game_system.se_play($data_system.buzzer_se)
          return
        else
          $game_system.se_play($data_system.decision_se)
          @equip_window.actor = @actors_window.index
          @equip_window.refresh
          @equip_window.index = 0
          @equip_window.active = true
          @equip_window.visible = true
          @equipch_window.active = false
        end
      end
    end
  end

  def update_equip
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @equipch_window.active = true
      @equip_window.visible = false
      @equip_window.active = false
      return
    end
    if Input.trigger?(Input::C)
      item = @equip_window.item
      actor = $game_party.actors[@actors_window.index]
      if item != nil and not actor.equippable?(item)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @equipch_window.index
      when 0 # Weapon
        if item == nil and actor.weapon_id == 0
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        if item != nil and item.id == actor.weapon_id
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.equip_se)
        old_equip = $data_weapons[actor.weapon_id]
        actor.equip(0, item == nil ? 0 : item.id)
        new_equip = $data_weapons[actor.weapon_id]
        @equip_window.refresh
        if OLDSCHOOL::SPHELP_EQUIP
          @command_window.visible = false
          @actors_window.visible = false
          @equipch_window.visible = false
          @equip_window.visible = false
          @equip_window.active = false
          @sphelp_window.visible = true
          @sphelp_window.active = true
          check_weapon_help(old_equip, new_equip)
        end
      when 1 # Shield
        if item == nil and actor.armor1_id == 0
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        if item != nil and item.id == actor.armor1_id
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.equip_se)
        old_equip = $data_armors[actor.armor1_id]
        actor.equip(1, item == nil ? 0 : item.id)
        new_equip = $data_armors[actor.armor1_id]
        @equip_window.refresh
        if OLDSCHOOL::SPHELP_EQUIP
          @command_window.visible = false
          @actors_window.visible = false
          @equipch_window.visible = false
          @equip_window.visible = false
          @equip_window.active = false
          @sphelp_window.visible = true
          @sphelp_window.active = true
          check_armor_help(old_equip, new_equip)
        end
      when 2 # Helmet
        if item == nil and actor.armor2_id == 0
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        if item != nil and item.id == actor.armor2_id
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.equip_se)
        old_equip = $data_armors[actor.armor2_id]
        actor.equip(2, item == nil ? 0 : item.id)
        new_equip = $data_armors[actor.armor2_id]
        @equip_window.refresh
        if OLDSCHOOL::SPHELP_EQUIP
          @command_window.visible = false
          @actors_window.visible = false
          @equipch_window.visible = false
          @equip_window.visible = false
          @equip_window.active = false
          @sphelp_window.visible = true
          @sphelp_window.active = true
          check_armor_help(old_equip, new_equip)
        end
      when 3 # Body
        if item == nil and actor.armor3_id == 0
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        if item != nil and item.id == actor.armor3_id
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.equip_se)
        old_equip = $data_armors[actor.armor3_id]
        actor.equip(3, item == nil ? 0 : item.id)
        new_equip = $data_armors[actor.armor3_id]
        @equip_window.refresh
        if OLDSCHOOL::SPHELP_EQUIP
          @command_window.visible = false
          @actors_window.visible = false
          @equipch_window.visible = false
          @equip_window.visible = false
          @equip_window.active = false
          @sphelp_window.visible = true
          @sphelp_window.active = true
          check_armor_help(old_equip, new_equip)
        end
      when 4 # Accessor
        if item == nil and actor.armor4_id == 0
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        if item != nil and item.id == actor.armor4_id
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.equip_se)
        old_equip = $data_armors[actor.armor4_id]
        actor.equip(4, item == nil ? 0 : item.id)
        new_equip = $data_armors[actor.armor4_id]
        @equip_window.refresh
        if OLDSCHOOL::SPHELP_EQUIP
          @command_window.visible = false
          @actors_window.visible = false
          @equipch_window.visible = false
          @equip_window.visible = false
          @equip_window.active = false
          @sphelp_window.visible = true
          @sphelp_window.active = true
          check_armor_help(old_equip, new_equip)
        end
      end
    end
  end

  def update_sphelp
    if Input.trigger?(Input::B) or Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      command = $game_system.menu_commands[@command_window.index]
      if OLDSCHOOL::ACTOR_SEL and command != "Item"
        @actors_window.visible = true
        @actors_window.active = true
      else
        @command_window.active = true
      end
      @command_window.visible = true
      @sphelp_window.active = false
      @sphelp_window.visible = false
      return
    end
  end

  def check_item_help(item)
    @sphelp_window.clear
    actor_name = $game_party.actors[0].name
    if item.recover_hp != 0
      if item.recover_hp > 0
        text1 = "¡#{actor_name} has recovered "
      else
        text1 = "¡#{actor_name} has lost "
      end
      text2 = $data_system.words.hp + "!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if item.recover_hp_rate != 0
      if item.recover_hp_rate > 0
        text1 = "¡#{actor_name} has recovered "
      else
        text1 = "¡#{actor_name} has lost "
      end
      text2 = $data_system.words.hp + "!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if item.recover_sp != 0
      if item.recover_sp > 0
        text1 = "¡#{actor_name} has recovered "
      else
        text1 = "¡#{actor_name} has lost "
      end
      text2 = $data_system.words.sp + "!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if item.recover_sp_rate != 0
      if item.recover_sp_rate > 0
        text1 = "¡#{actor_name} has recovered "
      else
        text1 = "¡#{actor_name} has lost "
      end
      text2 = $data_system.words.sp + "!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if item.parameter_type != 0
      text1 = "¡#{actor_name}'s "
      case item.parameter_type
        when 0 then text2 = "Max " + $data_system.words.hp
        when 1 then text2 = "Max " + $data_system.words.sp
        when 2 then text2 = $data_system.words.str
        when 3 then text2 = $data_system.words.dex
        when 4 then text2 = $data_system.words.agi
        when 5 then text2 = $data_system.words.int
      end
      if item.parameter_points != 0
        if item.parameter_points > 0
          text3 = " increased!"
        else
          text3 = " decreased!"
        end
        @sphelp_window.draw_next_line(text1 + text2 + text3)
      end
    end
    if item.plus_state_set.size > 0
      plus_state_array = []
      for i in 0...item.plus_state_set.size
        plus_state_array.push($data_states[item.plus_state_set[i]].name)
      end
      text1 = "¡#{actor_name} gained status: "
      text2 = plus_state_array.join(", ") + "!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if item.minus_state_set.size > 0
      minus_state_array = []
      for i in 0...item.minus_state_set.size
        minus_state_array.push($data_states[item.minus_state_set[i]].name)
      end
      text1 = "¡#{actor_name} lost status: "
      text2 = minus_state_array.join(", ") + "!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
  end

  def check_skill_help(skill)
    @sphelp_window.clear
    actor_name = $game_party.actors[@actors_window.index].name
    if skill.power != 0
      if skill.power < 0
        text1 = "¡#{actor_name} has recovered "
      else
        text1 = "¡#{actor_name} has lost "
      end
      text2 = $data_system.words.hp + "!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    # ...
  end

  def check_weapon_help(old_item, new_item)
    @sphelp_window.clear
    actor_name = $game_party.actors[@actors_window.index].name
    if old_item != nil and new_item != nil
      atk = new_item.atk - old_item.atk
      pdef = new_item.pdef - old_item.pdef
      mdef = new_item.mdef - old_item.mdef
      str_plus = new_item.str_plus - old_item.str_plus
      dex_plus = new_item.dex_plus - old_item.dex_plus
      agi_plus = new_item.agi_plus - old_item.agi_plus
      int_plus = new_item.int_plus - old_item.int_plus
      # plus_state_set
      # minus_state_set
    elsif old_item == nil
      atk = new_item.atk
      pdef = new_item.pdef
      mdef = new_item.mdef
      str_plus = new_item.str_plus
      dex_plus = new_item.dex_plus
      agi_plus = new_item.agi_plus
      int_plus = new_item.int_plus
      # plus_state_set
      # minus_state_set
    else
      atk = 0 - old_item.atk
      pdef = 0 - old_item.pdef
      mdef = 0 - old_item.mdef
      str_plus = 0 - old_item.str_plus
      dex_plus = 0 - old_item.dex_plus
      agi_plus = 0 - old_item.agi_plus
      int_plus = 0 - old_item.int_plus
      # plus_state_set
      # minus_state_set
    end
    if atk != 0
      text1 = "¡#{actor_name}'s #{$data_system.words.atk}"
      text2 = atk > 0 ? " increased!" : " decreased!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if pdef != 0
      text1 = "¡#{actor_name}'s #{$data_system.words.pdef}"
      text2 = pdef > 0 ? " increased!" : " decreased!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if mdef != 0
      text1 = "¡#{actor_name}'s #{$data_system.words.mdef}"
      text2 = mdef > 0 ? " increased!" : " decreased!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if str_plus != 0
      text1 = "¡#{actor_name}'s #{$data_system.words.str}"
      text2 = str_plus > 0 ? " increased!" : " decreased!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if dex_plus != 0
      text1 = "¡#{actor_name}'s #{$data_system.words.dex}"
      text2 = dex_plus > 0 ? " increased!" : " decreased!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if agi_plus != 0
      text1 = "¡#{actor_name}'s #{$data_system.words.agi}"
      text2 = agi_plus > 0 ? " increased!" : " decreased!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if int_plus != 0
      text1 = "¡#{actor_name}'s #{$data_system.words.int}"
      text2 = int_plus > 0 ? " increased!" : " decreased!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
  end

  def check_armor_help(old_item, new_item)
    @sphelp_window.clear
    actor_name = $game_party.actors[@actors_window.index].name
    if old_item != nil and new_item != nil
      # auto_state_id
      pdef = new_item.pdef - old_item.pdef
      mdef = new_item.mdef - old_item.mdef
      str_plus = new_item.str_plus - old_item.str_plus
      dex_plus = new_item.dex_plus - old_item.dex_plus
      agi_plus = new_item.agi_plus - old_item.agi_plus
      int_plus = new_item.int_plus - old_item.int_plus
      # guard_state_set
    elsif old_item == nil
      # auto_state_id
      pdef = new_item.pdef
      mdef = new_item.mdef
      str_plus = new_item.str_plus
      dex_plus = new_item.dex_plus
      agi_plus = new_item.agi_plus
      int_plus = new_item.int_plus
      # guard_state_set
    else
      # auto_state_id
      pdef = 0 - old_item.pdef
      mdef = 0 - old_item.mdef
      str_plus = 0 - old_item.str_plus
      dex_plus = 0 - old_item.dex_plus
      agi_plus = 0 - old_item.agi_plus
      int_plus = 0 - old_item.int_plus
      # guard_state_set
    end
    if pdef != 0
      text1 = "¡#{actor_name}'s #{$data_system.words.pdef}"
      text2 = pdef > 0 ? " increased!" : " decreased!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if mdef != 0
      text1 = "¡#{actor_name}'s #{$data_system.words.mdef}"
      text2 = mdef > 0 ? " increased!" : " decreased!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if str_plus != 0
      text1 = "¡#{actor_name}'s #{$data_system.words.str}"
      text2 = str_plus > 0 ? " increased!" : " decreased!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if dex_plus != 0
      text1 = "¡#{actor_name}'s #{$data_system.words.dex}"
      text2 = dex_plus > 0 ? " increased!" : " decreased!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if agi_plus != 0
      text1 = "¡#{actor_name}'s #{$data_system.words.agi}"
      text2 = agi_plus > 0 ? " increased!" : " decreased!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
    if int_plus != 0
      text1 = "¡#{actor_name}'s #{$data_system.words.int}"
      text2 = int_plus > 0 ? " increased!" : " decreased!"
      @sphelp_window.draw_next_line(text1 + text2)
    end
  end

  def update_end
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.decision_se)
      @end_window.active = false
      @end_window.visible = false
      @command_window.active = true
      return
    end
    if Input.trigger?(Input::C)
      case @end_window.index
      when 0  # to title
        $game_system.se_play($data_system.decision_se)
        Audio.bgm_fade(800)
        Audio.bgs_fade(800)
        Audio.me_fade(800)
        $scene = Scene_Title.new
      when 1  # shutdown
        $game_system.se_play($data_system.decision_se)
        Audio.bgm_fade(800)
        Audio.bgs_fade(800)
        Audio.me_fade(800)
        $scene = nil
      when 2  # quit
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Menu.new(5)
        return
      end
      return
    end
  end
end



Instructions

Read the script instructions and change the globals in module OLDSCHOOL to modelate your script.
Supports 4 actors as the default system.
The available commands are "Item", "Skill", "Equip", "Status", "Save" and "End Game".
If you want to change the names of these, you will have to do it through the entire script.
You can add more on the array but if you don't change the script they will obviously do nothing.



Compatibility

Compatible with Scene_Status and Scene_File edits.
It only uses one alias in Game_System::initialize



Author's Notes

No credits needed.
21
RMXP Script Database / [XP] Window Extra Functions
July 06, 2014, 11:16:04 am
Window Extra Functions
Authors: Wecoc
Version: 1.0
Type: Window AddOn
Key Term: Misc Add-on



Introduction

RPG::Sprite functions on Window_Base, so basically you can use windows as battlers
Inspired on the Wolf RPG Editor window options

On this video you can see some of the functionalities this script takes:
https://www.youtube.com/watch?v=Md7yT7fl86c

You can recreate the blink effect on 0:25, damage effects on 2:02 or the paralysis color effect on 4:10



Features


  • Use Window as a RPG::Sprite (see Instructions)




Screenshots

I took none because it's unnecessary for this type of script.


Script

Insert over main:
Spoiler: ShowHide

#==============================================================================
# ** Window Extra Functions 1.0
#------------------------------------------------------------------------------
#  Author: Wecoc (no credits needed)
#------------------------------------------------------------------------------
#  RPG::Sprite functions on Window_Base
#  Inspired on the Wolf RPG Editor window options
#  https://www.youtube.com/watch?v=Md7yT7fl86c
#------------------------------------------------------------------------------
#  self.flash(color, duration)
#  self.color.set(red, green, blue, [alpha])
#  self.displace(x, y, duration)
#  self.whiten([color])
#  self.appear
#  self.escape
#  self.collapse
#  self.blink_on
#  self.blink_off
#  self.blink?
#  self.effect?
#==============================================================================

class Window_Base < Window

  attr_accessor :viewport
  alias viewport_settings_ini initialize unless $@

  def initialize(x, y, width, height)
    viewport_settings_ini(x, y, width, height)
    refresh_viewport
    @_whiten_duration = 0
    @_appear_duration = 0
    @_escape_duration = 0
    @_collapse_duration = 0
    @_displace_duration = 0
    @_blink = false
    @_x = self.x
    @_y = self.y
  end
   
  def refresh_viewport
    self.viewport = Viewport.new(self.x, self.y, self.width, self.height)
    self.viewport.z = self.z + 1
  end

  def x=(value)
    super(value)
    refresh_viewport
  end

  def y=(value)
    super(value)
    refresh_viewport
  end

  def width=(value)
    super(value)
    refresh_viewport
  end

  def height=(value)
    super(value)
    refresh_viewport
  end

  def visible=(value)
    super(value)
    self.viewport.visible = value
  end

  def flash(color,duration)
    self.viewport.flash(color,duration)
  end

  def color
    return self.viewport.color
  end

  def displace(x, y, duration)
    @_x = x
    @_y = y
    @_displace_duration = duration
  end

  def whiten(color=Color.new(255, 255, 255))
    self.color.set(color.red, color.green, color.blue, 128)
    self.opacity = 255
    @_whiten_duration = 16
    @_appear_duration = 0
    @_escape_duration = 0
    @_collapse_duration = 0
  end

  def appear
    self.color.set(0, 0, 0, 0)
    self.opacity = 0
    @_appear_duration = 16
    @_whiten_duration = 0
    @_escape_duration = 0
    @_collapse_duration = 0
  end

  def escape
    self.color.set(0, 0, 0, 0)
    self.opacity = 255
    @_escape_duration = 32
    @_whiten_duration = 0
    @_appear_duration = 0
    @_collapse_duration = 0
  end

  def collapse
    self.flash(Color.new(255, 64, 64, 255), 48)
    @_collapse_duration = 48
  end

  def blink_on
    unless @_blink
      @_blink = true
      @_blink_count = 0
    end
    return true
  end

  def blink_off
    if @_blink
      @_blink = false
      self.color.set(0, 0, 0, 0)
    end
    return true
  end

  def blink?
    @_blink
  end

  def effect?
    @_whiten_duration > 0 or
    @_appear_duration > 0 or
    @_escape_duration > 0 or
    @_collapse_duration > 0
  end

  def update
    super
    self.viewport.update
    if $game_system.windowskin_name != @windowskin_name
      @windowskin_name = $game_system.windowskin_name
      self.windowskin = RPG::Cache.windowskin(@windowskin_name)
    end
    if @_whiten_duration > 0
      @_whiten_duration -= 1
      self.color.alpha = 128 - (16 - @_whiten_duration) * 10
    end
    if @_appear_duration > 0
      @_appear_duration -= 1
      self.opacity = (16 - @_appear_duration) * 16
    end
    if @_escape_duration > 0
      @_escape_duration -= 1
      self.opacity = 256 - (32 - @_escape_duration) * 10
    end
    if @_collapse_duration > 0
      @_collapse_duration -= 1
      self.opacity = 256 - (32 - @_collapse_duration) * 10
    end
    if @_displace_duration > 1
      @_displace_duration -= 1
      self.x += (@_x - self.x) / @_displace_duration
      self.y += (@_y - self.y) / @_displace_duration
    end
    if @_blink
      @_blink_count = (@_blink_count + 1) % 32
      if @_blink_count < 16
        alpha = (16 - @_blink_count) * 6
      else
        alpha = (@_blink_count - 16) * 6
      end
      self.color.set(255, 255, 255, alpha)
    end
    return true
  end
end



Instructions

Spoiler: ShowHide
flash(color, duration)

Makes a flash effect on the window

color.set(red, green, blue, [alpha])

Changes the window color

displace(x, y, duration)

Moves the window to the specified point

whiten

Applies a white flash similar to the RPG::Sprite

whiten(color)

Applies a flash with the specified color on the window

appear

The window appears smoothly

escape

The window disappears smoothly

collapse

Applies a red flash similar to the RPG::Sprite

blink_on

The window starts blinking

blink_off

The window stops blinking

blink?

Checks if window is blinking

effect?

Checks if some effect is activated on the window




Author's Notes

No credits needed, so enjoy it for free!
22
RMXP Script Database / [XP] Scene_File modified
July 06, 2014, 10:53:12 am
Scene_File modified
Authors: Wecoc
Version: 1.0
Type: Load / Save System
Key Term: Title / Save / Load / GameOver Add-on



Introduction

Simple modification of Scene_File which shows file windows in a different way so you can use more, and display more information in each one.


Features


  • Easy configurable

  • Displays the chapter, time, gold, map name...




Screenshots

Spoiler: ShowHide




Script

Put over main the entire code:

Spoiler: ShowHide

#==============================================================================
# ** Scene_File modified
#------------------------------------------------------------------------------
#  Author: Wecoc
#==============================================================================

class Window_SaveFile < Window_Base
  attr_reader   :filename
 
  def initialize(file_index, filename)
    super(160, 64, 480, 480 - 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.rxdata"
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp         = file.mtime
      @characters         = Marshal.load(file)
      @frame_count        = Marshal.load(file)
      @game_system        = Marshal.load(file)
      @game_switches      = Marshal.load(file)
      @game_variables     = Marshal.load(file)
      @game_self_switches = Marshal.load(file)
      @game_screen        = Marshal.load(file)
      @game_actors        = Marshal.load(file)
      @game_party         = Marshal.load(file)
      @game_troop         = Marshal.load(file)
      @game_map           = Marshal.load(file)
      @game_player        = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
  end

  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    if @file_exist
      for i in 0...@characters.size
        bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
        cw = bitmap.rect.width / 4
        ch = bitmap.rect.height / 4
        src_rect = Rect.new(0, 0, cw, ch)
        x = 160 - @characters.size * 32 + i * 100 - cw / 2
        # Character
        self.contents.blt(x + 24, 72 - ch, bitmap, src_rect)
        # Name
        draw_actor_name(@game_party.actors[i], x, 76)
        # Level
        draw_actor_level(@game_party.actors[i], x, 100)
        # State
        draw_actor_state(@game_party.actors[i], x, 124)
      end
     
      # Playing time
      hour = @total_sec / 60 / 60
      min = @total_sec / 60 % 60
      sec = @total_sec % 60
      time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
      self.contents.font.color = normal_color
      self.contents.draw_text(128, 176, 300, 32, time_string, 2)
     
      # Date when saving
      self.contents.font.color = normal_color
      time_string = @time_stamp.strftime("%d/%m/%Y %H:%M")
      self.contents.draw_text(128, 200, 300, 32, time_string, 2)
     
      # Gold
      cx = contents.text_size($data_system.words.gold).width
      self.contents.font.color = normal_color
      self.contents.draw_text(308, 224, 120-cx-2, 32, @game_party.gold.to_s, 2)
      self.contents.font.color = system_color
      self.contents.draw_text(428-cx, 224, cx, 32, $data_system.words.gold, 2)
     
      # Chapter (variable 1)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 176, 120, 32, "Chapter")
      self.contents.font.color = normal_color
      self.contents.draw_text(100, 176, 48, 32, @game_variables[1].to_s)
     
      # Map name
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 200, 320, 32, @game_map.map_name)
     
      # Map description
      self.contents.font.color = system_color
      self.contents.draw_text(4, 272, 320, 32, "Map description")
      self.contents.font.italic = true
      self.contents.font.color = normal_color
      self.contents.font.size -= 2
      for i in 0...@game_map.map_def.size
        self.contents.draw_text(4, 300 + 24*i, 480, 32, @game_map.map_def[i])
      end
      self.contents.font.italic = false
      self.contents.font.size += 2
    end
  end
end

class Game_Map
 
attr_reader   :map_id 
  def map_name
    @mpn = load_data("Data/MapInfos.rxdata")
   return @mpn[@map_id].name
end

  def map_def
    case @map_id
    when 1
      # Example
      return ["A map with anything on it, just grass and the",
              "f*king player alone.",
              "This is just an example"]
    else
      return [""]
    end
  end
end

class Scene_File
 
  FILE_SIZE = 12   # File Size
 
  def main
    @help_window = Window_Help.new
    @help_window.set_text(@help_text)
   
    command_text = "File "
    command_array = []
    for i in 0...FILE_SIZE
      command_array.push("#{command_text + (i+1).to_s}")
    end
    @command_window = Window_Command.new(160, command_array)
    @command_window.y = 64
    @command_window.height = 480 - 64
    @file_index = $game_temp.last_file_index
    @command_window.index = @file_index
   
    @savefile_windows = []
    for i in 0...FILE_SIZE
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
      @savefile_windows[i].visible = false
    end
   
    @savefile_windows[@file_index].visible = true
   
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    @command_window.dispose
    for i in @savefile_windows
      i.dispose
    end
  end

  def update
    @help_window.update
    @command_window.update
    for i in 0...@savefile_windows.size
      @savefile_windows[i].visible = (i == @file_index)
    end
   
    if Input.trigger?(Input::C)
      on_decision(make_filename(@file_index))
      $game_temp.last_file_index = @file_index
      return
    end

    if Input.trigger?(Input::B)
      on_cancel
      return
    end

    if Input.repeat?(Input::DOWN)
      if Input.trigger?(Input::DOWN) or @file_index < (FILE_SIZE-1)
        $game_system.se_play($data_system.cursor_se)
        @file_index = (@file_index + 1) % FILE_SIZE
        return
      end
    end
    if Input.repeat?(Input::UP)
      if Input.trigger?(Input::UP) or @file_index > 0
        $game_system.se_play($data_system.cursor_se)
        @file_index = (@file_index + (FILE_SIZE-1)) % FILE_SIZE
        return
      end
    end
  end
end



Instructions

You can change the max number of files on this line:

FILE_SIZE = 12
23
RMXP Script Database / [XP][VX] Unlockables
February 06, 2014, 11:01:23 am
Unlockables
Authors: Wecoc
Version: 1.0
Type: Game Utility
Key Term: Game Utility



Introduction

With this script you will be able to add an unlockables in the game.
Imagine for example the player arrived to the last save point on your game (ie practically we can say that the player has spent the entire game at least once), then you can do that if the player re-start the game again he will have some options he had not before.

That's what this script does.


Features


  • Use multiple unlockables (as many as you want)

  • "New Game" versus "New Game +" (read instructions)




Screenshots

Not for this type of script.


Demo

No demo available. You can ask for one.


Script

XP version:
Spoiler: ShowHide

#==============================================================================
# ** [XP] Unlockables v 1.0
# by: Wecoc
#==============================================================================

module Wep
 DES_SW = [1] # switch ID
 NEW_PLUS = true # New Game +
end

class Window_Command < Window_Selectable
 def size
   return @item_max
 end
end

class Scene_Title
 include Wep
 def main
   if $BTEST
     battle_test
     return
   end
   $data_actors        = load_data("Data/Actors.rxdata")
   $data_classes       = load_data("Data/Classes.rxdata")
   $data_skills        = load_data("Data/Skills.rxdata")
   $data_items         = load_data("Data/Items.rxdata")
   $data_weapons       = load_data("Data/Weapons.rxdata")
   $data_armors        = load_data("Data/Armors.rxdata")
   $data_enemies       = load_data("Data/Enemies.rxdata")
   $data_troops        = load_data("Data/Troops.rxdata")
   $data_states        = load_data("Data/States.rxdata")
   $data_animations    = load_data("Data/Animations.rxdata")
   $data_tilesets      = load_data("Data/Tilesets.rxdata")
   $data_common_events = load_data("Data/CommonEvents.rxdata")
   $data_system        = load_data("Data/System.rxdata")
   $game_system = Game_System.new
   @sprite = Sprite.new
   @sprite.bitmap = RPG::Cache.title($data_system.title_name)
   draw_commands
   @continue_enabled = false
   for i in 0..3
     if FileTest.exist?("Save#{i+1}.rxdata")
       @continue_enabled = true
     end
   end
   if @continue_enabled
     @command_window.index = @command_window.size - 2
   else
     @command_window.disable_item(@command_window.size - 2)
   end
   $game_system.bgm_play($data_system.title_bgm)
   Audio.me_stop
   Audio.bgs_stop
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     break if $scene != self
   end
   Graphics.freeze
   @command_window.dispose
   @sprite.bitmap.dispose
   @sprite.dispose
 end
 
 def draw_commands
   s1 = "New Game"
   s2 = "New Game +"
   s3 = "Load"
   s4 = "Exit"
   if NEW_PLUS
     result = []
     for i in 0...DES_SW.size
       result.push(false)
     end
     for i in 0..3
       if FileTest.exist?("Save#{i+1}.rxdata")
         file = File.open("Save#{i+1}.rxdata", "rb")
         characters = Marshal.load(file)
         Graphics.frame_count = Marshal.load(file)
         $game_system = Marshal.load(file)
         $game_switches = Marshal.load(file)
         for i in 0...DES_SW.size
           result[i] = true if $game_switches[DES_SW[i]] == true
         end
         file.close
       end
     end
     result.delete(false)
     array = result.size > 0 ? [s1, s2, s3, s4] : [s1, s3, s4]
   else
     array = [s1, s3, s4]      
   end
   @command_window = Window_Command.new(192, array)
   @command_window.back_opacity = 160
   @command_window.x = 320 - @command_window.width / 2
   @command_window.y = 288
 end
 
 def update
   @command_window.update
   if Input.trigger?(Input::C)
     if @command_window.size == 4
       case @command_window.index
       when 0  # New game
         command_new_game
       when 1  # New game plus
         command_new_game_plus
       when 2  # Continue
         command_continue
       when 3  # Shutdown
         command_shutdown
       end
     else
       case @command_window.index
       when 0  # New game plus
         command_new_game_plus
       when 1  # Continue
         command_continue
       when 2  # Shutdown
         command_shutdown
       end
     end
   end
 end

 def command_new_game_plus
   if DES_SW == nil or DES_SW.size == 0
     command_new_game
     return
   end
   result = []
   for i in 0...DES_SW.size
     result.push(false)
   end
   for i in 0..3
     if FileTest.exist?("Save#{i+1}.rxdata")
       file = File.open("Save#{i+1}.rxdata", "rb")
       characters = Marshal.load(file)
       Graphics.frame_count = Marshal.load(file)
       $game_system = Marshal.load(file)
       $game_switches = Marshal.load(file)
       for i in 0...DES_SW.size
         result[i] = true if $game_switches[DES_SW[i]] == true
       end
       file.close
     end
   end
   command_new_game
   for i in 0...result.size
     $game_switches[DES_SW[i]] = true if result[i] == true
   end
 end
end


VX version:
Spoiler: ShowHide

#==============================================================================
# ** [VX] Unlockables v 1.0
# by: Wecoc
#==============================================================================

module Wep
 DES_SW = [1] # switch ID
 NEW_PLUS = true # New Game +
end

class Window_Command < Window_Selectable
 def size
   return @item_max
 end
end

class Scene_Title
 include Wep
 def create_command_window
   s1 = Vocab::new_game
   s2 = Vocab::new_game + " +"
   s3 = Vocab::continue
   s4 = Vocab::shutdown
   if NEW_PLUS
     result = []
     for i in 0...DES_SW.size
       result.push(false)
     end
     for i in 0..3
       if FileTest.exist?("Save#{i+1}.rvdata") and (Wep::DES_SW).size > 0
         file = File.open("Save#{i+1}.rvdata", "rb")
         characters          = Marshal.load(file)
         Graphics.frame_count = Marshal.load(file)
         @last_bgm            = Marshal.load(file)
         @last_bgs            = Marshal.load(file)
         $game_system        = Marshal.load(file)
         $game_message        = Marshal.load(file)
         $game_switches      = Marshal.load(file)
         for i in 0...DES_SW.size
           result[i] = true if $game_switches[DES_SW[i]] == true
         end
         file.close
       end
     end
     result.delete(false)
     array = result.size > 0 ? [s1, s2, s3, s4] : [s1, s3, s4]
   else
     array = [s1, s3, s4]  
   end
   @command_window = Window_Command.new(192, array)
   @command_window.back_opacity = 160
   @command_window.x = (544 - @command_window.width) / 2
   @command_window.y = @command_window.size == 3 ? 288 : 262
   if @continue_enabled
     @command_window.index = @command_window.size - 2
   else
     @command_window.draw_item(@command_window.size - 2, false)
   end
   @command_window.openness = 0
   @command_window.open
 end

 def update
   @command_window.update
   if Input.trigger?(Input::C)
     if @command_window.size == 4
       case @command_window.index
       when 0  # New game
         command_new_game
       when 1  # New game plus
         command_new_game_plus
       when 2  # Continue
         command_continue
       when 3  # Shutdown
         command_shutdown
       end
     else
       case @command_window.index
       when 0  # New game plus
         command_new_game_plus
       when 1  # Continue
         command_continue
       when 2  # Shutdown
         command_shutdown
       end
     end
   end
 end

 def command_new_game_plus
   if DES_SW == nil or DES_SW.size == 0
     command_new_game
     return
   end
   result = []
   for i in 0...DES_SW.size
     result.push(false)
   end
   for i in 0..3
     if FileTest.exist?("Save#{i+1}.rvdata") and (Wep::DES_SW).size > 0
       file = File.open("Save#{i+1}.rvdata", "rb")
       characters          = Marshal.load(file)
       Graphics.frame_count = Marshal.load(file)
       @last_bgm            = Marshal.load(file)
       @last_bgs            = Marshal.load(file)
       $game_system        = Marshal.load(file)
       $game_message        = Marshal.load(file)
       $game_switches      = Marshal.load(file)
       for i in 0...DES_SW.size
         result[i] = true if $game_switches[DES_SW[i]] == true
       end
       file.close
     end
   end
   command_new_game
   for i in 0...result.size
     $game_switches[DES_SW[i]] = true if result[i] == true
   end
 end
end



Instructions

To use it, at that point where the unlockable has to be activated, you have to activate a game switch. Then in the first line of this script you put the ID switch, where it says DES_SW = [1] (so changing the 1 for the ID). You can use more than one, por example DES_SW = [1, 2] for multiple unlockables, the mechanism is the same.

As long as that file of the completed game exists, the new games will contain automatically that switch/es already activated, so after that the rest is simple.

The script contains a global called NEW_PLUS, you can see it in the very start of the code. When activated, on the screen will appear a new command "New Game +", so you can start the game as always without the unlock features OR with the unlockables using the new command. When deactivated, the default "New Game" will gain the new feature.


Compatibility

Probably you will need to do some changes if you use a non-default title screen.


Credits and Thanks


  • Wecoc




Author's Notes

I know that Moonpearl did a very similar script some time ago called "Moonpearl's New Game Plus", the differences are which I said in Features; DES_SW is an array and you can deactivate the New Game + command.
24
Wecoc Database Eval Script 1.0
Authors: Wecoc
Version: 1.0
Type: Database Feature
Key Term: Misc Add-on



Introduction

This script allows you to insert eval (script calls) in database name boxes. There are some examples on the script, as well as where you can use it (basically, in all the non-numeric holes which database lets you write crap). Some boxes have a very limited space to write, so I added the option to use Shortcuts and to create your own easily. You can use those in every script call.



Features


  • Use both eval and default names

  • Set your own shortcuts




Screenshots

I think it makes no sense for this type of script.


Demo

No demo.


Script

XP version:
Spoiler: ShowHide

#==============================================================================
# ** [XP] Wecoc Database Eval Script 1.0
#==============================================================================

# ------------- INTRODUCTION --------------------------------------------------

# This script allows to use eval in database string inputs.
# You can name an item as always, but with this you have several more options.

# --------------- EXAMPLES ----------------------------------------------------

#   Potion
#   $game_variables[1]
#   "Potion" + var[1]
#   "Radar: #{map.to_s}"
#   "Poison, rating #{self.rating}"
#   act[0].name + "'s Shield"
#   map == 1 ? "Poison" : "Toxic"

# ------------- WHERE TO USE --------------------------------------------------

# Database --> Actors   --> Name (This makes no sense)
# Database --> Classes  --> Name
# Database --> Skills   --> Name + Description
# Database --> Items    --> Name + Description
# Database --> Weapons  --> Name + Description
# Database --> Armors   --> Name + Description
# Database --> Enemies  --> Name
# Database --> Troops   --> Name
# Database --> States   --> Name
# Database --> Animations-> Name (This makes no sense)
# Database --> Tilesets --> Name (This makes no sense)
# Database --> C. Events -> Name (This makes no sense)
# Database --> System   --> Atributes + Words (Gold, HP ...)

# --------------- CREDITS -----------------------------------------------------

# Author: Wecoc

#==============================================================================


module Wecoc_Eval
 def check_eval(n)
   $testing = true
   eval = get_eval(n)
   $testing = false
   if eval == "Exception"
     return n
   else
     return eval(n).to_s
   end
 end
 
 def get_eval(n)
   return begin
     eval(n).to_s
   rescue Exception
     "Exception"
   end
 end
 
 # Shortcuts [ Add as many as you want ]
 
 def var
   return $game_variables
 end
 
 def stch
   return $game_switches
 end
 
 def act
   return $game_party.actors
 end
 
 def map
   return $game_map.map_id
 end
end

module RPG
 class Actor
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end
 
 class Animation
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end
 
 class Armor
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
   def description
     return check_eval(@description)
   end    
 end

 class Class
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end
 
 class CommonEvent
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end
 
 class Enemy
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end
 
 class Event
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end

 class Item
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
   def description
     return check_eval(@description)
   end    
 end
 
 class MapInfo
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end
 
 class Skill
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
   def description
     return check_eval(@description)
   end    
 end
 
 class State
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end
 
 class System
   include Wecoc_Eval
   def elements
     array = [nil]
     for i in 1...@elements.size
       array.push(check_eval(@elements[i]))
     end
     return array
   end
   
   class Words
     include Wecoc_Eval
     def gold
       return check_eval(@gold)
     end
     def hp
       return check_eval(@hp)
     end
     def sp
       return check_eval(@sp)
     end
     def str
       return check_eval(@str)
     end
     def dex
       return check_eval(@dex)
     end
     def agi
       return check_eval(@agi)
     end
     def int
       return check_eval(@int)
     end
     def atk
       return check_eval(@atk)
     end
     def pdef
       return check_eval(@pdef)
     end
     def mdef
       return check_eval(@mdef)
     end
     def weapon
       return check_eval(@weapon)
     end
     def armor1
       return check_eval(@armor1)
     end
     def armor2
       return check_eval(@armor2)
     end
     def armor3
       return check_eval(@armor3)
     end
     def armor4
       return check_eval(@armor4)
     end
     def attack
       return check_eval(@attack)
     end
     def skill
       return check_eval(@skill)
     end
     def guard
       return check_eval(@guard)
     end
     def item
       return check_eval(@item)
     end
     def equip
       return check_eval(@equip)
     end
   end
 end
 
 class Tileset
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end
 
 class Troop
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end
 
 class Weapon
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
   def description
     return check_eval(@description)
   end    
 end
end

class Interpreter
 include Wecoc_Eval
end

class SystemStackError < Exception
 alias testing_exception initialize unless $@
 def initialize
   return if $testing
   testing_exception
 end
end


VX version:
Spoiler: ShowHide

#==============================================================================
# ** [VX] Wecoc Database Eval Script 1.0
#==============================================================================

# ------------- INTRODUCTION --------------------------------------------------

# This script allows to use eval in database string inputs.
# You can name an item as always, but with this you have several more options.

# --------------- EXAMPLES ----------------------------------------------------

#  Potion
#  $game_variables[1]
#  "Potion" + var[1]
#  "Radar: #{map.to_s}"
#  "Poison, rating #{self.rating}"
#  act[0].name + "'s Shield"
#  map == 1 ? "Poison" : "Toxic"

# ------------- WHERE TO USE --------------------------------------------------

# Database --> Actors  --> Name (This makes no sense)
# Database --> Classes  --> Name + Command Name
# Database --> Skills  --> Name + Description + Message 1 + Message 2
# Database --> Items    --> Name + Description
# Database --> Weapons  --> Name + Description
# Database --> Armors  --> Name + Description
# Database --> Enemies  --> Name
# Database --> Troops  --> Name
# Database --> States  --> Name + Message 1 + Message 2 + Message 3 + Message 4
# Database --> Animations-> Name (This makes no sense)
# Database --> C. Events -> Name (This makes no sense)
# Database --> System  --> Atributes
# Database --> Terms

# --------------- CREDITS -----------------------------------------------------

# Author: Wecoc

#==============================================================================


module Wecoc_Eval
 def check_eval(n)
   $testing = true
   eval = get_eval(n)
   $testing = false
   if eval == "Exception"
     return n
   else
     return eval(n).to_s
   end
 end

 def get_eval(n)
   return begin
     eval(n).to_s
   rescue Exception
     "Exception"
   end
 end

 # Shortcuts [ Add as many as you want ]

 def var
   return $game_variables
 end

 def stch
   return $game_switches
 end

 def act
   return $game_party.actors
 end

 def map
   return $game_map.map_id
 end
end

module RPG
 class Actor
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end

 class Animation
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end

 class Area
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end

 class BaseItem
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
   def description
     return check_eval(@description)
   end  
 end

 class Class
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
   def skill_name
     return check_eval(@skill_name)
   end
 end

 class CommonEvent
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end

 class Enemy
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end

 class Event
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end

 class MapInfo
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end

 class Skill
   include Wecoc_Eval
   def message1
     return check_eval(@message1)
   end
   def message2
     return check_eval(@message2)
   end  
 end

 class State
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
   def message1
     return check_eval(@message1)
   end
   def message2
     return check_eval(@message2)
   end  
   def message3
     return check_eval(@message3)
   end
   def message4
     return check_eval(@message4)
   end  
 end

 class System
   include Wecoc_Eval
   def elements
     array = [nil]
     for i in 1...@elements.size
       array.push(check_eval(@elements[i]))
     end
     return array
   end
 
   class Terms
     include Wecoc_Eval
     def level
       return check_eval(@level)
     end
     def level_a
       return check_eval(@level_a)
     end
     def hp
       return check_eval(@hp)
     end
     def hp_a
       return check_eval(@hp_a)
     end
     def mp
       return check_eval(@mp)
     end
     def mp_a
       return check_eval(@mp_a)
     end
     def atk
       return check_eval(@atk)
     end
     def def
       return check_eval(@def)
     end
     def spi
       return check_eval(@spi)
     end
     def agi
       return check_eval(@agi)
     end
     def weapon
       return check_eval(@weapon)
     end
     def armor1
       return check_eval(@armor1)
     end
     def armor2
       return check_eval(@armor2)
     end
     def armor3
       return check_eval(@armor3)
     end
     def armor4
       return check_eval(@armor4)
     end
     def weapon1
       return check_eval(@weapon1)
     end
     def weapon2
       return check_eval(@weapon2)
     end
     def attack
       return check_eval(@attack)
     end
     def skill
       return check_eval(@skill)
     end
     def guard
       return check_eval(@guard)
     end
     def item
       return check_eval(@item)
     end
     def equip
       return check_eval(@equip)
     end
     def status
       return check_eval(@status)
     end
     def save
       return check_eval(@save)
     end
     def game_end
       return check_eval(@game_end)
     end
     def fight
       return check_eval(@fight)
     end
     def escape
       return check_eval(@escape)
     end
     def new_game
       return check_eval(@new_game)
     end
     def continue
       return check_eval(@continue)
     end
     def shutdown
       return check_eval(@shutdown)
     end
     def to_title
       return check_eval(@to_title)
     end
     def cancel
       return check_eval(@cancel)
     end
     def gold
       return check_eval(@gold)
     end
   end
 end

 class Troop
   include Wecoc_Eval
   def name
     return check_eval(@name)
   end
 end
end

class Game_Interpreter
 include Wecoc_Eval
end

class SystemStackError < Exception
 alias testing_exception initialize unless $@
 def initialize
   return if $testing
   testing_exception
 end
end




Instructions

It's so simple, just use the boxes as if they were script calls.
You can use Potion as a name, but also $game_party.actors.select{|x| x.name.size < 5}[0].name + " Shield" rescue "Hero Shield"


Compatibility

Not incompatibility issues known.


Credits and Thanks


  • Wecoc





Author's Notes

Don't hesitate to ask any questions about the code.
Remember variables can have any value, also text, for example $game_variables[1] = "Mana Potion"
25
Well, I was working on some new resources for everyone... Also I will update as soon as I make more, so consider it's because Christmas is coming.

First of all, I did sort of a mapping tutorial and I released these edits:

Mountain01_Wecoc_Edit
Waterfall01
Waterfall02

Result: ShowHide



But the most important here is my platform "Do it yourself", which helped me a bit to do some of them.
I did a "Builtset" from the RTP which will allow you to make your own resources easily.

RTP_Buildset

It consists of a copy-paste resource set of all the most important textures included on RTP.

Doing a template and putting on it the textures it requires, allows to make in a simple way a new object.



I also did this template for you

RTP_Template

Example + Recolor:


You can post what you get with the builtset if you want to share it.
Sorry, but I have to say I will no accept requests except if they are easy to do. I'm a really busy man.

I will post some of my resourses soon. I will post also Eron's resources, he is using the builtset too and is an excellent graphist.
He gave me permission to post their stuff here, I shall specify who did each resource.
No credits needed in any case, all in this topic is free for use.
26
Resource Database / [XP] Pack de AddOns RTP
October 06, 2013, 06:45:14 am
PACK DE ADDONS RTP

This package contains a lot of RTP Addons (generally new tilesets or tiles to include on yours).
Most are recent and wew made exclusively for the pack.

Examples:

Spoiler: ShowHide





Credits:

- Duffledest
- Eron
- J&L (JoKer & Laguna)
- Pokepik
- Wecoc

License:

The 'Pack de AddOns RTP XP' has been assembled by different members of the RPG maker hispanic community,
and specifically represents the 'Mundo Maker' community.

Anyone can distribute the pack through the communities.
Anyone can use the resources of the pack giving credits to the author of the resource, according to its folder name.
If the resource is not inside of any folder, it doesn't require credits except Tumbavilla which has the authors names inside.
The pack is in its final version.

Download:

Pack de AddOns RTP 2.0.zip
27

How to disable Fullscreen Alt+Enter function





Orochii Zouveleki told me this trick some time ago and it's useful so I wanted to post it.
When you are on game you can switch between fullscreen mode or window mode pressing Alt+Enter.

I will show you how to have a better control on this function and also how to deactivate it.




Step 1:
Download Resource Hacker. It's the same program used on this tutorial to change the icon on your game: Changing Your Game Icon


Step 2:
Start up ResHacker.exe
Go to File -> Open, then go to the directory where your game files are located.
Choose to open the the dll ; by default it's filename is RGSS102J.dll

Spoiler: ShowHide





Step 3:
Accelerators >> 102 >> 1024

Spoiler: ShowHide





Step 4:
Change this:
VK_RETURN, 40002, NOINVERT, ALT, VIRTKEY

to this:
VK_F13, 40002, NOINVERT, VIRTKEY


Spoiler: ShowHide



Now the fullscreen is not called with Alt + Enter but rather with F13.

The important thing there is that you won't be able to call it through the keyboard because there's no F13 key, but you can use it on scripts using Win32API.



Step 5:
Click 'Compile Script'



Step 6:
Go to File -> Save
A copy of the original dll will be saved also on the game's folder.



Step 7:
Close Resourse Hacker and test the game.
28
RMXP Script Database / [XP][VX] Improved Scene_Debug
September 12, 2013, 05:32:05 pm
Debug Eval
Authors: Wecoc
Version: 1.0
Type: Debug AddOn
Key Term: Game Utility



Introduction

Are you tired of the limited default Scene_Debug and you want one a little more personalized to further test your project?
Well I did one where you can write an eval and get it done :D



Features


  • Multiline eval

  • Easy configurable shortcuts

  • Write debug to call the default debug scene

  • Full Keyboard (Beware UK-QWERTY will cause problems!)




Screenshots

Spoiler: ShowHide





Script

Put the script over main. To call it use F9 as always only in debug mode. It's that simple :)
Spoiler: ShowHide

#==============================================================================
# [XP/VX] Debug Eval (Scene_Debug Edit) v1.0
#------------------------------------------------------------------------------
# By: Wecoc
#------------------------------------------------------------------------------
# Please do not judge me for this, I'm really not that crazy.
#==============================================================================


#==============================================================================
# ** Modules configuration
#==============================================================================

# EVAL_HELP ) Shortcuts [ Add as many as you want ]

module EVAL_HELP
 def var
   return $game_variables
 end
 
 def stch
   return $game_switches
 end
 
 def debug
   $scene = Scene_Debug.new
 end
 
 def help
   print EVAL_HELP.instance_methods.join("\n")
 end
end

# EVAL_FEATURES ) VX Compatibility

$debug_eval_vx = defined?(Game_Interpreter)

module EVAL_FEATURES # VX compatibility
 WIDTH =  $debug_eval_vx ? 544 : 640
 HEIGHT = $debug_eval_vx ? 416 : 480
 
 def play_cursor
   if $debug_eval_vx
     Sound.play_cursor
   else
     $game_system.se_play($data_system.cursor_se)
   end
 end
 def play_decision
   if $debug_eval_vx
     Sound.play_decision
   else
     $game_system.se_play($data_system.decision_se)
   end
 end
 def play_cancel
   if $debug_eval_vx
     Sound.play_cancel
   else
     $game_system.se_play($data_system.cancel_se)
   end
 end
 def play_buzzer
   if $debug_eval_vx
     Sound.play_buzzer
   else
     $game_system.se_play($data_system.buzzer_se)
   end
 end
end

# WecocInput ) Keyboard Features

module WecocInput
 Teclas = {
 # index => [ key, mayúsculas, minúsculas, shift, AltGr]
 1 =>   [0x01, "", ""], # Click L
 2 =>   [0x02, "", ""], # Click R
 3 =>   [0x04, "", ""], # Click M
 4 =>   [0x08, "", ""], # Back
 5 =>   [0x09, " ", " "], # Tab
 6 =>   [0x0C, "", ""], # Bloq Numpad 5
 7 =>   [0x0D, "", ""], # Enter
 8 =>   [0x11, "", ""], # Ctrl (0xA2 + 0x11)
 9 =>   [0x12, "", ""], # Alt
 10 =>  [0x13, "", ""], # Pause
 11 =>  [0x14, "", ""], # Cap Lock
 12 =>  [0x1B, "", ""], # Esc
 13 =>  [0x20, " ", " "], # Backspace
 14 =>  [0x21, "", ""], # Next Page
 15 =>  [0x22, "", ""], # Prev Page
 16 =>  [0x23, "", ""], # End
 17 =>  [0x24, "", ""], # Start
 18 =>  [0x25, "", ""], # Left arrow
 19 =>  [0x26, "", ""], # Up arrow
 20 =>  [0x27, "", ""], # Right arrow
 21 =>  [0x28, "", ""], # Down arrow
 22 =>  [0x2C, "", ""], # Print Screen
 23 =>  [0x2D, "", ""], # Insert
 24 =>  [0x2E, "", ""], # Del
 25 =>  [0x30, "0", "0", "=", "="],
 26 =>  [0x31, "1", "1", "!", "|"],
 27 =>  [0x32, "2", "2", '"', "@"],
 28 =>  [0x33, "3", "3", "·", '#'],
 29 =>  [0x34, "4", "4", "$", "~"],
 30 =>  [0x35, "5", "5", "%"],
 31 =>  [0x36, "6", "6", "&", "¬"],
 32 =>  [0x37, "7", "7", "/"],
 33 =>  [0x38, "8", "8", "("],
 34 =>  [0x39, "9", "9", ")"],
 35 =>  [0x41, "A", "a", true],
 36 =>  [0x42, "B", "b", true],
 37 =>  [0x43, "C", "c", true],
 38 =>  [0x44, "D", "d", true],
 39 =>  [0x45, "E", "e", true],
 40 =>  [0x46, "F", "f", true],
 41 =>  [0x47, "G", "g", true],
 42 =>  [0x48, "H", "h", true],
 43 =>  [0x49, "I", "i", true],
 44 =>  [0x4A, "J", "j", true],
 45 =>  [0x4B, "K", "k", true],
 46 =>  [0x4C, "L", "l", true],
 47 =>  [0x4D, "M", "m", true],
 48 =>  [0x4E, "N", "n", true],
 49 =>  [0x4F, "O", "o", true],
 50 =>  [0x50, "P", "p", true],
 51 =>  [0x51, "Q", "q", true],
 52 =>  [0x52, "R", "r", true],
 53 =>  [0x53, "S", "s", true],
 54 =>  [0x54, "T", "t", true],
 55 =>  [0x55, "U", "u", true],
 56 =>  [0x56, "V", "v", true],
 57 =>  [0x57, "W", "w", true],
 58 =>  [0x58, "X", "x", true],
 59 =>  [0x59, "Y", "y", true],
 60 =>  [0x5A, "Z", "z", true],
 61 =>  [0x5B, "", ""], # Windows
 62 =>  [0x5C, "", ""], # R-Windows
 63 =>  [0x5D, "", ""], # Scroll Fix
 64 =>  [0x60, "0", "0"], # Numpad
 65 =>  [0x61, "1", "1"], # Numpad
 66 =>  [0x62, "2", "2"], # Numpad
 67 =>  [0x63, "3", "3"], # Numpad
 68 =>  [0x64, "4", "4"], # Numpad
 69 =>  [0x65, "5", "5"], # Numpad
 70 =>  [0x66, "6", "6"], # Numpad
 71 =>  [0x67, "7", "7"], # Numpad
 72 =>  [0x68, "8", "8"], # Numpad
 73 =>  [0x69, "9", "9"], # Numpad
 74 =>  [0x6A, "*", "*"], # Numpad
 75 =>  [0x6B, "+", "+"], # Numpad
 76 =>  [0x6C, "", ""],   # Numpad
 77 =>  [0x6D, "-", "-"], # Numpad
 78 =>  [0x6E, ".", "."], # Numpad
 79 =>  [0x6F, "/", "/"], # Numpad
 80 =>  [0x70, "", ""], # F1
 81 =>  [0x71, "", ""], # F2
 82 =>  [0x72, "", ""], # F3
 83 =>  [0x73, "", ""], # F4
 84 =>  [0x74, "", ""], # F5
 85 =>  [0x75, "", ""], # F6
 86 =>  [0x76, "", ""], # F7
 87 =>  [0x77, "", ""], # F8
 88 =>  [0x78, "", ""], # F9
 89 =>  [0x79, "", ""], # F10
 90 =>  [0x7A, "", ""], # F11
 91 =>  [0x7B, "", ""], # F12
 92 =>  [0x90, "", ""], # BloqNum
 93 =>  [0x91, "", ""], # BloqDespl
 94 =>  [0xA0, "", ""], # Shift
 95 =>  [0xA1, "", ""], # R-Shift
 96 =>  [0xA2, "", ""], # Ctrl (0xA2 + 0x11)
 97 =>  [0xA3, "", ""], # R-Ctrl
 98 =>  [0xA4, "", ""], # Alt
 99 =>  [0xA5, "", ""], # R-Alt
 100 => [0xBA, "`", "`", "^", "["],
 101 => [0xBB, "+", "+", "*", "]"],
 102 => [0xBC, ",", ",", ";"],
 103 => [0xBD, "-", "-","_"],
 104 => [0xBE, ".", ".", ":"],
# 105 => [0xBF, "Ç", "ç", true, "}"],
 105 => [0xBF, "}", "}", true, "}"],
# 106 => [0xC0, "Ñ", "ñ", true],
 107 => [0xDB, "'", "'", "?"],
# 108 => [0xDC, "º", "º", "ª", 92.chr], # \
 108 => [0xDC, 92.chr, 92.chr, 92.chr, 92.chr], # \
# 109 => [0xDD, "¡", "¡", "¿"],
# 110 => [0xDE, "´", "´", "¨", "{"],
 111 => [0xE2, "<", "<", ">"]
 }
 
 Keyboard_Acces = Win32API.new("user32","GetAsyncKeyState",['i'],'i')

def self.get_key(key)
   Keyboard_Acces.call(key) & 0x01 == 1
 end
end


#==============================================================================
# ** Window_Eval
#==============================================================================

class Window_Eval < Window_Base
 
 include EVAL_FEATURES
 include EVAL_HELP
 
 attr_accessor :text
 attr_accessor :down
 attr_accessor :cursor
 
 def initialize
   super(0, 0, WIDTH, HEIGHT-64)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.contents.font.color = normal_color
   self.contents.font.name = "Courier New"
   self.contents.font.size = 18
   self.contents.font.bold = true
   $falcao_apply = false
   $testing = true
   @text = ""
   @cursor = [0, 0]
   @lines = 0
   @caps_lock = 2
   @shift = false
   @altgr = false
   @down = -1
   refresh
 end
 
 def refresh
   self.contents.clear
   draw_back
   draw_eval
   draw_cursor
 end
 
 def draw_back
   rect0 = Rect.new(10, 10, WIDTH-32-20, HEIGHT-64-32-20)
   rect1 = Rect.new(10, 10, WIDTH-32-20, 2)
   rect2 = Rect.new(10, HEIGHT-64-32-20+8, WIDTH-32-20, 2)
   rect3 = Rect.new(10, 10, 2, HEIGHT-64-32-20)
   rect4 = Rect.new(WIDTH-32-20+8, 10, 2, HEIGHT-64-32-20)
   
   self.contents.fill_rect(rect0, Color.new(8,8,8,160))
   self.contents.fill_rect(rect1, Color.new(200,200,200,255))
   self.contents.fill_rect(rect2, Color.new(200,200,200,255))
   self.contents.fill_rect(rect3, Color.new(200,200,200,255))
   self.contents.fill_rect(rect4, Color.new(200,200,200,255))
   self.contents.font.color = normal_color
 end
 
 def draw_eval
   for i in WecocInput::Teclas.values
     if WecocInput.get_key(i[0])
       if @down == -1
         if i[0] == 0x14 # Caps
           @caps_lock = @caps_lock == 1 ? 2 : 1
         end
         unless i[1] == ""
           if @shift
             case i[3]
             when nil
               @text.insert get_cursor_pos, i[@caps_lock]
             when true
               @text.insert get_cursor_pos, i[@caps_lock == 1 ? 2 : 1]
             else
               @text.insert get_cursor_pos, i[3]
             end
             @shift = false
             @altgr = false
           else
             if @altgr
               if i[4] != nil
                 @text.insert get_cursor_pos, i[4]
               end
               @shift = false
               @altgr = false
             else
               @text.insert get_cursor_pos, i[@caps_lock]
             end
           end
           @cursor[0] += 1
         end
         if i[0] == 0x78 # F9
           play_cancel
           $scene = Scene_Map.new
         end
         if i[0] == 0xA0 or i[0] == 0xA1 # Shift
           @shift = true
         end
         if i[0] == 0xA4 or i[0] == 0xA2 or i[0] == 0x11 # AltGr
           @altgr = true
         end
         if i[0] == 0x0D # Enter
           @text.insert get_cursor_pos, ";"
           @cursor[1] += 1
           @lines += 1
           @cursor[0] = 0
         end
         if i[0] == 0x09 # Tab
           @text.insert get_cursor_pos, " "
           @cursor[0] += 1
         end
         if i[0] == 0x25 # Left
           if @cursor[0] == 0
             unless @cursor[1] == 0
               @cursor[1] -= 1
               @cursor[0] = get_txt[@cursor[1]].size
             end
           else
             @cursor[0] -= 1
           end
         end
         if i[0] == 0x27 # Right
           if @cursor[1] != @lines
             if @cursor[0] == get_txt[@cursor[1]].size
               @cursor[1] += 1
               @cursor[0] = 0
             else
               @cursor[0] += 1
             end
           else
             @cursor[0] += 1 if @cursor[0] != get_txt[@cursor[1]].size - 1
           end
         end
         if i[0] == 0x26 # Up
           if @cursor[1] != 0
             @cursor[1] -= 1
             @cursor[0] = [@cursor[0], get_txt[@cursor[1]].size].min
           end
         end
         if i[0] == 0x28 # Down
           if @lines == @cursor[1]
             play_cursor
             @down = 0
           else
             @cursor[1] += 1
             @cursor[0] = [@cursor[0], get_txt[@cursor[1]].size - 1].min
           end
         end
         if i[0] == 0x2E # Del
           if @lines == @cursor[1]
             del_txt unless @cursor[0] == (get_txt[@cursor[1]].size - 1)
           else
             @lines -= 1 if @cursor[0] == (get_txt[@cursor[1]].size)
             del_txt
           end
         end
         if i[0] == 0x08 # Backspace
           if @text.size <= 1
             @text = ""
             @cursor[0] = 0
           else
             if @text[get_cursor_pos-1].chr == ";"
               @cursor[1] -= 1
               @cursor[0] = get_txt[@cursor[1]].size - 1
               @lines -= 1
               del_txt
             else
               @cursor[0] -= 1
             end
             del_txt
           end
         end
       end
     end
   end
   write_eval
 end
 
 def get_txt
   txt = ""
   txt.concat(@text)
   txt << " "
   return txt.include?(";") ? txt = txt.split(";") : [txt]
 end
 
 def del_txt
   text = @text.split(//)
   text.delete_at(get_cursor_pos)
   @text = text.join
   @text = "" if @text.nil?
 end
 
 def get_cursor_pos
   pos = 0
   for i in 0...@cursor[1]
     pos += get_txt[i].size+1
   end
   pos += @cursor[0]
   return pos
 end
 
 def write_eval
   if @text != nil and @text != ""
     txt = get_txt
     for i in 0...txt.size
      self.contents.draw_text(20, 20 + i*24, 620, 32, txt[i])
     end
   end
   return
 end
 
 def get_eval_code
   return begin
     eval(@text).to_s
   rescue Exception
     "Exception"
   end
 end
 
 def draw_cursor
   rect = Rect.new(@cursor[0]*10+20, 28 + @cursor[1]*24, 2, 16)
   self.contents.fill_rect(rect, Color.new(128,128,128,255))
 end
end


#==============================================================================
# ** Window_DebugCommand
#==============================================================================

class Window_DebugCommand < Window_Selectable
 
 include EVAL_FEATURES
 
 def initialize
   super(0, HEIGHT-64, WIDTH, 64)
   self.contents = Bitmap.new(width - 32, height - 32)
   @item_max = 2
   @column_max = 2
   @commands = ["Confirm", "Cancel"]
   refresh
   self.index = 0
 end

 def refresh
   self.contents.clear
   for i in 0...@item_max
     draw_item(i)
   end
 end

 def draw_item(index)
   width = (WIDTH-32)/2
   self.contents.draw_text(width * index, 0, width, 32, @commands[index], 1)
 end
 
 def update_cursor
   super
   self.cursor_rect.height = 32
 end
end


#==============================================================================
# ** Scene_DebugEval
#==============================================================================

class Scene_DebugEval
 
 include EVAL_FEATURES
 
 def main
   @eval_window = Window_Eval.new
   @command_window = Window_DebugCommand.new
   @command_window.index = -1
   Graphics.transition
   loop do
     Graphics.update
     update
     if $scene != self
       break
     end
   end
   $game_map.refresh
   Graphics.freeze
   @eval_window.dispose
   @command_window.dispose
 end
 
 def update
   if @eval_window.down == -1
     @command_window.index = -1
   else
     @command_window.index = [@command_window.index, 0].max
   end
   if @command_window.index != -1
     update_command
   end
   @eval_window.refresh
   @command_window.update
 end
 
 def update_command
   for i in WecocInput::Teclas.values
     if WecocInput.get_key(i[0])
       if i[0] == 0x25 # Left
         play_cursor
         @command_window.index = 0
       end
       if i[0] == 0x27 # Right
         play_cursor
         @command_window.index = 1
       end
       if i[0] == 0x26 # Up
         play_cursor
         @eval_window.down = -1
       end
       if i[0] == 0x20 or i[0] == 0x0D or i[0] == 0x78 # Space, Enter or F9
         case @command_window.index
         when 0 # Confirm
           $scene = Scene_Map.new if @eval_window.text != "help"
           eval = @eval_window.get_eval_code
           eval == "Exception" ? play_buzzer : play_decision
         when 1 # Cancel
           play_cancel
           $scene = Scene_Map.new
         end
         $testing = false
       end
       if i[0] == 0x78 # F9
         play_cancel
         $scene = Scene_Map.new
       end
     end
   end
 end
end


#==============================================================================
# ** [Others]
#==============================================================================

if $debug_eval_vx

 class Scene_Map < Scene_Base
   def call_debug
     Sound.play_decision
     $game_temp.next_scene = nil
     $scene = Scene_DebugEval.new
   end
 end

else

 class Scene_Map
   def call_debug
     $game_temp.debug_calling = false
     $game_system.se_play($data_system.decision_se)
     $game_player.straighten
     $scene = Scene_DebugEval.new
   end
 end

end

class SystemStackError < Exception
 alias testing_exception initialize unless $@
 def initialize
   return if $testing
   testing_exception
 end
end



Instructions

To set new shortcuts go on the very beginning of the script inside module EVAL_HELP and write there all you want.
If when you are on game you forget it you can write help on the eval and a print with the shortcuts will appear.
You can control the cursor with direction arrows. To activate the command window you just have to press down arrow, only if you are on the last line.


Compatibility

No incompatibilities known. It uses only one alias (SystemStackError initialize)


Credits and Thanks


  • Wecoc

  • Falcao (Input reference)




Author's Notes

I have to drink less. If you have any question don't hestitate to ask.
Enjoy ~
29
AGO (Audio-Graphics-Others) Finder
Authors: Wecoc
Version: 1.0
Type: File finder
Key Term: Game Utility



Introduction

This script allows you to find across the whole game something in particular (like a bgm, a picture, or a switch) to know where it was used.
You can copy the script on your game over main then use it as times as you want and then delete it again, so credits are not needed.



Features


  • Checks all used files of an specific type

  • Checks all unused files of an specific type

  • The result can be saved on a txt file

  • Tells you where a file is used across the game




Screenshots
N/A


Demo
N/A


Script

Put over main the entire code: AGO Finder 1.0


Instructions

Inside the script.


Compatibility

I don't care xD <- (joking)
It uses an alias of Scene_Title :command_new_game
Nothing more I guess.


Credits and Thanks

No credits needed.


Author's Notes

If a file is called from the Script Editor, the script will not find it. So if you want to delete a not found file, I recommend you to search it on the Script Editor before.
Don't worry about script call from events, the script searches there. Enjoy! :)
30
RMXP Script Database / [XP] Change Tile Size
July 16, 2013, 02:26:29 pm
Change Tile Size
Authors: Wecoc
Version: 1.0
Type: Tilemap Add-On
Key Term: Game Utility



Introduction

This script allows you to change que width and the height of the tiles, under 32px. It's a Tilemap Add-On but I also modified Game_Map, Game_Character, Game_Player and Sprite_Character to fix movement and scroll problems with the edit. It does not contain a Resolution script, but you will probably need one if you use it. The editor draws it wrong but borders don't need to be transparent, Tilemap ignores them, so depending how you release the tileset you will be able to map easily.


Features


  • You can change tile width and height independently (always under 32px)

  • Player and events will be displayed well on the map

  • Movement and scroll fit well with the new tile size




Screenshots

Spoiler: ShowHide





Demo

Download Change Tile Size.zip


Instructions
There are 2 new scripts in the demo, you just need to copy them.
On the top of the Tilemap script there is a module called RESTILES with two globals, X and Y. It's that simple, just change their values.


Compatibility

Be careful with that, the second script changes many things of default classes. However I don't know about any important incompatibility.


Credits and Thanks


  • King & GodLike -> All the original Tilemap source

  • Wecoc -> Simple "change tile size" add-on




Author's Notes

Hope you enjoy it.