Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: Zeriab on August 21, 2008, 10:15:34 am

Title: [XP] Disc Changer - If you need more than 999 maps
Post by: Zeriab on August 21, 2008, 10:15:34 am
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




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





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
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Blizzard on August 21, 2008, 10:45:13 am
I use CC's license. ^_^
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Zeriab on August 21, 2008, 11:09:46 am
You are more strict than me :P

There an additional restriction to the terms.
I did originally make it for a commercial game, but asked if I could post it freely. (He would naturally not have to pay for me scripting it)
See if you can spot what it is XD
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Blizzard on August 21, 2008, 11:11:48 am
Is it this?

Quotewithout even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE


I don't know the GNU license from memory, but I don't recall this piece.
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Zeriab on August 21, 2008, 11:40:00 am
Nope.

I am so gonna say this when it finally is true!

YOU ARE WRONG BLIZZARD.

Luckily not very much ^^
I mean no flaming though, it's mean as a joke ^^

Note: It seems that vgvgf's decryptor/extractor won't extract the maps on any of the discs except disc 0 (those directly in the data folder)
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Blizzard on August 21, 2008, 11:42:30 am
Not entirely.

Quote from: Blizzard on August 21, 2008, 11:11:48 am
I don't know the GNU license from memory, but I don't recall this piece.


I naturally can't recall it because I don't know the license from memory. Nevertheless I was wrong. ;_;
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Diokatsu on August 21, 2008, 11:44:36 am
Diverging from all this mess of GNU vs CC....

Love it xD Great script although I personally may not need it. If I do well then, it's in the database.
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Zeriab on August 21, 2008, 11:47:01 am
Ah yes, I am most sorry. I just couldn't resist this change to tease Blizzy.

I am glad you like the script ^^
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Blizzard on August 21, 2008, 11:47:43 am
When I make the homepage and a couple of other connected pages, there will be one page which features links to all database topics, ordered by poster. :)
Well, if people care to use the "Type" in the script title all the time, I can actually parse the post for that and order it by type. :D

And I <3 you, Zeriab. <3
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Shadonking on August 21, 2008, 12:10:17 pm
i cant get it to work.

at the start of the game it must load from the data file but the other maps can be put in disk 1 is that right. if yes that i know what my problem is
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Blizzard on August 21, 2008, 01:23:24 pm
"Disc 0" is the first disc if I am not wrong.
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Zeriab on August 21, 2008, 01:58:13 pm
Disc 0 is indeed the first script. Disc 0 is the maps in the data folder, i.e. the maps you can see in the main project ;)

@Blizzy: I <3 you too :3
Don't depend on the "Type" though. You can be sure it won't work out well -_-
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Blizzard on August 21, 2008, 02:02:53 pm
I know. I use custom types for my scripts. I could include something in the template called "Script Type" or "Common Type" or "Search Type" or "Log Type" or "Keyword Type" or "Key Term" while there are not so many scripts in the database yet. Parsing the beginning of the post for that line should be no problem then if I give a strict list of possible types. :)
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Shadonking on August 21, 2008, 05:48:48 pm
ok i get that now but it still deosnt work, when i put in the script command to change disks is says data/disk1/map001.rxdata not found.

whats the prob then, sorry for bieng a pain
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Blizzard on August 21, 2008, 05:54:04 pm
You have to put the maps from another disc into the disk1 folder in the Data folder.
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Zeriab on August 22, 2008, 07:35:34 am
Quote from: shadonking on August 21, 2008, 05:48:48 pm
ok i get that now but it still deosnt work, when i put in the script command to change disks is says data/disk1/map001.rxdata not found.

whats the prob then, sorry for bieng a pain

The reason it doesn't work is that the folder is named disk1, it should be named disc1.
A silly little error of the type that can be very hard to spot ^_^

@Blizz: Yeah perhaps you are right, but you should nevertheless still consider the maintenance cost
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Shadonking on August 22, 2008, 07:55:22 am
ok thanks,

its working fine now.

yay, now i can make a really big game.
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Blizzard on August 22, 2008, 08:26:47 am
Quote from: Zeriab on August 22, 2008, 07:35:34 am
@Blizz: Yeah perhaps you are right, but you should nevertheless still consider the maintenance cost


Me and SRK (with some help of Aqua) edited the topics in XP and VX databases yesterday already. :D Now all I need is to make a php script that accesses the MySQL database, gets the right data out, orders the links appropriately and categorizes according to the key term. :D
I tell you, after this everybody will start copying my idea. xD
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Zeriab on August 22, 2008, 08:44:07 am
I am glad it worked out fine ^^
Sounds like you are making a big game >_>
I hope it goes well

@Blizzy: Oh that's awesome :3
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Shadonking on August 22, 2008, 09:35:38 am
yeh its going to be big becuase its going to be zelda map wise so its good not having a limit.

down side is its going to take ages to make lol
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Memor-X on August 24, 2008, 09:13:48 pm
*starts singing Wrath of the Twin out loud* i requested this, i never forgot about this, and i've been straining my head trying to figure out how the hell i'm going to complete Black Core or HoM without it, Zeriab, if your a girl, i'd kiss you, if your a guy, i'll get my neice to kiss you (she's two years older then me and most of my friends who've seen her thinks she's hot)

just a few questions, you said that if we had the SDK we're fine, (otherwise replace some of the code in the defult scripts) anyway, since any and all of my games will have a version of the SDK in some way (thanks alot Seph for making an Airship and Map-Title script using 2 differnt SDKs) will this script work find with SDK V 1.x and 2.x

also, you said that there may be a compatibility problem with scripts that reads MapInfos.rxdata and displays the names of each map, does that mean CMS's aswell (mainly Blizzard's CMS)

with this script, i am now much more comfortable in using as many maps as i like in any game i am to make, yay
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: shdwlink1993 on August 24, 2008, 10:57:15 pm
cough... I already had made one in the SFS... and I even... marked you in special thanks... for requesting it... :'(

Oh well, Zeriab's is a lot more practical than mine, and it's probably much better than mine. Power-ups for Zeriab.
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Zeriab on August 25, 2008, 06:19:17 am
Wow... I am energized.  8)
I am glad you like it ^_^
I do remember a discussion back in the day about a disc changer. (I admit I had forgotten until you reminded me)

I believe that the area I use in the SDK is the same in both SDK V 1.x and 2.x
If this is true then you should have no problems using it.

As for Blizzard's CMS. If it reads MapInfos.rxdata then yes. It will only show correctly on disc 0.
I suggest you ask Blizzard where the location is used in his CMS and ask him to use this instead:
load_data(sprintf("Data/%sMapInfos.rxdata", $game_system.disc))


Also note that since the filename alters you can't simply cache it. If that's what Blizzard has done then it'll be slightly more difficult.

You can also try to send your script file to me although asking Blizz will probably be the fastest way.

*hugs*
- Zeriab
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Blizzard on August 31, 2008, 06:16:51 pm
By default line 524. :P

*late reply* ._.
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Zeriab on September 21, 2008, 06:04:41 am
Updated to version 1.05.
You can now use arbitrarily named folders. Just give a string instead of a number when using the change_disc command.
If you are using a number it works just like before.

*hugs*
- Zeriab
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Machoo on June 15, 2013, 06:30:26 am
I don't know if you will be able to receive this as it has been such a long time, I was trying to use this script with a modded version of Blizz ABS, and I'm pretty sure there's a problem within the loading of Map_Data.abs

When I change disc to disc 1, very frequently tiles randomly become unpassable. It must be something to do with the intelligent passibility or the eight dimensional movement script.

I don't know much about ruby, and I am just throwing key words around. Is there any way to work around this?
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Blizzard on June 15, 2013, 12:59:13 pm
Try disabling intelligent passability.
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Ethereal on November 16, 2017, 06:51:58 am
sorry to reply this old topic, but a i have a problem
when i use the command change_disc(0) this error appear:

(https://i.imgur.com/jyNsk9J.png)

am i doing something wrong? because the command change_disc(0) it is not used to return to the original Data?

(https://i.imgur.com/C1UR4K4.png)

Can someone please help me...?  :shy: :(
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Jaiden on November 16, 2017, 07:52:18 am
It looks like you are not using the arguments correctly. The "id =", etc. are only in the directions to show you what each argument means.

Your script call should look like this:
change_disc(0, 3, 10, 14)

Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Ethereal on November 16, 2017, 08:04:09 am
still the same...

(https://i.imgur.com/cHQ9qYO.png)

i getting this error only when i try to return to the main Data folder

i could make this disc0 folder, but some of my scripts just won't work correctly how they should inside the discs folder
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Jaiden on November 16, 2017, 09:58:14 am
As I suspected, it looks like there isn't any code that actually handles what happens when you change to Disk 0, I just tested it in a demo.

I'm not entirely sure if the SDK changes anything, since I didn't use the SDK, just made the Game_Map edit. Adding a condition that handles what happens when the map is set to "0" seemed to work.

Try replacing your script with this and see how it goes:
Quote
#==============================================================================
# ** 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 == 0
    $game_system.disc = "/"
  elsif 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


It looks like using a folder with a regular name is bugged, so I'll take a look at that, too, when I get a moment.
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Ethereal on November 16, 2017, 10:20:49 am
Man, you're genius...Nothing else to say.
Thank you so muuuch, is working perfectly now!!  :O.o: :O.o:
Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Jaiden on November 16, 2017, 10:32:43 am
I definitely wouldn't use the word genius...

This fixes the issue with the custom folder name not working properly, in case you decide to use folder names instead of disc folders:
Spoiler: 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 == 0
    $game_system.disc = "/"
  elsif number.is_a?(Integer)
    $game_system.disc = "disc#{number}/"
  else
    disc = '/'
    disc += number.to_s 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

Title: Re: [XP] Disc Changer - If you need more than 999 maps
Post by: Ethereal on November 16, 2017, 11:01:30 am
Quote from: BoisterousHero on November 16, 2017, 10:32:43 am
This fixes the issue with the custom folder name not working properly, in case you decide to use folder names instead of disc folders:
Spoiler: 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 == 0
    $game_system.disc = "/"
  elsif number.is_a?(Integer)
    $game_system.disc = "disc#{number}/"
  else
    disc = '/'
    disc += number.to_s 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


i will definitely take a look, thanks.

Quote from: BoisterousHero on November 16, 2017, 10:32:43 am
I definitely wouldn't use the word genius...


Alright, then you are my hero.  lol