Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Disc Changer - If you need more than 999 maps

Zeriab

Sponsor

Disc Changer
Version: 1.05

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.

Demo

http://www.mediafire.com/?mymituktnto

Script
Ruby:
#==============================================================================

# ** 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

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

<span style="color:#000080; font-style:italic;">=begin

<span style="color:#000080; font-style:italic;">INSTRUCTIONS

<span style="color:#000080; font-style:italic;">------------

<span style="color:#000080; font-style:italic;">If you do not have the SDK then you have to change Game_Map

<span style="color:#000080; font-style:italic;">In the Game_Map setup method change the load_data line to this: (Line 50)

<span style="color:#000080; font-style:italic;"> 

<span style="color:#000080; font-style:italic;">  # Load map from file and set @map

<span style="color:#000080; font-style:italic;">  @map = load_data(sprintf("Data/%sMap%03d.rxdata", $game_system.disc, @map_id))

<span style="color:#000080; font-style:italic;"> 

<span style="color:#000080; font-style:italic;">After you have done this the below will work.

<span style="color:#000080; font-style:italic;"> 

<span style="color:#000080; font-style:italic;">This script enables the change_disc command. Use script calls to change the disc.

<span style="color:#000080; font-style:italic;">For disc 1 create a subfolder in your data folder called 'disc1' and place the

<span style="color:#000080; font-style:italic;">map files for disc 1 in there.

<span style="color:#000080; font-style:italic;">For disc 2 you should create a subfolder called 'disc2' and place the map files

<span style="color:#000080; font-style:italic;">for disc 2 in there. And so on for each of your discs.

<span style="color:#000080; font-style:italic;">The syntax is:

<span style="color:#000080; font-style:italic;"> 

<span style="color:#000080; font-style:italic;">  change_disc(number, id = nil, x = nil, y = nil, direction = nil)

<span style="color:#000080; font-style:italic;"> 

<span style="color:#000080; font-style:italic;">The nil numbers mean that those arguments are optional. When you don't use them

<span style="color:#000080; font-style:italic;">then they are set to whatever the current map_id, x, y and direction are at the

<span style="color:#000080; font-style:italic;">moment.

<span style="color:#000080; font-style:italic;"> 

<span style="color:#000080; font-style:italic;">If you want to change to disc 2 then you can put this in a script call:

<span style="color:#000080; font-style:italic;"> 

<span style="color:#000080; font-style:italic;">  change_disc(2)

<span style="color:#000080; font-style:italic;">  

<span style="color:#000080; font-style:italic;">You will then be transfered to disc 2 with the same map id and coordinates as

<span style="color:#000080; font-style:italic;">what the player currently has.

<span style="color:#000080; font-style:italic;">If you want to be more precise and say you want to change to disc 2 on the map

<span style="color:#000080; font-style:italic;">with id 10 and the player must be placed at the tile with x = 6 and y = 13 then

<span style="color:#000080; font-style:italic;">you should put this in a call script&#058;

<span style="color:#000080; font-style:italic;"> 

<span style="color:#000080; font-style:italic;">  change_disc(2, 10, 6, 13)

<span style="color:#000080; font-style:italic;">  

<span style="color:#000080; font-style:italic;">Note that when you start the game the maps directly in the data folder is used.

<span style="color:#000080; font-style:italic;">You can back to them by changing to disc number 0.

<span style="color:#000080; font-style:italic;">Basically, disc number 0 is the maps directly in the data folder and not in any

<span style="color:#000080; font-style:italic;">of the sub folders.

<span style="color:#000080; font-style:italic;"> 

<span style="color:#000080; font-style:italic;">The final argument is the direction. By default the player retains the current

<span style="color:#000080; font-style:italic;">direction. You can put 6 different values as direction:

<span style="color:#000080; font-style:italic;"> 

<span style="color:#000080; font-style:italic;">0, 10 : No change

<span style="color:#000080; font-style:italic;">2     : Turn Down

<span style="color:#000080; font-style:italic;">4     : Turn Left

<span style="color:#000080; font-style:italic;">6     : Turn Right

<span style="color:#000080; font-style:italic;">8     : Turn Up

<span style="color:#000080; font-style:italic;"> 

<span style="color:#000080; font-style:italic;">If you for example want to transfer the player to disc 1, map 43 at x = 30 and

<span style="color:#000080; font-style:italic;">y = 4 with the player looking down you should put this in a call script&#058;

<span style="color:#000080; font-style:italic;"> 

<span style="color:#000080; font-style:italic;">  change_disc(1, 43, 30, 4, 2)

<span style="color:#000080; font-style:italic;">  

<span style="color:#000080; font-style:italic;">*hugs*

<span style="color:#000080; font-style:italic;"> - Zeriab

<span style="color:#000080; font-style:italic;">=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

Installation

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:
Ruby:
    # 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:
Ruby:
  # 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.

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.

Q&A's

None so far

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:
Ruby:
load_data(sprintf("Data/%sMapInfos.rxdata", $game_system.disc))

Credits and Thanks

Thanks goes to Legend of Harpine for which this was originally designed.
Credits goes to Zeriab for writing the script.

Special thanks goes to Kain Nobel

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
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
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
 
Cool, but I found a script here that is called Unlimited Database or something like that which alows you to go above 999 in every tab. Or maybe thats different from over 999 maps that you display in your script?
 
Interesting script... again, not perfect because it looks kinda crazy without any comment seperators, but nicely written indeed. While you'd probably be better off writing an 001A-...A-999A-001B-...B-999B-001C-... system because of simplicity, I guess this version has it's advantages as well... as long as people think about including all the maps necessary for backtraveling, this will work just fine.
 

Zeriab

Sponsor

Thanks a lot BlueScope ^^

You are quite right, I should have commented it so the format was similar to the default scripts.
I did not do the type of system you suggest because it involves renaming map files (if I understand what you suggest correctly)
A bigger reason is that I believe it would be harder to modify specific maps than if you have a project for each disc.
I also believe it's easier to stick to copy/paste for non-scripters-

I thank you again for your input ^^

*hugs*
- Zeriab
 

poccil

Sponsor

Though the script is interesting, I don't see how the limit of 999 maps could be reached.  Most games normally don't reach even 300 or so maps.  Even Pokemon Diamond and Pearl, for instance, might only have about 250 maps, and not a thousand of them.
 
Because of my running events, I've had to make ALOT of maps so I can avoid ingame lag. This will come in handy for me, though not right now. Congrats on making such a lovely script!
 

Zeriab

Sponsor

That poccil is probably the reason why it has not been made before. However if you look at some of the RM2K(3) games you have seen games with over 999 maps.
I made this because of a need. I know it sounds insane, but I did indeed. I have also worked on another game (as scripter) where the map design was altered due to the 999 map limit.
Another reason is the one Fertility said ^^

@Fertility: I'm glad you like it ^^

*hugs*
- Zeriab
 
Dude, this is a pretty cool concept indeed, although people usually don't create more than 999 maps. I do see that you don't need 1000+ maps to use this system, thats good.

However, you should give us the option of either tracking it by the standard "Disc1", "Disc2", or to be able to track them by "Start of Game" maps, "The First Town" maps, "The First Dungeon" maps, etc. So instead of changing discs, you'd just be changing towns or whatever, and every map in that folder would just be the maps referring to that location.

Since I make alot of maps for just one town or whatever, I sometimes find myself starting early the maps for the next town in a second project and copying them over later on, so I might actually use this system. The let down, doing it that way is I would always have to leave eventing for last, because you can't exactly keep transfer player events straight doing it that way. However, this system would make it possible to do seperate-project mapping and eventing without having to worry about ID, just place the maps in the folder when you're done and port them over to the origional project and change disc between seperate map groups.

You should really implement the idea of naming them by location, I'd probably use this if you had that option.

Have you tried this system with an encrypted project? Does it encrypt the maps properly, and change discs properly?
 

Zeriab

Sponsor

Thanks for the comments Kain ^^
I like the idea of also naming the discs by name. It can be fairly easily implemented by changed the writer so it checks whether it is an integer or not. I'll update the disc changer with the idea when I get the time ^^

I admit I did not think of using the script the way you mention but I can definitely see the potential in it. It helps making independent areas even more independent.

I have tried this system in an encrypted project. It worked flawlessly for me. In addition I found that vgvgf's rgssad extractor only extracts the maps directly in the data folder and not any map in any other disc. (A scripter can naturally overcome the problem)

*hugs*
- Zeriab
 

Zeriab

Sponsor

I have now updated the disc changer to version 1.05.
This time you can give a string instead of a number as the disc. In this case it will assume the string is the folder name of the disc and use that.
 
I need to install the RMXP here, but I'll look into it, it does use the game_whatever integer or function, I'll try it and see if can be fixed using your "patch note".

just gimme some time (around 5 hours) and I'll tell ya.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top