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 - Zeriab

1
Welcome! / Zeriab is back, this time with hugs
October 21, 2015, 05:20:04 pm
Hi all!

Long time no see. How have you all been the past couple of years?

There are 93 pages of unread pages since my last visit, so I'd rather ask you guys. What I have missed?
What's the progress with the ARC engine? Did you continue to work on it, or find something else to do?

It really is great to see you again

*hugs*
- Zeriab
2
Welcome! / This is goodbye.
April 15, 2010, 06:37:48 am
Hey all,

Due to RL stuff I will take my leave for at least a couple of months and maybe even years.
It has nothing do with this forum except that it uses my time. (Because you are all so wonderful :3)
I have known it for a long time and nothing bad has happened, so don't worry about me ^^

I will therefore leave in one week rather than atm.
It's I can respond to your goodbyes and have some last minute discussions

I love you all
*hugs*
- Zeriab
3
RPG Maker XP/VX Decrypter

As I am sure most of you know, there are decrypters out there. I would not dream of releasing a decrypter if I were the first, but since they are out there it's a different matter. I wrote this to compete against the other decrypters out there.

Features
  • Fast decryption. 50 MB usually takes 10-25 seconds to decrypt.
  • Decrypt multiple files as once.
  • Cross-platform
  • User-friendly
  • Cool music


Instructions
Note: Java must be installed to run the decrypter. You can download it for free at java.com.

Download the .jar file: http://www.mediafire.com/?yezjhdmjnln


Press enter or double-click on the file to run the program.

When you run the program you'll get a file dialog.
Find the directory with the encrypted archive(s)

You can selected more than one file. Control+Left-click for individual file (de)selection.


A progress bar will allow you to keep track of how far each archive has been encrypted.


When you see this you are done and all the archives has been decrypted  :thumb:


If everything went well you should find folder present in the current directory which are named the same as the encrypted archives except for the dot being replaces with underscore.

Future Work
Fix the issue of the decrypted contents not being moved to its proper destination some times.
Allow the output directory to be specified.
Allow batch files for simple decryption of multiple files.
Allow decryption of files across multiple directories to be scheduled for decryption (as opposed to having to run the program one time for each directory)
Allow search of encrypted archives.

Author's Notes
The decrypter is slight slower than my RPG Maker XP/VX Encrypter since it has to create many files compared to one.
Creating files is slow because the OS has to create and attach access lists to it, creating multiple file handlers is expensive and I imagine virus scanners might work slower with multiple files.

*hugs*
4
General Discussion / RPG Maker XP/VX Encrypter
December 30, 2009, 05:21:50 am
Here is a little tool I made for those who want their compressed archive without having to go through the installer RPG Maker XP/VX makes.
Considering how long time the compression takes there is also some time to save if your project is big size wise. (Why do such a compression when you gain so little? Unencrypted contents you do gain something though)

Download: http://www.mediafire.com/?52t3nyyooyt

I can tell you that RPG Maker XP failed to create an installer for a 228 MB big project. So if your project is big enough you may have to use this tool. I have successfully made a 174 MB .rgssad which seemingly ran perfectly fine. It was a crafted example though.
I haven't tested to see whether RPG Maker VX has the same issue or not.

Quote from: ReadMeCopy the RPG Maker Encrypter.jar over to your project at the same place as Game.exe
Run RPG Maker Encrypter.jar.

Note that no dialog is visible while it works.
It will tell you when it finishes.

I have encrypted 174 MB in less than a minute, so it shouldn't take too long. (Only the Data and Graphic folder will be encrypted)


P.s. I have been lazy with the GUI, it does disappear while the encryption is taking place.

*hugs*
- Zeriab
5
Hey all!
I made a list of what I considered important points in event or points which could take a long time to discover on your own. (If you discover it at all)
Feel free to add your points ^_^


  • Set Move Route overrides previous move route for the player or given event
  • Set Move Route and Player Touch
  • Wait for Move's Completion issue
  • New Event Tab cancels Move Route
  • Reluctance of events moving onto other events
  • Tileset events and Through
  • Parallel/Autorun events loops
  • Common events on parallel trigger restart on map change
  • Force action does not work on turn 0 in battles
  • Defending actor + force action
  • Self-switches in common events
  • 'This event' in common events


Set Move Route overrides previous move route for the player or given event
I have seen a lot of support questions regarding which is due to this.
A typical cause are evented dash systems. You have to set a move route to change the speed of the player.
You can for example set a move route for the player to do something in a cutscene. The dash system then sets a new move route for the player and the player stops after one step or so.
The same holds for any events. Note that each event has their own move route (or none).
Note that events and the player don't have to have a move route. This is important for the following issue:

Set Move Route and Player Touch
If you have a passable event on Player Touch trigger, the event will NOT trigger if the player walks over the tile using a Set Move Route. If the player stops on the tile the event will trigger, but it will not trigger if the player continues.
You can fix this by setting the event trigger to Event Touch.

Wait for Move's Completion issue
Its wait until the player and no event have a move route. If you set a move route for an event which is on repeat action, then it never ends.
This can cause the game to practically freeze. As a general rule don't use Wait for Move's Completion. It can lead to hard-to-spot freezes which in the worst case can appear to happen randomly.

New Event Tab cancels Move Route
Let's say you have an event with two tabs, each with the same character.  The condition on the second tab is not true (so the first tab is 'active').
You have another event that executes a "Set Move Route" on this character event.  The character starts moving across the screen.
If the condition on the second tab becomes true while the character is in the middle of the move route, the move route will be cancelled and he will stop walking.

Reluctance of events moving onto other events
An event will not move onto a tile occupied by another event unless either of them has Through ON. (Or both)
The same holds for the player. The player basically treated as an event when other events move around.

Tileset events and Through
The passability settings are ignored for events which has Through ON. The same holds for the player.
Tileset events are interesting in this regard because they can turn impassable tiles to passable tiles.
Let's say you have a tileset event which turn an impassable tile into being passable. If we set Through ON for the event then its passability settings will be ignored. Yes, the passable tile will now not be passable anymore.
It is something to keep in mind. Especially for bridges that will be built some time into the game.
If you events to be able to cross the bridge without having Through ON then you must make the tiles underneath passable and use blocking events for when the bridge is out. Let the pages displaying the bridges have Through ON.

Parallel/Autorun events loops
When a parallel or autorun event has finished processing it will be processed again (next frame in case of parallel events).
Typical issues happens when you use event commands which takes several frames to complete.
For example showing an animation or moving an event or the player with a parallel event. Only the first few frames are shown over and over with the show animation and only the first move command is considered.
The solution simple to change the condition so that it doesn't loop after it has finished processing the event, which can be done by erasing the event or changing the page. Or in terms of common events, turning off the triggering switch.
In this aspect the Exit Event Processing command may lead to confusion since it ends the processing of the event. You may therefore get unwanted loops. Just change the conditions before the exit event processing command.

Common events on parallel trigger restart on map change
A typical case where this is a problem is if you want to have an invisible time running across maps.
If you have a Wait 999 frames event command, then it'll start over each time you transfer to a new map. (A solution for this is to wait say 4 frames, add to a variable and Exit Event processing if the variable is not over some value (conditional branch))

Force action does not work on turn 0 in battles
You can for example not have an item which causes on of the actor to attack immediately, nor can you have the monsters attack immediately. (I.e. before you can run away)
You can mimick it with animations and deal damage, but it's very tedious.

Defending actor + force action
This may not be an issue, but it's worth noting.
Let's say you set Actor 2 to defend and have a force action which causes Actor 2 to attack in Normal sequence. (Let's say the force action is in a common event triggered by the skill of Actor 3)
If Actor 2 acts before Actor 3 then Actor 2 will not attack when Actor 3 acts, but Actor 2 will not defend anymore. This means more damage for monsters attacking Actor 2 after Actor 3 has acted.

Self-switches in common events
I have wrote a tutorial about this matter ~ http://forum.chaos-project.com/index.php?topic=2425.0

'This event' in common events
It refers to the map event calling that common event (either directly or indirectly)
If there's not a map event calling that common event then the event command has no effect.



Special Thanks
Animus
Kipe
Regi
Shaz

*hugs*
- Zeriab
6
General Discussion / PNO - Threads and other evils
June 10, 2009, 05:48:31 am
Quote from: Blizzard on June 10, 2009, 04:57:18 am
The "Script is hanging" error on start up happens because the game is trying to connect to a host that doesn't exist (aka bogus IP). There's nothing that can be done about it except completely rewriting Ruby's socket class because it simply takes a while until the timeout of the socket is exceeded. And I'm not gonna do that because it might turn out that I actually have to go as deep as messing with Windows' API to actually fix that irrelevant problem. When you set up the servers in the game properly, it's not supposed to ever happen anyways.


Isn't that problem easily solved by having a thread controlling the socket and a thread controlling the rest?
Of course you may hit the problem with the Ruby interpreter pausing during Win32API calls, but that's a RMXP specific problem rather than a Ruby problem.

Either way this game really looks good :3
7
Here is a small Utility module which provides method for reading from and writing to .ini files.

module Utility
  #############
  # DLL STUFF #
  #############
  READ_INI         = Win32API.new('kernel32',  'GetPrivateProfileStringA',
                                  %w(p p p p l p), 'l')
  WRITE_INI        = Win32API.new('kernel32',  'WritePrivateProfileStringA',
                                  %w(p p p p), 'l')
  ##
  # Read from system ini
  #
  def self.read_ini(key_name, app_name = 'Game', filename = 'Game.ini',
                    buffer_size = 256, default = '')
    buffer = "\0" * buffer_size
    READ_INI.call(app_name, key_name, default, buffer, buffer_size - 1,
                  ".\\" + filename)
    return buffer.delete("\0")
  end
 
  ##
  # Write to system ini
  #
  def self.write_ini(key_name, value, app_name = 'Game', filename = 'Game.ini')
    return WRITE_INI.call(app_name, key_name, value.to_s, ".\\" + filename)
  end
end


This can for example be used to store configuration information in Game.ini instead of storing it in a separate file. Configuration data the player should be able to change that is.
You can of course also mess around with the already existing data in Game.ini.

If you for example want to read the title of the game you can do that with:
Utility.read_ini('Title')


If you want to save that Windowskin number 3 is used you can do that with:
Utility.write_ini('Windowskin', '3')


Now you may want that setting to be save specific and you should not write save specific details to the .ini file. You can of course, but you really should think it through before doing so.
A global setting is whether to start the game up in fullscreen or not which for example could be done with:
Utility.write_ini('Fullscreen', '1', 'Window')


Notice the new argument I have put there.
Try and see what the effects are in the ini file.
There are also other arguments which I have not covered which you can experiment with.
Just note that the values are strings

*hugs*
- Zeriab
8
F12 Pause with image script
Authors: Zeriab
Version: 1.1
Type: Pause system, F12 reset prevention
Key Term: Misc System



Introduction

This script changes the functionality of the F12 button so it toggles pause on and off instead of resetting the game.
It displays an image while paused.



Screenshots




Script

Spoiler: ShowHide
#==============================================================================
# ** Pausing with F12
#------------------------------------------------------------------------------
# Zeriab
# Version 1.1
# 2009-05-25 (Year-Month-Day)
#------------------------------------------------------------------------------
# * Version History :
#
#   Version 1.0 -------------------------------------------------- (2009-05-22)
#   - First release
#
#   Version 1.1 -------------------------------------------------- (2009-05-25)
#   - The pause image now appears immediately when F12 is pressed.
#   - Transitions are cut short rather than restarted when F12 is pressed.
#------------------------------------------------------------------------------
# * Description :
#
#   This script changes the functionality of pressing F12 during the game
#   from resetting the game to (un)pausing the game. A picture is displayed
#   while the game is paused. (Having a picture is optional)
#------------------------------------------------------------------------------
# * License :
#
#   Copyright (C) 2009  Zeriab
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU Lesser Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU Lesser Public License for more details.
#
#   For the full license see <http://www.gnu.org/licenses/>
#   The GNU General Public License: http://www.gnu.org/licenses/gpl.txt
#   The GNU Lesser General Public License: http://www.gnu.org/licenses/lgpl.txt
#------------------------------------------------------------------------------
# * Compatibility :
#
#   Is most likely not compatible with other F12 prevention scripts.
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place this script anywhere above main.
#   The image file 'pause' present in Graphics/Pictures is used.
#   Note: No picture is shown if there is no 'pause' in Graphics/Pictures.
#==============================================================================

#=============================================================================
# ** Reset class (because it won't be defined until F12 is pressed otherwise)
#=============================================================================
class Reset < Exception
 
end
#=============================================================================
# ** Module Graphics
#=============================================================================
module Graphics
  class << self
    #-------------------------------------------------------------------------
    # * Aliases Graphics.update and Graphics.transition
    #-------------------------------------------------------------------------
    unless self.method_defined?(:zeriab_f12_pause_update)
      alias_method(:zeriab_f12_pause_update, :update)
      alias_method(:zeriab_f12_pause_transition, :transition)
    end
    #-------------------------------------------------------------------------
    # Change the update method so F12 toggles pause
    #-------------------------------------------------------------------------
    def update(*args)
      # Try to update normally
      begin
        zeriab_f12_pause_update(*args)
        return
      rescue Reset
        # Do nothing
      end
      # F12 has been pressed
      done = false
      # Store frame count
      frame_count = Graphics.frame_count
      # Show pause image
      @sprite = Sprite.new
      @sprite.z = 9999
      begin
        @sprite.bitmap = RPG::Cache.picture('pause')
      rescue
        @sprite.bitmap = Bitmap.new(32,32)
      end
      # Keep trying to do the update
      while !done
        begin
          zeriab_f12_pause_update(*args)
          done = true
        rescue Reset
          # Do Nothing
        end
      end
      # F12 has been released, update until it is pressed again
      while done
        begin
          zeriab_f12_pause_update(*args)
        rescue Reset
          done = false
        end
      end
      # F12 has been pressed, keep trying to update
      while !done
        begin
          zeriab_f12_pause_update(*args)
          done = true
        rescue Reset
          # Do nothing
        end
      end
      # F12 has been released, dispose pause image
      @sprite.dispose
      # Set proper frame count
      Graphics.frame_count = frame_count
    end
    #-------------------------------------------------------------------------
    # Changes the transition so it is cut short if F12 is pressed
    #-------------------------------------------------------------------------
    def transition(*args)
      done = false
      # Keep trying to do the transition
      while !done
        begin
          zeriab_f12_pause_transition(*args)
          done = true
        rescue Reset
          # Set transition length to 0 frames.
          args[0] = 0
        end
      end
    end
  end
end



Instructions

Copy+paste the script into the script editor. (Unsure? See this tutorial)
Import picture named pause to Graphics/Pictures. You can use the example picture below for trying it out.




Compatibility

Will most likely not work together with other scripts changing the functionality of the F12 button.


Credits and Thanks

Credits goes to Zeriab for writing the script and making the Paused picture.
Thanks to sixdd for suggesting pause toggling and showing a pause image.
Thanks goes to Kiriashi for inspiration on cutting the transitions short.



Author's Notes

If F12 is pressed during a transition the transition is cut short.
You can use the pause image and modify it any way you like. You don't have to provide credits or anything.
Note that it does NOT work on VX.

License: ShowHide
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser Public License for more details.

For the full license see <http://www.gnu.org/licenses/>;
The GNU General Public License: http://www.gnu.org/licenses/gpl.txt
The GNU Lesser General Public License: http://www.gnu.org/licenses/lgpl.txt
9
Tutorial Database / [RMXP] Common Events
January 01, 2009, 06:26:14 am
Common Events
Note: This is aimed at intermediate eventers


Common events are pretty much like map events with change that they are made common to all maps and don't have pages. (Or exactly one page)
I will discuss various issues of common events though first take a look at this common event and map event:

What happens when you trigger the map event?
What would happen if you change the common event's trigger to Parallel instead of Autorun and then trigger the map event?
What happens if you call the common event from a battle event?
Basically, how does self-switches work in common events with the added question about order of execution.


The call stack
Self-switches
The common events do not have self-switches attached to themselves, but you can still use the self-switch functionality. They work differently than in map events.
To help understand how self-switches work in common events I will introduce the concept of a Call Stack. Whenever you use the Call Common Event... event command you place the common event on the Call Stack. (On top of the event which calls the common event)
To help you understand the Call Stack try to imagine a stack of papers. Each time you call a common event you place on top of the stack just like you would place a piece of paper on top of the paper stack. Whenever you have processed the top common event you remove it from the stack and look at the event which called the common event since it is now on top. This event is then continued from where it called the common event.
A bit like you read the paper on top of the stack. You come to a 'call common event' and place another paper on the stack. Once you have read that paper you go back to the previous paper and read from where you left it.

All except the bottom event (the event which is not called with the Call Common Event... event command) in the Call Stack are common events because only common events can be called. The bottom event can be a map event, battle event or a common event.
The bottom event is the important event when considering self-switches since the Control Self Switch... command only makes any difference when the bottom event is a map event. If the bottom event is a map event then the self-switches changed will be the map event's self-switches. Likewise is the self-switches of the map event considered in conditional branches. If the bottom event is not a map event then all self-switches are OFF and you cannot turn them ON.
You can have several map events call the same common event. When each map event is interpreted it is used for considering self switches.

Here is an example of a chest (2 pages) and a common event:


Set move route
As you can see I have used a Set Move Route... command which works similarly to Control Self Switches....
If you select This Event as the event to use it will only work if the bottom event of the Call Stack is a map event.
The map event is the one moved just like how the self switches of the map event were considered in the common event.
If the Player or a specific event was chosen then it will work on the map, but not in the battle.
Note that when choosing a specific event the id is considered. If you call the event on a different map it will try to use the event with the same id on the different map.
Note also that you can only pick among the events on the map you look at (or lasted looked at). You may therefore need to choose a different map before you can pick the event you want.


Code reuse
After having made the event above you can just copy and paste the chests to get chests that you can only open once. What are the advantages of this approach? What are the disadvantages?
If you change the common event you will change the functionality of all the chests. If you want it to open a little faster you just have to do it in the common event. No need to find all chests and change them all.
A disadvantage which I am sure you have realized is that all the chests currently contain the same thing, 50 gold.  You can of course easily change it, but you would change the contents of all the chests. What if you wanted the chests to have different contents? Well, you can remove the message and gold gain from the common event and place it in the chest. Then you can change it from chest to chest while still sharing the way of opening a chest in the common event.
You can say that you reuse the code for opening a chest. You only define it one place and then reuse it in each chest. Of course you can make a common event which other common event calls. Code reuse is about preventing copy-pasting of event code where you make no alterations.
Does this mean it is always a good idea to share functionality? NO! It is not always a good idea to share functionality. You have to evaluate the need on a case-by-case situation and sometimes a solution which is preferable in one situation or game is not preferable in another situation or game.

Code reuse typically increases complexity initially although it may turn out later to increase the productivity. On the other hand it may turn out to decrease the productivity.
Take a look at this event demo: http://www.rpgm.org/downloads/1421/Doors.zip (Mirror)
It is a door system where the player can pick the preferred functionality of the doors, or at least the standard doors.
Is it ridiculous? Has too many common events and effort been spent on the doors? Is it even worth it? Is it too little?
It is case-dependent. It most cases probably a little too much, but then again, maybe not. Maybe the player will like being able to speed up transitions after a while. It may just add an extra touch.
I do hope you see what I am getting at.
There is of course much more to be discussed about code reuse but I will leave that to another tutorial.


"Common event call has exceeded maximum limit."
You get this error when there are too many events on the call stack. There is a fixed limit of at most 100 events on top of the bottom event. If you try an additional call common event you get the error.
You can alter this limit with a simple edit to the Interpreter script. Note that the amount of calls is limited by the system stack as well. With a simple event which called itself I got to make 491 calls before getting a SystemStackError. Do not make the mistake of thinking you can use up to 491 calls since some event commands can easily need more calls and with the alias style in many scripts you can easily have more calls.

I can't imagine a situation where the 100 call limit will be a problem except for badly designed events. You can for example consider the situation where you have one common event calling another common event which in turn calls the first common event. There, you have a cycle. This error should definitely be discovered, but you can have designs where it may not necessarily be discovered.
Consider an evented menu where you have a common event for each menu item. The menu is shown as well. If you move up or down you call the common event corresponding to the new menu item and then just prepare for that event to exit afterwards. When you have gone up and down more than 100 times you get the error. It is definitely possible that you won't test for this.

How should it have been designed instead? One solution could be to introduce a common event which launches the common events for each menu item corresponding to a variable. Each of the common events will exchange the explicit calls to other menu common events with an implicit call by changing the variable and then exiting. The launcher common event will then call the common event.
We now have a structure which should not continuously increase the size of the stack. (The amount of papers in it)


Exercises
These exercises are totally optional. You can use them to get a feeling of what I am talking about and for getting some experience.

Exercise 1
The first exercise is about answering the questions answered at the very top about the Mysterious person.
Try to guess what messages will be shown when the common event trigger is on Autorun.
Try to guess what messages will be shown when the common event trigger is on Parallel.
Try to guess what messages will be shown if a battle event calls the common event. (Common event triggers won't work in battles)

I suggest you write it down and then use RMXP to check it the answers. Be sure to enter the events exactly as shown here.
Here are the answers although I recommend you using RMXP to check the answers if possible.
Spoiler: ShowHide
Try to guess what messages will be shown when the common event trigger is on Autorun.
Message 1: ON

Try to guess what messages will be shown when the common event trigger is on Parallel.
Message 1: ON
Message 2: OFF

Try to guess what messages will be shown if a battle event calls the common event.
Message 1: OFF


Exercise 2
This exercise revolves around making a chest system you are satisfied with.
Try to make it easy to copy while still being easy to modify. This is about making your game quicker.
You can additionally consider storing how many chests have been opened for stats fanatics. (Believe me; if you get an idea like this far into the project you will be VERY pleased if all the chests use a common event)

Exercise 3
Everybody loves puzzles.(Untrue statement)
Therefore this exercise is about making a puzzle or at least some building stones for puzzles.
The idea behind the puzzle is to get from point A to point B. There are some objects in the way with which you can interact.
Here is a list of the building blocks:

  • A boulder which you can push forward
  • A boulder which keeps sliding forward until it hits something or you push it another way
  • A boulder which you only can pull backwards
  • A boulder which you can both push and pull
  • A boulder which you also can drag sideways
  • Anything else you can imagine


Try to create nice scalable solutions. Hopefully boulders you can just copy and paste.
I won't promise that all of these types of boulders are feasible to create nice and scalable. It is up to you to find out.
Good luck.


Final notes
While this is very tutorial like I want discussions. Hopefully insightful discussion about beneficial common event use.
I realize that I have only scratched the surface here. I haven't talked about scalability yet. I feel that it is a bit too much in an intermediate eventing tutorial.
I will be happy to hear any suggestions on how to improve this tutorial.
I want to thank everyone who takes time off for reading my tutorial and everyone who replies.
I hope you will become wiser in your eventing decisions.

Thanks
Iceplosion for some very nice critique!

*hugs*
- Zeriab
10
RMXP Script Database / [XP] Quest Book
December 15, 2008, 10:32:04 am
Quest Book
Authors: Zeriab
Version: 1.2
Type: Quest Organization and Display System
Key Term: Misc System



Introduction

This is a fairly heavy quest book which provides an overview over a number of quests represented by pictures. Each of the quests can be selected and a window with quest specific details will be shown. (The pictures are 80x80)


Features

Quests can have any number of parts. (Only the text for the current part is shown)
The quest book can be applied to a game in progress since whether quests are solved or not depends on variables, switches or a combination of them.
Solved quests kept and can be shown.
The opacity of background of the quest book can be changed and a picture can be shown behind it accordingly to a variable.


Screenshots




Demo

QuestBook version 1.2 (rar)


Script

I really suggest the demo rather than the script since it also contains example pictures.
I have included them for people who just want to take a look at the script.
Quest Book Script

Here is the example usage of the script used in the demo: (I would suggest placing it in a different section)


Installation

Insert the script just above main. (Like so many other scripts)
Insert just below the script a new section. This section will be were you configure the script. Create quests and such.


Instructions

I will try an experiment here. Instead of written a big wall of text explaining everything I want to know where my explanation should be in-depth and where it should be more shallow. I.e. where should I focus.
Please look at the example usage of the script.
What is for you the most confusing parts?
Will you be able to modify the quests?
Will you be able to add another quest?
Will you be able to add/remove a quest part?
Is it clear how the Quest_Criteria works?
Do you understand the top part where you configure the background?
How do you add/remove another background picture?
How do you change the opacity of the quest book? The path?
Can you figure out how to modify, add and remove the actual picture files? (You should probably download the demo for this)

This is a case of help me become better at helping you. I am sorry for the inconvenience.


Compatibility

If you are using exotic save systems: ShowHide

At the bottom of the script (Binding to Scene_Load section in the demo) you find this code
#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
#  Aliases and uses the on_decision method to reset $game_quests on the proper
#  time.
#==============================================================================

class Scene_Load < Scene_File
 # Check if the alias already exists (To avoid F12 errors)
 unless self.method_defined?(:zeriab_questbook_scene_load_on_decision)
   alias zeriab_questbook_scene_load_on_decision :on_decision
 end
 def on_decision(*args)
   # Call the original method
   zeriab_questbook_scene_load_on_decision(*args)
   # Check if the scene has changed
   unless $scene == self
     # Reset quest data
     $game_quests.reset
   end
 end
end


The idea with that snippet is to call a method when you load a save. It is used to preserve consistency in the quest book
$game_quests.reset


Note only do this if there is a problem with the snippet. (You can try putting a " p 'test' " in the reset method in Game_Quests if you want to test that it is called when you load a game)



Credits and Thanks

Credits goes to Zeriab
Special thanks goes to Indinera who requested the script for the game Laxius Force

I would like to thank everyone using their time to try and use my system.
I would like to thank everyone reading this topic.
Thanks.


Author's Notes

License: ShowHide
Copyright (C) 2007  Zeriab

This script is free to use under the condition of Zeriab being credited. (Commercial and non-commercial projects alike)
This script can be freely changed and distributed under the condition of the original author remains in the script.
Verbatim copies of this topic can be freely distributed

This script is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


This script were designed for a game so the visualization is very fixed.

I would be delighted if you report any bug, errors or issues you find.
In fact I would be delighted if you took the time and replied even if you have nothing to report.
Suggestions are more than welcome

And finally: ENJOY!

- Zeriab
11
Scheduler
Authors: Zeriab
Version: 1.0
Type: Scheduler
Key Term: Scripting Tool



Introduction

How many of you tried creating a parallel process where you put in an amount of frames and then a script call or something else afterwards?
Basically a simply way of doing something after an amount of frames. This is the principle behind the script. To schedule pieces of code to be executed after an arbitrary amount of frames. No making decrementing counters. The scheduler takes care of all that or well most of it. It is still not as simple as using the wait event command.


Script

#==============================================================================
# ** Scheduler
#------------------------------------------------------------------------------
#  This class allows to schedule a proc or method call a given amount of frames
#  into the future with any amount of arguments
#==============================================================================
class Scheduler
  #============================================================================
  # ** Order
  #----------------------------------------------------------------------------
  #  An order is a proc, method or something else which has 'call' as a method,
  #  and the arguments to pass along.
  #============================================================================
  # Create an struct for containing the data
  Order = Struct.new(:callable, :arguments)
  # Extend the class with a call-method which calls the callable with the args
  class Order
    #------------------------------------------------------------------------
    # * Call the callable with the present arguments
    #------------------------------------------------------------------------
    def call
      callable.call(*arguments)
    end
  end
  #============================================================================
  # ** RecurringOrder
  #----------------------------------------------------------------------------
  #  An order which is recurring every specified amount of time until
  #  FalseClass is returned from the call.
  #  Note that arguments remain the same for each call
  #============================================================================
  # Create an struct for containing the data
  RecurringOrder = Struct.new(:callable, :arguments, :frames)
  # Extend the class with a call-method which calls the callable with the args
  class RecurringOrder
    #------------------------------------------------------------------------
    # * Call the callable with the present arguments
    #------------------------------------------------------------------------
    def call
      result = callable.call(*arguments)
      unless result == FalseClass
        Scheduler.schedule_recurring(frames, frames, callable, *arguments)
      end
    end
  end
 
  #============================================================================
  # ** Mapping
  #----------------------------------------------------------------------------
  # Maps an index to an array. Values can be added to these value.
  # Each array starts empty.
  #============================================================================
  class Mapping
    #------------------------------------------------------------------------
    # * Initialization
    #------------------------------------------------------------------------
    def initialize
      @mapping = {}
    end
    #------------------------------------------------------------------------
    # * Add an value to a given index
    #------------------------------------------------------------------------
    def add(index, value)
      @mapping[index] = [] if @mapping[index].nil?
      @mapping[index] << value
    end
    #------------------------------------------------------------------------
    # * Retrieve the list of values mapped to the index
    #------------------------------------------------------------------------
    def get(index)
      return [] if @mapping[index].nil?
      @mapping[index]
    end
    #------------------------------------------------------------------------
    # * Delete the array the index is mapped to. Conceptually it is now empty
    #------------------------------------------------------------------------
    def empty(index)
      @mapping.delete(index)
    end
  end
 
  #--------------------------------------------------------------------------
  # * Initialization
  #--------------------------------------------------------------------------
  def initialize
    # This maps
    @mapping = Mapping.new
    @tick = 0
  end
  #--------------------------------------------------------------------------
  # * Scheduling
  #--------------------------------------------------------------------------
  def schedule(frames, callable, *arguments)
    # Create an order
    order = Order.new(callable, arguments)
    @mapping.add(frames + @tick, order)
  end
  #--------------------------------------------------------------------------
  # * Scheduling
  #--------------------------------------------------------------------------
  def schedule_recurring(frames, frames_to_wait, callable, *arguments)
    # Create an order
    order = RecurringOrder.new(callable, arguments, frames_to_wait)
    @mapping.add(frames + @tick, order)
  end
  #--------------------------------------------------------------------------
  # * Update the scheduler
  #--------------------------------------------------------------------------
  def update
    # Get the orders for the current tick
    orders = @mapping.get(@tick)
    # Delete the mapping's reference to the list of orders
    @mapping.empty(@tick)
    # Call each order
    for order in orders
      order.call
    end
    # Advance the tick (next frame)
    @tick += 1
  end
 
  #--------------------------------------------------------------------------
  # * 'Singleton' principle used although you can easily make
  #   an extra scheduler. (Class method only works for this)
  #--------------------------------------------------------------------------
  @@instance = self.new
  def self.instance
    return @@instance
  end
  ## Class methods point to the equivalent instance methods
  def self.schedule_recurring(*args) instance.schedule_recurring(*args); end
  def self.schedule(*args) instance.schedule(*args); end
  def self.update(*args) instance.update(*args); end
end


The latest version will be present here: http://zeriab.plesk3.freepgs.com/root/scripts/Scheduler/scheduler.txt
You could check it if more than a month has passed since last edit. You know, just in case.
More generally all material related to the Scheduler except the forum topic can be found here: http://zeriab.plesk3.freepgs.com/index.php?dir=scripts/Scheduler/

Here is a binding if you want the scheduler to work for every frame. Basically for each Graphic.update the scheduler is updated.
It doesn't matter whether you are in a menu, title screen, battle. As long as Graphic.update is called so is the scheduler. (The main scheduler)
module Graphics
  class << self
    unless self.method_defined?(:scheduler_update)
      alias :scheduler_update :update
    end
    def update(*args)
      scheduler_update(*args)
      Scheduler.update
    end
  end
end



Instructions

Semi-big and evil instructions: ShowHide
You can schedule in two ways.
You can do a one-time schedule which works like this: (Using the class method)
Scheduler.schedule(frames, callable, *arguments)
# Here's an example
Scheduler.schedule(65, Proc.new {|x,y| p x,y}, "A string", 42)

The 65 means that the proc will be called after 65 frames. (Or 65 ticks to be more precise. 1 update = 1 tick usually)
After 65 ticks the proc {|x,y| p x,y} will be called with the arguments x = "A string" and y = 42. (The *arguments means any number of arguments. This can also be no arguments at all)
The Scheduler uses duck typing and assumes that anything which has the .call method works properly in the context. I imagine procs and methods to be the most commonly used.

The next is that you can schedule a recurring call which works like this: (Using the class method)
Scheduler.schedule_recurring(frames, frames_to_wait, callable, *arguments)
# Here's an example
Scheduler.schedule_recurring(65, 30, Proc.new {|x,y| p x,y}, "A string", 42)

The arguments is the same as for the one-time with the addition of the frames_to_wait argument.
This specifies that after the first 65 ticks each recurring call will happen after 30 ticks.
This will continue until the callable returns FalseClass. (Mind you it's false.class and not false)

Now you have to update the schedule every frame or it won't schedule properly.
Here is a binding where the scheduler updates every time the Graphics module updates. (Made for XP. I am unsure whether this part works in VX)
module Graphics
  class << self
    unless self.method_defined?(:scheduler_update)
      alias :scheduler_update :update
    end
    def update(*args)
      scheduler_update(*args)
      Scheduler.update
    end
  end
end


Note that the class methods only work for one scheduler. I believe this should be the generally working Scheduler.



Compatibility

The Scheduler alone use only Ruby and could easily be placed in a Ruby if one wanted that.
It is highly unlikely that you will encounter any compatibility issues with the backbone alone since it is independent from RGSS/2 library.

On the other side there could potentially be problems with the bindings which makes use of the scheduler so it actually does something in game.
Currently there is only the Graphics.update binding which makes compatibility issues very unlikely.


Future Work
- Explicitly exit/stop a scheduler. The scheduled items can then be discard, executed or maybe something else.
- Error handling. (This may be an external. I.e. not embedded in the core)
- Documentation


Credits and Thanks

Credits goes to Zeriab for creating the system

I would like to thank everyone using their time to try and use my system.
I would like to thank everyone reading this topic.

Thanks.


Author's Notes

I would be delighted if you report any bug, errors or issues you find.
In fact I would be delighted if you took the time and replied even if you have nothing to report.
Suggestions are more than welcome.

Note that I will release a demo which shows a couple of ways of using this script.
Note also that I will always make a post when I have an update. (Small stuff like typos excluded)

And finally: ENJOY!

- Zeriab
12
Zeriab's Caterpillar Script
Authors: Zeriab
Version: 1.0
Type: Party Movement System
Key Term: Custom Movement System



Introduction

This script creates a caterpillar of the party members by using events present on the map. (You need to actually make the events in the editor)
When the caterpillar is deactivated they act just like any other event. Most event commands still works on the events when the caterpillar is activated, but the results be strange.


Screenshot




Demo

Currently I can only present a demo which includes Wachunga's Multiple Message Windows which requires SDK 1.5: MediaFire
This is because Wumpi and Despain requested it to work with that message system. (Only the caterpillar script is my work. I had nothing to do with the rest)


Script

Spoiler: ShowHide
#==============================================================================
# ** Zeriab's Caterpillar Script
#------------------------------------------------------------------------------
# Zeriab
# 1.0
# 2008-08-25
#------------------------------------------------------------------------------
# This script creates a caterpillar of the party members by using events.
#------------------------------------------------------------------------------
# Paste this script just above main.
#
# Put \cat_actor[3] in the name of an event and it will be considered the event
# for the actor with id 3. The name could for example be "Cyrus\cat_actor[3]"
#
# The switch number specified with CATERPILLAR_ACTIVE_SWITCH (default is 23) is
# used to determine whether the events should be positioned in the caterpillar
# or not. Then the switch is off they are just like any other event.
# You can do CATERPILLAR_ACTIVE_SWITCH = true for always having the caterpillar
# enabled
#
# The REMOVE_VISIBLE_ACTORS (default is true) is used to determine whether
# actor event not in the party should be erased or not.
# If it is set to an integer rather than true or false the switch with the
# corresponding id is used. For example REMOVE_VISIBLE_ACTORS = 21 will allow
# you to determine whether the events should be erased or not depending whether
# switch 21 is OFF or ON.
#
# The MAX_ACTORS (default is 4) is used to determine how many player moves
# should be remembered. Only change this if you can have a party with more than
# 4 actors.
#==============================================================================
class Game_Caterpillar
 CATERPILLAR_ACTIVE_SWITCH = 23
 REMOVE_VISIBLE_ACTORS = true
 MAX_ACTORS = 4
 #--------------------------------------------------------------------------
 # * Initialize the caterpillar
 #--------------------------------------------------------------------------
 def initialize
   @actors = []
   @actor_id_to_event = {}
   @move_list = []
 end
 #--------------------------------------------------------------------------
 # * Clear the caterpillar data
 #--------------------------------------------------------------------------
 def clear
   @actors.clear
   @actor_id_to_event.clear
   @move_list.clear
 end
 #--------------------------------------------------------------------------
 # * Check if the caterpillar script is active
 #--------------------------------------------------------------------------
 def active?
   if CATERPILLAR_ACTIVE_SWITCH.is_a?(Integer)
     return $game_switches[CATERPILLAR_ACTIVE_SWITCH]
   else
     return CATERPILLAR_ACTIVE_SWITCH
   end
 end
 #--------------------------------------------------------------------------
 # * Add an actor event to the caterpillar
 #--------------------------------------------------------------------------
 def add_actor(event, actor_id)
   @actor_id_to_event[actor_id] = event
   event.move_list.clear
   added = false
   for actor in $game_party.actors
     if actor.id == actor_id
       @actors << event
       event.moveto($game_player.x, $game_player.y)
       added = true
     end
   end
   if remove_visible_actors? && !added && active?
     event.erase
   end
 end
 #--------------------------------------------------------------------------
 # * Check if visible actors should be removed
 #--------------------------------------------------------------------------
 def remove_visible_actors?
   if REMOVE_VISIBLE_ACTORS.is_a?(Integer)
     return $game_switches[REMOVE_VISIBLE_ACTORS]
   else
     return REMOVE_VISIBLE_ACTORS
   end
 end
 #--------------------------------------------------------------------------
 # * If the game player has been centered. I.e. teleported somewhere.
 #--------------------------------------------------------------------------
 def center
   # Check if the caterpillar is active
   return unless active?
   # Clear the move_llist
   @move_list.clear
   # Refresh the caterpillar
   update
   # Move the actors to the new place
   for event in @actors
     event.moveto($game_player.x, $game_player.y)
     event.move_list.clear
   end
 end
 #--------------------------------------------------------------------------
 # * Refresh the caterpillar. (Use sparingly)
 #--------------------------------------------------------------------------
 def refresh
   # Check if the caterpillar is active
   return unless active?
   # Clear the data
   clear
   # Check each event
   for event in $game_map.events.values
     if event.is_a?(Game_Event)
       event.check_caterpillar
     end
   end
   # Center the events around the player
   center
   # Update the caterpillar
   update
 end
 #--------------------------------------------------------------------------
 # * Register a player move
 #--------------------------------------------------------------------------
 def register_player_move(move_speed, *args)
   # Check if the caterpillar is active
   return unless active?
   # Add the new command
   @move_list.unshift([move_speed, args])
   # Append the new moves to the caterpillar events
   update_actor_movement
   # Check if the last command should be removed
   if @move_list.size > MAX_ACTORS + 1
     # Remove the last move command
     @move_list.pop
   end
 end
 #--------------------------------------------------------------------------
 # * Updates the actors movement.
 #--------------------------------------------------------------------------
 def update_actor_movement
   for i in 0...@actors.size
     if i + 1 < @move_list.size
       command = @move_list[i + 1]
       actor = @actors[i]
       actor.move_list.unshift(command[1])
       actor.move_speed = command[0]
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Update the caterpillar.
 #--------------------------------------------------------------------------
 def update
   # Check if the caterpillar is active
   return unless active?
   old_actors = @actors
   @actors = []
   # Create a copy of the party actors
   caterpillar = $game_party.actors.dup
   # Remove the first element
   caterpillar.shift
   # Go through each actor that's possible present in the caterpillar
   for actor in caterpillar
     event = @actor_id_to_event[actor.id]
     unless event.nil?
       @actors << event
       event.unerase if remove_visible_actors?
       event.character_name = actor.character_name
     end
   end
   if remove_visible_actors?
     # Go through the old actors to see if any should be erased
     for actor in old_actors
       unless @actors.include?(actor)
         actor.erase
       end
     end
   else
     # Erase the event for the current player should there be one
     event = @actor_id_to_event[$game_party.actors[0].id]
     event.erase unless event.nil?
   end
 end
 #--------------------------------------------------------------------------
 # * Unerase all erased actor events
 #--------------------------------------------------------------------------
 def unerase_all
   for event in @actor_id_to_event.values
     event.unerase
   end
 end
 #--------------------------------------------------------------------------
 # * Erase actor events not in the party
 #--------------------------------------------------------------------------
 def erase_non_party_events
   for event in @actor_id_to_event.values
     event.erase unless @actors.include?(event)
   end
 end
end

#==============================================================================
# ** Game_Player - Registration of movement
#==============================================================================
class Game_Player < Game_Character
 unless self.method_defined?('zeriab_caterpillar_game_player_center')
   alias_method(:zeriab_caterpillar_game_player_center, :center)
 end
 #--------------------------------------------------------------------------
 # * When the player is centered (i.e. teleported somewhere)
 #--------------------------------------------------------------------------
 def center(*args)
   zeriab_caterpillar_game_player_center(*args)
   $game_system.caterpillar.center
 end
 
 #--------------------------------------------------------------------------
 # * Generate registration of player moves to the caterpillar code
 #--------------------------------------------------------------------------
 MOVE_METHODS = ['move_down', 'move_left', 'move_right', 'move_up',
                 'move_lower_left', 'move_lower_right', 'move_upper_left',
                 'move_upper_right', 'jump']
 
 # Go through each method
 for method in MOVE_METHODS
   # Create the script for the specific method
   PROG = <<_END_
 def #{method}(*args)
   x,y = self.x, self.y
   super(*args)
   unless self.x == x && self.y == y
     $game_system.caterpillar.register_player_move(@move_speed, '#{method}', args, [self.x, self.y])
   end
 end
_END_
   # Run the script
   eval(PROG)
 end
end

#==============================================================================
# ** The simply version of my little module add-on. Will only be added if it
#    has not been added already. (Will not overwrite the extended if it is used)
#==============================================================================
class Module
 # Prevent adding the method again should it already be present.
 unless self.method_defined?('attr_sec_accessor')
   def attr_sec_accessor(sym, default = 0)
     attr_writer sym
     attr_sec_reader sym, default
   end
   
   def attr_sec_reader(sym, default = 0)
     sym = sym.id2name
     string = "def #{sym};" +
              "  @#{sym} = #{default}  if @#{sym}.nil?;" +
              "  @#{sym};" +
              "end;"
     module_eval(string)
   end
 end
end

#==============================================================================
# ** Game_System - The caterpillar class added
#==============================================================================
class Game_System
 attr_sec_accessor :caterpillar, 'Game_Caterpillar.new'
end

#==============================================================================
# ** Game_Event - Checking of name and implementation of movement for actors
#==============================================================================
class Game_Event < Game_Character
 ##
 # Attributes
 #
 attr_sec_accessor :move_list, '[]'
 attr_accessor     :move_speed
 attr_writer       :character_name
 ##
 # Aliases
 #
 unless self.method_defined?('zeriab_caterpillar_game_event_passable?')
   alias zeriab_caterpillar_game_event_initialize :initialize
   alias zeriab_caterpillar_game_event_passable?  :passable?
   if Module.constants.include?('SDK')
     alias zeriab_caterpillar_game_event_update_movement  :update_movement
   else
     alias zeriab_caterpillar_game_event_update  :update
   end
 end
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize(map_id, event, *args)
   # Default update
   zeriab_caterpillar_game_event_initialize(map_id, event, *args)
   # Check if the caterpillar is active
   return unless $game_system.caterpillar.active?
   # Check for caterpillar actor denomination
   check_caterpillar
 end
 #--------------------------------------------------------------------------
 # * Check for caterpillar actor denomination
 #--------------------------------------------------------------------------
 def check_caterpillar
   # Check for caterpillar actor denomination (Last is used if more present)
   @event.name.gsub(/\\cat_actor\[([0-9]+)\]/i) {@caterpillar_actor = $1 }
   # Check if an valid denomination is found.
   if @caterpillar_actor.is_a?(String)
     @caterpillar_actor = @caterpillar_actor.to_i
     if $data_actors[@caterpillar_actor].nil?
       @caterpillar_actor = nil
     else
       $game_system.caterpillar.add_actor(self, @caterpillar_actor)
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Check passability
 #--------------------------------------------------------------------------
 def passable?(*args)
   if @caterpillar_actor.nil? || move_list.empty? ||
      !$game_system.caterpillar.active?
     return zeriab_caterpillar_game_event_passable?(*args)
   else
     return true
   end
 end
 ##
 # SDK and Non-SDK stuff
 #
 if Module.constants.include?('SDK')
   #------------------------------------------------------------------------
   # * Update Movement
   #------------------------------------------------------------------------
   def update_movement
     if @caterpillar_actor.nil? || move_list.empty? ||
        !$game_system.caterpillar.active?
       return zeriab_caterpillar_game_event_update_movement
     end
     # Interrupt if not stopping
     if jumping? or moving?
       return
     end
     # Retrive the command
     command = move_list[0]
     # Call the command
     method(command[0]).call(*command[1])
     # Make sure the x and y are right in the end
     @x, @y = *command[2]
     # Remove the command
     move_list.pop
   end
 else # Non-SDK version
   #------------------------------------------------------------------------
   # * Update Movement
   #------------------------------------------------------------------------
   def update
     # Interrupt if not stopping
     no_move = jumping? or moving?
     # Update
     zeriab_caterpillar_game_event_update
     # Check if it should return
     if $game_system.caterpillar.active? && @caterpillar_actor != nil &&
        !move_list.empty? && !no_move
       # Retrive the command
       command = move_list[0]
       # Call the command
       method(command[0]).call(*command[1])
       # Make sure the x and y are right in the end
       @x, @y = *command[2]
       # Remove the command
       move_list.pop
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Bring back an erased event
 #--------------------------------------------------------------------------
 def unerase
   @erased = false
   refresh
 end
end

#==============================================================================
# ** Game_Map - Clear the caterpillar when changing to a new map
#==============================================================================
class Game_Map
 ##
 # Aliases
 #
 unless self.method_defined?('zeriab_caterpillar_game_map_setup')
   alias zeriab_caterpillar_game_map_setup :setup
 end
 #--------------------------------------------------------------------------
 # * Transfer Player
 #--------------------------------------------------------------------------
 def setup(*args)
   $game_system.caterpillar.clear
   zeriab_caterpillar_game_map_setup(*args)
 end
end

#==============================================================================
# ** Game_Switches - Listening to special switch changes
#==============================================================================
class Game_Switches
 ##
 # Aliases
 #
 unless self.method_defined?('zeriab_caterpillar_game_switches_setter')
   alias zeriab_caterpillar_game_switches_setter :[]=
 end
 #--------------------------------------------------------------------------
 # * Setter
 #--------------------------------------------------------------------------
 def []=(switch_id, value, *args)
   zeriab_caterpillar_game_switches_setter(switch_id, value, *args)
   if switch_id == Game_Caterpillar::CATERPILLAR_ACTIVE_SWITCH
     $game_system.caterpillar.refresh
   elsif switch_id == Game_Caterpillar::REMOVE_VISIBLE_ACTORS
     if value
       $game_system.caterpillar.erase_non_party_events
     else
       $game_system.caterpillar.unerase_all
     end
   end
 end
end

#==============================================================================
# ** Interpreter - Check for use of certain commands
#==============================================================================
class Interpreter
 ##
 # Aliases
 #
 unless self.method_defined?('zeriab_caterpillar_interpreter_command_129')
   alias zeriab_caterpillar_interpreter_command_129 :command_129
   alias zeriab_caterpillar_interpreter_command_322 :command_322
 end
 #--------------------------------------------------------------------------
 # * Change Party Member
 #--------------------------------------------------------------------------
 def command_129
   result = zeriab_caterpillar_interpreter_command_129
   $game_system.caterpillar.refresh
   return result
 end
 #--------------------------------------------------------------------------
 # * Change Actor Graphic
 #--------------------------------------------------------------------------
 def command_322
   result = zeriab_caterpillar_interpreter_command_322
   $game_system.caterpillar.update
   return result
 end
end



Instructions

There are instructions in the header, but they might be hard to understand.
I have tried to break down the instructions so they hopefully are easier to understand.

Big and evil instructions: ShowHide

The script uses map events with special tags in their name.
The map events are tied to specific actors.
If you want an event to represent the actor with id 1 in the database then somewhere in the name of the event put this: \cat_actor[1]
If you want an event to represent the actor with id 19 then use this instead: \cat_actor[19]
Basically you put in \cat_actor[id of actor] in the name of the event in question.
Note that you need to do this for every map. Yes, a lot of work.

You copy the script and paste it just above main. (I.e. you open the script editor, scroll to the bottom of the left form, click on main, press insert and paste the script into the right form)

In the script pay attention to the area just below the script header:
#==============================================================================
class Game_Caterpillar
 CATERPILLAR_ACTIVE_SWITCH = 23
 REMOVE_VISIBLE_ACTORS = true
 MAX_ACTORS = 4
 #--------------------------------------------------------------------------


This is the area of script where you can customize the script. I will go through each of the lines and explain what they do:

CATERPILLAR_ACTIVE_SWITCH = 23
This line will allow you to control whether the caterpillar is active or not by specifying a switch.
By default you can see that we have CATERPILLAR_ACTIVE_SWITCH = 23 which means you can turn the caterpillar ON and OFF by turning switch 23 ON and OFF.
Notice that switch 23 by default start on OFF and you must turn the switch ON before the caterpillar 'works'.
Feel free to change the number 23 to any number you want, i.e. which switch you want.
If you for example want to use switch 0169 instead it should be CATERPILLAR_ACTIVE_SWITCH = 169.

REMOVE_VISIBLE_ACTORS = true
This determines whether events for actors not currently in the party should be erased or not.
You can set this to a number like REMOVE_VISIBLE_ACTORS = 21 if you want to specify it with a switch. In this example you can turn it ON and OFF by turning switch 21 ON and OFF.

MAX_ACTORS = 4
I believe this is self-explonatory. Only change this if you can have more than 4 actors. No harm is done if you have a lower max.

A little word of caution: Do not put leading 0's in front of numbers in ruby. The reason is that Ruby considers numbers with leading 0's as octadecimal. I.e. 0, 1, 2, ... , 6, 7, 10, 11, ...   No 8 nor 9. So for example 15 oct = 13 and 8 oct and 9 oct gives an error.


Here are two call scripts you can use if you feel the caterpillar isn't updated properly like problems with the graphic. Also highly useful should you have custom scripts and need to tell the caterpillar script has changed: (The call script is the event command on the bottom-right of page 3)

This will update the caterpillar to make sure the right events and right graphics are used.
$game_system.caterpillar.update


This will refresh the caterpillar which pretty much 'starts on a fresh'. All the events will be placed the same place as the player. As if you were teleported. Only use this if the update don't work.
$game_system.caterpillar.refresh




FAQ

Why did you make a caterpillar script when so many are around?
Despain requested a script that worked with a particular message script and Wumpi requested a script which used map events.
It didn't seem like there was such a caterpillar script out there although I admittedly didn't search hard.
So I made this believing it would work differently from other caterpillars scripts.

How do you get the events to act differently when they walk in the caterpillar and when they don't?
Create a page which has the caterpillar activation switch as precondition. If that is the top page (the one with the highest number) then that will be the event's functionality when in the caterpillar.
If you have problems with the graphic of some events not being what they are supposed to be then add a 1 frame wait and a script call:
$game_system.caterpillar.update

This should solve the problem. The 1 frame wait is necessary or the page change will not have been registered before the update and the result is the same.

The caterpillar made me stuck
Set the events of the caterpillar to Through. (Options area to the lower right)


Compatibility

This script will most likely not work with any other caterpillar system.
Saves made with this caterpillar script cannot be used should you remove it again. (Saves without it will work with it)
It should work both without and with the SDK and I believe it should with both SDK 1.x and SDK 2.x although I have only tested SDK 1.5.


Credits and Thanks

Credits goes to Zeriab for creating the system

I would like to thank Despain and Wumpi for requesting the script.
I would like to thank everyone using their time to try and use my system.
I would like to thank everyone reading this topic.

Thanks.


Author's Notes

I would be delighted if you report any bug, errors or issues you find.
In fact I would be delighted if you took the time and replied even if you have nothing to report.
Suggestions are more than welcome

And finally: ENJOY!

- Zeriab
13
Disc Changer
Authors: Zeriab
Version: 1.05
Type: Feature Simulator
Key Term: Game Utility



Introduction

This script allows you to change discs where each disc can contain 999 maps.
The transitions between each disc works seamlessly just like a normal transfer.


Features


  • Allows to have more than 999 maps.
  • Seamless trasition.



Screenshots

None needed for this.


Demo

http://zeriab.plesk3.freepgs.com/root/scripts/ChangeDisc.rar


Script

Paste the script just above main.
IF you have the SDK then you are done.

If you do NOT have the SDK:
Find Game_Map in the script editor.
Go to the setup method to around line 50 (assuming the default script)
It should look like this:
    # Load map from file and set @map
    @map = load_data(sprintf("Data/Map%03d.rxdata", @map_id))


Change the second line so the end result is this:
  # Load map from file and set @map
  @map = load_data(sprintf("Data/%sMap%03d.rxdata", $game_system.disc, @map_id))


You have now installed the script.

Script: ShowHide
#==============================================================================
# ** Disc Changer script (Designed for Legend of Harpine)
#------------------------------------------------------------------------------
# Zeriab
# 1.05
# 2008-09-20
#------------------------------------------------------------------------------
# Allows you to change the disc, where each disc can contain 999 maps
#==============================================================================
=begin
INSTRUCTIONS
------------
If you do not have the SDK then you have to change Game_Map
In the Game_Map setup method change the load_data line to this: (Line 50)

  # Load map from file and set @map
  @map = load_data(sprintf("Data/%sMap%03d.rxdata", $game_system.disc, @map_id))

After you have done this the below will work.

This script enables the change_disc command. Use script calls to change the disc.
For disc 1 create a subfolder in your data folder called 'disc1' and place the
map files for disc 1 in there.
For disc 2 you should create a subfolder called 'disc2' and place the map files
for disc 2 in there. And so on for each of your discs.
The syntax is:

  change_disc(number, id = nil, x = nil, y = nil, direction = nil)

The nil numbers mean that those arguments are optional. When you don't use them
then they are set to whatever the current map_id, x, y and direction are at the
moment.

If you want to change to disc 2 then you can put this in a script call:

  change_disc(2)
 
You will then be transfered to disc 2 with the same map id and coordinates as
what the player currently has.
If you want to be more precise and say you want to change to disc 2 on the map
with id 10 and the player must be placed at the tile with x = 6 and y = 13 then
you should put this in a call script:

  change_disc(2, 10, 6, 13)
 
Note that when you start the game the maps directly in the data folder is used.
You can back to them by changing to disc number 0.
Basically, disc number 0 is the maps directly in the data folder and not in any
of the sub folders.

The final argument is the direction. By default the player retains the current
direction. You can put 6 different values as direction:

0, 10 : No change
2     : Turn Down
4     : Turn Left
6     : Turn Right
8     : Turn Up

If you for example want to transfer the player to disc 1, map 43 at x = 30 and
y = 4 with the player looking down you should put this in a call script:

  change_disc(1, 43, 30, 4, 2)
 
*hugs*
- Zeriab
=end

class Game_System
  attr_writer :disc
  def disc
    @disc ||= ''
    @disc
  end
end

class Game_Temp
  attr_accessor :disc_changing
end

class Game_Map
  attr_writer :map_id
  if Module.constants.include?('SDK')
    def setup_load
      # Load map from file and set @map
      @map = load_data(sprintf("Data/%sMap%03d.rxdata", $game_system.disc, @map_id))
    end
  end
end

def change_disc(number, id = nil, x = nil, y = nil, direction = nil)
  # Change disc
  if number.is_a?(Integer)
    $game_system.disc = "disc#{number}/"
  else
    disc = number.to_s
    disc += '/' unless disc[-1] = 47
    $game_system.disc = disc
  end
  # Process arguments
  map_id = id.is_a?(Integer) ? id : $game_map.map_id
  x = $game_player.x unless x.is_a?(Integer)
  y = $game_player.y unless y.is_a?(Integer)
  direction = $game_player.direction unless direction.is_a?(Integer)
  # Set transferring player flag
  $game_temp.player_transferring = true
  # Set transferring player flag
  $game_temp.disc_changing = true
  # Set player move destination
  $game_temp.player_new_map_id = map_id
  $game_temp.player_new_x = x
  $game_temp.player_new_y = y
  $game_temp.player_new_direction = direction
  # Change the current map id in case the new and old are identical.
  $game_map.map_id = 0
end



Instructions

To create a disc you must create a subfolder in the Data folder called Disc1 for disc 1, Disc2 for disc 2 and so on. In general Disc#.  (You should be perfectly able to do Disc14 and so on.)
Then put the maps you want in that subfolder.
When you have done this you can use the instructions in the script header for changing the disc. (The script call is the event command on the third page, bottom-right)

Note that disc 0 is special in that it uses the maps directly in the data folder and not Disc0. These are the maps you can see in the editor.

You could have a project for each disc. That way it's easier to change the maps on each disc any time you want. Just copy paste the changes into the main project when you have made the changes.
You can also just copy the other .rxdata files from the main project into the disc project for making sure the rest of the database and scripts are the same in each project.

Version 1.05:
You can now call the change_disc method with a string instead of a number of the disc. In this case the folder with the given name will be used.



Compatibility

This is probably not compatible with scripts that reads MapInfos.rxdata and displays the names of each map.
You must alter those scripts so it reads the MapInfos.rxdata for the corresponding disc.
You can try to find the place with load_data("Data/MapInfos.rxdata") and change it to this:
load_data(sprintf("Data/%sMapInfos.rxdata", $game_system.disc))



Credits and Thanks


  • Credits goes to Zeriab for writing the script.
  • Thanks goes to Legend of Harpine for which this was originally designed.
  • Special thanks goes to Kain Nobel




Terms and Conditions
License: ShowHide
Copyright (C) 2008  Zeriab

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version with an additional restriction for commercial projects:
Credits must be given to Zeriab.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser Public License for more details.

For the full license see <http://www.gnu.org/licenses/>;
The GNU General Public License: http://www.gnu.org/licenses/gpl.txt
The GNU Lesser General Public License: http://www.gnu.org/licenses/lgpl.txt




Author's Notes

I would be delighted if you report any bug, errors or issues you find.
In fact I would be delighted if you took the time and replied even if you have nothing to report.
Suggestions are more than welcome

And finally: ENJOY!

- Zeriab
14
Here is a rather useful snippet I just cooked up.
This prevents the F12 key from resetting the game.
For some reason pressing the F12 key now seems to speed up the game in many cases and in other pauses the game.

#=============================================================================
# ** Reset class (because it won't be defined until F12 is pressed otherwise)
#=============================================================================
class Reset < Exception
 
end
#=============================================================================
# ** Module Graphics
#=============================================================================
module Graphics
  class << self
    #-------------------------------------------------------------------------
    # * Aliases Graphics.update and Graphics.transition
    #-------------------------------------------------------------------------
    unless self.method_defined?(:zeriab_f12_removal_update)
      alias_method(:zeriab_f12_removal_update, :update)
      alias_method(:zeriab_f12_removal_transition, :transition)
    end
    def update(*args)
      begin
        zeriab_f12_removal_update(*args)
      rescue Reset
        # Do nothing
      end
    end
    def transition(*args)
      done = false
      # Keep trying to do the transition
      while !done
        begin
          zeriab_f12_removal_transition(*args)
          done = true
        rescue Reset
          # Do nothing
        end
      end
    end
  end
end


For an extreme example of the speed up issue I mentioned here is a picture:


I don't know whether it actually went with 410 FPS or if something broke.
15
Event Systems / Jump System
April 06, 2008, 04:41:35 pm
Jump System

There are 2 jump systems in that project. The second (and enabled one) was done per request. The first one was what I started with.
I got inspired from a brainless Jump tutorial at .org ^^
I have tried to make the jump system to feel fluid and nice.

You can download the project from: http://zeriab.plesk3.freepgs.com/root/events/JumpSystem.rar

You jump by press Q (or whatever your L-button is assigned to).
If you just press Q you jump on the spot. If you press Q and some of the direction buttons you jump in that way.
You can hold down Q for some time and press the buttons you want, or let Q go for a quick jump. (The delay can be adjusted by changing a variable)
You can change the jump strength (length) by pressing A, S and D. (Or whatever you have assigned for the X,Y,Z-buttons)

The second jump system feels like an overkill for normal use and requires more work to be implemented while the first is more simple and easier to use.

Note that you will be able to jump through trees (You can try it in the demo)
You can fix this using terrain tags, but it will require a lot of work and will probably be significantly slower than the presented system.

I am very much interested in feedback. How does the system feels? How is the responsiveness? Anything that could be done better? What parts do you like?

*hugs*
- Zeriab
16
Event System Database / Pig Puzzles
January 08, 2008, 06:55:27 am
Pig Puzzles
Version: 1.0
Type: Mini-Game



Introduction

The event system Pig Puzzles has been made by Zeriab.
The event system plus this topic has been made as an experiment directed at eventers. (There are no instructions for example)
You can still use it in your games. I would recommend having your eventer take a look at it anyway.
Thanks goes to RMXP for making this possible.
Credits should be given.

The purpose in Pig Puzzles is to guide the lost pig into the closure made for it.
The pig will continuously repeat the few instructions given to it. (Different per level)

In the system provided there are 4 different instructions you can give the pig, which basically is which of the ways the pig should move.
That's basically all there is to the game.

Note that I haven't used much energy on the mapping, so try to look away from it.

You can easily add more instructions by increasing the base and add more pages to the pig.
You could also use the principle of this system for other purposes.

Just look in the game and read the comments.
I hope they will be sufficient.


Features


  • Mini-Game
  • Perfect Mini-Game for Eventers to Study On



Screenshots





Demo

You should be able to download the event system from at least one of the links in the spoiler.


Instructions

As this if for eventers, please note there are no instructiosn.


Credits and Thanks


  • Zeriab
  • Everyone who reads this Topic
  • All people who played the game



Author's Notes

Issues
As you'll probably notice this system is not perfect.
If you are an eventer you could try to solve some of the issues. Just use this section in any way you want. If you use it I hope you will learn from the experience. ;)
Note: I have not thought about the difficulty level of the problems, so don't be surprised if it vary a lot. (When you find errors you usually don't find them in order of how difficult they are to solve)

If you reset while the pig is moving you will notice the pig sometimes move after the reset.
Fix the issue
I can tell you there exist a simple fix. This does not necessarily mean it is easy though. Good luck ;)

When you enter the digits you use digit 0 to exit. I.e. you cannot enter 0 as an instruction.
In the system provided there are 4 instructions (1,2,3,4) yet they need a base of 5 because 0 has to be included.
The instruction 0 has complications the other instructions have not, which is why it cannot be directly implemented.
Make it possible to include the 0 instruction where it behaves in the same way as the other digits.
It might be a good idea to store the instructions with more than 1 variable.

The way you enter the instructions are present in the event you trigger. As there are more levels there are dublicates of the instructions.
Why have dublicates if you just can have a common event.
Make an common event that does the job and can be called where ever

You can see how users of the system can change the show messages in the top of the event.
Let's say the user wants the text to be different from one event to another.
How would you solve that?
Would you go back to the original setting and copy the NPC with a full instruction set and not just a call to a common event or will you make several common events where you just alter the text in them?
Well... It could be the user wants every NPC to say something different, or perhaps the user wants groups of NPCs where each group says something different and every NPC in a group say the same thing.
Is your answer to the previous question the same in both situations?

Here's a thought. You know the engine part? The part where calculations are done, the part below the warning comment.
What if you wanted to split the event so the engine part was present in the common event and the user-editable part was in the NPC. How would you do it?
Try to think about these questions:

  • Can it be done?
  • How much should be put in the common event part and how much should be put in the NPC? I.e. how should the work be distributed?
  • How should the communication between NPC event and common event be established?
  • How complex will the solution be?
  • How much is gained versus the amount of extra work and code?
  • Is it worth the trouble?
There is no reason wasting your time on a super complex solution if it is better you kept the old version and didn't do anything at all.


There is basically just 2 issues and something to think about in this section.
There might be other issues lurking around in the system. How would you go about finding unknown issues. In fact you don't even know if there is any issues or not.
Develop strategy for finding issues

At least thinking about it would help. You can never be sure there aren't any issues left, but you can try to limit the amount of issues. (Note the word 'try')
Also be aware that it is possible not finding any issues.
This is more something for you and hopefully you will be able to create better event systems.
I am going to leave this open and just event with:
Don't make the conclusion: "I found no issues, therefore there are no issues"

I am certain I can make this thread better, so if there are anything you find confusing, bad or good. Please do help me by telling me this.
If you find something to be confusing I can try to clarify it.
If you find something to be bad I can try to make it better.
If you find something to be good I can let it stay. (Think if I removed something good)
That is why I want you comments, that and because they make me happy ^_^

Oh, and finally: ENJOY!
- Zeriab

Oink. := ~Starrodkirby86
17
RMXP Script Database / [XP][VX] Dialog System
January 08, 2008, 06:53:41 am
Dialog System
Authors: Zeriab
Version: 1.0
Type: Extra
Key Term: Scripting Tool



Introduction

I have tried to make a Dialog system which is intended to ease the creation of dialogs.



Quote from: Dialog system
#==============================================================================
# ** Dialog system
#------------------------------------------------------------------------------
# Zeriab
# Version 1.0
# 2007-11-07 (Year-Month-Day)
#------------------------------------------------------------------------------
# * Description :
#
#   A small framework like script for dialogs
#------------------------------------------------------------------------------
# * License :
#
#   Copyright (C) 2007  Zeriab
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU Lesser Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU Lesser Public License for more details.
#
#   For the full license see <http://www.gnu.org/licenses/>
#   The GNU General Public License: http://www.gnu.org/licenses/gpl.txt
#   The GNU Lesser General Public License: http://www.gnu.org/licenses/lgpl.txt
#------------------------------------------------------------------------------
# * Instructions :
#
#   You can place this script pretty much anyway you like.
#   Place it above any other Dialogs you might be using.
#   Increase the STARTING_Z_VALUE if you have trouble with the dialog not
#   on top.
#==============================================================================
class Dialog
  STARTING_Z_VALUE = 1500 # Default value is 1500
  attr_accessor :value
  attr_writer :marked_to_close
  #--------------------------------------------------------------------------
  # * Getter with 'false' as default value
  #--------------------------------------------------------------------------
  def marked_to_close
    @marked_to_close = false  if @marked_to_close.nil?
    return @marked_to_close
  end
  #--------------------------------------------------------------------------
  # * Initialization
  #--------------------------------------------------------------------------
  def mark_to_close
    self.marked_to_close = true
  end
  #--------------------------------------------------------------------------
  # * Show the dialog
  #   Returns the value from the dialog
  #--------------------------------------------------------------------------
  def self.show(*args, &block)
    dialog = self.new(*args, &block)
    dialog.marked_to_close = false
    return dialog.main
  end
  #--------------------------------------------------------------------------
  # * Initialization
  #--------------------------------------------------------------------------
  def initialize(*args, &block)
    # For subclasses to overwrite
  end
  #--------------------------------------------------------------------------
  # * Main processing
  #--------------------------------------------------------------------------
  def main
    # Create the dimmed background
    create_background
    # Create Windows
    main_window
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if the dialog should close
      if marked_to_close
        break
      end
    end
    # Dispose of windows
    main_dispose
    # Dispose of background
    dispose_background
    # Update input information
    Input.update
    # Returns the acquired value
    return self.value
  end
  #--------------------------------------------------------------------------
  # * Create the dimmed background
  #--------------------------------------------------------------------------
  def create_background
    bitmap = Bitmap.new(640,480)
    bitmap.fill_rect(0,0,640,480,Color.new(0,0,0,128))
    @background_sprite = Sprite.new
    @background_sprite.z = STARTING_Z_VALUE
    @background_sprite.bitmap = bitmap
  end
  #--------------------------------------------------------------------------
  # * Create the windows
  #--------------------------------------------------------------------------
  def main_window
    # For the subclasses to override
    # Remember to set their z.value to at least STARTING_Z_VALUE + 1
  end
  #--------------------------------------------------------------------------
  # * Dispose the background
  #--------------------------------------------------------------------------
  def dispose_background
    @background_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # * Dispose the windows
  #--------------------------------------------------------------------------
  def main_dispose
    # For the subclasses to override
    # Dispose your windows here
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # For the subclasses to override
    if Input.trigger?(Input::B)
      mark_to_close
    end
  end
end


What is a dialog? You can consider it as a scene that runs on top of the current scene.
Here is an example of how the system can be used. It is a yes/no dialog.
Quote from: An example - A Yes/No Dialog
#============================================================================
# * A Simple Yes/No dialog
#============================================================================
class Dialog_YesNo < Dialog
  # self.value: false = No, true = Yes
 
  #--------------------------------------------------------------------------
  # * A show method
  #--------------------------------------------------------------------------
  def initialize(default_value = false, text = nil)
    # Sets the default value
    self.value = default_value
    @text = text
    # Sets the menu index
    if default_value
      @menu_index = 0
    else
      @menu_index = 1
    end
  end
  #--------------------------------------------------------------------------
  # * Create the windows
  #--------------------------------------------------------------------------
  def main_window
    @disposables = []
   
    # The command window
    @command_window = Window_Command.new(80, ['Yes', 'No'])
    @command_window.index = @menu_index
    @command_window.x = (640 - @command_window.width) / 2
    @command_window.y = (480 - @command_window.height) / 2
    @command_window.z = STARTING_Z_VALUE + 1
    @disposables << @command_window
   
    # The text window
    if @text.is_a?(String)
      @text_window = Window_Help.new
      @text_window.set_text(@text, 1)
      @text_window.z = STARTING_Z_VALUE + 1
      @disposables << @text_window
    end
  end
  #--------------------------------------------------------------------------
  # * Dispose the windows
  #--------------------------------------------------------------------------
  def main_dispose
    @disposables.each {|element| element.dispose}
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    @command_window.update
    if Input.trigger?(Input::B)
      mark_to_close
    end
    if Input.trigger?(Input::C)
      if @command_window.index == 0
        self.value = true
      else
        self.value = false
      end
      mark_to_close
    end
  end
end


The idea is that you can all this dialog anywhere with the code:
# Code before
var = Dialog_YesNo.show(default_value, text) # Calls the dialog
# Code after

The dialog should then be shown and the code after will only be executed after the player chooses yes or no. It will return false if No is selected and true if Yes is selected.
Then the code placed after the call will be executed. You can say it will freeze execution until the dialog is closed.
The principle is that you can call this code anyway. In script calls as well as in normal scripts.
Here is an example of a script call:
s = 'Do you want to open the chest?'
v = Dialog_YesNo.show(true, s)
$game_switches[5] = v

Here is an event using this:
Quote from: Angry Chest

I assume you know how to make page 2 and page 3 yourself.

I know. This can easily be done with the normal choice system in events. So what about an example where its use is more clear?
Did you know that if you try to save on a slot where there already is a savegame it does not ask if you want to overwrite? It simply just overwrites the savegame. Let us say we don't want that. The remedy?
class Scene_Save < Scene_File
  alias scene_save_overwrite_dialog_on_decision on_decision
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  def on_decision(filename)
    if File.exist?(filename)
      var = Dialog_YesNo.show(false, 'Do you want to overwrite' +
                                     ' the old savegame?')
      unless var
        $game_system.se_play($data_system.buzzer_se)
        return
      end
    end
    scene_save_overwrite_dialog_on_decision(filename)
  end
end

Just paste this anywhere below the original Scene_Save.


I have tried to give dialogs the feeling of scenes.
When you create a dialog you will in most cases only have to overwrite 3-4 methods:

main_window
You should create the windows you are going to use in this method.
Please set the .z-values of the windows to at least STARTING_Z_VALUE + 1
This is what you put before the main loop when creating a normal scene.
You can consider it pretty much equivalent to the main_window method in the SDK.
Does nothing by default

main_dispose
Dispose of the windows you have created here and do any other clean up you find necessary.
Does nothing by default

update
The update method is pretty much equivalent to the update method in a normal scene.
Exits the scene when you press the B-button by default.

You end the dialog by calling the mark_to_close method. It will then exit just like if you normally change the scene.
Remember to set the value that will be returned. By default is nil returned.
Use self.value = ... to set the value. This value will not be frozen after you use the mark_to_close method, which means that you can change the value after you use that method if it happens later in the update method.

I am certain that I have messed something up or forgotten to tell something important. Please do tell if you run into any problems

*hugs*
- Zeriab
18
Here's a litte addition to the module I have made ^^
class Module
 def attr_secure_accessor(sym, *args, &block)
   if block.nil? # default actions
     args = [0] if args.size == 0 #default = 0
     if args.size < 2 # One pair
       attr_writer sym
       attr_secure_reader sym, *args
     else # loads of methods followed by a default value.
       default = args[-1]
       syms = [sym].concat(args)
       syms.pop
       for sym in syms
         attr_writer sym
         attr_secure_reader sym, default
       end
     end
   else # when a block is given
     # currently just pair sematics
     args.unshift(sym)
     i = 0
     while i < args.size
       attr_writer args[i]
       attr_secure_reader args[i], args[i+1]
       i += 2
     end
   end
 end
 
 def attr_secure_reader(sym, default = 0)
   sym = sym.id2name
   string = "def #{sym};" +
            "  @#{sym} = #{default}  if @#{sym}.nil?;" +
            "  @#{sym};" +
            "end;"
   module_eval(string)
 end
end


Simple Version
class Module
 def attr_secure_accessor(sym, default = 0)
   attr_writer sym
   attr_secure_reader sym, default
 end
 
 def attr_secure_reader(sym, default = 0)
   sym = sym.id2name
   string = "def #{sym};" +
            "  @#{sym} = #{default}  if @#{sym}.nil?;" +
            "  @#{sym};" +
            "end;"
   module_eval(string)
 end
end


You can use it like this:
attr_secure_accessor :method, default

It works pretty much like the attr_accessor except that you can only do method creation per call.
method is the method name.
default is the default value the method returns. (If it has not been written to yet.)

An usage example:
class Foo
 attr_secure_accessor :visible, false
 attr_secure_accessor :data, 'Data_Foo.new'
end


This way you'll have that the default variable of visible is false.
If it is called before you write to the variable you will get 'false' rather than 'nil'
One thing to note is that lazy instantiation is used.
Let us assume that Data_Foo is a heavy object. It is only created if you try to read what the data attribute contains before you have written to it. More specifically. If the value of data attribute is nil then it is change to be what the default value is.

The code in the example is converted to this:

class Foo
 def visible=(value)
   @visible = value
 end
 def visible
   @visible = false  if @visible.nil?
   @visible
 end
 
 def data=(value)
   @data = value
 end
 def data
   @data = Data_Foo.new  if @data.nil?
   @data
 end
end

One thing to notice is that you must put '' around Data_Foo.new to make it a string. Otherwise you will get an error in almost all cases.

The greatest use will probably be if you want to add information to hidden classes. Let's for an example take RPG::Actor.
You can use its initialize method to set the default value by default because it won't be called automatically.
Other than that it will hopefully make the coder shorter and easier to understand.

Naturally. Only use this functionality where it is needed or where it can have a positive use ^_^

*hugs*
~ Zeriab
19
Zeriab's Anti Event Lag System
Authors: Zeriab
Version: 1.2
Type: Anti Event Lag System
Key Term: Game Utility



Introduction

This system changes the design used for controlling the events on the game map as well as reducing the number of character sprites outside of the visible area.
The new design for the events should in most cases give faster collision detection
In certain situations this system should be slightly slower though I doubt it can make any noticeable difference.
This script only makes event collision detection faster in the case where all the events are visible.
The greatest benefit from this script comes from large maps with sparse population of events. Basically, events do no come together loads at a time.



Version history
For anyone interested: ShowHide

Version 0.8 -------------------------------------------------- (2007-09-03)
- First release

Version 0.81 ------------------------------------------------- (2007-09-05)
- Overwrote Game_Map's passable? method for faster collision detection

Version 0.9 -------------------------------------------------- (2007-09-12)
- Support for the Non-SDK patch
- Support for defining whether and event will always be updated or never be updated by defining name patterns.

Version 1.0 -------------------------------------------------- (2007-09-24)
- Fixed compatibility issue with Blizzard's Caterpillar script
- Overwrote more methods scanning for events on a specific tile
- Support for defining whether an event will always be updated or never be updated by specifying the event's id and map_id
- Some structural changes.
- Integrated the Non-SDK patch into the main script

Version 1.05 ------------------------------------------------- (2007-11-18)
- Fixed bug where sprites might not be disposed when changing scene.

Version 1.1 -------------------------------------------------- (2008-04-10)
- Added declaration to which common events to update

Version 1.15 ------------------------------------------------- (2008-06-19)
- Added automatic detection of which common events to update (optional)

Version 1.2 -------------------------------------------------- (2008-07-04)
- Fixed a case where an event could be registered twice causing transparent
   events to look less transparent.




Features

Easy to alter the size of the visible area. (In combination with resolution scripts for example)
Pattern matching on event names to ease determination of events needing special treatment. (Never update and always update)
Specify special update schemes for events by their id and the map they are on.



Screenshots

The screenshot was taking from my test map included as an attachment. There are 662 events on that 500x500 map.





Demo

http://www.sendspace.com/file/0up9up (zip version)



Script

Zeriab's Anti Event Lag System version 1.2
Note: The comments in the script are aimed at other scripters. Don't be scared by it.



Installation

You don't have to do more than copy and paste the script into the script editor BUT where you paste it matters.
If you are using the SDK 2.0+ paste the script just below the SDK.
If you are are not using the SDK then paste the script just below the default scripts

The structure in the script editor should be like this:
default scripts
(SDK)
Zeriab's Anti Event Lag System
(custom scripts)
main


Pasting the script just above main has caused errors!

You can add [A] to the name of an event if you want it always updated. A typical example is that you want an event outside of the screen to move around properly.
You can add [N] to the name of an event and it will never be updated. Great for non-animated decoration events.
Note that if you have both [A] and [N] in the name of the event the event will never be updated.

If you are not satisfied with the default settings or are curious you can look into the customization possibilities
Customization: ShowHide

A little below the big header there is a customization area (line 265-284) which contains:
class Game_Map
  ALWAYS_UPDATE = false
  BUFFER_SIZE = 1
  TILES_VERTICAL = 15
  TILES_HORIZONTAL = 20
  LIMIT_COMMON_EVENTS = true
  SPECIFY_COMMON_EVENTS_MANUALLY = false
  # If you want to specify which common events to update
  COMMON_EVENTS_TO_UPDATE = []
  # If you want the script to automatically read the common events and find
  # out which to update. Must be the path to the CommonEvents.rxdata
  COMMON_EVENT_FILEPATH = 'Data/CommonEvents.rxdata'
end

class Game_Event
  SPECIAL_UPDATE_IDS = {}
  NEVER_UPDATE_NAME_PATTERNS = ['[N]'] # [N] in the event name => not updated
  ALWAYS_UPDATE_NAME_PATTERNS = ['[A]'] # [A] in the event name => always updated
end


There are comments on how to use each constant in the script header. Those comments are aimed at other scripters and can therefore be fairly difficult to understand for non-scripters. The examples in the header can useful even if you are not a scripter.
I will explain each constant in a more humane way. (Using this in unison with the instructions in the header might yield the best result)

I'll start by going through class Game_Map.
ALWAYS_UPDATE
Set this to true if you want all events updated. All events will on the map will be updated just like with the default scripts. This is slow, but you will still get the effects of the changed collision detection and sprite management.
I included this option for compatibility reasons more than anything else. Don't use this if you want a few events outside of the screen to be constantly updated. In that case refer to the stuff in Game_Event

BUFFER_SIZE
The buffer size tells how many tiles outside of the visible area should be updated.
If you have many big sprites (for the events) and get the sprites just disappearing or 'freezing' for a moment near the edge of the screen the solution can be to increase the buffer size.
Be aware that increasing the buffer size makes the game slower.

TILES_VERTICAL
Use this to tell how many tiles there on a vertical line across the game screen.
Only change this value if you change the resolution.

TILES_HORIZONTAL
Use this to tell how many tiles there on a horizontal line across the game screen.
Only change this value if you change the resolution.

LIMIT_COMMON_EVENTS
Set this to false if you do not wish to limit which common events are updated.
If you do not limit the common events the next three constants have no effect. (SPECIFY_COMMON_EVENTS_MANUALLY, COMMON_EVENTS_TO_UPDATE, COMMON_EVENT_FILEPATH)

SPECIFY_COMMON_EVENTS_MANUALLY
Set this to true if you want to specify the common events manually. This is not recommended for beginners.
You will have to fill out COMMON_EVENTS_TO_UPDATE if you set this to true. COMMON_EVENT_FILEPATH will have no effect if this is true.
If this is set to false then COMMON_EVENTS_TO_UPDATE will have no use. The script will automatically detect which common events to update if this is set to false.

COMMON_EVENTS_TO_UPDATE
Fill in the array with the common event ids you want updated. (Look in the database for the numbers)
All other common events will not be updated. They can still be called using the call common event command, but they will not be started if they have the autorun or parallel process triggers.

COMMON_EVENT_FILEPATH
The path to where the common events are stored.
Only touch this if you have changed the filename where the common events are stored. If you don't know what this means then chances are that you should not change what is given.


Next we come to class Game_Event which is a bit more complicated to customize.
Typically you can be fine without modifying the following constants. Id y
SPECIAL_UPDATE_IDS
You can use this to say that specific in specific maps must always be updated or never updated.
If an event is always updated it acts just as it does with the default scripts.
If an event is never updated it not move. Neither with Autonomous Movement nor the event command 'Set Move Route...'. You can still to some degree interact with it but in general use the never update feature for decoration events.

NEVER_UPDATE_NAME_PATTERNS
You can use this to specify new patterns to look for in the names of the events.
If the name of an event matches at least one of the patterns it will never be updated.
A pattern can both be what is called a regular expression and a string. If you don't know what a regular expression is or don't understand them then don't try to use regular expressions.
The string is a piece of text and the name of the event will be checked if that piece of text is anywhere in the name. The text have to be surrounded by either 'text' or "text". There is no practical difference in case of this script.
If an event is never updated it not move. Neither with Autonomous Movement nor the event command 'Set Move Route...'. You can still to some degree interact with it but in general use the never update feature for decoration events.

ALWAYS_UPDATE_NAME_PATTERNS
You can use this to specify new patterns to look for in the names of the events.
If the name of an event matches at least one of the patterns it will always be updated.
A pattern can both be what is called a regular expression and a string. If you don't know what a regular expression is or don't understand them then don't try to use regular expressions.
The string is a piece of text and the name of the event will be checked if that piece of text is anywhere in the name. The text have to be surrounded by either 'text' or "text". There is no practical difference in case of this script.
If an event is always updated it acts just as it does with the default scripts.




Q&A's

How can I make sure that an event outside of the screen moves like I told it to?
Change the name of the event so it always updates.
With the default configurations you can do this by adding [A] anywhere in the name.



Compatibility
Technical Details: ShowHide

This is SDK compliant. It is written for SDK version 2.3.
It has not been tested with older versions.
Requires SDK Part 2 or the Non-SDK patch version 1.1

The following methods has been overwritten:

  • Game_Character.passable?
  • Game_Map.passable?
  • Game_Map.update_events
  • Game_Player.check_event_trigger_here
  • Game_Player.check_event_trigger_there
  • Game_Player.check_event_trigger_touch
  • Spriteset_Map.init_characters
  • Spriteset_Map.update_character_sprites


The following methods have been aliased:

  • Game_Event.jump
  • Game_Event.moveto
  • Game_Event.move_down
  • Game_Event.move_left
  • Game_Event.move_right
  • Game_Event.move_up
  • Game_Event.move_lower_left
  • Game_Event.move_lower_right
  • Game_Event.move_upper_left
  • Game_Event.move_upper_right
  • Game_Map.setup



Rataime's Sun Effect: ShowHide

Paste this code in a new section anywhere below Rataime's Sun Effect and above main. (use can press Insert to create a new section)
alias Zantilag_XPML_read XPML_read
def XPML_read(markup,event_id,max_param_number=0)
  return if $game_map.events[event_id].nil?
  Zantilag_XPML_read(markup,event_id,max_param_number=0)
end



Near Fantastica's Particle Engine v2: ShowHide

Paste this code in a new section anywhere below Near Fantastica's Particle Engine v2 and above main. (use can press Insert to create a new section)
class Spriteset_Map
  def update_character_sprites
    nf_particles_spriteset_map_update_character_sprites
    for sprite in @character_event_sprites
      next unless sprite.character.is_a?(Game_Event)
      if sprite.character.pe_refresh == true
        sprite.character.pe_refresh = false
        @particle_engine.remove_effect(sprite.character)
        @particle_engine.add_effect(sprite.character)
      end
    end
  end
end






Credits and Thanks

Thanks goes to Enterbrain for making this possible.
Special thanks to Blizzard for many suggestions, help and support :3
Special thanks to:
Eilei
Shadow Wolf
Untravaersil
darksora

I would like to thank everyone using their time to try and use my system.
I would like to thank everyone reading this topic.
Thanks.



Terms and Conditions
License: ShowHide
Copyright (C) 2007  Zeriab

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser Public License for more details.

For the full license see <http://www.gnu.org/licenses/>;
The GNU General Public License: http://www.gnu.org/licenses/gpl.txt
The GNU Lesser General Public License: http://www.gnu.org/licenses/lgpl.txt




Author's Notes

I would be delighted if you report any bug, errors or issues you find.
In fact I would be delighted if you took the time and replied even if you have nothing to report.
Suggestions are more than welcome

And finally: ENJOY!

- Zeriab
20
Hey all
I was a bit bored and fiddled around with the movement of Window_Items. I found the way I represent here better. I decided to make it broader and have created a solution intended for subclasses of Window_Selectable
I will provide two versions. One if you want to only apply this on certain windows and not others. Another that just changes the functionality of Window_Selectable.

Here is the mix-in version for changing specific classes:
#==============================================================================
# ** Warped Movement mix-in for subclasses of Window Selectable
#------------------------------------------------------------------------------
# Zeriab
# Version 1.0
# 2007-08-22 (Year-Month-Day)
#------------------------------------------------------------------------------
# * Description :
#
#   This is a mix-in module for windows subclassing designed to 'enhance' the
#   arrow-key movement system used to select the item by creating warping.
#   That is, if you are at the bottom and press down you will go up to the top
#   in the next column. Like-wise for down, left and right.
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place the script anywhere above Main.
#   To give a subclass of Window_Selectable let it include the module
#
#   If you for example wanted to apply the module to Window_Item you should
#   write this code: (Must be below the original Window_Item
# ------------------------------------------
#   class Window_Item < Window_Selectable
#     include Window_Selectable_Type_2
#   end
# ------------------------------------------
#
#   Here is a version for Window_Skill. You get the idea.
# ------------------------------------------
#   class Window_Skill < Window_Selectable
#     include Window_Selectable_Type_2
#   end
# ------------------------------------------
#
#   Note: Don't include this module in Window_Selectable ~
#         May cause issues with Windows where the update method is used
#==============================================================================

#==============================================================================
# ** module Window_Selectable_Warped
#==============================================================================
module Window_Selectable_Warped
 #----------------------------------------------------------------------------
 # * Frame Update
 #----------------------------------------------------------------------------
 def update
   last_index = @index
   super
   if last_index == @index && active && @item_max > 1
     if Input.repeat?(Input::DOWN)
       # Move cursor down
       $game_system.se_play($data_system.cursor_se)
       @index = (@index % @column_max + 1) % @column_max
     end
     # If the up directional button was pressed
     if Input.repeat?(Input::UP)
       # Move cursor up
       $game_system.se_play($data_system.cursor_se)
     @index = (@index % @column_max + 1)
     @index = -@index % @item_max + @item_max % @column_max
     @index -= @column_max  if @index >= @item_max
     end
     # If the right directional button was pressed
     if Input.repeat?(Input::RIGHT)
       # Move cursor right
       $game_system.se_play($data_system.cursor_se)
       @index = (@index + 1) % @item_max
     end
     # If the left directional button was pressed
     if Input.repeat?(Input::LEFT)
       # Move cursor left
       $game_system.se_play($data_system.cursor_se)
       @index = (@index - 1) % @item_max
     end
   end
 end
end


Next we have the change for all Window_Selectable subclasses. This also requires less work.
#==============================================================================
# ** Warped Movement for Window Selectable
#------------------------------------------------------------------------------
# Zeriab
# Version 1.0
# 2007-08-22 (Year-Month-Day)
#------------------------------------------------------------------------------
# * Description :
#
#   This script is designed to 'enhance' the arrow-key movement system of
#   Window_Selectable used to select the item by allowing warping.
#   That is, if you are at the bottom and press down you will go up to the top
#   in the next column. Like-wise for down, left and right.
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place the script below Window_Selectable and above Main.
#
#   Note: May cause issue with scripts that are depent on the index not
#         changing under certain circumstances
#==============================================================================

#==============================================================================
# ** Window_Selectable
#==============================================================================
class Window_Selectable < Window_Base
 alias zeriab_warped_update update
 #----------------------------------------------------------------------------
 # * Frame Update
 #----------------------------------------------------------------------------
 def update
   last_index = @index
   # original update method is called
   zeriab_warped_update
   if last_index == @index && active && @item_max > 1
     if Input.repeat?(Input::DOWN)
       # Move cursor down
       $game_system.se_play($data_system.cursor_se)
       @index = (@index % @column_max + 1) % @column_max
     end
     # If the up directional button was pressed
     if Input.repeat?(Input::UP)
       # Move cursor up
       $game_system.se_play($data_system.cursor_se)
     @index = (@index % @column_max + 1)
     @index = -@index % @item_max + @item_max % @column_max
     @index -= @column_max  if @index >= @item_max
     end
     # If the right directional button was pressed
     if Input.repeat?(Input::RIGHT)
       # Move cursor right
       $game_system.se_play($data_system.cursor_se)
       @index = (@index + 1) % @item_max
     end
     # If the left directional button was pressed
     if Input.repeat?(Input::LEFT)
       # Move cursor left
       $game_system.se_play($data_system.cursor_se)
       @index = (@index - 1) % @item_max
     end
   end
 end
end

Instructions are in the script headers. Enjoy ~

- Zeriab
21
RMXP Script Database / [XP] Letter minigame
January 08, 2008, 06:45:58 am
Letter Minigame
Authors: Zeriab
Version: 1.2
Type: Logical Minigame
Key Term: Minigame



Introduction

The Letter Minigame has been made by Zeriab.
Thanks goes to RMXP for making this possible and Near Fantastica for the Anti Event Lag Script.
Credits should be given.

The purpose in the Letter Minigame is to get a good score by collecting as many letters in the maze as possible within the time limit.
Different letters give different amount of points.

You can see how much each letter gives by looking at the letters on this island.
The more points the rarer the letter.

A yellow letter = 10 points
A green letter  = 15 points
A azure letter  = 20 points
A red letter    = 25 points
A purple letter = 30 points
A black letter  = 100 points


Version History
Version 1.2:
Fixed an issue which might cause immense amounts of memory to be used.

Version 1.1:
Adds $letter_minigame.score - works also after $letter_minigame.dispose.
Gives a solution to the F12 issue present in the earlier demo.


Screenshots





Demo

You download my demo from: http://www.mediafire.com/?mjqe21okk4c


Script

The script is too big to put it in here so I have place it in a text file which can be downloaded here: http://www.mediafire.com/?ynqbzmmjjmd


Instructions

Here I will try to explain how the scripts is used.
I have split this section in two.
One for the Maze Generator. This generates the maze and places the events.
This is not linked with the Letter Minigame.
One for the Letter Minigame. This controls the letters collected and the visual effects.
This is not linked with the Maze Generator. A normally made level could be used.
You can look at the scripts in the end of the scripts editor.

I have also edited some of the normal scripts in the demo. These has been marked by having a * in front of its name in the script chooser.
This is the Maze_Generator module.
To call it use this syntax:
Maze_Generator::Maze.new(x, y, max_chance, array_of_events, value=0, layer=1)
    x               : x-coordinate for starting point
    y               : y-coordinate for starting point
    max_chance      : The total chance used for choosing among the events
    array_of_events : Numbers on events paired with their chance value
    value           : value of the tileset assigned to the maze (default=0)
    layer           : the layer that will be crawled (default=1)

An example could be:
 Maze_Generator::Maze.new(49,49,300,[[2,22],[3,19],[5,17],
                                   [6,14],[7,10],[9,2]],0,1)

Notice the how you should write the array_of_events.
The first number is the number on the event you want.
In this example the script will start in 49,49 and spread out from there.
It will change the tiles on layer 1 to 0 if it's not already 0.
You can encapsulate the maze by making a border of tiles with 0 as value.
Otherwise it will be restricted by the map borders.
In dead ends it might place an event.
The second value you see in each pair shows the change that the corresponding event is spawn. It is compared to the total probability.
There is a 22/300 chance of event number 2 being spawned in a dead-end.
There is a 19/300 chance of event number 3 being spawned in a dead-end and so on.
The originally placed events WILL be deleted.

Don't let the user save the game in a map where you have used the Maze_Generator as the changes will not be saved.

This is the letter minigame itself.
Managing how many of which letters are collect and showing the stats.
To call it use this syntax:
$letter_minigame = Letter_Minigame.new(array_of_events, array_of_points)
    array_of_events : Numbers on the events used.
    array_of_points : The amount of points for the corresponding event in
                      array_of_events. Linked by placement.

$letter_minigame is the reference used by the results screen.

An example could be:
$letter_minigame = Letter_Minigame.new([2,3,5,6,7,9],[10,15,20,25,30,100])
This will take and use the graphics from event number 2,3,5,6,7 and 9
The latter shows the amount of points each element is worth.
The first element will have the graphic from event number 2 and be worth 10.
The second element will have the graphic from event number 3 and be worth 15 and so on.

The events you should collect must contain this line as a script:
$letter_minigame.add(position)
    position : Position of the element in the array. First position = 0

For example the syntax
$letter_minigame.add(0)
Should be put in the events which has the graphic of event number 2 and are 10 points worth.
$letter_minigame.add(1)
Should be put in the events which has the graphic of event number 3 and are 15 points worth and so on.


Now when the minigame is finished used this syntax to call the results screen.
$scene = Letter_Result_Menu.new
This will gather information from $letter_minigame

You might have an interest in changed the results screen accordingly to your needs. Feel free to do so


The command $letter_minigame.score returns the score.
This works even after the $letter_minigame.dispose command is used.
That is because .dispose leaves the little information needed for calculation the score.
You can for example use this for giving prizes afterwards.


FAQ

How could I make a maze that has no timer on it with this script? Cause I wanna make a maze, and put a boss in it, but I want the maze to be randomized, and I don't want the timer either. The other thing is, how can I set this up so that I can have just the 1 boss event in it in a specific spot, and not have to worry about that spot being in a wall, or unreachable because the maze wasn't made right.

Quote from: long answerThe timer part is easily solved because the event in the top-left corner is controlling the timer.
For what you want you don't need the Letter Minigame, just the Maze_Generator module.

You don't need the $letter_minigame = Letter_Minigame.new([2,3,5,6,7,9],[10,15,20,25,30,100])

You would only need something like this: Maze_Generator::Maze.new(49,49,0,[],0)
This will create a maze where no events are spawned.

Now can you find a plaze where there with certainty is no wall?
Yes. The starting point you give.
Considering the above example the square at 49, 49 will be empty.
There might be more certain squares, but I'm not sure.
I do however know that there is a pattern linked with the probability of a square being a wall.

If S is the starting point then the pattern will look like this:
Quote
X0X0X0X
0P0P0P0
X0X0X0X
0P0S0P0
X0X0X0X
0P0P0P0
X0X0X0X


It will continue to spread outwards like that.
Symbol Explination:
S: Starting point
P: Very high possibility of being a passable square (non-wall), above 90% I'd say. Probability decreases near edges.
O: Might be a wall, might not. No significant difference is probability.
X: Is most certainly a wall.

So you can put your boss on the starting point for certainty or on one of the P's for a very good chance of not being in a wall. (Don't put the boss near an edge in this case)


There might also be another solution you can use.
You see the X's are most certainly a wall.
What now if the wall was passable and the other wasn't?
That way the script would create the wall.
As the script create an acyclic graph (you don't have to understand this term) you be certain that there is a way from outside into any, yes... ANY of the X-squares.
If you do not have a rim around the maze you can however not be sure of a way from one X to another.
Something like this might do the trick:
Maze_Generator::Maze.new(49,49,0,[],48)
The 48 tells the script to use the tile graphic with id 48. Before 0 was used.
48 is generally water.
I don't know the system for this. I just found out with trial and error.

If you are creating a wall rather than a path you can also encase an area or the maze itself by putting the title with id-48 on the P's.
There will be a walkable path around the P.

You have to something like because I haven't scripting in the possibility to have just one and no more than one of a certain event places somewhere in the maze.
I or you could try to simply put the event on the last square touched by the crawler. (Script edit)
I hope you will find my answer satisfying.


How do I set up item prizes?
For example, if I had 250 points, I win a potion or something like that.


Using this command will return the score: $letter_minigame.score
For non-scripters you can use the Call Script command with $game_variables[10] = $letter_minigame.score, where the 10 is the variable number. Just set it to the number of the variable you want to use.
Now that you have the score in a variable I assume that you can do the rest.


Compatibility

Is not compatible with saving and loading. The map will reset if loaded.
Might be SDK compliant.


Credits and Thanks

I would like to thank RMXP - Underground personal for creating a scripting contest which inspired me to create this work.
I would like to thank everyone using their time to try this and finally I would like to thank everyone reading this topic.
Thanks.


Author's Notes

I suggest using Near Fantastica's anti event lag script due to the often high amount events.
This script can create more than 1000 events. I suggest however that you refrain from designing level where this is an eminent possibility.
Using the event command Erase Event will not entirely delete the event.
The event still exists in the $game_map.events and lags about as much as a blank events.

And finally: ENJOY!

- Zeriab
22
RMXP Script Database / [XP] SLOLS
January 08, 2008, 06:43:33 am
Snake Look-alike on Load Script
Authors: Zeriab
Version: 1.0
Type: Snake game
Key Term: Minigame



Introduction

The SLOLS has been made by Zeriab.
Thanks goes to RMXP for making this possible
Credits should be given.


Features

The purpose of SLOLS is to provide the player an opportunity to interact with something during loading sequences. I think the loading time will not seem as long as normally if the player as something to do while the program is loading.
They don't experience the time it takes to load as bad even though the script reduced the loading speed.
In the game itself the principle is to collect dots by moving a bigger dot into them. There is no time limit. There is no way to die or get stuck or etc.  Steering is done by the arrow keys.
When the loading is finished a sound will be played and visual aids will be used to let the player know that the loading is finished.
The player can then continue by pressing a trigger key (fx. ENTER)
There is no need to press enter. The player can play the game as long as he or she wants unless  the script loaded does something that changes this.


Screenshots




Demo

The demo has been combined with my Letter Ninigame to show a example of use.
If the Letter Minigame is used credits mentionen in the Letter Minigame should be given.

http://zeriab.plesk3.freepgs.com/root/scripts/SLOLS.rar


Script

I have collected them all in 1 file which can be downloaded here: http://zeriab.plesk3.freepgs.com/root/scripts/SLOLS.txt (mirror)


Instructions

You must have these pictures in your graphics\pictures folder or the arrow keys shown on the picture will be missing:


The Script:
This script used the global variable $loader.
It can run without $loader being initialized in which case the script considers the loading as done.
To use $loader you must set it to a Thread. The syntax is:
Thread.new( [arg]* ) {| args | block } ->  aThread  (Reference)

An example:
$loader = Thread.new { MyClass.new }

To get the SLOLS scene use this syntax:
$scene = Scene_SLOLS.new(scene=Scene_Map.new)
scene will be used to set the scene that comes after Scene_SLOLS. The scene to be used after finished loading and player pressing trigger.

An example; syntax for standard scene: (Scene_Map)
$scene = Scene_SLOLS.new
# or
$scene = Scene_SLOLS.new(Scene_Map.new)


The script will store the amount of dots in the variable number specified by Cheese_Variable in Scene_SLOLS. (Near top)
There also are the Margin (in pixels) and the Border_Thickness (in pixels).
Changing these may break the design. The info bar with the instructions is a bit fragile.


Compatibility

Should be independent which increases compatibility.


Credits and Thanks

I would like to thank everyone using their time to try and use SLOLS.
I would like to thank everyone reading this topic.
Thanks.


Author's Notes

I don't recommend letting the script being 'loaded' change the $scene as makes the SLOLS stop rather suddenly from my point of view (Players position).

And finally: ENJOY!

- Zeriab
23
Picture Scrolling System (Event Based)
Version: 1.0
Type: Scrolling System



Introduction

This person had made some errors. When I fixed I thought: "Hey, I can make this into a smarter more user friendly system"
By smarter I meant it was easier for the editor to set up. Especially the ability to easily set a rather long wait.
In case you didn't know. You can max set a wait to 999 frames. You can max set a variable to 99 999 999.
By more user friendly I mean giving the user the ability to scroll the text faster and skip it at their command.


Features


  • Is able to work on RPG Maker XP or 2000-2003 (Alternative for 2k3)
  • Smooth :)



Screenshots

The instructional screenshots count as screenshots right? :)


Demo

No Demo applicable. Use the instructions instead.


Instructions

FOR RMXP:

Page 1:

Page 2:


Remember to set the condition of page 2 to Local Switch A is ON.
Also the actions shown on page 2 are just there for an example.

If you ever want to come back to the map you used it in, remember to turn a switch ON and make a new page with the condition or something similar.
You can likewise do the actions in the end of page 1 let the switch turn on and leave Page 2 blank.
It's up to you.

If I have done my comments properly I shouldn't need to talk what you should do to set it up.
Also you may post this wherever you want. You have my permission.
You are also free to extend it, make it more simple, in fact to edit it in anyway.
It would be nice if you try to keep the comments or update them so it's easy to set it up.

FOR RPG2K3:


Here's the event:


Set the trigger to Autorun:


The actions shown on the bottom of the event are just there for an example.

Here are the pictures I used in the example:
http://img517.imageshack.us/img517/7038/Scrolling_intro1.png
http://img517.imageshack.us/img517/4146/Scrolling_intro2.png
http://img517.imageshack.us/img517/2898/Scrolling_intro3.png


Credits and Thanks


  • Zeriab



Author's Notes

You may post this wherever you want. You have my permission.
You are also free to extend it, make it simpler, in fact to edit it in anyway.
It would be nice if you try to keep the comments or update them so it's easy to set it up.

Comments and critics are appreciated.

Well, that's that.
- Zeriab
25
[SIZE=8]Regular Expressions in RGSS (Regexp)[/SIZE]

Preface

This article is intended to give basic insight in the use of Regular Expressions in RGSS and to be used for future reference.
I assume you, the reader, have scripting knowledge. If you have problems with scripting issues when you read/test the tutorial that is not directly related to regular expression it would probably be a good idea to seek basic scripting tutorials before continue reading or you will most likely not get as much out of reading this tutorial.
This is not an in-depth tutorial on regular expressions. It is more of an appetizer. A help to get you started. (Along with the reference part naturally)
I hope will be able to figure out how to use Regular expressions to your advantage with what I have provided as well as being able to figure out what I have not run through.

I am sure I will have made at least one error. Please do tell me if you find it.
If you have any problems understanding anything of the material here, ask. Worst case scenario is me not answering. Best case is you getting an answer that will help you understand the stuff here ^_^
Worth the risk? I would say so.

Enjoy reading
- Zeriab

Contents

  • Preface
  • Contents
  • Reference
  • What are regular expressions/languages?
  • How to create regular expressions
  • How to use regular expressions
  • Non-regular languages accepted
  • Examples
  • Exercises
  • Credits and thanks
  • Sources and useful links

Reference

Reference from ZenSpider:

Quote from: Reference
Regexen

/normal regex/iomx[neus]
%r|alternate form|

options:

/i         case insensitive
/o         only interpolate #{} blocks once
/m         multiline mode - '.' will match newline
/x         extended mode - whitespace is ignored
/[neus]    encoding: none, EUC, UTF-8, SJIS, respectively

regex characters:

.          any character except newline
[ ]        any single character of set
[^ ]       any single character NOT of set
*          0 or more previous regular expression
*?         0 or more previous regular expression(non greedy)
+          1 or more previous regular expression
+?         1 or more previous regular expression(non greedy)
?          0 or 1 previous regular expression
|          alternation
( )        grouping regular expressions
^          beginning of a line or string
$          end of a line or string
{m,n}      at least m but most n previous regular expression
{m,n}?     at least m but most n previous regular expression(non greedy)
\A         beginning of a string
\b         backspace(0x08)(inside[]only)
\B         non-word boundary
\b         word boundary(outside[]only)
\d         digit, same as[0-9]
\D         non-digit
\S         non-whitespace character
\s         whitespace character[ \t\n\r\f]
\W         non-word character
\w         word character[0-9A-Za-z_]
\z         end of a string
\Z         end of a string, or before newline at the end
(?# )      comment
(?: )      grouping without backreferences
(?= )      zero-width positive look-ahead assertion
(?! )      zero-width negative look-ahead assertion
(?ix-ix)   turns on/off i/x options, localized in group if any.
(?ix-ix: ) turns on/off i/x options, localized in non-capturing group.


What are regular expressions/languages?
You can skip this section if you want since it is a bit of theory without too much practical application.

A regular language is a language that can be expressed with a regular expression.
What do I mean by language?
I mean that words either can be in the language or not in the language.
Let us for the moment for simplification consider an alphabet with just a and b. This means that you only have the symbol a and the symbol b to make words of when using this alphabet.
A regular language with that alphabet will define which combinations of a and b are words in the language. When I say a regular language accepts a words I mean that it is an actual word in the language.
We could define a regular language to be an a followed by any amount of bs and ended by 1 a. 0 bs is a possibility.
Etc. aa, aba and abbba would be in the language.
b, abbbbab and bba would on the other hand not be in the language.
We can quickly see that there are an infinite amount of words belonging to the language ^_^

A regular expression is the definition of a regular language.
Let us start with a simple regular expression:
aba
This means that accepted word must consist of an a followed by a b followed by an a.
This particular regular expression defines a regular language that only accepts one word, aba.

The previous regular language can be expresses as:
a(b)*a

Notice the new notation. The star *.
It literally means any amount of the symbol it encompasses. By any amount it is 0, 1, 2, ...
As long as just one of the amounts fits it will be accepted.
The regular expression defines a regular language that accepts any words that consists of an a followed by any amount of bs followed by an a and nothing more.
Note that a(b)*(b)*a expresses the same regular language. This can easily be seen as one of the (b)* can be 0 all the time and you have the same regular expression.
We can conclude that there can exist an infinite amount ways to express a regular language

If we wanted the words just to start with a(b)*a and what come after is irrelevant we can use this regular expression: a(b)*a(a|b)*

Note: The () are not really needed when there is only 1 letter, I just put them on for clarity. It is perfectly fine to write ab*a(a|b)*

Let us define a new regular expression:
abba|baba

We have new notation again. The | simple means or like in normal RGSS.
So this regular expression defines a language that accepts abba and baba. It is pretty straightforward.

The? means either 0 or 1 of the symbol. ab?a accepts aa and aba.

One final often used notation is the + operator - a(b)+a
It is basically the same as the star * operator with the difference of at least one b.
(x)+ is the same as x(x)*, where x means that it could be anything. Any regular notation.

Note (a)* also accepts the empty word. I.e. "" in Ruby syntax.

I will end this section with an example of a non-regular language:
Any words in this language has a number of as in the start followed by the same number of bs.
I.e. ab, aabb, aaabbb and so on.

I will not trouble you with the proof because I think you will find it as boring as I do.
If you really want it I am sure you can manage to search for it yourself. ;)


How to create regular expressions

You can create a regular expression with one of the following syntaxes: (I will use the first one in my examples)

/.../ol
%r|...|ol
Regexp.new('...', options, language)

The dots (...) symbolize the actual regular expression. You can see the syntax up in the reference section.
The o symbolizes the place for options, which are optional. You do not have to write anything here.
o be any of the following i,o,m,x You can have several of them. You can choose them all if you want. From the reference section:
Quote/i         case insensitive
/o         only interpolate #{} blocks once
/m         multiline mode - '.' will match newline
/x         extended mode - whitespace is ignored
/[neus]    encoding: none, EUC, UTF-8, SJIS, respectively

The /[neus] is for the l. You can choose either n, e, u or s. Only one encoding is possible at a time.

The options block in Regexp.new is optional. This is a little different from the options part in the previous syntaxes.
Here you can put:
Regexp::EXTENDED - Newlines and spaces are ignored.
Regexp::IGNORECASE - Case insensitive.
Regexp::MULTILINE - Newlines are treated as any other character.

If you want more than one option, let us say ignore case and multiline, you or them together like this: Regexp::IGNORECASE | Regexp::MULTILINE


We move on to what you actually write instead of the dots (...)
Notice that . means any character.
If you want to find just a dot use \.

Let us take the example where you want to accept words that start with either a, b or c. What comes after does not matter
/(a|b|c).*/ is a possibility, so is [abc].* and [a-c].*
This illustrates the use of the []. If you want all letters use [a-zA-Z] or just [a-z] if you have ignore case on.
If you have weird letters, i.e. not a-z then you probably have to enter them manually.
Example, any word:
/[a-z]*/i gives the same as /[a-zA-Z]*/
The first case will not allow case sensitive stuff later though. I.e. /[a-z]*g/i is not the same as /[a-zA-Z]*g/.
In the first case words that end with big G are accepted while they are not in the latter case.
Numbers are [0-9]
Just use \w to get numbers, letters and _


Let us a bit more difficult example.
We have used Dir to get the files in a directory. We want to remove the file extension from the strings. How exactly we will do it is shown in the next section.
Here we will write the regular expression that accepts the file extension with dot and only the file extension.
If there are more dots as in FileName.txt.dat we will only consider the end extension. I.e. only .dat.
If you have self-discipline enough it would be a good time to try and figure out how to do it on your own. Just consider every extension.

My answer is /\.[^\.]*\Z/
I will go through this step by step.
First we have \. which means a dot like I told earlier. It is the dot in the file name.
Next we have the [^\.]* bit. The [] means one of the character in the brackets. [^] means any character that is not in the brackets. Since you have the dot \. in the brackets it means any character but the dot.
The star simple means any amount, so any amounts of non-dot characters are accepted.
Finally we have \Z which means at the end of the string. It will be explained in the next section.


How to use regular expressions

You may have wondered why there are both a * and *? operator that basically does the same.
I have also avoided other use specific operators.
These are related to how they should be applied to strings.

You now know how to create regular expressions and I will in this section tell you how to actually use.

I will continue the example from the previous section.
We have the string:
str = "Read.me.txt"

We want to remove the .txt which can be done this way:
str. gsub!(/\.[^\.]*\Z/) {|s| ""}

We use the gsub! which modifies the string. The return is "Read.me"
The \Z means that it has to be at the end of the line and/or string. '\n' is considered to be a new line. It does not take .me because there is a dot after it and it is therefore not at the end of the line. (Remember that [^\.] do not accept dots)
Here is a list of the methods on strings where you can apply the regular expression.
Look here for how to use them: http://www.rubycentral.com/ref/ref_c_string.html

  • =~
  • [ ]
  • [ ]=
  • gsub
  • gsub!
  • index
  • rindex
  • scan
  • slice
  • slice!
  • split
  • sub
  • sub!

Basically whenever you see aRegexp or pattern as an argument you can apply your regular expression.

The effects vary from method to method, but I am sure you can figure it out as the principle when considering regular expressions are the same.

Another fishy thing you might have notices is the non-greedy variants of * and +.
To illustrate the different effect try this code:
 "boobs".gsub(/bo*/) {|s| p s}     # 1
"boobs".gsub(/bo*?/) {|s| p s}    # 2
"boobs".gsub(/bo+/) {|s| p s}     # 3
"boobs".gsub(/bo+?/) {|s| p s}    # 4

The first one (greedy) will print out "boo" and "b". It takes all the os it can.
The next one (non greedy) will print out "b" and "b". It takes as few os as possible.
That is basically the difference. It will take os if necessary. In the following code "boob" is printed out in both examples.
 "boobs".gsub(/bo*b/) {|s| p s} 
"boobs".gsub(/bo*?b/) {|s| p s}


The + operator is similar except that there have to be at least 1 o.
In 3rd case you will get "boo" and 4th case you will get "bo".

All in all. The longest possible string is taken unless you have some non greedy operators. The non greedy operators will try to get the shortest possible string.
"boobs".gsub(/o*?/) {|s| p s} will give pure ""s.
As a finale I will talk about escaping characters. You may have wondered about how to search for the characters that have special meaning like *, |, /.
The trick is to escape them. That is what it is called. You just basically have to put a \ in front of them.
\*, \| and \/. To get \ just use \\.
I have already showed an example where I escape the dot. (\.)

There are still loads of operators I have not showed. Some are a bit advanced some are not. They will not be included in this tutorial except for the back reference shown in the next section
Until I make another tutorial or extend this tutorial you can have fun with discovering how they work on your own ^_^

Non-regular languages accepted

It is a bit ironic that the regular expression implementation in Ruby also accepts some non-regular languages.
It is the back-references I am talking about.
Look at this example: /(wii|psp)\1/
wiiwii and psppsp, but neither wiipsp nor pspwii.
You can use back references to make non-regular languages.
I am not going to supply neither proof nor example. You can google it yourself if you are doubting ^_^
One problem with back references is speed. It goes from polynomial time to exponential time. If the regular expressions have been implemented just a little sensible the speed down will only effect regular expressions with the extra functionality.
It should not be too much of a problem with short regular expressions, but it is still something to consider.

Examples

A couple of examples for reference and guidance ^_^

Example 1
I will start by giving some code:
files = Dir["Data/*"]
files.each {|s| s.gsub!(/\.[^\.]*$|[^\/]*\//) {|str| ""}}

The filenames of all the files in the Data directory are stored in the files variable as strings in an Array. (subdirectories and their contents not included)
That is what the Dir["Data/*"] command returns.
The next line calls gsub!(/\.[^\.]*$|[^\/]*\//) {|str| ""} on each filename. (Remember that it is a string)
Now we finally come to the big regular expression:]/\.[^\.]*$|[^\/]*\//
Notice the |. This means that we accept strings that fulfills either what comes before or what comes after. If  the string are accepted in both cases it will still be accepted
Let us look at /\.[^\.]*$. This looks like something we have seen before. Since $ means end of string/line it basically does the same thing as \Z. We have already run through this example, it removes the extension.
Next we will look [^\/]*\//. Remember the bit about escaping?
[^\/] means any character but /. The star means any amount of them.
It is followed by \/ which means the character /. The last character MUST be /
Since the greedy version of the star is used it will try to find the longest possible string which ends with /.
So this basically finds the directory bit of the path.
This means that it either has to be the extension or the path before the filename. We remove these parts by substituting the found strings with "".

This can be used if you for some reason want to draw the files in the location without the path and extension. (You might have them elsewhere.)

Exercises

I have made up a couple of exercise you can try to deal with. I have not provided the answer and I do not plan to provide them.
I consider them more of a stimulant; A way to help you at learning regular expressions.
If you really want to check your answers then PM me. Do not post your answers here.

Exercise 1
Let str be an actual string. What does this code do?
str.gsub!(/.*\..*/) {|s| ""}


Exercise 2
You have one long string that contains a certain amounts of words. Whitespace characters separate the words.
These words have a structure. They all start with either "donkey_" or "monkey_"
What comes after the "_" differs from word to word.
What you want is to separate the monkeys from the donkeys.
You want to put the donkeys in a donkey array and the monkeys in a monkey array.
Make the 2 arrays before and use just a gsub call to separate the monkeys from the donkeys.

Credits and thanks
This article have been made by Zeriab, please give credits
Credits to ZenSpider.com for the reference list.

Thanks to:
Ragnarok Rob for the example word "boobs". (An amazingly good word ^_^)
SephirothSpawn for getting me to do this tutorial.
Nitt (jimme reashu) for bug reporting.

Sources and useful links

ZenSpider - http://www.zenspider.com/Languages/Ruby/QuickRef.html#11
Ruby Central - http://www.rubycentral.com/ref/ref_c_regexp.html
Regular-Expressions.info - http://www.regular-expressions.info/
26
General Discussion / RMXP F.A.Q.
January 08, 2008, 06:25:42 am
Frequently asked questions - RMXP
By Zeriab - Version 2.2

[SIZE=8]Table of Contents:[/SIZE]

  • What is RMXP?
  • What is a switch?
  • What is a variable?
  • What is a script?
  • What is RGSS?
  • What is the Database?
  • What are layers?
  • What is compile game disk?
  • What is RTP?
  • What is RPG Maker XP RTP?
  • What is the maximum...
  • What are the default width and height of the game window?
  • What music types are supported by RMXP?
  • Where can I learn to script RGSS?
  • How do you set the player's starting point?
  • How do you make an NPC?
  • How do I make a quest, where you have to find an item?
  • How do I import maps, made on another computer?
  • How do I import new resources?
  • How do I send my game to my friends?
  • How do I distribute my game without the RTP?
  • I added a call script, now a popup box with "????????" or "Syntax error" occurs.
  • I don't hear any sound, while my speakers are on and my sound card drivers are set.
  • I get an error message saying "Failed to initialize DirectX Audio" when I try to start up RMXP. What do I do?
  • I have inserted a new script and the font doesn´t show up. How to fix this?
  • I have problems with my map. The player can walk over solid stuff. How do I fix this?
  • I have used 'Erase Event' to remove an event, but when I come back later it has appeared. How can I solve this?
  • It says "Incompatible versions". What should I do?
    |
  • Sources
  • Special thanks
    |
  • Help
______________________________________________________________________


What is RMXP?
RMXP, short for RPG Maker XP, is a game making tool made by Enterbrain
You can find their english website here: http://www.enterbrain.co.jp/tkool/RPG_XP/eng




What is a switch?
A switch is an object that can be true or false, on or off. To learn how to use switches, look at this tutorial by Dubealex: http://www.creationasylum.net/index.php?showtopic=6




What is a variable?
A variable is an object that contains a number you can change with events.
To learn how to use variables, look at this tutorial by Dubealex http://www.creationasylum.net/index.php?showtopic=65 or this tutorial by Yami http://yamisiterawr.com/variables.php




What is a script?
The term 'script' have many different meanings (cf. Google and Wikipedia). When used in context with RMXP the general meaning is:
"This is a programming term that refers to a set of instructions (a program) that is executed by another program rather than the computer's processor." - http://www.satellite-tv-hq.com/telecom-glossary-s.htm
This basically means that a script is being interpreted and not compiled.




What is RGSS?
RGSS, short Ruby Game Scripting System, is a set of commands written in an interpreted language to automate certain application tasks or a type of computer code than can be directly executed by a program that understands the language in which the script is written. Scripts do not need to be compiled to be executed.
Source: http://en.wikipedia.org/wiki/Ruby_Game_Scripting_System




What is the Database?
The Database can be found under Tools\Database (F9). You can also get to this by pressing F9.
The Database is the Menu that contains all the game specific settings, such as:
what imported tilesets are used for what;
what items are in the game, and how they interact with the characters;
what monsters are in the game, how they fight, how strong they are, how they look, what groups they travel in;
it also stores character data such as how they look, what their stats are and how they improve as the char levels.
This is also where you setup common events, and other settings that affect the whole game such as the battle music or the tileset for the menus.
This is also where you set what picture is used for the title screen and game over screen, but this is not where you import graphics, here your just picking which already imported graphic to use.
The Resource Manager is used to import graphics.




What are layers?
Layers are the multiple levels in which you are to place objects. The first layer is for putting down the ground usually. The second layer is for putting down the rest the objects. What is unique about RPG XP is the third layer, which is basically just the second layer, over the second layer. Then, finally, you have the event layer, where you basically place events.




What is compile game disk?
It is an option under File in the editor.
It compiles your game into 1 file that you can run on another computer.
If you press it a dialog show appear asking you for an address. For a folder to be more explicit.
This is your output folder where the file will be placed after creation if you accept the dialog. (Click ok)
You have the option to create an encrypted archive.
This means that you can't get access to the game through the editor nor access to your resources when installing the game from the created file.




What is RTP?
RTP means Run Time Package. A package required to run a program, often filled with data used by much programs of the same kind.
For RMXP RTP, look below.




What is RPG Maker XP RTP
RPG Maker XP RTP is a system for reducing the total size of a "game disk" made with RMXP. RPG Maker XP RTP contains the graphics, music (MIDI, etc.)
and DLL files used when creating a game with RMXP ? basically a collection of common materials. When a game is created with RTP data, once it is
finished, you won't have to add this data to the actual "game disk," which consequently allows you to significantly reduce the game file size.
Source: http://www.enterbrain.co.jp/tkool/RPG_XP/eng




What is the maximum...
...number of maps : 999
...number of events per map : 999
...dimensions of a map : 500 x 500
...database items : 999 each (tilesets, common events, actors, skills...)
...height of a tileset : Unlimited. However, lag increases when it is bigger.
More limitations can be found here: http://www.creationasylum.net/index.php?showtopic=204




What are the default width and height of the game window
640 pixels width, 480 pixels height.




What music types are supported by RMXP?
By default, RMXP support .MP3, .WAV, .MID, .WMA and .OGG. MP3 and WMA are streamed, this means they are loaded while playing. OGG is usually much smaller, but can not stream, so need to be loaded fully before playing.

Additional formats like the Playstation PSF and miniPSF can be played with scripts.




Where can I learn to script RGSS?
Look in the sticky topic located under Rpg Game Making\RGSS Scripts located here: http://www.creationasylum.net/index.php?showtopic=8327




How do you set the player's starting point?
Go to the event layer (F8).
Right click on a tile.
Select 'Player's Starting Position' from the drop down menu.




How do you make an NPC?
Go to the event layer (F8).
Make an event somewhere by either double clicking on a square with the left mouse button, right clicking and selecting New Event... or selecting the square and pressing [Enter]
This will open the event dialog. To the left there is a white field with 'Graphic:' in words just above it.
Double click on this (left mouse button) and select the graphic you want.
When this is done go to the big white field to the right.
Here is all the event commands listed. Select it and insert a new command.
Here you can make the NPC do what you want it to do.
Remember that you can a short pop up message by right-clicking and pressing What's this?
You can also get this by pressing F1. You will get the description on the button you have select.
You can move the selection with the arrow keys.




How do I make a quest, where you have to find an item?
There is a bazillion ways to do this. I will try to cook the general concepts down into an example.
If you don't know what a switch is or are unsure of how to use them you should read What is a switch? before continuing.
Phase 1: Activation of the quest
Let's say you talk to this person who gives you the quest. If the quest is given you let the event turn on a switch.
We could use switch 21 - Quest Start and turn it ON. (This could be any switch)
You should make sure that the person does not continue to give the quest. (This is strictly speaking not necessary)
Make a new event page and set as precondition the switch 21 - Quest Start. (Should be the same as the switch you turned ON in the previous page. Remember to set the event graphic)
Here you can set the action for when the Quest is active, but not finished.

Phase 2: Getting the item
Let's say that you could not get the item before.
The event from which you can get the item shall like the event starting the quest have a condition for when the quest start. That is. New page, Precondition set to 21 - Quest Start (2nd page)
Here you should turn another switch to ON. Let it be 22 - Item Gotten. You can make some actions. (Tell the player a story or whatever)
Make a new page (3rd). Set Precondition to 22 - Item Gotten.
Here you can set actions if the player tries to trigger the event again.

Phase 3: Ending the quest
Go back to the event that starts the quest and make a new page (3rd). Set precondition to 22 - Item Gotten.
Here you should tell the player that he or she has completed the quest. Afterwards turn switch 23 - Quest Finished ON. New page (4th). Precondition set to 23 - Quest Finished.
For the item event. New page (4th). Precondition set to 23 - Quest Finished.
Here you can make actions for when the player triggers the events after the quest is completed.

Final notes:
As you might notice a lot of switches are used.
You could actually add an event and then check whether the player has it or not with a conditional branch during the quest. This will eliminate the need for the 22 - Item Gotten switch.




How do I import maps, made on another computer?
Copy both projects on 1 computer.
Open both of them.
In the project tree window to the lower left:
Right-click on one of the maps you want to copy and press copy in the dropdown menu.
Now go to the other project and select a map in the tree structure.
Right-click and press paste.
The map will then be copied into the allocated place in the tree structure.
Keep doing this until you have copied all maps over.
Note that the Player's Starting Position is not copied over.
Also note that the map id most probably changes.
This means that you might have to change some events.




How do I import new resources?
There is an Icon near the little music note, it is the folder with 3 documents (icon). This'll take you to the import/export system.
You can also access the import/export by Tools\Materialbase (F10).
Here you click the Import... button and find the file you want to import.
Here you left click on the color you want transparent.
You can also right-click for a semi-transparent color.
Click OK and you are done.




How do I send my game to my friends?
Look at What is compile game disk?
Send the resulting file to them.
They may have to install the RTP found here: http://www.enterbrain.co.jp/tkool/RPG_XP/eng/download.html
Look below if you want to know how to distribute it without the RTP.




How do I distribute my game without the RTP?
Dubealex has made a tutorial about this, which can be found here: http://www.creationasylum.net/index.php?showtopic=1303




I added a call script, now a popup box with "????????" or "Syntax error" occurs.
You have made an error in the syntax from the call script. Please note that everyline will be interpreted as a new script, unless you have the fix for this.




I don't hear any sound, while my speakers are on and my sound card drivers are set.
Press F1 while in game. Make sure the thirth (Play BGM and ME in game) and the fourth (Play BGS and SE in game) are set.




I get an error message saying "Failed to initialize DirectX Audio" when I try to start up RMXP. What do I do?
Just install/reinstall your Sound Card Audio Driver.




I have inserted a new script and the font doesn´t show up. How to fix this?

Open the scripts and go to MAIN. Find this line:
$scene = Scene_ ... .new


and just before that line add:
Font.default_name = $fontface = $defaultfonttype = "Tahoma"
Font.default_size = $fontsize = $defaultfontsize = 22


Still having problems? Try installing the font files located here:
Fonts.zip




I have problems with my map. The player can walk over solid stuff. How do I fix this?
You might not have set the 'passabilities' in the Database > Tab Tileset.
If you still have problems try to use a dummy tile. Make one of the tiles, that are completely transparent, unpassable and use it to disable passability on the map on the 3rd layer.

If you want to check the passibilty in your map, just choose some "visible" dummy tile and fill with the bucket tool one area in the map. A little trick to actually "see" passability/unpassability on your map. After you finished editing just bucket it back with a passable/unpassable tile.




I have used 'Erase Event' to remove an event, but when I come back later it has appeared. How can I solve this?
First you must understand what Erase Event does.
When you enter a map it is loaded into the memory. Erase Event removes the event from this temp map.
The state of the map is NOT stored when loading another map. (The same as going to another place).
When you now go back again the map will be loaded with the events in their original positions.
This is why it doesn't work.
To solve it simply use switches.
Turn on a switch where you have your Erase Event-command.
Then make a new page and put the switch you just turned on as a precondition for the new page.
Problems with switches? Look at What is a switch?.




It says "Incompatible versions". What should I do?
Make a new project and replace the Game.rxproj inside the demo with the new one. If you still can't start it, open Game.ini and change RGSS102E.dll to RGSS100J.dll. If it already is RGSS100J.dll, change it to RGSS102E.dll.





Sources:

Official English Site
- http://www.enterbrain.co.jp/tkool/RPG_XP/eng

Creation Asylum
- http://www.creationasylum.net

Google
- http://www.google.com

Oxford English Dictionary
- http://www.oed.com

Wikipedia
- http://www.wikipedia.org

Special thanks:
Aus "ace" Wallace
Blizzard
Constance
deadly_diablo
kitramos
Marlune
Me™
zuzagi


Help:
I need YOUR help in making this FAQ better.
Have anything else to add? New questions with or without answers?
Please do post tell me and chances are that I will post it.

Is anything wrong? Some information doesn't work or is in fact wrong? Or does it just need an update?
Getting this kind of information is valuable as well. The information as good and as accurate as possible while having good depth.

Something wrong with the terminology? Wrong terms used?
Is it not called a 'Conditional Branch', but a 'Fork' instead?
If people try to find a button they think is named something different that what it actually is... A lot of time is a wasted.

As you can see there might be a lot you can help with, but before posting your help there is something you must know:
By contributing to this FAQ you agree that distribution of this work in parts or as a whole is left entirely at my discretion.
You also agree that once integrated you lose the right to demand your work's removal.
27
Welcome! / Free hugs for everyone!
January 07, 2008, 08:20:26 pm
Hey all!

For those of you I know, nice to meet you again.
I am Zeriab, a scripter and eventer and a moderator at the old forums.
For those you I don't, nice to meet you.

For all: *hugs*
- Zeriab