Jump to content
Jester

Map Edge Transfer (VX-Ace) v2.3 (updated 09/21)

Recommended Posts

Map Edge Transfer (VX-Ace) v2.3 by Jester
special thanks: 
 diamondandplatinum3 for being an awesome guy. CHECK OUT HIS SCRIPTING VIDEOS!
helpful feedback: 
 PVGames, Chigoo, Tammsyn
 
Version History:
06.FEB.2013 -> 1.0 -> Initial Release
08.FEB.2013 -> 1.1 -> Bugfixes, Syntax Overhaul, 8-dir compatibility
18.FEB.2013 -> 2.0 -> More Customization and compatibility with Slide-Effect
05.MAR.2013 -> 2.1 -> Compatibility improvement
15.MAR.2013 -> 2.2 -> A Script call to manually choose the transfer coordinates  (Take a look at line 72 and below)
15.MAR.2013 -> 2.2a -> Hotfix
21.SEP.2013 -> 2.3 -> Added "Offset" Script call (Take a look at line ~100 and below)
 
Features:
Automatic Map-Edge-Transfer system
More realistic looking transfer
 
This Script allows the player to automatically transfer to the next
map when hitting the edge of the current map, using in-game variables.
It also adds a small feature to make it look like the player actually
WALKS out of the current map into the new map instead of teleporting.
 
This Script is NOT PLUG'N'PLAY, but relatively easy to use. 
Take a look at the Customization section.
If you still have problems, try out the recent Demo before asking for help!
 
Bugs:
(no known issues)
 
Conflicts:
Place this Script below any movement scripts, like 8-dir-movement
I am fine with Compatibility fix requests if you say "PLEEAASEEEE!!!"
 
Screenshot(s):

vih3bJP.png

 
 
Script:
(link to the Slide-Effect Script in my signature)
 
Terms of Use:
-Free to use in uncommercial projects
-Credit me if you feel like it
-Have a nice day

 

Edited by Jester
  • Like 1

Share this post


Link to post
Share on other sites

Uhh Congratulations on your first script but I still don't understand what is the point of that or maybe I don't understand the idea its self.

Share this post


Link to post
Share on other sites

Okay I was hoping that this was going to be like The Legend of Zelda when you walk out of a map it slides the picture over and the character moves. Good job on your first script!!!!

Share this post


Link to post
Share on other sites

I just tested it, seems cool. Now I understand how it works :)

Share this post


Link to post
Share on other sites

Thanks guys :)

 

Okay I was hoping that this was going to be like The Legend of Zelda when you walk out of a map it slides the picture over and the character moves. Good job on your first script!!!!

 

Yes, I actually plan to add a slide feature! But don't expect it too fast, since it is way harder than it actually sounds to do it for a Ruby-Newb like me.  :wacko:

Share this post


Link to post
Share on other sites

Congrats on your first script. I too have been watching DP3's tutorials and plan on trying my hand at a script at some point, though I don't really have any ideas for a script of my level.

 

On the topic of the script, I'm actually surprised no one has made this idea yet. The sliding functions sounds extremely hard though, since I assume you'd have to change the way maps load and scenes transition. That would also be a potential compatibility nightmare. But good luck in that endeavor.

Share this post


Link to post
Share on other sites
Congrats on your first script. I too have been watching DP3's tutorials and plan on trying my hand at a script at some point, though I don't really have any ideas for a script of my level.

 

On the topic of the script, I'm actually surprised no one has made this idea yet. The sliding functions sounds extremely hard though, since I assume you'd have to change the way maps load and scenes transition. That would also be a potential compatibility nightmare. But good luck in that endeavor.

 

Thanks. :)Yeah, basically the biggest problem is to include the map the player transfers to into the slide effect, since I don't think that there is a easy way to make a picture of it before transfering, so the screen position needs to be altered and I currently don't see a way around accepting the graphical glitches it will cause when using together with HUDs, Fog/Parralaxes and any Shadow systems that are not build around the same idea. There actually is a Slide Effect Script for VX, which I plan to observe soon. Maybe I missed a little fact in my thoughts, that will make things easier.  :rolleyes:

 

Anyways, I will keep thinking about a way to include a Slide-Effect in the future. Maybe I will create a seperated Script which adds new fade types other than fade-white, fade-black and none. But one way or the other, I am pretty proud about the way this Script works already.

Edited by Jester

Share this post


Link to post
Share on other sites

Just to confirm for ya, this is not compatible with 8-direction movement. I mean, it doesn't crash or anything, but if you try to get to the edge of the map while moving diagonal, you won't be able to touch it. Can still touch it though if you use one of the four cardinal directions. Any change you will be fixing this?

 

Edit: An easy way to fix the 8-dir issue would be to automatically force the player into the direction required. So if the player is moving towards the bottom of the map at a diagonal, once he touches the transfer area, he is forced downward so that the transfer triggers.

Edited by PVGames
  • Like 1

Share this post


Link to post
Share on other sites
Just to confirm for ya, this is not compatible with 8-direction movement. I mean, it doesn't crash or anything, but if you try to get to the edge of the map while moving diagonal, you won't be able to touch it. Can still touch it though if you use one of the four cardinal directions. Any change you will be fixing this?

 

Edit: An easy way to fix the 8-dir issue would be to automatically force the player into the direction required. So if the player is moving towards the bottom of the map at a diagonal, once he touches the transfer area, he is forced downward so that the transfer triggers.

 

Thanks for the Feedback. v1.1.0 should be more compatible with most of the 8-dir-movement Scripts. Let me know if you encounter further problems.  :)

Share this post


Link to post
Share on other sites

Heya Jester,

 

I tried out the latest version. I am using Victor Sant's 8-dir script, and I have noticed that the same issue persists in regards to trying to transfer maps while moving at a diagonal. If I move at a diagonal and hit the edge of the screen, I just get sort of 'stuck' there until I move towards the edge in a cardinal direction.

Share this post


Link to post
Share on other sites

Hey PVGames, thanks for the report.

 

Have you tried to place my Script below Victor's Scripts? I have tested it on a new project and I have the same problem, when Map Edge Transfer is placed above Victor's Diagonal Movement. When placing it below, it works as intended though. This is because 8-dir-movement scripts usually overwrite a Method that I am adressing in my Script and I can't really change that.

 

Please let me know, if placing my Script below the 8-dir-Script doesn't help and I will try my best to fix it.  :)

Edited by Jester

Share this post


Link to post
Share on other sites

Ah, you are quite right Jester. That seems to have done the trick indeed :-)  Thanks!

Share this post


Link to post
Share on other sites

Out of curiosity if you ever intend to add a slide effect, do you have any idea how it would be done? I was thinking the tilemap could be copied but the way tilemaps wrap could be trouble some unless you split the screen into two viewports for a while. I am not sure if you could get a clean bitmap. Another possibility I thought of if the two maps have the same tileset is to make a mega-table class and set the tilemap's map_data to it, and have the mega-table class reference table blocks inside it (this is actually more or less how zelda did it). Not too sure of the details. Hehe... it might even be possible to make a script that dynamically loads chunks into a 3x3 grid of maps, but they would have to be the same size.

Edited by KilloZapit
  • Like 1

Share this post


Link to post
Share on other sites

Yeah, I saw stuff like that before. It's actually easier to do then I thought, because you can just use the viewport's ox and oy to slide them around. Just basically keep the tilemap, possibly the character sprites and other stuff, and make the old viewport a background viewport, then make the tilemap/sprites for the new map and put it in a new foreground viewport off screen and adjust the ox or oy coords for both viewports. there will be some tricky details I guess like not disposing the spriteset for the old map until later. I donno.

 

edit: I would use Graphics.snap_to_bitmap but too many sprites would have to be changed or fiddled with I think.

Edited by KilloZapit
  • Like 1

Share this post


Link to post
Share on other sites

I knew it would be hard to do, but it seems to be even harder than I thought, since class bitmap is hidden. I wanted to save the first screen into a bitmap, alter the screen position so the screen is outside of the map after transferring and than move the bitmap and screen to create a slide effect, after that get rid of the bitmap and release the screen. So Graphics.snap_to_bitmap is what I also think would be a good idea, also because OriginalWij made use of it in his Map Slide script for VX and it worked perfectly there. That's basically as far as I've been in my thinking process about it, yet and I'm really gonna look deeper into it today. One of the potentially problems further down the line  will ofcourse be the screen position thing and I'm not sure yet, if it is a good solution.

 

Thanks for the feedback  ;)

Edited by Jester

Share this post


Link to post
Share on other sites

i think map image we see in scene_map is Spriteset_map. maybe we could 'trick' it like this.

when transferring save the old spriteset_map (before changing map so it contain image from old map).

then save that to bitmap. show it on the screen in higher viewport or z value than spriteset_map. so when we already in another map the other map

is covered by 'old' map. maybe create some method in Game_Map update method to freeze the game map temporary until the sliding effect done (if necessary. so the slided map didn't suddenly changed because the Game_Map updating).

then save the new map spriteset_map to bitmap. now we have two bitmap that can be 'slided' together.

after sliding. dispose both bitmap. of course when sliding the map will be static image and no event move.

 

viable?

 

edit: i smell trouble :D. spritesetmap is the whole map. :D. so need a way to save certain part of it only.

Edited by estriole
  • Like 1

Share this post


Link to post
Share on other sites

So there's no way to just create a second spriteset_map containing the new map and then just sliding both over? (afterwards just dispose of the old one)

Edited by Tsukihime
  • Like 1

Share this post


Link to post
Share on other sites

Well, spriteset_map also contains effects and other stuff. Also, I figured out something handy! Graphics.snap_to_bitmap snaps whatever would be displayed at that moment, meaning you can set up what you want to be snapped, snap a bitmap, then set up what the screen should actually display.

  • Like 1

Share this post


Link to post
Share on other sites

Exactly.  :D

 

I have observed OriginalWij's Map Slide Script and managed to get a Slide Effect to work on the base of some of his code. But it has still a big bunch of incompatibility issues which I am trying to adress tomorrow.

 

Whoever is interested in the "beta" version:

v2.0 BETA: Pastebin and it is important to credit OriginalWij for this, since it includes some of his code in some shape or form.

 

I am not happy with the compatibility issues though, so this is not a supported version yet. Those issues occur when using it together with Light Effect or Fog scripts and such. In worst case it could crash, like it does with Victor's Ligh Effects and you have to disable the Slide Effect.  :unsure:

 

Thanks for your input so far btw  :)

Share this post


Link to post
Share on other sites

I think you should change @veiwport1's ox and oy or x and y rather then moving all the sprites inside around personally.

 

Also, you shouldn't need to dispose the spritemap like that, I think... doing that may be the reason for some crashes.

Edited by KilloZapit
  • Like 1

Share this post


Link to post
Share on other sites

Hm, I am not very familiar with viewport to be honest. How do you manipulate the viewport to like be outside of the map? I am able to set a viewport up and change ox, oy etc., but it doesn't really do what i want. :/

 

Thanks for the tip with dispose. I have also been not sure with the first spriteset.dispose, since it doesn't seem to have any effect. But it sadly doesn't fix the crashes and glitches.

 

edit: oh and also ignore the formatting problems. I always forget to activate Ruby-mode in Notepad++  :unsure:

Edited by Jester

Share this post


Link to post
Share on other sites

As far as I know, and I may be wrong, messing with the viewport ox/oy/x/y/ will basically move every sprite inside it, so you can just treat it like a big sprite.

  • Like 1

Share this post


Link to post
Share on other sites

The sprites' positions are relative to the origin of the viewport, not the window (ie: absolute coords)

  • Like 1

Share this post


Link to post
Share on other sites

Update:

While testing the Slide-Effect I have stumbled upon a major bug of my Script, that teleported the player to the wrong coordinates, if - for example - map 1 had a different width than map 2 and you travelled from map 1 through the west-edge into map 2. This was due to a noob mistake :wacko:  and I have fixed it with v1.1b. (also uploaded a fixed v2.0 beta)

 

I'm gonna try to improve the Slide-Effect compatibility tomorrow. Enaugh for me today xD

(edit: Pastebin is trolling me today. I've uploaded the wrong v2.0 for a second. Fixed it, though. ._. )

Edited by Jester

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted