Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

3 Pages V   1 2 3 >  
Reply to this topicStart new topic
> + Disc Changer VX + custom tilesets per disc feature +, Have unlimited maps and almost unlimited tilesets!
omegazion
post Nov 20 2008, 05:21 AM
Post #1


Level 1 / 0
Group Icon

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 Zeriab
Release Date: Nov. 20, 2008

Introduction

This 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.

Script

CODE
#==============================================================================
#  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



NOTE

Switches and Variables are shared between discs! Take note of that when doing your eventing in other discs.

Compatibility

Maybe incompatible with scripts that use map ids.



DEMO

This demo is very simple and too short. I just need to show how things are done.


Installation

Put 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.
Attached File(s)
Attached File  Disc_Changer_VX.zip ( 493.64K ) Number of downloads: 1523
 


__________________________

Those who live by the sword, Die by the gun.
Go to the top of the page
 
+Quote Post
   
Enelvon
post Nov 20 2008, 05:27 PM
Post #2


Level 1
Group Icon

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
Go to the top of the page
 
+Quote Post
   
Azuaya
post Nov 21 2008, 12:09 AM
Post #3


Random Wanderer
Group Icon

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.

Go to the top of the page
 
+Quote Post
   
saynosin
post Nov 21 2008, 01:08 AM
Post #4


Level 5
Group Icon

Group: Member
Posts: 64
Type: Developer
RM Skill: Beginner




Sounds interesting thank you happy.gif


__________________________



Storyline: 50% Characters: 20%
Scripts: 60% Resources: n/a
Go to the top of the page
 
+Quote Post
   
omegazion
post Nov 25 2008, 02:45 AM
Post #5


Level 1 / 0
Group Icon

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.
Go to the top of the page
 
+Quote Post
   
onidsouza
post Nov 25 2008, 07:27 AM
Post #6


image master of doom
Group Icon

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




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.


__________________________
Gabba Gabba Hey! enjoy your life ^^
lol (by keet's brother)
some lol
more lol
even MORE lol
Serious Discussion
why all my lol's have Teh Parakeet involved?

me ^^

bacon

Spamming is always better with bacon
Go to the top of the page
 
+Quote Post
   
Kolid
post Nov 25 2008, 12:42 PM
Post #7


Level 19
Group Icon

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




Thanks again for making this Omega, sorry I didn't see it yet. If I have any questions about this, I'll just ask ;o Time to test it out!


__________________________
Jade Elegy Progress ;o
Go to the top of the page
 
+Quote Post
   
omegazion
post Nov 26 2008, 09:37 AM
Post #8


Level 1 / 0
Group Icon

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.
Go to the top of the page
 
+Quote Post
   
onidsouza
post Nov 27 2008, 10:50 AM
Post #9


image master of doom
Group Icon

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


__________________________
Gabba Gabba Hey! enjoy your life ^^
lol (by keet's brother)
some lol
more lol
even MORE lol
Serious Discussion
why all my lol's have Teh Parakeet involved?

me ^^

bacon

Spamming is always better with bacon
Go to the top of the page
 
+Quote Post
   
Galandil
post Nov 27 2008, 01:06 PM
Post #10



Group Icon

Group: Member
Posts: 3
Type: Event Designer
RM Skill: Masterful




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 ph34r.gif
Go to the top of the page
 
+Quote Post
   
onidsouza
post Nov 27 2008, 01:27 PM
Post #11


image master of doom
Group Icon

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 ph34r.gif


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


__________________________
Gabba Gabba Hey! enjoy your life ^^
lol (by keet's brother)
some lol
more lol
even MORE lol
Serious Discussion
why all my lol's have Teh Parakeet involved?

me ^^

bacon

Spamming is always better with bacon
Go to the top of the page
 
+Quote Post
   
Zeriab
post Nov 27 2008, 03:15 PM
Post #12


Level 12
Group Icon

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


__________________________
Go to the top of the page
 
+Quote Post
   
bulldog533
post Nov 27 2008, 08:25 PM
Post #13


Level 1
Group Icon

Group: Member
Posts: 10
Type: Developer
RM Skill: Beginner




What are the disc things your talking about I'm kind of new to this stuff.

I had the RPG maker for a long time but the game I was making I kind of abandoned it but I'm starting back up on it.

So basically I'm new at this stuff.


__________________________
My Youtube page
youtube.com/bulldog533





Go to the top of the page
 
+Quote Post
   
Kolid
post Nov 28 2008, 08:24 AM
Post #14


Level 19
Group Icon

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 smile.gif


__________________________
Jade Elegy Progress ;o
Go to the top of the page
 
+Quote Post
   
Twilight27
post Nov 28 2008, 11:12 AM
Post #15


Level 19
Group Icon

Group: Revolutionary
Posts: 371
Type: Event Designer
RM Skill: Beginner




QUOTE (Kolid @ Nov 28 2008, 12:24 PM) *
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 smile.gif


Pirate ships? Famitsu tiles? Wow, I haven't been around for a while; please update me on what these are.
Anyways, awesome script! This solves so much problems...but what are mapids?


__________________________

Fall to the power of the Emo!
We have cookies!


Notice!! Check out my topic (http://www.rpgrevolution.com/forums/index.php?showtopic=45736&st=0#entry454175) if you're interested in helping me make a script that limits the number of characters & items you use in battle AND also an item durability feature! Thanks for any help in advance!
Go to the top of the page
 
+Quote Post
   
AmIMeYet
post Nov 28 2008, 12:16 PM
Post #16


new av & (dynamic) sig!
Group Icon

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




Great script!
Cheers to Omegazion and Zeriab for making this. smile.gif

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!
[Show/Hide] USEFULL script snippets:
[Show/Hide] Do require's in VX:
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
[Show/Hide] Invert Dash enabling:
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)..
Go to the top of the page
 
+Quote Post
   
Azuaya
post Nov 28 2008, 10:07 PM
Post #17


Random Wanderer
Group Icon

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.

Go to the top of the page
 
+Quote Post
   
omegazion
post Nov 29 2008, 01:07 AM
Post #18


Level 1 / 0
Group Icon

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




@onidsouza: I told you you shouldn't have changed it.
the empty? built-in method is a string method which checks if a string has 0 length.. like ""
I see you're not much familiar with regular expressions
/([0-9])+/
0 - 9 matches any digit, while the plus sign means it can match up to any number of digits, so it's syntactically unlimited

@Twilight27: Sorry i didn't separate the words, It's supposed to be map ids. A script example would be Dervvulfan's battlebacks, Since they depend on map ids to work.

@Azuaya: That is an example of scripts that use map ids. The script-fix would be that script specific. Mind posting that script here?

@Zeriab: lol, those features really weren't needed in XP, Anyway Ill get to that new script soon.


__________________________

Those who live by the sword, Die by the gun.
Go to the top of the page
 
+Quote Post
   
Twilight27
post Nov 29 2008, 05:09 AM
Post #19


Level 19
Group Icon

Group: Revolutionary
Posts: 371
Type: Event Designer
RM Skill: Beginner




Um, I have a question. The instructions say for the other discs, create the other maps in another game. So I'd have to be careful of the switches and such I use (like using both Switch 17's in both games for different reasons), right? Any other pointers I should be aware not to mix up and create errors?

Btw, what were the pirate ships and famitsu tiles you talked about? lol


__________________________

Fall to the power of the Emo!
We have cookies!


Notice!! Check out my topic (http://www.rpgrevolution.com/forums/index.php?showtopic=45736&st=0#entry454175) if you're interested in helping me make a script that limits the number of characters & items you use in battle AND also an item durability feature! Thanks for any help in advance!
Go to the top of the page
 
+Quote Post
   
Kolid
post Nov 29 2008, 06:29 AM
Post #20


Level 19
Group Icon

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




http://rmrk.net/index.php?topic=28415.0
For the pirates.

And by famitsu, I meant Macks.


__________________________
Jade Elegy Progress ;o
Go to the top of the page
 
+Quote Post
   

3 Pages V   1 2 3 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 08:16 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker