+ Disc Changer VX + custom tilesets per disc feature +, Have unlimited maps and almost unlimited tilesets! |
|
|
|
|
Nov 20 2008, 05:21 AM
|

Level 1 / 0

Group: Revolutionary
Posts: 198
Type: Scripter
RM Skill: Masterful

|
~[Disc Changer VX + custom tilesets per disc feature]~ Version: 1.02 Author: Omegazion, original DC script for XP by ZeriabRelease Date: Nov. 20, 2008IntroductionThis script allows you to change the disc, where each disc can contain as much as 999 maps! Giving you the freedom to have unlimited maps! I have also added the feature so that each disc can have different tilesets. Features- have more than 999 maps! - have different tilesets per disc, technically giving you the freedom to have unlimited tilesets too! - the change disc is as quick as a simple player transfer. ScriptCODE #============================================================================== # Disc Changer script VX + custom tilesets per disc feature #------------------------------------------------------------------------------ # Original DC script by Zeriab, translated to VX by omegazion and added # custom tilesets per disc feature. v1.02 #==============================================================================
=begin
INTRODUCTION ------------
This script allows you to change the disc, where each disc can contain 999 maps. I have also added the feature so that each disc can have different tilesets.
INSTRUCTIONS ------------
This script enables the change_disc command. Use script calls to change the disc. create the other disc maps separately in another project. when you are done, save it, then copy the map files in the Data folder of that project. (The map files are the ones that are named MapXXX.rvdata where XXX is an integer).
After that, in the Data folder of the Original project, you must create a disc folder. This is where you put the map files. For disc 1, name the disc folder 'disc1' and so on..
New! You can name the disc folders with whatever you want, as long as you follow special disc name instructions below.
CHANGING 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. (which is the folder named 'disc2'
If you are not using the format 'discX' as a disc name, (WeirdTilesDisc as an example in the demo) you can replace the number argument with its name, closed in ""
change_disc("WeirdTilesDisc")
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)
ADDED CUSTOM TILESETS FOR EACH DISC FEATURE ------------------------------------------- At the same folder of that disc, you could put Tileset files (i.e. TileE, TileA4 etc..) The script will automatically load those tilesets when they are there. If you do this, you must also put the System.rvdata in the disc folder, for the passage settings. If you do not do that, it will use the passage settings in the original project, (which is most of the time, wrong). =end class Game_System attr_writer :disc def disc @disc ||= '' @disc end end
def change_disc(number, id = nil, x = nil, y = nil, direction = nil) # Change disc if number.is_a?(Integer) $game_system.disc = number <= 0 ? "" : "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) $game_player.reserve_transfer(map_id, x, y, direction) # Change the current map id in case the new and old are identical. $game_map.map_id = 1000 + map_id end
class Game_Map attr_writer :map_id alias oz_dc_setup setup def setup(map_id) if $game_system.disc.empty? # Original Disc oz_dc_setup(map_id) # Perform original call else @map_id = map_id # Load map data from disc @map = load_data(sprintf("Data/%sMap%03d.rvdata", $game_system.disc, @map_id)) @display_x = 0 @display_y = 0 # Get Folder Location loc = "Data/#{$game_system.disc}" $game_system.disc =~ /([0-9]+)/ dn = $1.to_i if not $game_temp.disc_passages[dn].nil? # Get passage data stored in game temp @passages = $game_temp.disc_passages[dn] elsif FileTest.exist?(loc + "System.rvdata") # If system.rvdata exists # load system settings from that file disc_sys = load_data(loc + "System.rvdata") # Use passage settings from that file @passages = disc_sys.passages # Store in Temp data for faster loading $game_temp.disc_passages[dn] = @passages else # Use default passage settings @passages = $data_system.passages end referesh_vehicles setup_events setup_scroll setup_parallax @need_refresh = false end end end
#============================================================================== # ** Custom Tileset Per Disc Feature #==============================================================================
class Spriteset_Map alias oz_dc_create_tilemap create_tilemap def create_tilemap if $game_system.disc.empty? oz_dc_create_tilemap else folder_loc = sprintf("Data/%s", $game_system.disc) @tilemap = Tilemap.new(@viewport1) # For each tileset file extension ["A1", "A2", "A3", "A4", "A5", "B", "C", "D", "E"].each_with_index do |name, i| tilename = "Tile#{name}" # If the file exists if not Dir[folder_loc + tilename + ".*"].empty? @tilemap.bitmaps[i] = Cache.load_bitmap(folder_loc, tilename) else # Load default bitmap @tilemap.bitmaps[i] = Cache.system(tilename) end end @tilemap.map_data = $game_map.data @tilemap.passages = $game_map.passages end end end
class Game_Temp attr_accessor :disc_passages alias oz_dc_init initialize def initialize oz_dc_init @disc_passages = [] end end NOTESwitches and Variables are shared between discs! Take note of that when doing your eventing in other discs. CompatibilityMaybe incompatible with scripts that use map ids. DEMOThis demo is very simple and too short. I just need to show how things are done. InstallationPut script above main. Above most scripts. Terms and Conditions- Feel free to use in any commercial/non-commercial game as long as credits included Credits- Zeriab : For the Original Disc Changer Script for XP - Me, Probably.
__________________________
 Those who live by the sword, Die by the gun.
|
|
|
|
|
|
|
3 Pages
1 2 3 >
|
 |
Replies
(1 - 19)
|
|
Nov 20 2008, 05:27 PM
|
Level 1

Group: Member
Posts: 5
Type: None
RM Skill: Undisclosed

|
Nice. Porting this was on my to-do list, so you saved me some time. ^_^b
-Enelvon
|
|
|
|
|
|
|
|
|
Nov 21 2008, 12:09 AM
|

Random Wanderer

Group: Revolutionary
Posts: 157
Type: Scripter
RM Skill: Beginner

|
Hey, nice script. Guess this is handy for those who loves using custom tilesets for each map. Now with this, each map will be like RPG Maker XP style... Thanks for creating it with your hard effort. Definitely A+ script!
__________________________
I wander around the RPG Maker VX forums to help others in need... if I'm bothered.
|
|
|
|
|
|
|
|
|
Nov 25 2008, 02:45 AM
|

Level 1 / 0

Group: Revolutionary
Posts: 198
Type: Scripter
RM Skill: Masterful

|
Enelvon! You should also share your scripts here! QUOTE (Azuaya @ Nov 21 2008, 12:09 AM)  Hey, nice script. Guess this is handy for those who loves using custom tilesets for each map. Now with this, each map will be like RPG Maker XP style... Thanks for creating it with your hard effort. Definitely A+ script! Thank you! The Good thing about this script is that the tilesets can have different passabiities, and most of the features are automatic.
__________________________
 Those who live by the sword, Die by the gun.
|
|
|
|
|
|
|
|
|
Nov 26 2008, 09:37 AM
|

Level 1 / 0

Group: Revolutionary
Posts: 198
Type: Scripter
RM Skill: Masterful

|
QUOTE (onidsouza @ Nov 25 2008, 07:27 AM)  Hey very nice script, but one thing, i was getting an error in this line:
if $game_system.disc.empty? # Original Disc
So i changed for this:
if $game_system.disc = 0
Did i maked something critical? or there is no problem? With me it works very fine. Uh, $game_system.disc is a string... i dunno... What does the error say? @Kolid : Feel free to do so.
__________________________
 Those who live by the sword, Die by the gun.
|
|
|
|
|
|
|
|
|
Nov 27 2008, 10:50 AM
|

image master of doom

Group: Revolutionary
Posts: 603
Type: None
RM Skill: Undisclosed

|
QUOTE (omegazion @ Nov 26 2008, 03:37 PM)  QUOTE (onidsouza @ Nov 25 2008, 07:27 AM)  Hey very nice script, but one thing, i was getting an error in this line:
if $game_system.disc.empty? # Original Disc
So i changed for this:
if $game_system.disc = 0
Did i maked something critical? or there is no problem? With me it works very fine. Uh, $game_system.disc is a string... i dunno... What does the error say? @Kolid : Feel free to do so. Yes i got it, .empty? must be a method to check if i am calling original disc, but when i use that i got this error: script 'discchanger' line 101: NoMethodError Ocurred Undefined method 'empty?' for 0:Fixnum where did you defined empty? method? i try find that line in the script but i don't find. This error is only on me or you forget to def that method?
This post has been edited by onidsouza: Nov 27 2008, 10:51 AM
__________________________
|
|
|
|
|
|
|
|
|
Nov 27 2008, 01:27 PM
|

image master of doom

Group: Revolutionary
Posts: 603
Type: None
RM Skill: Undisclosed

|
QUOTE (Galandil @ Nov 27 2008, 07:06 PM)  I dunno if it has been asked or explained, but how many discs can you actully have for this disc changer script? If anyone knows or can explain I'd be delighted. Galandil  because of this line: $game_system.disc =~ /([0-9]+)/ i think that you can have up to 9 discs, but i don't know, i am not a very good scripter, I am getting error in this script so i can tell you. Omegazion can't tell you better.
This post has been edited by onidsouza: Nov 27 2008, 01:28 PM
__________________________
|
|
|
|
|
|
|
|
|
Nov 27 2008, 03:15 PM
|

Level 12

Group: Revolutionary
Posts: 196
Type: Event Designer
RM Skill: Skilled

|
It's a regular expression meaning which finds any number. (A string containing 0,1,2,3,4,5,6,7,8 or 9) Actually it finds the position of the first match and stores it in $game_system.disc You have unlimited amount of saves. (In practice you have a limit, but you'll never reach it) Omegazion I appreciate you converting the script and even adding more features ^^ I have seen you did not convert my latest version which supports arbitrarily named discs. (So you can have a folder for each city or something like that) http://zeriab.plesk3.freepgs.com/root/scri...isc_changer.txt*hugs* - Zeriab
__________________________
|
|
|
|
|
|
|
|
|
Nov 28 2008, 08:24 AM
|

Level 19

Group: Revolutionary
Posts: 396
Type: Artist
RM Skill: Skilled

|
I really feel that this isn't getting the attention it deserves; this script eliminates the mapping limits that VX has; in fact, with this script, you can make pirate ships in VX now. It works excellent, is easy to use after you read the directions, and allows you to use all of the Famitsu tiles. Win-win situation
__________________________
Jade Elegy Progress ;o 
|
|
|
|
|
|
|
|
|
Nov 28 2008, 12:16 PM
|

new av & (dynamic) sig!

Group: Revolutionary
Posts: 149
Type: Scripter
RM Skill: Undisclosed

|
Great script! Cheers to Omegazion and Zeriab for making this.  I'll see if I can put this to good use..
__________________________
 >>Latest EventScripter news: Conditional Branches fully working! Currently working on a documentation site. Topic: EventScripter>> Portals (yes, in RPG Maker VX!)>>Working with Sojabird on his Scriptology; I also invented Scriptuzzle.. Try one; make one! CODE $LOAD_PATH << Dir.getwd #You only need to call this once Kernel.require("includable.rb") #replace includable.rb with the name of the file you want to load CODE #=============================================================================# # # # ANTI DASH HACK # # # # # # By AmIMeYet # # # # # # please credit me # # # #=============================================================================# class Game_Player < Game_Character def dash? return false if @move_route_forcing return false if in_vehicle? return true if Input.press?(Input::A) and $game_map.disable_dash? end end This snippet basically inverts the dashing.. allowing you to dash only when 'disable dashing' is checked. This way, normal maps disable dashing, but the ones you set to disable actually allow dashing.. It should be placed where you normally place the scripts ('above main', in the materials section of the scripts window)..
|
|
|
|
|
|
|
|
|
Nov 28 2008, 10:07 PM
|

Random Wanderer

Group: Revolutionary
Posts: 157
Type: Scripter
RM Skill: Beginner

|
NOTE TO USERS USING MAP NAME POP-UP SCRIPTS!!! : Place omegazion's disc changer script below the map name pop-up scripts within the script editor, or it will give an error!
Say, omegazion, there is a problem if a user uses a map name pop-up script that shows the Map name when entered into the map.
1. Transfer player to another map in disc 1 2. Map name does not show 3. Transfer back to disc 0 4. Map name appears
So therefore, when changing to different disc, the map name pop-up script will not show. Hopefully it can be fixed somehow.
__________________________
I wander around the RPG Maker VX forums to help others in need... if I'm bothered.
|
|
|
|
|
|
|
|
|
Nov 29 2008, 06:29 AM
|

Level 19

Group: Revolutionary
Posts: 396
Type: Artist
RM Skill: Skilled

|
http://rmrk.net/index.php?topic=28415.0For the pirates. And by famitsu, I meant Macks.
__________________________
Jade Elegy Progress ;o 
|
|
|
|
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
RPG RPG Revolution is an Privacy
Policy and Legal
|
|