Changing Tileset

Started by Mightylink, May 01, 2009, 09:45:03 pm

Previous topic - Next topic

Mightylink

Is it possible to change a maps tileset through a script? This would work wonders for seasons and I notice most of the tilesets are the same, just different graphics.

G_G

Try
$game_map.tileset_name = "Tile set name here"

Doubt it'll work but I'm not sure.

Mightylink

Nope, but funny thing is it didnt give any errors either, I guess I will do this the hard way and have 4 maps for each map.

G_G

Did the game by chance freeze up?

Mightylink

May 01, 2009, 10:15:44 pm #4 Last Edit: May 01, 2009, 10:18:13 pm by Mightylink
No nothing happend, it just kept going like the script wasnt even there. I had a suspicion this wouldnt work anyway, I was just hoping it would cause it would save me a lot of space and time. One way or another my games going to have seasons, I think im going to have to have 4 versions of each map and use events to put the player on the right ones <_<

Maby I could get spring, summer, fall with just screen tones, but winter requires a snow tileset <_<

Reno-s--Joker

You might have to look at Game_Map or Spriteset_Map, and then refresh the map...? *is a noob scripter*

I found this in Game_Map (setup) and it looked kinda promising:
# Load map from file and set @map
    @map = load_data(sprintf("Data/Map%03d.rxdata", @map_id))
    # set tile set information in opening instance variables
    tileset = $data_tilesets[@map.tileset_id]

Actually maybe you could change the stuff in the brackets here (from Spriteset_Map)

@tilemap = Tilemap.new(@viewport1)
@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)

to something else like
@tilemap.tileset = RPG::Cache.tileset("Autumn")


I dunno, just throwing some random ideas around. It would kinda suck if you had to do multiple maps for each. :| Although having to use a disc changer would add a bit of a professional touch. Sorta. :)

Blizzard

Yeah, Reno got it kinda right. It requires a few more things, though. There's a special script for it as well. You might wanna look it up somewhere. (i.e. rmxp.org)
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.


Mightylink

May 02, 2009, 05:24:17 pm #8 Last Edit: May 02, 2009, 05:46:50 pm by Mightylink
I think thats it but im surprised about the description:

QuoteOkay, this script allows you to change the current tileset with another one. Sounds like something you wouldn't want to do, but it is great for 3 big things:
1. Create bridges using a duplicate tileset and a simple command.
2. Mountains with real depth.
3. Change the appearance of a tileset. (for instance, make it look more demonic without needing a new map to teleport to.)


Doesnt mention anything about using it for 4 seasons, I thought that would be the main reason anyone would want this, I will give it a try, let you know how it works.

[EDIT] It works! Its so awesome thank you ^_^ Now all I have to do is fix up the tilesets so they match and make triggers to load the right one during each season, this is ganna be great.

Hellfire Dragon

That's nice little script, saving map space instead of duplicating a map and then changing it's tiuleset, also could be useful showing a town after an attack, instead of covering it in events or duplicating it.

Mightylink

May 02, 2009, 06:19:21 pm #10 Last Edit: May 02, 2009, 07:45:28 pm by Mightylink
Ya just needs a bit of tileset work, make sure all the tiles are in the same spots in the image, its probably why they didnt mention it for seasons cause going from grasstown to snowtown wouldnt work without requiring editing :P

[EDIT] Heres a little test I did, it worked out really well, but instead of having 4 sets im just using 2 since I can get the same results with just screen tones for spring, summer fall, then it goes to winter which is a different tileset, took me about an hour to rearrange snowland to match grassland.

Spring
Spoiler: ShowHide


Summer
Spoiler: ShowHide


Fall
Spoiler: ShowHide


Winter
Spoiler: ShowHide

Reno-s--Joker

Quote from: Mightylink on May 02, 2009, 05:24:17 pm
I think thats it but im surprised about the description:

QuoteOkay, this script allows you to change the current tileset with another one. Sounds like something you wouldn't want to do, but it is great for 3 big things:
1. Create bridges using a duplicate tileset and a simple command.
2. Mountains with real depth.
3. Change the appearance of a tileset. (for instance, make it look more demonic without needing a new map to teleport to.)


Doesnt mention anything about using it for 4 seasons, I thought that would be the main reason anyone would want this, I will give it a try, let you know how it works.

LOL true - 1 and 2 are a bit.... wth. :xD: But anyhow, I'm glad it works! HD also has a good point there - it would probably work nicely for destroyed towns. :shifty:

Btw, your maps look awesome - I especially admire the dedication of the bridge guard. :V:
Nah, I love realism. It can be really effective in a game. <3

Mightylink

oh that was just a test map, my game is pretty complex i havent made any main game maps yet, im trying to get all the features in first so i dont have to keep starting new save files down the road.

The biggest problem with rpg maker is when you add new scripts sometimes save files dont work, that is the main reason most people never finish a game or make them really short, im determined to go for the full 100h game and adding new features halfway down the road isnt an option 0.0

Reno-s--Joker

Wise, wise move. I had to learn that the hard way. ;_____________;

Anyhow, good luck with the game and whoa.... 100 hours. o_O
:xD: