[XP]Maps inside the game, called from item or menu

Started by Evander, July 10, 2009, 09:23:16 am

Previous topic - Next topic

Evander

Hello guys, it's my first post here so please forgive me if I did something against the rules of this forum :)

First, let me say, you guys here are pretty awesome with what you do with scripts in RPGmaker.
you really change a rather average tool into something that is very good :)

About my request, I wonder if its possible to make a script that, when called from menu (like party switcher) or by use of an item (lets call it "atlas") would show a map of an entire area.
A map itself would be a .png file
Think of this as a concept:


Two kind of maps I have in mind, one for a big area (lets call this World Map and lets assume its 100x100 size) that one would show a player position, indicated by some... uhm, indicator.
We assume that we know:
-an exact size of our WorldMap (here its 100x100)
-an exact size of our map.png file
Question is: is this possible to make a script to show a party indicator on a map.png depending on an actual coordinates of the tile the party is on a WorldMap?

Second type of map is a map of the location we are in. Lets say it will be for towns/some special places only.
So we open the maps by either menu command or an "atlas" item, and there we have options to show WorldMap (this time w/o a party indicator), and scroll through all maps we have put in our game.
Like lets say we are in the town called "Awesomer's Place" which has four quarters.
I would like the script to show a awepla.png (graphic for an entire town) and in lower left corner there should be a name of the map I'm currently in.

So to imagine that more precisely... we walk around our WorldMap, we open the map.png, we see our position on this map, we enter the town "Awesomer's Place", we open the map again.
This time we see just a map.png, w/o a party indicator, with an inscription in lower left corner, that says "Awesomer's Place - South Quarter", and we can scroll through available maps with an arrow keys until we find that one we want to look at.

Is this possible to script that the easy way?

Regards,
Evan

Hellfire Dragon

Sally already evented a map like that, take a look.

Check the XP Download link.

Evander

I'll take a look, thanks for the info  ;)

Edit:
So um, I looked into a demo and events themselves.
its not quite what I was asking for  ;)

Sally uses events set up on the maps, that change coordinates for drawing a dot on the map.

I would rather have something like reading coordinates of a tile from a world map, than have dot drawn accordingly to tile coordinates, on my map.png.

let me show you.
here we have a crude world map (lets pretend its big, and what we see is just like 1/10 of the whole map)

here is party standing next to the stonehedge: http://yfrog.com/3jworld1ug
and here is what the script should show: http://yfrog.com/0nworldmap1g

if a player moves some tiles (lets say ten) to the right, the indicator should move with some fixed amount of pixel (lets say it will be 10 pixels per tile, so it would move a 100 pixels to the right)
results should be something like this:
Game World: http://yfrog.com/0qworld2g
map shows: http://yfrog.com/17worldmap2g

eventually we enter a town like this: http://yfrog.com/3jplacesouthg
and script shows this: http://yfrog.com/0qplacemapg (assume there is some cool menu on the right side ;) )

of course it may be possible to add some events to a World Map, so that when players steps on such, description of location changes to something like "south of awesomer's town" - You know what I mean :)

I hope I explained everything more clearly now.
i'm pretty sure that a script would require some setting up (like defining where on the shown map we should draw position for tile 0,0, so we could fit everything perfectly)
What do You think - is something like this worth an effort?

Regards,
Evan

No double posting within 24 hours!
Use the Modify feature instead; it will automatically bump your post, too.
~Aqua

Aqua

Uh...
I wonder if I should try... o.o

I will most likely fail somewhere along the line though...
Probably the scrolling through maps part XD

Question: Do you have all maps unlocked at the start?
If not, then how would you gain them?
Items or array?

Evander

 :D

The World Map itself may not be that impossible, I think.
It should be able to read coords of the tile player is standing at.
say its 3,3. Script gets these, multiplies by *3, adds a standard shift (lets say that actual part of shown picture with map starts at x = 50, y = 30  - user will have to configure this when setting up the map) and draws a player flag at x = 59 and y = 39.
I saw Juans Location Window here: http://forum.chaos-project.com/index.php?topic=13.0
as well as game_guy Coordinate Displayer here: http://forum.chaos-project.com/index.php?topic=2972.0

I believe these scripts are good to start with :)

QuoteI will most likely fail somewhere along the line though...
Probably the scrolling through maps part XD

...for some reason I though about Blizzard's party switcher... map_available = true,  etc.
hmm  :wacko:

QuoteQuestion: Do you have all maps unlocked at the start?
If not, then how would you gain them?
Items or array?

That I think will depend on a particular project someone is working with.
As with one I'm thinking of now, player is supposed to get an "Atlas" which should contain World Map from the start.
As for unlocking other maps, I'm not yet that familiar with rmxp script -_-" to tell what will be better.
but *I think* that they shouldn't be an items.

say a player goes into the shop, or an inn, buys a map of 'Dark Evil Cave' from Dark Evil Mapseller and from now on player can use arrow buttons on map screen to change between maps.

lets assume that there will be a precise number of other maps in the game, most likely - towns only.

Regards,
Evan

Aqua

Hmmm... the way I'm thinking of doing it, you might not have to configure anything other than the maps you have at the start.

But... we'll see what you want.
Do you have a World Map and a Wolrd Map Map that I can use to script this?

Evander

I just put up a crude World Map, inside /pictures You will find a WM map (Atlas_world.png).
Its not actually how my project will look like, its just an example for You to demonstrate the concept :)

unfortunately it's a little big for a "demo" due to heavy world tileset I was using.  :<_<:

I'm going for a wedding party tomorrow, so at sunday I'll try to make version with some "locations" :)

http://rapidshare.com/files/254354146/Project1.exe.html

Regards,
Evan

Aqua

I got it to either display the default map (configured) or the current map and display the player's position.

Still working on scrolling through maps XD
See... I knew I was gonna fail at this part.

Edit:
Scrolling through maps work :P
But... I still need to do the map name display...

Edit again:
Finished :P
Lemme add some more comments and put some finishing touches to the demo.

Edit again again:
Okay here it is.
http://www.sendspace.com/file/jbpfmy
Please tell me if anything is unclear or if I missed anything you wanted.
If all's good, I'll post it in the scripts DB, too :P

Edit edit edit edit:
I found a bug...
Unlocked maps don't get saved :P
I fix; I fix!

Edit edit edit edit edit:
Bug fixed XD
Not gonna update though... =/
(Until I get your feedback)

Ryex

that's some very good work aqua! now if only...  never mind In mid post I decided to take a look at the code and noticed that you already have a config to set up which maps you can view *slaps self*
you know there is a famous quote that applies here "better to stay silent and let people think you a fool than to open your mouth and remove all doubt"
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Evander

July 11, 2009, 06:24:23 am #9 Last Edit: July 11, 2009, 06:29:24 am by Evander
thanks, Aqua, I'll take a look now, but I'll comment all that once I be back from the party  ;)

edit:
On a quick thought, I must say thats pretty awesome :D
thats exactly what I need to start with :) and thats way better than Sally's concept :)
I'll look into scripts later :)

Aqua

Here's the updated version; it has more features XD
http://starrodkirby86.web44.net/AquasStuff/WorldAtlas.zip

If all's fine, I'll post it in the scripts DB
(and use your maps if you don't mind)

Evander

Hello :)

Ok, finally had time to look into script, as well as Your new version.

Few quick finds:
- evens on map002 and map003 are not required ;)

- I found a part of instruction to be pretty obscure:
QuoteThey should all be (..) named according to what map id it belongs to (with 3 digits).
For example, map id 1 should have a picture file that is named 001

Do You mean the *internal id order* of maps inside program?
like this?
Quote$map_names = load_data('Data/MapInfos.rxdata')
    $map_names.each_key {|key| $map_names[key] = $map_names[key].name}

the potential problem is, that rmxp does not show a map :id during editing maps, also rearranging maps tree may cause a lot of confusion :D
potentially, making a 100 maps will force the user to write somewhere in which order the maps were made(but I think it is a matter of organisation).

- also, removing a map xxid.png file from data will cause a message: "Unable to find file Graphics/Pictures/Atlas/00id and the program will exit. Of course we are not assuming that someone will deliberately delete maps only to crash their games, but its a potential problem ;)

- as for above, I also wonder about Zeriab's disc changer (for more than 999 maps) I doubt that *I* will ever need that many, but some one can find this a problem. not a serious issue tho.

- speaking of map id's. If we build a town made of for example 2 quarters, let them be map005 and map006, than we create a map for entire town, and put a map file for 005, this will cause player indicator to be shown - somewhere on this map, but it will have nothing to do with actual position :)
perhaps it would be better to either:
* make it possible to define inside script what png file is used with corresponding map (hmm...)
* make it possible to turn player position indicator off by default for non-worldmaps (this sound easier to do).

and finally:
Quote(and use your maps if you don't mind)

I don't mind, however I was using a tileset from "rpg palace". I'm not sure if a guy who made it will mind his tileset included with some script somewhere else - probably not, but I'm not sure.

maybe I'll try to make world map with default tiles...

Aqua

Quoteevens on map002 and map003 are not required

I don't get what you mean here... o.o

Quote from: Evander on July 12, 2009, 08:39:19 am
- I found a part of instruction to be pretty obscure:
QuoteThey should all be (..) named according to what map id it belongs to (with 3 digits).
For example, map id 1 should have a picture file that is named 001

Do You mean the *internal id order* of maps inside program?
like this?
Quote$map_names = load_data('Data/MapInfos.rxdata')
    $map_names.each_key {|key| $map_names[key] = $map_names[key].name}

the potential problem is, that rmxp does not show a map :id during editing maps, also rearranging maps tree may cause a lot of confusion :D
potentially, making a 100 maps will force the user to write somewhere in which order the maps were made(but I think it is a matter of organisation).

Map ID is shown in the editor.  On the bottom of the editor, it says as an example
003: Map Name (50 x 50)

The 003 is the id - it won't change if you delete/rearrange maps.

Quote- also, removing a map xxid.png file from data will cause a message: "Unable to find file Graphics/Pictures/Atlas/00id and the program will exit. Of course we are not assuming that someone will deliberately delete maps only to crash their games, but its a potential problem

Well duh... if you configured xxid to be a map, but there's no graphic, of course RMXP is gonna throw an "Unable to find file" error.
It does that with any missing graphic.

Quote- as for above, I also wonder about Zeriab's disc changer (for more than 999 maps) I doubt that *I* will ever need that many, but some one can find this a problem. not a serious issue tho.

I'm not sure how the disc changer works, but I think it just transfers data to another game which still has 999 maps max.  Not sure though...

Quote- speaking of map id's. If we build a town made of for example 2 quarters, let them be map005 and map006, than we create a map for entire town, and put a map file for 005, this will cause player indicator to be shown - somewhere on this map, but it will have nothing to do with actual position
perhaps it would be better to either:
* make it possible to define inside script what png file is used with corresponding map (hmm...)
* make it possible to turn player position indicator off by default for non-worldmaps (this sound easier to do).

I actually thought of that as being a problem... but you could just either combine map005 & map006 in the editor or have 2 different images for it... XD
And I was thinking of an override to map searching... but eh... we'll see.
>.< Forgot to add feature to turn off player location indicator.

Evander

Quote
Quoteevens on map002 and map003 are not required

I don't get what you mean here... o.o

there were some left-over events ;)
nevermind :)

Quote
Map ID is shown in the editor.  On the bottom of the editor, it says as an example
003: Map Name (50 x 50)

The 003 is the id - it won't change if you delete/rearrange maps.

sorry, my bad  :shy:
I work with maps with editor stretched over entire desktop, and I don't have auto-hide for windows bar enabled.

Quote
Well duh... if you configured xxid to be a map, but there's no graphic, of course RMXP is gonna throw an "Unable to find file" error.
It does that with any missing graphic.

ok :)

QuoteAnd I was thinking of an override to map searching... but eh... we'll see.
>.< Forgot to add feature to turn off player location indicator.

:)

Aqua

Oh those events were used to teleport between maps... XD

Evander

July 12, 2009, 06:12:28 pm #15 Last Edit: July 13, 2009, 02:28:00 pm by Evander
Here is a version with no other resources used than default (+my modifications only).
there are few locations here, maps of them included.

I've also included Your script in the build, so after You finish updates to script, this package can go to DB.
(ouch!)

Regards,
Evan

Aqua

That demo is the same as the first one you posted... D:

And I added a feature to override the default atlas dimensions, so now it's possible to combine map005 & map006 into 1 atlas.

But... I found a bug with displaying the current map's atlas... so I need to fix that :P

Edit:
Yay I fixed it :D

Evander

huh! I messed the exe files x_X

ok, this one is the correct one :)
http://rapidshare.com/files/255443754/WorldAtlas.exe.html
let's say it was an effect of Saturday wedding party =)