map scrolling script [Resolved]

Started by blackfox1250, September 19, 2010, 06:43:33 pm

Previous topic - Next topic

blackfox1250

September 19, 2010, 06:43:33 pm Last Edit: October 05, 2010, 06:38:55 pm by blackfox1250
ill be breef cause i have to get back to making my game and stuff.




first i need a script that mimics the way the scrolling of the map works in illusion of gaia , eg. the map dosn't go up or down uless you change floors but when your in a large area like a town the map moves normaly following your sprite up and down

here is a good way to show you what i mean no

http://www.youtube.com/watch?v=F4DtqP0wO5U&p=FC392426F88CC695&playnext=1&index=19

watch whole vid


WhiteRose

I was under the impression that this is the way it works by default.

blackfox1250

no i mean that the map shows several floors abut doesn't move unless I were to go down stairs

also that is only on certain maps that it does this...

http://www.youtube.com/watch?v=F4DtqP0wO5U&p=FC392426F88CC695&playnext=1&index=19

watch whole vid

Calintz

October 04, 2010, 09:31:58 pm #4 Last Edit: October 04, 2010, 09:35:23 pm by Calintz
yea...you don't need a script for this. you just have to make your maps a certain way.
the default map size is 20width x 15height. split your maps into sections that are 15panels high, and x panels wide (however long you want). make sure that at the 1st and 15th panels on each separate floor is an impassable tile. this will prevent the screen from scrolling (up and down) by itself. leaving a little space between your floors is your choice, but I personally think it would provide a better transition effect...

let's say you wanted three floors in your map...
you would want the height of your map to be 60panels high. that calculates to three stories at 15panels and three inter-spacing sections of 5panels a piece. when you transfer your character choose NOT to fade your map. simply relocate your character (using the transfer event) and then "manually" scroll the map at your desired speed.

I own this game and it's setting in my closet. Good game...but, I highly doubt that the game has a script for this. there really is no reason to write a script for something that is better suited to be done alongside the normal map creation process. you simply need to know how to bend the engine to meet your standards.

blackfox1250

October 04, 2010, 09:38:14 pm #5 Last Edit: October 04, 2010, 09:43:14 pm by blackfox1250
only problem is that when you moveup and down on the indavidual floors the scren will move too (just a bit) buti want it to not moveat all unless i change floors.

if i do it your way it will move ever so slightly up and down when i move

NOTE: i want to have wide hallways every now and again and that won't work like that. andi want the scrolling floors so i don't see how that will work

PS i own the game and still play it I don't like the final boss though

Calintz

if it moves just a bit, then change the standard. only make your move-able space ten panels high. trust me! no script is required for this...

blackfox1250

October 04, 2010, 09:44:38 pm #7 Last Edit: October 04, 2010, 09:46:39 pm by blackfox1250
explian a bit better i don't quite get it
and wouldn't it move down or up trying to center the character on the screen

Calintz

yes, but there is a fifteen panel limit by default. So we divide fifteen by two to get our limit for screens larger than 15panels. If we keep the entrance of the map against the map border and keep the player's move-able panels at seven (or anything less than 8panels) the screen won't scroll, because your character will not pass that midway point of the default scrolling panel. He will be less than centered to begin with, so the screen shouldn't scroll.

Edit:
I see your dilemma, but it can be worked around. Give me a minute.

blackfox1250

ok then when you got it worked out let me know

thats why i wanted a script :^_^':

Calintz

October 05, 2010, 03:50:57 pm #10 Last Edit: October 05, 2010, 05:46:43 pm by Calintz
The only way I can think to do this without a script is to make a new map for each floor.
You can make the height of the map however tall you'd like (for the scrolling) but make sure that you keep your player's move-able panels beneath eight panels and place the move-able space against the edge of the map. Then, upon player touch condition change your main character's graphics to "none" and use the "scroll map" event to reset the y position of the map. You should never have to tinker with the x value at all. After the map is finished scrolling into the new map, then transfer without fade.

Edit:
LMAO...well, I solved your problem with a switch, and two lines of additional code in the Game_Player script. I feel stupid...Lol. I should've listened to you earlier. I spent about an hour dicking around with maps trying to set this up, and I concluded that there actually isn't a way to do this without using some script syntax somewhere, so I apologize for being stubborn.

Anyway...
Create an additional switch in your editor and remember it ID. Call it "Dungeon" or something (anything that reminds you that you're currently in a dungeon). Then, open the script editor and highlight the Game_Player script. Scroll down to line 230. In that general area you'll see the code that processes the scroll feature that forces the player to stay in the middle of the map. You will only be working with the Down and Up codes.

The original looks like this:
Spoiler: ShowHide

# If character moves down and is positioned lower than the center of the screen
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
 # Scroll map down
 $game_map.scroll_down(@real_y - last_real_y)
end
# If character moves left and is positioned more let on-screen than center
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
 # Scroll map left
 $game_map.scroll_left(last_real_x - @real_x)
end
# If character moves right and is positioned more right on-screen than center
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
 # Scroll map right
 $game_map.scroll_right(@real_x - last_real_x)
end
# If character moves up and is positioned higher than the center of the screen
if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
 # Scroll map up
 $game_map.scroll_up(last_real_y - @real_y)
end





Replace it with this:
Spoiler: ShowHide

# If you are in a dungeon
if $game_switches[1] == true (This will be your switch you added)
else
 # If character moves down and is positioned lower than the center of the screen
 if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
   # Scroll map down
   $game_map.scroll_down(@real_y - last_real_y)
   end
 end
# If character moves left and is positioned more let on-screen than center
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
 # Scroll map left
 $game_map.scroll_left(last_real_x - @real_x)
end
# If character moves right and is positioned more right on-screen than center
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
 # Scroll map right
 $game_map.scroll_right(@real_x - last_real_x)
end
# If you are in a dungeon
if $game_switches[1] == true (This will be your switch you added)
else
 # If character moves up and is positioned higher than the center of the screen
 if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
   # Scroll map up
   $game_map.scroll_up(last_real_y - @real_y)
 end
end


Now, when you enter a dungeon make sure to turn that switch ON before anything. (Parallel Process processes that fastest)
When you exit the dungeon make sure that map turns this switch OFF.

Tested and works...
-Calintz-

blackfox1250

Thanks a bunch :^_^':

don't worry about being stuborn, it's okay. and thanks again *level up*

Calintz

Haha, you're welcome!
I was so sure that this could be done normally, and I got it to work at first, but then came the problem of continuing down after the first map was finished. Since this map would have both is upper and lower levels that needed to be on the map it made this impossible. Granted, if you just scrolled up and down this would work fine, but for realism it's best to do it with the script snippets.

Thanks for the Level Up.

blackfox1250

um... just wondering... :^_^':

can you help with my other script request...  (I posted it to help others rather than me cause i see this request every where so i made it slightly simpler to make the script...  in my opinion...  ;))

Calintz