Scroll Diagonally

NathanW

Veteran
Veteran
Joined
Mar 29, 2014
Messages
83
Reaction score
27
First Language
English
Primarily Uses
How's it going guys!

I have a question, but I don't know whether Eventing can do it or not. The Scroll Map function shows left, right, up and down options, a speed and a distance... Is there any way to make scrolling work diagonally through events? Or must there be a script involved? I want to be able to scroll up-right and then up in one smooth motion, for the starting scene of my game.

Any help would be appreciated.

EDIT: Just noticed I put this in the wrong subforum >.< I used VX Ace, so could I get it moved over to that forum please?
 
Last edited by a moderator:

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
I don't think it can be achieved with events. 

This is part of a script I made for Orange Season, it should be enough for what you need:

class Game_Interpreter    def wait_for_scroll        Fiber.yield while $game_map.scrolling?    end     def scroll_map(direction, distance, speed, wait = false)        @params = [direction, distance, speed]        command_204         wait_for_scroll if wait    endend class Game_Map    def do_scroll(direction, distance)        case direction            when 1                scroll_upper_l(distance)            when 2                scroll_down(distance)            when 3                scroll_lower_l(distance)            when 4                scroll_left(distance)            when 5                scroll_lower_r(distance)            when 6                scroll_right(distance)            when 7                scroll_upper_r(distance)            when 8                scroll_up(distance)            when 9                scroll_upper_l(distance)        end    end     def scroll_upper_l(distance)        scroll_up(distance)        scroll_left(distance)    end     def scroll_lower_l(distance)        scroll_down(distance)        scroll_left(distance)    end     def scroll_upper_r(distance)        scroll_up(distance)        scroll_right(distance)    end     def scroll_lower_r(distance)        scroll_down(distance)        scroll_right(distance)    endend You can call it this way:

Code:
$game_map.interpreter.scroll_map(direction, distance, speed)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Nice, but does that make it actually scroll in one direction and then the other? Or does it scroll at an angle?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
Nice, but does that make it actually scroll in one direction and then the other? Or does it scroll at an angle?
It scrolls X and Y at the same time.

The methods "scroll_down", "scroll_left" and so on do not actually do the scrolling, it only tells the map to start scrolling in the next frame. That's why this script scrolls both at the same time even thought I call one and then the other.

I just realized an easier way to approach this:

class Game_Interpreter  def command_204    return if $game_party.in_battle    $game_map.start_scroll(@params[0], @params[1], @params[2])  end   def wait_for_scroll    Fiber.yield while $game_map.scrolling?  endendThis way, all you need to do is create two "scroll map" commands and rpg maker will run both at the same time.

Then just call this to make rpg maker wait for the scroll to end:

 

Code:
$game_map.interpreter.wait_for_scroll
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top