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.

Interactive World Map Script V1.1(Test V1.2 Now!)

Status
Not open for further replies.
Interactive World Map Script Version: 1.2(beta)
By: Plague180

EDIT:Ive learned alot from making this script. once version 1.2 is stable i will add subsection support to editor.

EDIT2: ^^^^^^if anyone ever helps me find all the bugs in version 1.2, im still willing to add sub section support, but untill i see intrest im not working on this script.

This script creates a world map, to not be mistaken with a map.rxdata file, but an interactive world map that allows users to choose what town they would like to travel to and then go there, much like dragon age, guild wars, oblivion or fable 3.

Whats coming in update:
No more scripting skills required to use!
Editor!!! no more messing with scripts!
-YES!!!! old town data from version 1 and 1.1 can be imported to new format(if you can follow instructions)
-Create towns, delete towns, edit towns, all in the editor!
-easily copy InteractiveMapData.rxdata file from editor to game! completely seamless!
Cursor type 2 upgrade!!!
-now you can hold down the button you want and it will smoothly move(smooth method to be updated after feedback)
Cursor type 3 upgrade!!!
-fixed about 10 known bugs with cursor
Now using Glitch finders input module!
Removed crappy module for settings, now everything can be changed in game at any time, even if the script is running!
You have the ability to save and load map data when ever you want
-considering making it so you can switch between multiple map data files, let me know if anyone would like that feature.
Script runs faster and smoother then ever!
-slightly under 1500 NEW lines of code working harder for you(lol)
BETA:Added town "Popping" to beta version of 1.2

Screenshots
34e2o47.jpg

Version 1.2 Preview
aayd1.jpg


Demo

*Apparently im a ass, so ya its gone, email me if you want this script*


Instructions

1 = Screen X coordinate that u want the top left corner of icon to start.
2 = Screen Y coordinate that u want the top left corner of icon to start.
3 = Map Id player travels to when you click it.
4 = Map X coordinate player travels to when you click it.
5 = Map Y coordinate player travels to when you click it.
6 = Direction(2 = Down, 4 = Left, 6 = Right, 8 = up)
7 = Name of icon to use for town.
8 = Name of town for name box or under the cursor
9 = Switch used to lock and unlock that town.

Example Map_Items::Town.new(screen_x, screen_y, map_id, map_x, map_y, direction
icon_name, town_name, switch)

Sub sections are the same as normal maps, with the exception that their
last item is the name of the town that they are a sub section of.

Example Sub::Town.new(screen_x, screen_y, map_id, map_x, map_y, direction
icon_name, town_name, switch, upper_level)

VERY IMPORTANT: Put the towns in the order you want the game to cycle threw
them. you dont have to unlock them in order, just insert them in the order
you plan too have them cycle when they all are unlocked.

FAQ

Q: I get an error on line 302 in world_map, what wrong?
A: You don't have any towns UNLOCKED yet.

Compatibility

Haven't tested it with anything out side of my other custom scripts, but if you have a mouse system it might clash with this(if u use my mouse, but if u dont then it might not accept your clicks)

Credits and Thanks

SephirothSpawn - Created Data Structure
CyberSam - Keyboard Input Module
CyberSam - Mouse Module
Mr.Mo - Error Log
Tomas - World Map Background
Special Thanks to Silver Wind for all his help with my Sub Sections
Special Thanks to SephirothSpawn for all his support coding and moral, Thanks man!

Author's Notes

I work alot, but i will help you with any problems asap.
if you have a game that uses my script i would love to see what my script can do with good graphics :)

Terms and Conditions

I do not what this script hosted anywhere other then http://www.hbgames.org with out my permission. free for use commercial and noncommercial.
 
i live in bahrain and my internet really sucks today, every time i try to submit with the code it times out, so i cant post it atm, it is in demo though. let me know any other feed back :)
 
Looking good; this was one of my favourite features of Guild Wars I reckon, being able to zip about to places you've been to before.
 
Plague180":1m0ppghl said:
FAQ

Q: I get an error on line 305 in world_map, what wrong?
A: You don't have any towns UNLOCKED yet.

Q:I get an error on line 299 in sub_map, what wrong?
A: You don't have any sub sections for that town unlocked UNLOCKED. Shouldn't ever have an issue here because if there is no subsection it is sapose to go straight to the default, but one person did get this error.
This pretty much sounds like you blame everything on the player :/ If it's possible to have an empty array of towns, then by all means don't ignore that while scripting.

Other than that, I see a well-coded script right here :biggrin: You have a few non-broken-where-they-should-be-broken-for-viewability lines in there (note that you can break lines without messing up your script more than one time!), and I see the dreadful customization class full of pointless constants, but other than that: Clean coding, very good documentation. I think you're coming along good!
Oh, I also spotted self.contents = Bitmap.new(640-32, 480-32)... forcing the Interpreter to do a totally pointless calculation is... neither efficient nor smart ^^"

As a side note, I think your check_cursor_bounds method is broken... shouldn't it be...
[rgss]  def check_cursor_bounds
     if @cursor.x < 0
       @cursor.x = 0
     end
     if @cursor.x > 640 - RPG::Cache.icon(Map_Items::CURSOR).width
       @cursor.x = 640 - RPG::Cache.icon(Map_Items::CURSOR).width
     end
     if @cursor.y < 0
       @cursor.y = 0
     end
     if @cursor.y > 480 - RPG::Cache.icon(Map_Items::CURSOR).height
       @cursor.y = 480 - RPG::Cache.icon(Map_Items::CURSOR).height
     end
  end
[/rgss]

And a general suggestion: Having icons on the map displayed from the center instead of the upper-left corner makes more sense, considering you're trying to populate a map. It also allows you to change the icon size at whichever time during develoment without messing up the placement on the map.

Keep up the good work!
 
about my faqs, i wasnt sure what to make the script do if there is no maps, so i made it do nothing, i mean whats the point of letting the player open the map if there is no where to go? it is for travel not for viewing(tho i guess with some customizing it they could make it...)

i know you hate constants, but i like the current set up(will see what other people say)

once i have some bugs to fix i will edit the long lines too :)

i forgot to remove the -32 lol i meant to, i was just making sure it was right :)

you are correct about the cursor bounds check(even tho i dont think anyone will use cursor type 2)

And a general suggestion: Having icons on the map displayed from the center instead of the upper-left corner makes more sense, considering you're trying to populate a map. It also allows you to change the icon size at whichever time during development without messing up the placement on the map.
i dont get what you mean?
 
Plague180":3b047xt2 said:
you are correct about the cursor bounds check(even tho i dont think anyone will use cursor type 2)
I like how that proves me right in everything I ever said about overcustomizeable scripts and, in a looser range, too many constants ^^

Plague180":3b047xt2 said:
And a general suggestion: Having icons on the map displayed from the center instead of the upper-left corner makes more sense, considering you're trying to populate a map. It also allows you to change the icon size at whichever time during development without messing up the placement on the map.
i dont get what you mean?
Well, right now, you're drawing icons on the map, obviously decided by x and y coordinates, from the top left corner. You could, however, draw them from the center (as in icon_x = x + (icon-width/2), and the same for y) to get the benefits I was talking about before.
 
upon trying it your way i remembered why i used it my way, the cursor was going off screen some(32 pixels) so i added the minus 32. it works correct the way i had it. also you were trying to use my cursor type 2 against me and my beloved constants, you cant do that the only reason i kept the feature is because i made it before i had decided to make the mouse work for it. so ha :P silly blue and his constant-hateness(im still willing to see your side if you can give me an good example how losing the constants will help me). i changed the draw_town method to your suggestion and i now see how it would be useful to developers. but now i have to change draw_player and draw_cursor, and sadly i must go to work, but as soon as i get home i will fix the code and post new version :)
 
Btw, now that I see it, and before I forget it: Awesome user title, awesome signature ^^

As for the cursor, your minimum x (assuming you draw from the upper left corner) needs to be zero, while the max needs to be Window.width (speaking figuratively), in numbers 640. So yeah, I was wrong, but only because I didn't think and double-check what I was writing again ^^"

On a side note, a pretty faster way of writing your method would be this:
[rgss]   def check_cursor_bounds
    p RPG::Cache.icon(Map_Items::CURSOR).width.to_s + ', ' + RPG::Cache.icon(Map_Items::CURSOR).height # ready-made testing line for you ^^
    @cursor.x = [[@cursor.x, 0].max, 640].min
    @cursor.y = [[@cursor.y, 0].max, 480].min
  end
[/rgss]
 
i love your rant!!! <3 and when i get home i will look at the code u post in game, looks sound to me :) i like the added test line :) i do that alot!!!! exp with this script to extract the x and y passed into a method


edit:upon playing with that code i couldnt get it to do what i wanted, and my code is easier to read so i think im gonna stick with mine for now. now im gonna go work on changing draw_player and draw_cursor
 
I think you should work with the second cursor option, because I feel that having to switch from full keyboard control to using the mouse can break immersion (and even more so for those kids who use gamepads, who will have to set down their controller to operate the world map.
 
i have been really busy cause of work(im in the navy) but i have the 10th off, i shall try to fix the last few known bugs and release update then, 200 some odd views, and no comments, i just want to know if its a good system or a bad system, and anything else i could do to make it better, (can all ready hear blue's wheels turning) and is anyone having trouble with the mouse?
 
fixed cursor type 2, however my home computer cant connect to the internet for some reason :( has anyone found any other bugs? or any comments on the system?
 
ok, i know its late, but i finally updated demo, i tried to play test as much as i could, no problems that i could find, but you guys let me know if u find some. i have an idea for a easy editor so you dont even have to script to set up towns, if i get some time ill make it :)
 
I posted a topic about how to get an item that opens a world map and got directed here I think this is a very good script Plauge keep up the good work! It would be cool to see an easier editor that doesn't involve scripting. Might I suggest that in the next version you add some way to change the Cursor type in game? For example: I give the player an option that allows them to select if they would rather control the map cursor with a mouse or a keyboard. Because people like me use a controller but other people would like to use the mouse instead. I would really like to know how to do that if you can do it already.
 
thanks you so much for posting, my next version has everything you are asking for(tho because im changing my whole data structure so you can move your data from editor to game with only copy paste it, it might be a while)
im home on leave(im in the navy) til the 19th so i wont be working on it much till then. oh ya about the changing the cursor type you are right you cant change it once the game has been complied and running because i made it an constant, but most everything will be able to change after the game starts in new version. i just never thought it would be worth while to change cursor type because that would ruin game flow to me, but then people started saying the want the player to choose.
 
Status
Not open for further replies.

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