Author Topic: [XP] Map Combiner  (Read 8859 times)

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
[XP] Map Combiner
« on: January 10, 2011, 10:12:34 PM »
Map Combiner
Authors: Nathmatt
Version: 1.1
Type: utility
Key Term: Scripting Tool

Introduction

want to make a town or house creation system this script will take data from 1 map and add it to the map you are on

Features

  • The ability to add data from 1 map to the the one you are on

Screenshots

no screenshots needed

Demo

Demo

Script

(click to show/hide)

Instructions

just create at least 2 maps 1 is the main map the second is the data you want to add then use the script call
$game_map.add_map(map_id) map id the the map where the data being added is
also make sure the maps are the same size and using the same tileset

Compatibility

shouldn't have any comparability issues

Credits and Thanks

  • Nathmatt

Author's Notes

post any bugs or suggestions here
« Last Edit: January 11, 2011, 03:25:10 AM by nathmatt »
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script
(click to show/hide)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Map Combiner
« Reply #1 on: January 11, 2011, 02:23:27 AM »
I don't understand what purpose this serves, and when exactly you would use it.

Your explanation is a little vague, and by looking at the script, it doesn't appear to do anything more than draw the data from one map on to the current one. How could that be used?
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 nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
Re: [XP] Map Combiner
« Reply #2 on: January 11, 2011, 03:24:04 AM »
to make something like what i made in my demo

update 1.1 fixed bug you would get if the script call was called while not in Scene_Map
« Last Edit: January 11, 2011, 03:26:22 AM by nathmatt »
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script
(click to show/hide)

Offline [Luke]

  • Awakened Visionist
  • **
  • Posts: 77
  • LV: -2
    • View Profile
Re: [XP] Map Combiner
« Reply #3 on: January 13, 2011, 02:42:56 AM »
Magnificent. If you don't understand how can it work, let me show you an example (taken from my current project):

Imagine an Blizz-ABS game where 3 factions battle for the control of the island. It's an RMX-OS game, so faction members are real players. They can conquer towns and villages and defend them, also with NPC guards. Once they conquer a town, they can pay their money to develop it - build barracks, weapon shop and hire more guards (that one is by eventing, but you can feel the idea). This script will let you setup the option of adding new structures to current map and that's very useful.

Examples in non-RMX-OS game: paying for woodcutters to cut down trees, hiring masons to build a bridge, estabilishing a siege camp to destroy a wall, building a wall or fence - just imagine. Now you can add or remove any part of the map in-game without making clone maps (valley without bridge, valley with bridge, etc.).

Offline Wizered67

  • Astral Trancist
  • *****
  • Posts: 512
  • LV: 16
    • View Profile
Re: [XP] Map Combiner
« Reply #4 on: January 13, 2011, 02:45:48 AM »
The only problem with using this with RMX-OS is that it will only work for the one player that bought the town. Unfortunately, making it apply for all players would probably be really complicated......

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Map Combiner
« Reply #5 on: January 13, 2011, 03:32:11 AM »
Now you can add or remove any part of the map in-game without making clone maps (valley without bridge, valley with bridge, etc.).

You are still going to be making extra maps. You may has well just make them direct clones and change the maps.

It does give me an idea, though. I'm not gonna write it anytime soon, but a script that changes the specific tiles on the current map. A very similar effect would be given, with added houses, etc.

  • It would not require any extra maps, since you are merely modifing the map data for the current map.
  • The data could be saved easily by saving it to the Data/Map###.rxdata
  • All players would experience the effect.
  • All you would need to do would be to re-load the map and priority data, then re-draw the map.
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 [Luke]

  • Awakened Visionist
  • **
  • Posts: 77
  • LV: -2
    • View Profile
Re: [XP] Map Combiner
« Reply #6 on: January 13, 2011, 12:17:57 PM »
Now you can add or remove any part of the map in-game without making clone maps (valley without bridge, valley with bridge, etc.).
You are still going to be making extra maps. You may has well just make them direct clones and change the maps.

There's a huge difference. Imagine there are 5 houses to add to the city. Making clone maps would require 2^5 = 32 maps with all combinations of houses added. Now you've got the point?

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Map Combiner
« Reply #7 on: January 13, 2011, 03:20:28 PM »
Yeah, dumbass I get the point, probably much better than you do. I'm saying its possible to do without ANY extra maps.
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 Poe

  • Awakened Visionist
  • **
  • Posts: 55
  • LV: 2
    • View Profile
Re: [XP] Map Combiner
« Reply #8 on: December 04, 2011, 04:42:04 PM »
Now you can add or remove any part of the map in-game without making clone maps (valley without bridge, valley with bridge, etc.).

You are still going to be making extra maps. You may has well just make them direct clones and change the maps.

It does give me an idea, though. I'm not gonna write it anytime soon, but a script that changes the specific tiles on the current map. A very similar effect would be given, with added houses, etc.

  • It would not require any extra maps, since you are merely modifing the map data for the current map.
  • The data could be saved easily by saving it to the Data/Map###.rxdata
  • All players would experience the effect.
  • All you would need to do would be to re-load the map and priority data, then re-draw the map.


i checked the viability of that and found out this can be very easily done.

Code: [Select]
$game_map.data[x,y,z]where z is the layer (0-2)
holds the tile values for the currently active map, loaded from the data folder, and can be altered ingame.

to make the first layer of the second map tile the same as the first tile all you would need to do is put this in a script:
Code: [Select]
$game_map.data[1,0,0] = $game_map.data[0,0,0]
$game_map.need_refresh = true
or set it to any integer corresponding to a tile sprite, starting at 384 (numbers below are autotile parts).

i've only run a couple tests but it seems passability and priority gets transferred as well.

autotiles don't do their auto aligning however because every variation of the autotile has its own graphic that gets copied literally.
and it does not get saved either, when you exit the map the tiles will change back to the original setting. can't be that hard to work around that though.

(sorry if this was obvious to everyone already :))
« Last Edit: December 04, 2011, 06:39:06 PM by Poe »

Offline Sin86

  • Transcended Spirit
  • ***
  • Posts: 190
  • LV: 3
    • View Profile
Re: [XP] Map Combiner
« Reply #9 on: December 16, 2011, 01:36:24 AM »
I spotted a compatibilty issue using Blizz ABS and Tons of Addons.


No error message appears but if you try to combind an object on one map with another, the object will appear but you'll walk right through it(where you set the x's to on the map options) regardless of how you set up that map object within the map . Without Blizz ABS and Tons, the object will act normal.


Also, on huge maps(this map is width 170, height is 118), if you try using the script, your character will disappear although you can still control him/her unless you go to an event that transfers you into another map, reenter the map you were in before and you'll reappear on it. Only to see that the new object is still walkthroughable.

Offline Wizered67

  • Astral Trancist
  • *****
  • Posts: 512
  • LV: 16
    • View Profile
Re: [XP] Map Combiner
« Reply #10 on: December 19, 2011, 08:19:51 AM »
I've done some testing with this as I plan to use it in my own game and had no problems with Blizz-ABS and Tons of Addons. I have no problems with walking through things. Try putting Blizz-ABS and Tons below the map combiner. However, I have found 1 minor thing with Blizz-ABS and 1 fairly major thing. If you have an enemy on the original map and then combine a map with it, the enemy's HP will be reset. The major thing is that if you have a Blizz-ABS enemy on a map you combine with the original, when it dies, everything goes crazy. I'm not sure how to describe it. You randomly level up multiple times and items start appearing everywhere.

Oh yeah, and as for your other problem with character dissapearing, it is because the camera isn't centered anymore on the player. I solved this by adding
Code: [Select]
$game_player.center($game_player.x, $game_player.y)at the end of the "add_map" method.
« Last Edit: December 19, 2011, 08:26:06 AM by Wizered67 »

Offline Sin86

  • Transcended Spirit
  • ***
  • Posts: 190
  • LV: 3
    • View Profile
Re: [XP] Map Combiner
« Reply #11 on: December 19, 2011, 06:47:19 PM »
About the stuff about items appearing everywhere and you leveling up rapidly like you said. Well, lets say you make an enemy, it dies but has a switch(or self switch) on a 2nd page where it will never appear again. However, you want it to trigger only one thing. Not items or leveling up but all you want it to trigger is the script call to map combine whatever you want it to be. Will it still be doing the rapid level up and random items to appear too?

Also, I tried using the script call that is used to center the player but when I do. I get this error saying "SyntaxError occurred while running script". I set x and y to the respective coordinates too to where I want the player to be. I even have that script call at the end of the script call that uses the Map Combinder. Tried using it all in one script call, tried using it in 2 seperate script calls.

I even tried it without having to change the x and y but instead keeping x and y to be just x and y. No error there but the camera still goes off and eventually when I locate myself, I can still walk through the object that is suppose to appear. I even fixed the script order to have Map Combinder above Blizz ABS and Tons, still didn't fix it.
« Last Edit: December 19, 2011, 07:24:38 PM by Sin86 »

Offline Wizered67

  • Astral Trancist
  • *****
  • Posts: 512
  • LV: 16
    • View Profile
Re: [XP] Map Combiner
« Reply #12 on: December 19, 2011, 07:30:40 PM »
I'm not sure why you are having issues with walking through things still. It only did that when I had the wrong script order. As for the line I gave you, make sure it is in the right place. I put it in immediately after this line
Code: [Select]
$scene.spriteset = Spriteset_Map.new if $scene.is_a?(Scene_Map)
And as for the items appearing, it seems to do that no matter what, although if you have the enemy give no EXP the leveling thing no longer happens. To be honest, I have no idea how to fix this. It seems to be dropping all sorts of items, even when none should drop.

Offline Sin86

  • Transcended Spirit
  • ***
  • Posts: 190
  • LV: 3
    • View Profile
Re: [XP] Map Combiner
« Reply #13 on: December 19, 2011, 07:43:55 PM »
Script order I have done:




Code: [Select]
$game_map.add_map(30)
Code: [Select]
$scene.spriteset = Spriteset_Map.new if $scene.is_a?(Scene_Map)
Code: [Select]
$game_player.center($game_player.x, $game_player.y)
Tried making them all in one script call, tried making them in all 3 seperate script calls, tried replacing x and y to the appropiate coordinates, tried keeping x and y to be just x and y. I still get the same error saying "SyntaxError occurred while runing script".
« Last Edit: December 19, 2011, 07:46:28 PM by Sin86 »

Offline Wizered67

  • Astral Trancist
  • *****
  • Posts: 512
  • LV: 16
    • View Profile
Re: [XP] Map Combiner
« Reply #14 on: December 19, 2011, 08:15:31 PM »
Don't do it in a script call event. Add
Code: [Select]
$game_player.center($game_player.x, $game_player.y)
to the actual script immediately after the line

Code: [Select]
$scene.spriteset = Spriteset_Map.new if $scene.is_a?(Scene_Map)

Offline Sin86

  • Transcended Spirit
  • ***
  • Posts: 190
  • LV: 3
    • View Profile
Re: [XP] Map Combiner
« Reply #15 on: December 19, 2011, 08:28:13 PM »
Just tried it. I have the event saying:

Code: [Select]
$game_map.add_map(30) (30 is the map id for the map that has the object thats suppose to be placed, everything else including the player takes place on map 29 and all the event has is the script call that calls out the script to use the combinder)

Now I use the script that has the x and y on it and I place it directly below the part with
Code: [Select]
$scene.spriteset = Spriteset_Map.new if $scene.is_a?(Scene_Map). No error message this time but I still get thrown off the camera like I was getting before. The combinder script is above all the other the other scripts but below all the default scripts.
« Last Edit: December 19, 2011, 08:32:28 PM by Sin86 »

Offline Wizered67

  • Astral Trancist
  • *****
  • Posts: 512
  • LV: 16
    • View Profile
Re: [XP] Map Combiner
« Reply #16 on: December 19, 2011, 09:42:55 PM »
I don't know why its not working. Here is the exact script I have in and it works fine as far as the camera issue goes.

(click to show/hide)