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.

Messages - ForeverZer0

2961
RMXP Script Database / Re: [XP] Simple Event Ai
March 17, 2010, 05:49:41 pm
Good job. I was doing this through eventing and it was a pain in the ass.
This should make things easier.
2962
RMXP Script Database / [XP] Advanced Title Screen
March 17, 2010, 05:41:35 pm
Advanced Title Screen
Authors: ForeverZer0
Version: 2.0
Type: Title Add-On
Key Term: Title / Save / Load / GameOver Add-on



Introduction

This system will allow you alter the title screen and add some different effects that are not normally available.



Features


  • Animated Title
  • Different loop types
  • Easy display of picture on screen and/or over animation
  • Random Title Screen each load
  • Transition Effect on loading saved games
  • Weather/Fog Effects
  • BGS and SFX
  • Easy scene linking
  • Add text to window



Screenshots

Attempt at catching full animation in three screenshots. You'll get the idea, though.
Frame 1: ShowHide

Frame 2: ShowHide

Frame 3: ShowHide



Demo

I used low quality graphics for the demo to keep the filesize down, but you can still see what it is capable of.
Demo Link


Script

Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
# Zer0 Advanced Title
# Author: ForeverZer0
# Version: 2.0
# Date: 10.03.2010
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
# Version History
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#  Version 1.0 (3.14.2010)
#  - Original write
#
#  Version 1.1 (3.18.2010)
#  - Fixed a bug that would crash the game if you tried to return to the Title
#    Screen from the load screen when using the Load Transition.
#
#  Version 1.2 (3.21.2010)
#  - Added a part to pre-cache all the bitmaps before the animation begins,
#    which should drastically reduce the possibility of lagging.
#
#  Version 2.0 (10.03.2010)
#  - Totally re-written from scratch.
#  - Eliminated the unprofessional 'flicker' that would occur if the database
#    had an image defined for the title graphic.
#  - Improved performance, compatibility, overview, and configurability.
#  - Added Features:
#     - More options to how animations operate, with easier configuration.
#     - Added scene linker to easily add new commands to the title window.
#     - Added config to work with custom save systems.
#     - Add option to display text on the background.
#     - Window appearance can now be easily changed.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
#
# Compatibility:
#   - Should be compatible with just about anything other than scripts that
#     add animation, etc. to the Title screen
#   - Compatible with SDK
#
# Explanation:
#   This system will allow you alter the title screen and add some different
#   effects that are not normally available.
#
# Features:
#   - Animated Title
#   - Easy display of picture on screen and/or over animation
#   - Random Title Screen each load
#   - Transition Effect on loading saved games
#   - Weather/Fog Effects
#   - BGS and SFX
#   - Window configuration.
#
# Instructions:
#  - All the below configurable values can be set to nil to disable the feature
#    with the exception of SAVE_DATA. It is already configured to the default
#    system so leave it alone if you are not using a custom save system.
#  - If using the animated title, all pictures need to be named exactly the
#    the same, but have a different number at the end. The numbers should be
#    consecutive and in the order that the animation should follow. The first
#    image should be 0. (Ex. pic0, pic1, pic2, pic3, etc.)
#  - Configuration is below. Individual explanation for the settings is in
#    their respective sections. All Graphics, Fogs, SFX, BGS, etc. that you use
#    need to be in their normal folders.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:

 $zer0_adv_title = 2.0

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

class Scene_Title
#=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
#                           BEGIN CONFIGURATION
#=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

 ANIMATED = ['Globe ', 40, 4]
 # ['FILENAME', NUMBER_IMAGES, SPEED]
  ANIMATION_TYPE = 0
  # 0 = Do not loop. Run through images and stop on last one.
  # 1 = Changes back to first image after running course, then repeats.
  # 2 = Cycles backwards to the first image after running course, then repeats.
  # 3 = Continually shift through all the files in "Titles" folder randomly.
  CHANGE_SE = nil
  # ['FILENAME', VOLUME, PITCH]
  # Sound effect played when the image changes.
 
 RANDOM_BACKGROUNDS = true
 # Uses a random image for the title each load if ANIMATED is nil. There is no
 # need to configure the graphics. Any/all images from the "Titles" folder will
 # be used.
 
 WEATHER = nil # [1, 20]
 # [TYPE, POWER]
 # Weather effect to be used on title screen.

 FOG = nil # ['001-Fog01', 0, 2, -2, 3, 60]
 # ['FILENAME', HUE, X-SPEED, Y-SPEED, ZOOM, OPACITY]
 # Fog to be displayed on the title screen.

 BGS = nil # ['032-Switch01', 100, 100]
 # ['FILENAME', VOLUME, PITCH]
 # Background sound to be played during title.
 
 PIC = ['Title Pic', 0, 0, 3001, 0, true, 2]
 # ['NAME', X, Y, Z, OPACITY, FADE-IN?, FADE-IN SPEED]
 # Picture to be displayed on title screen.
   
 SAVE_DATA = ['Save', '.rxdata', 4, '']
 # ['SAVENAMES', 'SAVE_EXTENSION', SAVE_NUMBER, SAVE_DIRECTORY]
 # If you are using a custom save system that alters the name of the save files,
 # extension, or number of possible save files, configure this to match.
 # DO NOT SET THIS VALUE TO NIL!
 
 LOAD_OUT = ['010-Random02', 60, 40]
 LOAD_IN = ['012-Random04', 60, 40]
 # ['TRANSITION NAME', DURATION, VAGUE]
 # Transitions used from the load screen, and when game starts. Can use both or
 # only one.
 
 TEXT = ["Zer0 Advanced Title v.#$zer0_adv_title", 8, 460, 'Arial Black', 18]
 # ['STRING', X, Y, FONTNAME, FONTSIZE]
 # Have text be displayed on the images such as the version number, etc.
  TEXT_COLOR = Color.new(255, 113, 12, 255)
  # [RED, GREEN, BLUE, ALPHA]
  # Color used for the text if being used. White is default.
 
 WINDOW_DATA = [512, 352, 255, 128, false]
 # [X, Y, OPACITY, WIDTH, SHOW_WINDOWSKIN?]
 # Coordinates used for the main window. Default settings will be used if nil.
 COMMANDS = ['New Game', 'Continue', 'Options']
 # Strings used for the commands on the title screen. Omitting the third item
 # in the array will also effectively get rid of the "Shutdown" option that
 # many do not like for its uselessness.
 
 def _SCENE_LINK(command_index)
   # Configure here any scenes you would like to link to the Title screen. You
   # must first configure the name of the command in COMMANDS. After that, just
   # fill in the name of the scene for the proper index. Any command index left
   # undefined will be assumed to be a 'Shutdown' option.
   
   # ex.   when 2 then Scene_MyOptions
   
   # Will make the third command (index starts at 0) start the defined scene.
   # Do not configue anything for index 0 or 1. It will not work. They are
   # reserved for 'New Game' and 'Continue'.
   
   return case command_index
   when 2 then Scene_End
   end
 end
 
#=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
#                           END CONFIGURATION
#=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
 
 def main
   # If battle test
   if $BTEST
     battle_test
     return
   end
   # Load database
   $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')
   # Create an instance of Game_System and a few other instance variables
   $game_system, @sprites, @bitmaps = Game_System.new, [], []
   # Create list of filenames of images found in Titles directory.
   @files = Dir.entries('Graphics/Titles').find_all {|file|
     ['.png', '.jpg'].include?(File.extname(file)) }
   # Play BGS if defined.
   # Stop playing ME and BGS (for when returning to title from game)
   Audio.me_stop
   if BGS != nil
     $game_system.bgs_play(RPG::AudioFile.new(BGS[0], BGS[1], BGS[2]))
   end
   # Play title BGM
   $game_system.bgm_play($data_system.title_bgm)
   # Prepare bitmap(s) for the backgound graphic.
   if ANIMATED != nil
     if ANIMATION_TYPE != 3
       (0...ANIMATED[1]).each {|i|
         # Pre-cache the graphics now to prevent lag during animation.
         @bitmaps[i] = RPG::Cache.title("#{ANIMATED[0]}#{i}") }
     else
       @files.each {|file| @bitmaps.push(RPG::Cache.title(file)) }
     end
     @count, @index, @reverse = 0, 0, false
     # Create the audio file for later use if needed.
     if CHANGE_SE != nil
       @se = RPG::AudioFile.new(CHANGE_SE[0], CHANGE_SE[1], CHANGE_SE[2])
     end
   elsif RANDOM_BACKGROUNDS
     # Cache a random image from the array.
     @bitmaps.push(RPG::Cache.title(@files[rand(@files.size)]))
   else
     # Else use the bitmap defined in the database.
     @bitmaps.push(RPG::Cache.title($data_system.title_name))
   end
   # Create weather sprite if needed.
   if WEATHER != nil
     @weather = RPG::Weather.new
     @weather.type, @weather.max = WEATHER[0], WEATHER[1]
     @sprites.push(@weather)
   end
   # Create Fog sprite if needed.
   if FOG != nil
     @fog = Plane.new
     @fog.bitmap = RPG::Cache.fog(FOG[0], FOG[1])
     @fog.z, @fog.opacity = 3000, FOG[5]
     @fog.zoom_x = @fog.zoom_y = FOG[4]
   end
   # Create picture graphic if needed.
   if PIC != nil
     @picture = Sprite.new
     @picture.bitmap = RPG::Cache.picture(PIC[0])
     @picture.x, @picture.y, @picture.z = PIC[1], PIC[2], PIC[3]
     @picture.opacity = PIC[4]
     @sprites.push(@picture)
   end
   # Draw text on background image(s) if configured.
   if TEXT != nil
     @bitmaps.each {|bitmap|
       bitmap.font.name, bitmap.font.size = TEXT[3], TEXT[4]
       if TEXT_COLOR.is_a?(Color)
         bitmap.font.color = TEXT_COLOR
       end
       bitmap.draw_text(TEXT[1], TEXT[2], 640, TEXT[4]+8, TEXT[0])
     }
   end
   # Set graphic to background.
   @background = Sprite.new
   @background.bitmap = @bitmaps[0]
   # Create command window.
   commands = COMMANDS == nil ? ['New Game', 'Continue', 'Shutdown'] : COMMANDS
   if WINDOW_DATA != nil
     @command_window = Window_Command.new(WINDOW_DATA[3], commands)
     @command_window.back_opacity = WINDOW_DATA[2]
     @command_window.x, @command_window.y = WINDOW_DATA[0], WINDOW_DATA[1]
     unless WINDOW_DATA[4]
       @command_window.opacity = 0
     end
   else
     @command_window = Window_Command.new(192, commands)
     @command_window.y, @command_window.back_opacity = 288, 160
     @command_window.x = 320 - @command_window.width / 2
   end
   # Determine if any save files exist.
   filenames = []
   (1..SAVE_DATA[2]).each {|i|
     filenames.push("#{SAVE_DATA[3]}#{SAVE_DATA[0]}#{i}#{SAVE_DATA[1]}") }
   @continue_enabled = filenames.any? {|filename| File.exist?(filename) }
   # Disable 'Continue' if no save files are found.
   if @continue_enabled
     @command_window.index = 1
   else
     @command_window.disable_item(1)
   end
   @sprites.push(@command_window, @background)
   # Transition the graphics.
   Graphics.transition
   # Main loop
   loop { Graphics.update; Input.update; update; break if $scene != self }
   # Prepare for transition.
   Graphics.freeze
   Audio.bgs_stop
   # Dispose the bitmaps, sprites, etc.
   (@sprites + @bitmaps).each {|object| object.dispose }
   @fog.dispose if @fog != nil
   # Clear Cache to free the graphics from the memory.
   RPG::Cache.clear
 end
 #-----------------------------------------------------------------------------
 def update
   # Update the sprites.
   @sprites.each {|sprite| sprite.update }
   # Scroll fog if needed.
   if @fog != nil
     @fog.ox += FOG[2]
     @fog.oy += FOG[3]
   end
   # Update picture if needed.
   if @picture != nil && @picture.opacity != 255 && PIC[5]
     @picture.opacity += PIC[6]
   end
   # Update animation if needed.
   if ANIMATED != nil
     @count += 1
     if @count == ANIMATED[2]
       case ANIMATION_TYPE
       when 0 # No looping
         @index += 1
       when 1 # Re-Start
         @index = (@index + 1) % ANIMATED[1]
       when 2 # Reverse Cycle
         @index += @reverse ? -1 : 1
         # Change reverse flag when needed.
         if @index == 0
           @reverse = false
         elsif @index == ANIMATED[1]
           @reverse = true
         end
       when 3 # Random Image
         old = @index
         @index = rand(@bitmaps.size)
         # Ensure images don't repeat consecutively.
         @index += 1 if old == @index
       end
       # Make sure bitmap index stays within permissible range.
       @index = [[@index, 0].max, ANIMATED[1]-1].min
       # Alter the image to the new bitmap.
       @background.bitmap = @bitmaps[@index]
       # Play the change SE if needed.
       if @se != nil
         $game_system.se_play(@se)
       end
       # Reset count.
       @count = 0
     end
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Branch by command window cursor position
     case @command_window.index
     when 0 then command_new_game
     when 1 then command_continue
     else
       scene = _SCENE_LINK(@command_window.index)
       scene == nil ? command_shutdown : $scene = scene.new
     end
   end
 end
end

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

class Scene_Load < Scene_File
 
 alias zer0_adv_title_main main
 def main
   zer0_adv_title_main
   # Only if next scene is Scene_Map.
   if $scene.is_a?(Scene_Map)
     # Set data in local variables.
     tran_out, tran_in = Scene_Title::LOAD_OUT, Scene_Title::LOAD_IN
     folder = 'Graphics/Transitions/'
     # Play "out" transition if so configured.
     if tran_out != nil
       Graphics.transition(tran_out[1], folder + tran_out[0], tran_out[2])
       Graphics.freeze
     end
     # Play "in" transition if so configured.
     if tran_in != nil
       # Create an instance of the map sprite.
       map = Spriteset_Map.new
       Graphics.transition(tran_in[1], folder + tran_in[0], tran_in[2])
       Graphics.freeze
       # Dispose sprite.
       map.dispose
     end
   end
 end
end



Instructions

In the script.


Compatibility

Compatible with SDK.


Credits and Thanks


  • ForeverZer0, for writing the script
  • SephirothSpawn, for the idea



Author's Notes

Hope you enjoy. Be sure to credit if you use it in your game.
2963
Version is now 2.0.
Totally rewritten code.
Code has been optimized to reduce any lag and configuration has been made MUCH easier.
2964
Script Requests / Re: More about 'DMG' pops.
March 02, 2010, 05:39:56 pm
I personally don't know, I've never used it, but check out Caldaron's Realistic ABS.
I believe there is a demo for it at RPG-Palace.

I'm not sure, but I think there might be something along them lines in the script.
2965
QuoteIf you mean point-click-walk, no. This script is more of a tool to develop something else using it than an actually useful standalone script, but it can be used separately.


That is a quote by Blizzard in the "Mouse Controller" post.
The script really was designed to be used like that.

I know I sure as hell have no idea how to do it. Good luck, though.
2966
Yeah, I have Vista, too. It takes a little longer to get it going initially, but runs exactly the same once done.
2967
I had setup an instance battles system through events, very much the same as you mentioned above. It worked very well, but I changed my mind after I realized what a pain in the ass it would be to implement throughout a whole game.  

If you do decide to go with instance battles, I would suggest finding a way to script it so that making the enemies "attack" you (i.e. see you and run towards you) could be done through a comment in their event page or something like that.  

Check out Claimh's ATB CBS with his Chrono Trigger Interface.  That would be a good place to start.
2968
General Discussion / Re: Options Menu Script
March 02, 2010, 04:53:33 pm
Yeah, I know the feeling. I have a few other scripts, but I can't even post them because they all kind of work of of each other and would require someone else to have the same exact game setup...

I know the code above is a little screwy, it wasn't quite ready to be posted as it's own independent script.
Good luck, though.
2969
RMXP Script Database / [XP] Zer0 Options Controller
March 02, 2010, 04:23:39 pm
Zer0 Options Controller
Authors: ForeverZero
Version: 2.1
Type: Options Controller
Key Term: Misc Add-on



Introduction

Custom "Option" system that can be used on the fly.


Features


  • No menu option, uses hot keys to change anytime on the game map.
  • Easily accessible
  • Very customizable
  • Can independently change the text font/size for the window base and message windows.
  • Can change windowskins on the fly.
  • Change color of any windowskin.
  • Can redefine what the "Normal" text color is.
  • Auto-Configuration
  • Plug & Play, no intensive configuration needed



Screenshots

None


Demo

http://www.mediafire.com/download.php?www1etgmkhj


Script

Spoiler: ShowHide

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Zer0 Options Controller
# By ForeverZer0
# Version: 2.1
# Date: 3.12.2010 (newest version)
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Version History
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Version 0.9 (2.28.2010)
#   - Original write and release. Not yet bug-free.
#
# Version 1.0 (3.4.2010)
#   - Improved coding slightly.
#   - Now disposes window when not in use to reduce lag
#
# Version 1.1 (3.5.2010)
#   - Removed some redundant code and improved some refresh/update methods
#   - Added the function so that changes can be made during battle
#   - Added a compatibility switch for Wachunga's MMW  
#   - Now 'Plug & Play', no intensive configuration needed
#
# Version 2.0 (3.10.2010)
#   - Totally overhauled. All configuration is in the module at the top.
#   - All fonts, skins, etc. were placed in arrays instead of branches
#   - Removed bug that would cause an error if the <, >, +, or - buttons
#     were pressed without holding 1, 2, or 3.
#   - Scrapped the opacity changer due to bugs and incompatibilty issues with
#     MMW that I couldn't work out, since the only way I know how to do it will
#     totally override all windows, which isn't always cool...
#
# Version 2.1 (3.12.2010)
#   - Can now change color of any windowskin (Provided it initially had color)
#   - Altered sample window to show font name and size as well as show the
#     name for the windowskin and windowskin color.
#   - Fixed small error that would allow the text size to be changed one
#     over/under the allowable size.
#   - Made a few minor improvements to the coding
#  
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Compatibility:
#  - Will likely not not be compatible with an 'Options' menu or
#    system that alters the fonts, windowskins, etc.
#  - Compatible with SDK 1.5 and older. Not tested with newer versions,
#    though I don't believe there would be any incompatibility issues.
#
# Explanation:
#   This system will allow you to change the font type/size on the fly in
#   the game.  It will also allow the player to just as easily change the
#   windowskin. A sample window will pop up when holding any of the option
#   buttons to show the player the changes. It will dispose when the button is
#   released to keep it fom causing lag. The player can change the system font
#   (i.e. menus, etc.) seperately from the message window used for speech,
#   etc. if using Wachunga's Multiple Message Windows.
#
# Instructions:
#  - Configuration is below. You can add/remove as many different items from
#    the arrays, just make sure each item is seperated by a comma, and that
#    there is a bracket at the beginning and end ([ ]).
#  - All names for windowskins, fonts, etc are case sensitive and must be
#    spelled exactly the same as the filename.
#  - If you use this in your game, include an Auto-Font Installer with it
#    to make sure anyone who plays it will have all available fonts.
#
# To Use:
#  - Hold [1], press [<] and [>] to change system font, [+] and [-] for size.
#  - Hold [2], press [<] and [>] to change message font, [+] and [-] for size.
#  - Hold [3], press [<] and [>] to change skin, [+] and [-] for skin color.
#  - Hold [4], press [+] and [-] to change text color.
#
# Warnings:
#   Now, obviously making the text to big/small will cause graphical errors
#   and cause text to be cut-off, crammed together, etc., so use this with
#   a little common sense. If the minimum/maximum text size is set too small/big
#   it will cause an error, so make sure these are set within a usable range.
#
# Requirements:  
# - Need 'Blizzard's Custom Controls' to set-up controls (configuration below)
# - Script was written to be compatible with Wachanga's "Multiple Message
#   Windows". Therefore, not all of the features will be available if not
#   using this message system.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=                                  
# BEGIN Zer0 CONFIGURATION                                    
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

 # All changed settings will be saved with the gamefile.
 # Default settings will always be used on the title screen and will override
 # the settings in the database.
 
module Zer0_CFG
#-------------------------------------------------------------------------------

#   If you have Blizzard's Custom Controls script and have no other keys
#   assigned to the above defined buttons, just set this switch to true
#   for auto-configuration. Configuration for the keys is at the bottom of
#   the script if you wish to alter them for some reason.

     Blizzard_Controls_AutoConfig = true
     
     Wachunga_MMS = false # Set to true only if using Multiple Message Windows
     
#-------------------------------------------------------------------------------      

 # This defines the fonts used. Add or remove as many as needed.
 
 System_Fonts = ['Calibri', 'Comic Sans MS', 'Times New Roman', 'Candara',
                 'Arial', 'Tahoma', 'Tempus Sans ITC', 'Verdana',
                 'Century Gothic', 'Corbel', 'Segoe Print']
 
 Default_Font = ['Calibri', 18]   # <--- Default font and size
 Font_Size_Range = [10, 24] # Minimum/Maximum allowed values for the font size.
 
 # These will ONLY effect text that is 'normal_color'.
 Font_Color =  [ Color.new(255,255,255,255),   # White (Default Color)
                 Color.new(0,0,0,255),         # Black
                 Color.new(128,128,128,255),   # Gray
                 Color.new(64,64,64,255),      # Dark Gray
                 Color.new(255,128,128,255),   # Red
                 Color.new(128,128,255,255),   # Blue
                 Color.new(128,255,128,255),   # Green
                 Color.new(255,255,128,255) ]  # Yellow
                 # (Red, Green, Blue, Alpha)
                 
#-------------------------------------------------------------------------------  
 # If not using Wachanga's Multiple Message Windows, skip this section
 
 MMW_Fonts = ['Calibri', 'Comic Sans MS', 'Times New Roman', 'Candara',
                 'Arial', 'Tahoma', 'Tempus Sans ITC', 'Verdana',
                 'Century Gothic', 'Corbel', 'Segoe Print']
             
 Default_MMW_Font = ['Comic Sans MS', 17]  # <--- Default font and size          
 MMW_Font_Size_Range = [10, 24] # Min/Max allowed values for the font size.
 
 # Only change this if not using this windowskin for MMW
 MMW_Speech_Windowskin = 'white-windowskin_speech'
 
#-------------------------------------------------------------------------------
 
 Default_Windowskin = '001-Blue01'  # <--- Must be in array below
 
 Windowskins = ['Blizzard Hell Breath', 'Clover', 'Simple',
                 'Simple 2', '001-Blue01']
end
#-------------------------------------------------------------------------------
 
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=                                  
# END Zer0 CONFIGURATION                                    
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
 Z = Zer0_CFG  # DO NOT edit this
#==============================================================================
# ** Game_System
#==============================================================================

class Game_System
 
 attr_accessor :textshade
 attr_accessor :fontsize
 attr_accessor :message_size_changer
 attr_accessor :skin_color

 alias zer0_customizer_init initialize
 def initialize
   zer0_customizer_init
   @fontname = Z::Default_Font[0]
   @fontsize = Z::Default_Font[1]
   @system_font_changer = Z::System_Fonts.index(@fontname)
   @system_size_changer = @fontsize
   @message_font_changer = Z::MMW_Fonts.index(Z::Default_MMW_Font[0])    
   @message_size_changer = Z::Default_MMW_Font[1]    
   @skintype = Z::Windowskins.index(Z::Default_Windowskin)
   @skin_color = @textshade = 0            
   check_for_window_change
 end

 def check_for_window_change
   @windowskin_name = Z::Windowskins[@skintype]
   @fontsize = @system_size_changer
   @fontname = Z::System_Fonts[@system_font_changer]
   Font.default_name = $defaultfonttype = $fontface = @fontname #**
   Font.default_size = $defaultfontsize = $fontsize = @fontsize #**
   if Z::Wachunga_MMS
     @message.font_name = Z::MMW_Fonts[@message_font_changer]
     @message.font_size = @message_size_changer
   end
 end
 
 #** = Credit goes to Blizzard for lines marked with this
                                                   
 alias zer0_customizer_upd update          
 def update                                            
   zer0_customizer_upd
   @fontsize = @system_size_changer
   @fontname = Z::System_Fonts[@system_font_changer]
   Font.default_name = $defaultfonttype = $fontface = @fontname #**
   Font.default_size = $defaultfontsize = $fontsize = @fontsize #**
   
   if Input.press?(Input::SYS_FONT)                
     if Input.trigger?(Input::OPT_LEFT)              
       @system_font_changer += 1                
       @system_font_changer %= Z::System_Fonts.size
     elsif Input.trigger?(Input::OPT_RIGHT)  
       @system_font_changer += (Z::System_Fonts.size - 1)
       @system_font_changer %= Z::System_Fonts.size
     elsif Input.trigger?(Input::OPT_DOWN)
       if @system_size_changer > Z::Font_Size_Range[0]
         @system_size_changer -= 1
       end
     elsif Input.trigger?(Input::OPT_UP)
       if @system_size_changer < Z::Font_Size_Range[1]
         @system_size_changer += 1
       end
     end
   end
   
   if Input.press?(Input::MMW_FONT) && Z::Wachunga_MMS                    
     if Input.trigger?(Input::OPT_LEFT)          
       @message_font_changer += 1                
       @message_font_changer %= Z::MMW_Fonts.size                        
     elsif Input.trigger?(Input::OPT_RIGHT)  
       @message_font_changer -= 1
       @message_font_changer %= Z::MMW_Fonts.size
     elsif Input.trigger?(Input::OPT_DOWN)
       if @message_size_changer > Z::MMW_Font_Size_Range[0]
         @message_size_changer -= 1
       end
     elsif Input.trigger?(Input::OPT_UP)
       if @message_size_changer < Z::MMW_Font_Size_Range[1]
         @message_size_changer += 1
       end  
     end
   end
     
   if Input.press?(Input::WINDOW)
     if Input.trigger?(Input::OPT_DOWN)  
       @skin_color -= 8                 # Color changes will only apply to
       @skin_color %= 360               # windowskins that initially have color
     elsif Input.trigger?(Input::OPT_UP)  
       @skin_color += 8
       @skin_color %= 360
     elsif Input.trigger?(Input::OPT_LEFT)  
       @skintype -= 1
       @skintype %= Z::Windowskins.size
     elsif Input.trigger?(Input::OPT_RIGHT)  
       @skintype += 1
       @skintype %= Z::Windowskins.size
     end
   end  

   if Input.press?(Input::COLOR)
      if Input.trigger?(Input::OPT_DOWN)  
       @textshade -= 1                  
       @textshade %= Z::Font_Color.size
     elsif Input.trigger?(Input::OPT_UP)  
       @textshade += 1
       @textshade %= Z::Font_Color.size
     end
   end

 end
end

#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window
 # Redefines what the 'normal_color' for text is
 alias zer0_norm_color normal_color
 def normal_color  
   zer0_norm_color
   normal_color = Z::Font_Color[$game_system.textshade]
 end
end
 
#==============================================================================
# ** Window_Sample   (Simple window to show modifications on-screen)
#==============================================================================
class Window_Sample < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
   super(112, 108, 416, 264)  
   self.z = 9998
   self.contents = Bitmap.new(width - 32, height - 32)
   refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh  # Refresh method if changing message window
   if Z::Wachunga_MMS && Input.press?(Input::MMW_FONT)
     self.contents.clear
     self.windowskin = RPG::Cache.windowskin(Z::MMW_Speech_Windowskin)
     self.contents.font.name = $game_system.message.font_name
     self.contents.font.size = $game_system.message.font_size
     self.contents.font.color = Color.new(0,0,0)
   else   # Normal refresh method
     self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name)
     self.contents.clear
     self.contents.font.name = Font.default_name
     self.contents.font.size = Font.default_size
     self.contents.font.color = normal_color
   end
 
   # Define the strings used (Not needed, but keeps code neat)
   abctext = 'The quick brown fox jumped over the lazy dog.'
   numtext = '0 1 2 3 4 5 6 7 8 9'
   helptext = 'Press [+], [-], [<], or [>] to customize'
   sysfontname = "#{Font.default_name}"
   sysfontsize = "#{$game_system.fontsize}"
   messfontname = "#{$game_system.message.font_name}" if Z::Wachunga_MMS
   messfontsize = "#{$game_system.message_size_changer}" if Z::Wachunga_MMS
   skinname = "#{$game_system.windowskin_name}"
   skincolor = "#{($game_system.skin_color / 8) + 1}"
   
   # Recalculates the width of the text strings each time window refreshes
   w1 = contents.text_size('System Font').width
   w2 = contents.text_size('Message Font').width
   w3 = contents.text_size('System Window Base').width
   w4 = contents.text_size('Font Name:').width
   w5 = contents.text_size('Font Size:').width
   w6 = contents.text_size('Windowskin Name:').width
   w7 = contents.text_size(abctext).width
   w8 = contents.text_size(numtext).width
   w9 = contents.text_size(helptext).width
   w10 = contents.text_size(sysfontname).width
   w11 = contents.text_size(messfontname).width if Z::Wachunga_MMS
   w12 = contents.text_size(sysfontsize).width
   w13 = contents.text_size(messfontsize).width if Z::Wachunga_MMS
   w14 = contents.text_size(skinname).width
   w15 = contents.text_size('Windowskin Tone:').width
   w16 = contents.text_size(skincolor).width
   
   # Shows different info in window depending on button being pressed
   if Input.press?(Input::SYS_FONT)
     self.contents.font.color = system_color
     self.contents.draw_text(4, 0, w1, 32, 'System Font', 2)
     self.contents.draw_text(4, 96, w4, 32, 'Font Name:', 2)
     self.contents.draw_text(4, 128, w5, 32, 'Font Size:', 2)
     self.contents.draw_text(4, 192, w9, 32, helptext, 2)
     self.contents.font.color = normal_color
     self.contents.draw_text(4, 32, w7, 32, abctext, 2)
     self.contents.draw_text(4, 64, w8, 32, numtext, 2)
     self.contents.draw_text(w4 + 15, 96, w10, 32, sysfontname, 2)
     self.contents.draw_text(w5 + 15, 128, w12, 32, sysfontsize, 2)
   elsif (Input.press?(Input::MMW_FONT) && Z::Wachunga_MMS)
     self.contents.font.color = Color.new(0, 64, 128)
     self.contents.draw_text(4, 0, w2, 32, 'Message Font', 2)
     self.contents.draw_text(4, 96, w4, 32, 'Font Name:', 2)
     self.contents.draw_text(4, 128, w5, 32, 'Font Size:', 2)
     self.contents.draw_text(4, 192, w9, 32, helptext, 2)
     self.contents.font.color = Color.new(0, 0, 0) # Dark font for whiteback
     self.contents.draw_text(4, 32, w7, 32, abctext, 2)
     self.contents.draw_text(4, 64, w8, 32, numtext, 2)
     self.contents.draw_text(w4 + 15, 96, w11, 32, messfontname, 2)
     self.contents.draw_text(w5 + 15, 128, w13, 32, messfontsize, 2)
   elsif (Input.press?(Input::MMW_FONT) && !Z::Wachunga_MMS)
     self.contents.font.name, self.contents.font.size = 'Arial Black', 18
     warn1 = 'This feature requires' # I gotta learn how to splice text... :P
     warn2 = "Wachanga's Multiple Message Windows!"
     ww1 = contents.text_size(warn1).width  
     ww2 = contents.text_size(warn2).width
     self.contents.draw_text(4, 64, ww1, 32, warn1, 2)
     self.contents.draw_text(4, 96, ww2, 32, warn2, 2)
   elsif Input.press?(Input::WINDOW) || Input.press?(Input::COLOR)
     self.contents.font.color = system_color
     self.contents.draw_text(4, 0, w3, 32, 'System Window Base', 2)
     self.contents.draw_text(4, 96, w6, 32, 'Windowskin Name:', 2)
     self.contents.draw_text(4, 128, w15, 32, 'Windowskin Tone:', 2)
     self.contents.draw_text(4, 192, w9, 32, helptext, 2)
     self.contents.font.color = normal_color
     self.contents.draw_text(4, 32, w7, 32, abctext, 2)
     self.contents.draw_text(4, 64, w8, 32, numtext, 2)
     self.contents.draw_text(w6 + 15, 96, w14, 32, skinname, 2)
     self.contents.draw_text(w15 + 15, 128, w16, 32, skincolor, 2)
   end
 end
end

#==============================================================================
# ** Scene_Map
#==============================================================================
class Scene_Map
 
 alias sample_window_map_upd update
 def update
   sample_window_map_upd
   @sample_window.update if @sample_window != nil
   if Input.press?(Input::SYS_FONT) || Input.press?(Input::WINDOW) ||
      Input.press?(Input::MMW_FONT) || Input.press?(Input::COLOR)
     if @sample_window == nil
       @sample_window = Window_Sample.new
       $game_system.se_play($data_system.decision_se)
     end
   elsif @sample_window != nil
     @sample_window.dispose
     @sample_window = nil
   end
   if (Input.trigger?(Input::OPT_UP) || Input.trigger?(Input::OPT_DOWN) ||
     Input.trigger?(Input::OPT_LEFT) || Input.trigger?(Input::OPT_RIGHT)) &&
     (Input.press?(Input::SYS_FONT) || Input.press?(Input::MMW_FONT) ||
     Input.press?(Input::WINDOW) || Input.press?(Input::COLOR))
       $game_system.se_play($data_system.cursor_se)
       $game_system.check_for_window_change
       @sample_window.refresh if @sample_window != nil
   end
 end
end

#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle

 alias sample_window_battle_upd update
 def update
   sample_window_battle_upd
   @sample_window.update if @sample_window != nil
   if Input.press?(Input::SYS_FONT) || Input.press?(Input::WINDOW) ||
      Input.press?(Input::MMW_FONT) || Input.press?(Input::COLOR)
     if @sample_window == nil
       @sample_window = Window_Sample.new
       $game_system.se_play($data_system.decision_se)
     end
   elsif @sample_window != nil
     @sample_window.dispose
     @sample_window = nil
   end
   if (Input.trigger?(Input::OPT_UP) || Input.trigger?(Input::OPT_DOWN) ||
     Input.trigger?(Input::OPT_LEFT) || Input.trigger?(Input::OPT_RIGHT)) &&
     (Input.press?(Input::SYS_FONT) || Input.press?(Input::MMW_FONT) ||
     Input.press?(Input::WINDOW) || Input.press?(Input::COLOR))
       $game_system.se_play($data_system.cursor_se)
       $game_system.check_for_window_change
       @sample_window.refresh if @sample_window != nil
   end
 end
end

#-------------------------------------------------------------------------------
module Input
 if Zer0_CFG::Blizzard_Controls_AutoConfig
#  The 'Key' can be changed, but do not change the NAME for the button

# NAME        Key
 SYS_FONT = [Key['1']]    # Hold to engage System FontChanger  
 MMW_FONT = [Key['2']]    # Hold to engage Message FontChanger (if MMW)
 WINDOW = [Key['3']]      # Hold to engage Skin Color/Skin Changer
 COLOR = [Key['4']]       # Hold to engage Text Color Changer
 OPT_LEFT = [Key[',']]    # For changing options while Option is engaged [<]
 OPT_RIGHT = [Key['.']]   # For changing options while Option is engaged [>]
 OPT_UP = [Key['=']]      # For changing options while Option is engaged [+]
 OPT_DOWN = [Key['-']]    # For changing options while Option is engaged [-]
 
 end
end
#-------------------------------------------------------------------------------
module RPG
 module Cache
   def self.windowskin(filename)
     self.load_bitmap("Graphics/Windowskins/", filename, $game_system.skin_color)
   end
 end
end
#-------------------------------------------------------------------------------



Instructions

Place below debug and below main.
Rest of instructions are in the Script.


Compatibility

None known. Compatible with SDK.
Does require Blizzard's Custom Controls


Credits and Thanks


  • ForeverZero, for writing the script.
  • Blizzard, for writing a fantastic help manual



Author's Notes

Feel free to use any part of this in your game, just give me credit.
Some lines of code may have to be added/altered in other scripts, I'll probably update that sometime soon so
that it is not required.
Let me know how you like it, or if you have any constructive criticism, feel free to let me know.
2970
General Discussion / Re: Options Menu Script
March 02, 2010, 03:43:27 pm
Come to think of it, I might do a few edits and post this in the Script Database... Feel free to use use any part in your game if you need to, though. Hope that helped!
2971
General Discussion / Re: Options Menu Script
March 02, 2010, 03:33:32 pm
I made an Options menu for my game as well. I included a windowskin changer, font type/size changer, and audio controls. I use a custom Message Window script and I made the fontchanger to allow for settings to the "System" window and the "Message" window independently.

It worked very well, but I ended up scrapping the entire thing and doing something different.
I used "Blizzard's Custom Controls" and assigned buttons configurations so that if the "1" button is held down, it displays a window on screen and the "System" font text/size can be changed with
  • ,[-],[<], and [>]. The same goes with the "2" button for the "Message" window. I use the "3" button for altering the windowskin and window opacity. The script is dependent on a couple other scripts, but if you I'll post you a copy of it to see if you can learn anything off of it.

    The current script also has the beginnings of text color changer, but isn't yet complete. To use it, hold the "4" button and toggle the colors with the assigned buttons.

    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    # Ultimate Text/Window Customizer
    # Author: ForeverZero
    # Version: 1.00
    # Date: 2.23.2010
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    #
    # Explanation:
    #
    #   This system will allow you to change the font type/size at any point in
    #   the game. The player change the system font (i.e. menus, etc.) seperately
    #   from the message window used for speech, etc. It will also allow the
    #   player to just as easily change the windowskin and window opacity.
    #
    # Instructions:
    #
    #  - Hold [1], press [<] and [>] to change system font, [+] and [-] for size.
    #  - Hold [2], press [<] and [>] to change message font, [+] and [-] for size.
    #  - Hold [3], press [<] and [>] to change skin, [+] and [-] for window opacity.
    #
    # Warnings:
    #
    #   Now, obviously making the text to big/small will cause graphical errors
    #   and cause text to be cut-off, crammed together, etc., so use this with
    #   a little common sense.
    #
    # Requirements:
    #   
    #   Need 'Blizzard's Custom Controls', else you will need to edit and create
    #   your own button configuration, which will require a small bit of know-how
    #   on scripting.
    #
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=                                 
    # BEGIN CONFIGURATION                                   
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    #
    #
    #==============================================================================
    # ** Window_Base
    #------------------------------------------------------------------------------
    #  This class is for all in-game windows.
    #==============================================================================

                                     
    class Window_Base  < Window
     
      alias zero_norm_color normal_color
      def normal_color   
        zero_norm_color
        case $game_system.textshade
        when 0 then Color.new(255,255,255,255)
        when 1 then Color.new(0,0,0,255)
        when 2 then Color.new(255,64,64,255)
        when 3 then Color.new(64,255,64,255)
        when 4 then Color.new(255,200,0,255)
        when 5 then Color.new(128,0,255,255)
        when 6 then Color.new(0,0,255,255)
        end
      end
     
        def skinchanger_check
        $game_system.windowskin_name =
        case $game_system.skintype

        when 0 then "Black"           # Must be in Game Folder's Windowskin
        when 1 then "Black 2"         # file. Exact spelling and case sensitive.
        when 2 then "Thorns"
        when 3 then "Gold Leaf"
        when 4 then "Charcoal"
        when 5 then "Curtain"
        when 6 then "Parchment"
        when 7 then "Curtain 2"
        when 8 then "Sand"
        when 9 then "Purple"
        when 10 then "Black Pearl"
        when 11 then "Clover"
        when 12 then "Darkness"
        when 13 then "Simple Blue"
        when 14 then "XP Default"
        when 15 then "Black 3"
        when 16 then "Fire"
        when 17 then "Lufia01"
        when 18 then "Lufia02"
        when 19 then "Hell Breath"
        when 20 then "Simple White"
        when 21 then "Green"
        end
      end
    end
              TOTAL_SKINS = 22 # Be sure to adjust this to the total number
                               # of windowskins used, including zero.
    #==============================================================================
    # ** Game_System
    #==============================================================================

    class Game_System
     
      attr_accessor :system_font_changer
      attr_accessor :system_size_changer
      attr_accessor :message_font_changer
      attr_accessor :message_size_changer
      attr_accessor :window_opacity
      attr_accessor :skintype
      attr_accessor :textshade
     
      alias zero_ultimate_option_window_init initialize
      def initialize
        zero_ultimate_option_window_init
        @system_font_changer = 0      # Default System Font Type (see below)
        @system_size_changer = 15     # Default System Font Size
        @message_font_changer = 0     # Default Message Font Type (see below)
        @message_size_changer = 24    # Default Message Font Size
        @window_opacity = 160         # Default Window Opacity
        @skintype = 0                 # Default Windowskin (see above)
        @textshade = 0
        check_for_window_change
      end
     
      def check_for_window_change
        Font.default_size = @system_size_changer
        @message.font_size = @message_size_changer
       
        # System Fonts
        # Add or remove as many as needed, just follow the pattern.
        Font.default_name = case @system_font_changer
            when 0 then "Calibri"                         # **KEY GLOSSARY**
            when 1 then "Comic Sans MS"                   # [1] = SYSTEM_FONT
            when 2 then "Times New Roman"                 # [2] = MESSAGE_FONT
            when 3 then "Candara"                         # [3] = WINDOW
            when 4 then "Arial"                           # [<] = OPTIONLEFT
            when 5 then "Estrangelo Edessa"               # [>] = OPTIONRIGHT
            when 6 then "Tahoma"                          # [-] = OPTIONDOWN
            when 7 then "Tempus Sans ITC"                 # [+] = OPTIONUP
            when 8 then "Verdana"
            when 9 then "Century Gothic"
            when 10 then "Corbel"
            when 11 then "Kristen ITC"
            when 12 then "Segoe Print"
        end
                    @SYSTEM_FONTS = 13  # Be sure to adjust this to the total number
                                        # of system fonts used, including zero.

         
        # Message Fonts
        # Add or remove as many as needed, just follow the pattern.
        @message.font_name = case @message_font_changer
            when 0 then "Segoe Print"                     # "Komika Slick"?
            when 1 then "Nyala"                           # "Komika Slim"?
            when 2 then "Kristen ITC"                     # "Mistral"?
            when 3 then "Tempus Sans ITC"                 # "French Script MT"?
            when 4 then "Andalus"                     
            when 5 then "Calibri"
            when 6 then "Narkisim"
            when 7 then "Comic Sans MS"
            when 8 then "Papyrus"
            when 9 then "Maiandra GD"
        end
                    @MESSAGE_FONTS = 10  # Be sure to adjust this to the total number
                                         # of message fonts used, including zero.
                                           
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=                                 
    # END CONFIGURATION                                   
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

      end # End check_for_window_change
                                                           
      alias zero_ultimate_option_window_upd update           
      def update                                           
        zero_ultimate_option_window_upd                           
           
        # To make 'decision' sound when window is initialized
        if Input.trigger?(Input::SYSTEM_FONT) or Input.trigger?(Input::WINDOW) or Input.trigger?(Input::MESSAGE_FONT)
          $game_system.se_play($data_system.decision_se)
        end
       
        # All the input buttons were keys I assigned in Blizz's Custom Controls
       
        if Input.press?(Input::SYSTEM_FONT)                 
          if Input.trigger?(Input::OPTIONLEFT)             
              @system_font_changer -= 1                 
              @system_font_changer %= @SYSTEM_FONTS
              $game_system.se_play($data_system.cursor_se)
              check_for_window_change                     
          elsif Input.trigger?(Input::OPTIONRIGHT) 
              @system_font_changer += 1
              @system_font_changer %= @SYSTEM_FONTS
              $game_system.se_play($data_system.cursor_se)
              check_for_window_change 
          elsif Input.trigger?(Input::OPTIONDOWN) 
              @system_size_changer -= 1
              $game_system.se_play($data_system.cursor_se)
              check_for_window_change
          elsif Input.trigger?(Input::OPTIONUP) 
              @system_size_changer += 1
              $game_system.se_play($data_system.cursor_se)
              check_for_window_change
            end
          end
                                   
        if Input.press?(Input::MESSAGE_FONT)                     
          if Input.trigger?(Input::OPTIONLEFT)         
              @message_font_changer -= 1               
              @message_font_changer %= @MESSAGE_FONTS
              $game_system.se_play($data_system.cursor_se)
              check_for_window_change                         
          elsif Input.trigger?(Input::OPTIONRIGHT) 
              @message_font_changer += 1
              @message_font_changer %= @MESSAGE_FONTS
              $game_system.se_play($data_system.cursor_se)
              check_for_window_change 
          elsif Input.trigger?(Input::OPTIONDOWN) 
              @message_size_changer -= 1
              $game_system.se_play($data_system.cursor_se)
              check_for_window_change
          elsif Input.trigger?(Input::OPTIONUP) 
              @message_size_changer += 1
              $game_system.se_play($data_system.cursor_se)
              check_for_window_change
            end
          end
         
          if Input.press?(Input::WINDOW)
            if Input.trigger?(Input::OPTIONDOWN) 
              @window_opacity -= 5                  # Opacity: 0 - 255 (Loops)
              @window_opacity %= 255
              $game_system.se_play($data_system.cursor_se)
            elsif Input.trigger?(Input::OPTIONUP) 
              @window_opacity += 5
              @window_opacity %= 255
              $game_system.se_play($data_system.cursor_se)
            elsif Input.trigger?(Input::OPTIONLEFT) 
              @skintype -= 1
              @skintype %= TOTAL_SKINS
              $game_system.se_play($data_system.cursor_se)
            elsif Input.trigger?(Input::OPTIONRIGHT) 
              @skintype += 1
              @skintype %= TOTAL_SKINS
              $game_system.se_play($data_system.cursor_se)
            end
          end   
         
          if Input.press?(Input::FONTCOLOR)
            if Input.trigger?(Input::OPTIONDOWN) 
              @textshade -= 1                  # Opacity: 0 - 255 (Loops)
              @textshade %= 7
              $game_system.se_play($data_system.cursor_se)
            elsif Input.trigger?(Input::OPTIONUP) 
              @textshade += 1
              @textshade %= 7
              $game_system.se_play($data_system.cursor_se)
            end
          end
         
         
         
         
         
        end
      end
    #==============================================================================
    # ** Window_Dummy
    #==============================================================================

    class Window_Dummy < Window_Base
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize
        super(0, 0, 416, 200) 
        self.opacity = $game_system.window_opacity
        self.contents = Bitmap.new(width - 32, height - 32)
        refresh
      end

      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh  # Shows message window.
        if Input.press?(Input::MESSAGE_FONT) or Input.trigger?(Input::MESSAGE_FONT)
        self.contents.clear
        self.windowskin = RPG::Cache.windowskin("white-windowskin_speech")
        self.contents.font.name = $game_system.message.font_name
        self.contents.font.size = $game_system.message.font_size
        self.opacity = 255
        self.contents.font.color = Color.new(0,0,0)
      else   
        skinchanger_check  # Shows system window
        self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name)
        self.contents.clear
        self.contents.font.name = Font.default_name
        self.contents.font.size = Font.default_size
        self.opacity = $game_system.window_opacity
        self.contents.font.color = normal_color
      end
     
        abctext = "The quick brown fox jumped over the lazy dog."
        numtext = "0 1 2 3 4 5 6 7 8 9"
        helptext = "(Use [+], [-], [<], and [>] to customize)"
        aw = contents.text_size(abctext).width
        nw = contents.text_size(numtext).width
        hw = contents.text_size(helptext).width
       
        a = contents.text_size("System Font").width
        b = contents.text_size("Message Font").width
        c = contents.text_size("System Window Base").width
     
        if Input.press?(Input::SYSTEM_FONT)
          self.contents.font.color = system_color
          self.contents.draw_text(4, 0, a, 32, "System Font", 2)
          self.contents.draw_text(4, 128, hw, 32, helptext, 2)
          self.contents.font.color = normal_color
          self.contents.draw_text(4, 32, aw, 32, abctext, 2)
          self.contents.draw_text(4, 64, nw, 32, numtext, 2)
        elsif Input.press?(Input::MESSAGE_FONT)
          self.contents.font.color = Color.new(0,64,128)
          self.contents.draw_text(4, 0, b, 32, "Message Font", 2)
          self.contents.draw_text(4, 128, hw, 32, helptext, 2)
          self.contents.font.color = Color.new(0,0,0) # Diff. color for whiteback
          self.contents.draw_text(4, 32, aw, 32, abctext, 2)
          self.contents.draw_text(4, 64, nw, 32, numtext, 2)
        elsif Input.press?(Input::WINDOW)
          self.contents.font.color = system_color
          self.contents.draw_text(4, 0, c, 32, "System Window Base", 2)
          self.contents.draw_text(4, 128, hw, 32, helptext, 2)
          self.contents.font.color = normal_color
          self.contents.draw_text(4, 32, aw, 32, abctext, 2)
          self.contents.draw_text(4, 64, nw, 32, numtext, 2)
        end
      end
    end

    #==============================================================================
    # ** Scene_Map
    #==============================================================================
    class Scene_Map
     
      alias dummy_window_main initialize
      def initialize
        dummy_window_main
        @dummy_window = Window_Dummy.new
        @dummy_window.x, @dummy_window.y = 112, 140
        @dummy_window.visible = false
      end
     
      alias dummy_window_upd update
      def update
        dummy_window_upd
        @dummy_window.update
          # Make window visible if 1, 2, or 3 button is being held down.
        if Input.press?(Input::SYSTEM_FONT) or Input.press?(Input::WINDOW) or Input.press?(Input::MESSAGE_FONT)
            @dummy_window.visible = true
        else
            @dummy_window.visible = false
        end
        # If window is visible, update
        if @dummy_window.visible == true
          update_dummy
        end

        # This is so the window refreshes as soon as the button is pressed.
        if Input.trigger?(Input::SYSTEM_FONT) or Input.trigger?(Input::WINDOW) or Input.trigger?(Input::MESSAGE_FONT)
          @dummy_window.refresh
        end
      end

      def update_dummy   # Refreshes window if any change is applied
        if Input.trigger?(Input::OPTIONUP)
          @dummy_window.refresh
        elsif Input.trigger?(Input::OPTIONDOWN)
          @dummy_window.refresh
        elsif Input.trigger?(Input::OPTIONLEFT)
          @dummy_window.refresh
        elsif Input.trigger?(Input::OPTIONRIGHT)
          @dummy_window.refresh
        end
      end
     
    end
2972
Terrain Tag Speed Modifier
Authors: ForeverZero
Version: 1.00
Type: Movement Add-on
Key Term: Movement Add-on



Introduction

Very simple script that will automatically change the player's move speed based on the Terrain Tag of the Tile ID they are walking on.  Good if you want your player to walk slower through high grass, moving up and down ladders, etc. without having to do it manually through eventing.


Features


  • Easily customized to your needs
  • Merely set the terrain tags in your database to change player speeds



Screenshots

None really required...


Demo

None


Script

Spoiler: ShowHide

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Terrain Speed Modifier
# Author: ForeverZero
# Version: 1.00
# Date: 2.28.2010
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#   Player speed will be changed according to the current terrain tag of
#   the tile they are standing on. Can be modified as desired.
#
#   Just change terrain tags in Database as needed.
#  
#   Use Call Script ($game_system.terrain_tag_speeds = true/false)
#
#   See below to change default settings.
#  
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
class Game_System
 
 attr_accessor :terrain_tag_speeds
 
 alias terrain_tag_speeds_init initialize
 def initialize
   terrain_tag_speeds_init
   @terrain_tag_speeds = true
 end
end

   
class Game_Player
 attr_accessor :move_speed  
end

class Game_Map
                                         # Edit as needed
 alias terrain_move_speeds_upd update
 def update
   terrain_move_speeds_upd
   if $game_system.terrain_tag_speeds
     if $game_player.terrain_tag == 7  # If Terrain Tag = 7, Move Speed is 2
       $game_player.move_speed = 2
     elsif $game_player.terrain_tag == 6
       $game_player.move_speed = 3     # If Terrain Tag = 6, Move Speed is 3
     else
       $game_player.move_speed = 4     # Default Player Move Speed
     end
   end
 end
end



Instructions

Post above Main, and below Debug


Compatibility

Shouldn't be any. Possible if you are using a script that modifies player movement


Credits and Thanks


  • ForeverZero, for writing the script.



Author's Notes

None
2973
Ok, thanks a lot for the quick reply. :)
2974
Hey, I just created a profile here, and I was wondering if this site accepted script submissions.
I have a few minor scripts I wrote, nothing ground-breaking, but I haven't seen nothing like them in
the script database, and thought maybe someone might be able to use them. :P
2975
Welcome! / Re: Welcome!
March 01, 2010, 10:52:31 am
Hey, everyone. Thanks for the welcome. I keep coming back and using the scripts/resources off this site, so I decided to become a member. Of all the other similar sites out there, I think this one is the best. I wanna try to do whatever part I can to keep it that way.  ;)