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.

Mr. Spawn's image to panorama script.

Hello, i posted a few days ago with a request about using an image as a world map. As luck would have it, i stumbled across this script by sephiroth spawn, in response to a similar request, with instructions as to how this should be done. Here it is...

"Yes, you can do this. In Spriteset_Map, change the line:

CODE

@tilemap = Tilemap.new(@viewport1)
# any other lines dealing with @tilemap

# Change them to
if $game_switches[switch_id]
# Put all the previous @tilemap lines here
else
@tilemap = Sprite.new(@viewport1)
@tilemap.bitmap = RPG::Cache.picture($game_variables[variable_id])
end

Simple eh? For the people on this forum, probably. However, I'm new to all this. Like, completely rubbish. My problem is, i don't know exactly what to do with the script.
do i just change the line "@tilemap =Tilemap.new(@viewport1)" and all other lines containing "@tilemap" in the spriteset map script to "if $game switches[001]", or whatever, then put all of those lines containing "@tilemap" i changed underneath this line, followed by "else..." and end? And then activate the switch? Can someone tell me if this is correct? I found the link here: http://forums.rrrevolution.com/lofiversion/index.php?t5632.html

Thanks for reading, and/or responding. Cheerio.
 
well, this is a bump. i've tried, honestly i have. i can get other scripts to work sometimes, but i'm not really sure what the script format should be. if anyone can work out what to do with the above tutorial for using a panorama as a map, i'd be more than grateful. or, alternatively, a script which lets you see the panorama in the game editor, which i have never seen.

Go on, help me get started!
 
A script which lets you see the panorama in the map editor would be very useful, but judging by the "haa", i'm guessing that this would probably involve a complete re-write of the whole program. So, i'm still looking for help with the script, outlined above in the first post, really. I'm new, so i'm just trying to find out the limitations and possibilities of RMXP. And i'm looking for the best way to import an image as a world map. So, i thought sephirothspawn's script might be helpful. But i can't work out how to use it. By the way, please don't suggest cutting it up into 256 pixel wide tilesets. Or the old "import a panorama and set it to not scroll" trick. I've heard those before.
 

knmt

Member

Diegoale2000;202427 said:
You can't make a script affect the editor itself, only the game.
In order to do that you'd need a patch, and unless it's made by Enterbrain, it wouldn't be legal / safe.

I think he knows that.

BTW , I don't think that script will help you out , if you want a real map from an image , it's not that simple .

But first you have to say what you want with the "image map" . I mean the features you want it to have e.g. scrolling , priorities , passability , etc.
 
So, the editor can't be legally or safely modified by scripting. i knew that, really, i was just throwing ideas around. Sephirothspawn's script would not be helpful, either? Okay.

Here's what i want. I want to use a jpg as a world map. I would like the world map to be as large as possible, so that it can be freely navigated and interacted with. You know Dragonquest (VIII i think it is, on the ps2)? I want something like that, rather than the FF10 world map system which isn't really a world map. I would like to have stuff like mountains, rivers, etc., which should be unpassable except if the player gets hold of a dragon to fly around on or a ship to sail in, or whatever. So, i would like the world map to contain non-passable objects. I would also like to be able to put layers on top of the base image of the world map(towns, monsters, npc's, and so forth), as a single layer looks kind of flat.

I have come up with some ideas as to how to achieve this. The first is to cut my world map into 256 pixels, make one big strip, and then import the tileset to RMXP and paste it into the game editor. The problem with this method is, with an image 12640x16000 pixels (or 500x397 RMXP squares) it would produce a tileset approximately 800,000 pixels long, which, i'm sure you know, cannot be imported into the game editor.

Solution 2, similar to the above, involves importing the world map as single 256x16000 strips, then "painting by numbers" on each individual strip with suitable autotiles. In this way, the need for a ridiculously sized tileset is avoided, but at the price of my sanity. This method requires 60 repititions or so, and obviously spoils the original image.

Solution 3 involves importing a panorama, i think the biggest i have managed to import is about 7000x9000 pixels, which is getting close to what i want, then setting the panorama not to scroll in "spriteset map"(or the SDK). This method has the terrible disadvantage that i cannot see the image when i want to add layers and events to the map, which means i have to "blind block" it. This method, i forsee, would also have detrimental effects upon my few remaining social skills.

So, that's what i want, and what i can do already. So if anyone has any improvements to these methods, or completely different methods, i'd be delighted to hear them.
 

knmt

Member

If you want to use a panorama as a map like what you want above , I think it's impossible ( though it's possible but is too much to bear with a large map like that ) . But don't worry , I have another solution for ya .

This solution is tricky but I tested it and it worked perfectly with any size of the map .

_ Split your WorldMap into smaller maps that you're able to work with.
_ Create a series of transfering events near the edge of the current map that transfer the player to the correct map of the world map without transition , no fading and no graphics.freeze .
_ The player must be transfer to the place where he was transferred away .
_ Your maps must share the same edges but it's easy to do that thing .

Are you confused ? hix...here's the demo :

Code:
http://mihd.net/f4s1zp

Hope this helps you out !

Note :

I still left the Graphics.freeze so the screen freezes a bit when you transfer to the second map , just remove it for a smooth walking just like on a real map ...

oh and another thing , creating a lot of events manually will make your hands "freeze" too so I suggest using script . BYE!
 
Thanks for helping me out, that sounds like a pretty good solution, actually. So, i don't have to use the same tilesets on all the maps? Only matching tiles on the edges, right? That sounds like it might work.

...Erm, what is this? "http://mihd.net/f4s1zp". I put the address into internet explorer, and it just goes to http://mihd.net. Did you make me a file, knmt? That's very nice of you indeed! Unfortunately, i have no idea how to retrieve it! But i'll get started, anyhow. I saw somewhere a script which can automatically join several maps together, using transfer player commands at the map edges, so maybe i'll try that. Well done, knmt!
 

knmt

Member

Yeah it will redirect you to http://mihd.net with a downloadable link . But you have to click on the first line of the web with this title : "Request Download Link" . Then the link will appear after a few seconds , use a Download Manager if you want . I just made a demo to show what I wanted to tell you . Although this solution is good , you still have to do a lot of work ( just because your world map is too large hix.. ) .

BTW , you can use Script to help you with the transferring things , you do not need to manually put events on maps , which would take you a lot of time and effort .

Hope you will make a wonderful world map , I'd be glad to see it when it is done :).
 
Hello, i tried the mihd site again, but i can't see "request download link" anywhere. I also tried putting "request download link" followed by the filename in the URL, but this came up with "page not found". Maybe it's not working? Normally, any problems like this are my fault and idiocy related, but i suppose there may be a problem with the site or something.

I've broke my map into 25 equal rectangles, so i'm just about to start map-making. What's this about using scripts? You mean i can put the tileset into the game editor using script? Is there any forums which explain how to do this?

Anyway, i think it'll be a brilliant map and rather innovative game for my first try. I shall send you a copy of the map and the game when it's done.

Slainte!
 

knmt

Member

You can't find the link ? so weird...It worked fine for me haa...here's the screen after I put "http://mihd.net/f4s1zp" into the URL bar :

http://i150.photobucket.com/albums/s106/mtkn1/th_ScreenHunter_02May.gif[/IMG]

Actually using script to draw the map is a bad idea I think . After downloading the file I uploaded and understanding what I tried to explain to you , you would know that you could use script to create "transferring places" on the the map ( you can use events like what I use in my demo I uploaded but that would take lots of time and effort with a large map like that hix...) . If you have something to ask about that script I will be glad to tell you everything you need to know :) .

If you're really fond of making maps , you'll make a really wonderful map I guess haa...

I'd be glad to be the first one to try out your game , thanks!

See ya later.
 
Hmmm. Yes, i see what you mean. The problem i have with that method(before i carry on, i have to say i'm very grateful for your help), is that each map would have to contain a large part of the adjacent map, am i right? That is a LOT of maps! But still, it would work, i think. I just wonder, could i make this as large as i want? Like, 999 maps all linked together? Because if so, although it would require a lot of work, it would be brilliant!

Also, i wonder what you mean by the graphics freeze. On your demo, there is a slight pause when jumping from map 1 to map 2, and the tree moves a bit. I can see why the tree moves, because the maps aren't aligned, but i can't work out which lines to delete in the script. I see "graphics freeze", but if i delete this line nothing happens. What do i delete exactly?

Anyway, i'll try cutting my map up differently. Cheerio.
 

knmt

Member

Hix my bad , Graphic.freeze does not affect these things .

In Spriteset_Map on line 57 "def dispose" please change the first 5 lines to :

Code:
def dispose
# Dispose of tilemap
    ##@tilemap.tileset.dispose
    ##for i in 0..6
    ##  @tilemap.autotiles[i].dispose
    ##end
....

In Spriteset_Map function "def initialize" please change the first 4 lines starting from line 22 to :

Code:
....
##for i in 0..6
      ##autotile_name = $game_map.autotile_names[i]
      ##@tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
    ##end
....

and the last one to preserve your character's pattern :

In Scene_Map on line 265 change to :

Code:
##$game_player.straighten

Now the pause is removed !

is that each map would have to contain a large part of the adjacent map, am i right? That is a LOT of maps!

no , not really , you know that a screen is 20x15 game blocks in size ( 640x480) so your maps' edges just need to share 10x2 horizontal blocks and 7.5x2 vertical blocks . You said you needed a map with 500x400 blocks in size right? so you only need twenty 120x115 ( or even larger ) blocks-in-size maps to create the world map .( 500/5+20 and 400/4+15) . JUST 20 ( or even fewer ) maps yeah :D .


You can make the map as large as you want YEAH but splitted maps should not be too big for the sake of loading , disposing and renewing haa...

BTw , I've just tested with a 256x4000 tileset and a 120x115 map and it went just fine , no pause , smooth walking like real map ! You can use 220x215 I guess --> only 10 splitted maps needed ( not a LOT anymore :) )
 
Thank you for the pause removal instructions, knmt. Haven't tried it yet, but i'm sure it'll be good.

Yes, you're right, i won't need that many maps. So, i just arrange my maps so that there's a game screen width/height overlap on each edge of every map, except the edges, and put a whole bunch of transfer player events on the edges, yeah?

I think that is "problem solved", just about. I'll tell you how it goes. Thank you kindly for your sage advice.
 
Unfortunately, i still get a pause when i go from map 2 to map 1 in your demo. But not when moving from map 1 to map 2. How strange. Still, it's probably my fault if you've tried it out, eh?
 

knmt

Member

Yes, you're right, i won't need that many maps. So, i just arrange my maps so that there's a game screen width/height overlap on each edge of every map, except the edges, and put a whole bunch of transfer player events on the edges, yeah?

You bet ! you can use script to transfer your character too if you don't want to manually create events on maps :) . But I think you'll concentrate on drawing the map now , won't you ?

Unfortunately, i still get a pause when i go from map 2 to map 1 in your demo. But not when moving from map 1 to map 2. How strange. Still, it's probably my fault if you've tried it out, eh?

haa...why do you always think it is your fault ? Actually it's my fault haa...If you check the events on map2 you will know that I forgot to remove the fading option , the pause is for fading :) , just change it to no fading and it will work fine . ( I created that demo in a hurry to upload for you so hix...)
 
actually, hold on...

How do i set the teleport events so that they can only be entered either horizontally or vertically, depending on which edge of the map they are on? See what i mean? No? Well, if the teleport event is to a horizontally adjacent map, if the line of teleport events is walked up vertically, every time the character walks up a square, the map changes. So the teleports to a horizontally adjacent map should only teleport when entered horizontally, and teleports to vertical maps only vertically.

Can this be done?
 

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