Author Topic: [XP] Customizable Map System  (Read 7195 times)

Offline diagostimo

  • Ethereal Devastator
  • ****
  • Posts: 257
  • LV: 20
    • View Profile
[XP] Customizable Map System
« on: March 11, 2012, 08:23:35 AM »
Customizable Map System
Authors: Diagostimo
Version: 1.4
Type: Custom Environment System
Key Term: Custom Environment System

Introduction

Hi there, here is my first ever script, so please don't be afraid to criticize, basically this script allows you to use a picture for your map, and setup pictures to show at locations, e.g zoomed images of towns ect. I do plan on adding a lot more to this script as my understanding in ruby gets better, so if you can think of any features that could be a good addition to this, don't hesitate to ask :)

Features

  • use a custom picture as your main map image
  • setup pictures to show at locations for zoomed town images ect
  • customizable window size, and opacity for location windows
  • call from an item or event
  • configure names for locations
  • completely customize text to your liking
  • menu modifaction so the map can be called directly from the menu
  • use a variable to direct where your cursor will start when calling the map
  • customize text backs and back borders for the map window
  • customize teleporting locations
  • disable/enable teleport locations, teleport menu selection via script calls
  • customize teleporting sound
  • customize grid size and position of the map

Screenshots

(click to show/hide)
(click to show/hide)

Demo
http://www.mediafire.com/?bpy1yp7vf6ezcr4


Script

map script:
(click to show/hide)
Scene_Menu*:
(click to show/hide)
Scene_Party(seperated):
(click to show/hide)
Scene_Skill*:
(click to show/hide)

Scene_Equip*:
(click to show/hide)

Scene_Status*:
(click to show/hide)

Scene_Save*:
(click to show/hide)

Scene_End*:
(click to show/hide)


Instructions

Place above main and below all the default scripts, to call the script through events call: $scene = Scene_MapMenu.new(i)
i is the number of the index you want it to start at when opening the map, see the index reference image for a better understanding, all other instructions/configuration can be found in the script or demo.
if your using the customized menu, you need all the scripts above(replace old ones and place Scene_Party below Scene_Menu) Scene_Menu and Scene_Party are the major edited ones, but the rest have been edited so when you escape out of them you end up in the right place in the menu.
also the new Scene_Menu has a small config at the top where you can set the menu's x,y and set the variable id the map uses to call it to the right index.

here is the index reference image in-case the demo goes down/you dont want to dowload it:
(click to show/hide)

Compatibility

no know compatibility issues

Credits and Thanks

  • Diagostimo for the script
  • Juan and Blizzard for the interpreter fix

Author's Notes

I will provide updates on this, so it is up to standards :)
also i have used images from pokemon for the map, just for a good understanding how it works.
if you are already using the interpreter fix script in your project then you can remove that part from the map script.
UPDATE:26/4/2012
added configurable text to the windows.
added more configuration.
added a modified menu to call the map from.
updated the demo.
UPDATE:9/5/2012
added teleporting methods that can be enabled/disabled
see the demo or script for instructions
UPDATE:3/6/2012
added configuration so you can change the size of the maps grid, see inside the script config for details.
« Last Edit: June 03, 2012, 11:19:15 AM by diagostimo »

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Diagostimo's Map System
« Reply #1 on: March 11, 2012, 08:46:42 AM »
You link is invalid.
Also you should really reconsider putting up some screen shots since the script is graphically based.

EDIT:
Nevermind. It was the first 2 times I clicked it, but now it seems alright.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline diagostimo

  • Ethereal Devastator
  • ****
  • Posts: 257
  • LV: 20
    • View Profile
Re: [XP] Diagostimo's Map System
« Reply #2 on: March 11, 2012, 08:50:08 AM »
ye, i was in the process of editing the link as i tweaked at it a little to make it more user friendly, ill put some screenies together :)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Diagostimo's Map System
« Reply #3 on: March 11, 2012, 08:55:21 AM »
Ummm. I need to show you some things. You have a 12,000 line script that could be done in probably about 150-300 lines, probably less.
There is no reason to re-define so many things when the only difference is a number in the name.

Give me a few minutes and I'll make up some examples for you to check out.

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline diagostimo

  • Ethereal Devastator
  • ****
  • Posts: 257
  • LV: 20
    • View Profile
Re: [XP] Diagostimo's Map System
« Reply #4 on: March 11, 2012, 09:07:11 AM »
ok, i did attempt to do it all with:
   if index = 0
     then show this image ect
but i kept getting the error script is hanging :/
     

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Diagostimo's Map System
« Reply #5 on: March 11, 2012, 09:25:23 AM »
Take a look at this.
(click to show/hide)

I made a much simpler configuration, which also eliminated the need for multiple global variables, and is much easier to setup. The user needs only to add a line for any map they want to set up. If its not found, it returns a default "".

I eliminated the 500-something Scene and Window classes and replaced them with just 2 that are simply initialized with an index. This index is used to get the name of the image from the config.

On another quick note, which I am sure you will quickly find out as you continue to learn RGSS. In a refresh method, where you are redrawing a bitmap or a window, you should first clear it.
Code: [Select]
@bitmap.clear
# of
@window.contents.clear

It doesn't matter when the image will be drawn only once, but you will find that most things are not this way, and if you do not clear it, the new drawing will simply be placed over the old. This makes text rather hard to read when it is 10 words layered on top of each other :D .

Either way, see what you can learn from my couple quick edits, and feel free to ask any questions you may have.

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline diagostimo

  • Ethereal Devastator
  • ****
  • Posts: 257
  • LV: 20
    • View Profile
Re: [XP] Diagostimo's Map System
« Reply #6 on: March 11, 2012, 10:03:40 AM »
i get everything you did with the config and the index, what has got me confused is this:
 
Code: [Select]
when 1 then 'pallettown.png'
    when 2 then 'pallettown.png'
    when 3 then 'pallettown.png'
    when 4 then 'pallettown.png'
    # And so on and so forth...
    else 'pallettown.png'
how are those being directed at the index? what i mean is before if i wanted pallet town to be shown at index 193 i would have that as the number, if you get what im saying?
edit: doesnt matter i forgot to delete the old script to test with what you did, my only question now is how do i force it to return at the index point you used to call the window? also do i need else? the image is been called wherever i select

edit2: no worries iv figured out what i needed to know, wow i over complicated it so much :P at least now i can now focus on making it alot more interactive without worrying about updating 500 windows and scenes :)
« Last Edit: March 11, 2012, 10:36:55 AM by diagostimo »

Offline diagostimo

  • Ethereal Devastator
  • ****
  • Posts: 257
  • LV: 20
    • View Profile
Re: [XP] Diagostimo's Map System
« Reply #7 on: April 26, 2012, 12:34:41 PM »
updated the map, and added a customized menu that can call the map.

Offline Calintz

  • Guardian of Chaos
  • ********
  • Posts: 3803
  • LV: 108
  • Gender: Male
  • A Pixel's Worst Nightmare
    • View Profile
Re: [XP] Customizable Map System
« Reply #8 on: April 26, 2012, 09:27:24 PM »
this is a really cool script. i like the concept a lot. +1.

Offline diagostimo

  • Ethereal Devastator
  • ****
  • Posts: 257
  • LV: 20
    • View Profile
Re: [XP] Customizable Map System
« Reply #9 on: April 27, 2012, 12:19:18 AM »
thanks :D, i do have an idea to add more to it, perhaps a teleporting function but not sure how i would go about it yet, anyone think this is worthy enough for the database :P

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Customizable Map System
« Reply #10 on: April 27, 2012, 03:32:22 AM »
thanks :D, i do have an idea to add more to it, perhaps a teleporting function but not sure how i would go about it yet, anyone think this is worthy enough for the database :P

* Quickly moves to database *

What do you mean, its already there. :whistle:


EDIT:
Just a little tip for the future, don't edit the template, especially the header. You removed the "s" from "Authors" in the header (I know, I know, very minor), and it caused it to get all crazy looking in the Script Index. Its no big deal, I just added it back and all is good. Just saying for when you make your next script. :)
« Last Edit: April 27, 2012, 03:38:22 AM by ForeverZer0 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline diagostimo

  • Ethereal Devastator
  • ****
  • Posts: 257
  • LV: 20
    • View Profile
Re: [XP] Customizable Map System
« Reply #11 on: April 30, 2012, 11:58:09 AM »
update: just added customization to enable/disable text backs, text back borders, and change colors.

Offline diagostimo

  • Ethereal Devastator
  • ****
  • Posts: 257
  • LV: 20
    • View Profile
Re: [XP] Customizable Map System
« Reply #12 on: May 08, 2012, 11:31:23 PM »
update: added teleporting methods to location setup in the config, they can also be enabled/disabled via script call, see the demo/script for more info :)

Offline diagostimo

  • Ethereal Devastator
  • ****
  • Posts: 257
  • LV: 20
    • View Profile
Re: [XP] Customizable Map System
« Reply #13 on: June 03, 2012, 11:21:34 AM »
[Triple Posts*] Update, added the ability to customize the grid size of the map and also you can change the x and y of the grid to position it on the screen.