Get X/Y position of parallax map as it scrolls?

lodger

Villager
Member
Joined
Dec 8, 2019
Messages
14
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hi all,

Not sure if this should go here or plugin requests, but first I wanted to establish the scope of my situation, and see if a plugin/script would even be necessary.

So, I have a parallax background that has a sky and a sun. The map scrolls horizontally. I would like to make it so that when the sun scrolls to the middle of the map, and the player happens to be standing in that location at the same time, they're illuminated and an event occurs (e.g. it generates a key or unlocks a door).

Is there a way to determine the current x/y position of the parallax background (let's say the position of the edge or something) as it is scrolling? And I could then plug that information into an event switch/condition?

The only other way I could think of to do it would be to create a separate graphic for the sun, set it as an event with a character sprite, and have that scroll independently, but then I'd have to set up warps at the edge of the map so it loops back to the other side, and I'd have to make sure it moves at the same speed as the parallax background.

This might all be possible, and easier than my first suggestion, I just am too novice to know how off the top of my head.

Any help is appreciated!
 

MushroomCake28

KAMO Studio
Moderator
Joined
Nov 18, 2015
Messages
2,212
Reaction score
3,578
First Language
English
Primarily Uses
RMMV
The title is about getting x and y position of the parallax image, so I suppose I'll move the thread to learning Javascript.

I've moved this thread to Learning Javascript. Please be sure to post your threads in the correct forum next time. Thank you.

 

lodger

Villager
Member
Joined
Dec 8, 2019
Messages
14
Reaction score
2
First Language
English
Primarily Uses
RMMV
Thank you - I'm still quite new to RPG Maker, so just want to confirm if my guess is right.

If I wanted an event to occur in reaction to those coordinates being reached by the scrolling background, I could use a Conditional Branch - Script - and plug in that script?
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Stream will be live shortly with some Witcher 3 followed by Haunting Ground! Feel free to drop by!
I have at least three ongoing projects and I have no idea what to do with them.

Gotta love game dev.
I keep seeing the 'file tear' icon when I'm on some post that has images. I'm not sure if it's just me or it's the post, based on the replies I see.
Me: anime is okay. There are a couple good ones and a lot of really bad ones but the good are worth it. Brother: if you bring anime anywhere near me I'll break your nico nico kneecaps
Wasting so much time trying to get a sprite behavior to work. I feel like banging my head against a wall.

Forum statistics

Threads
94,277
Messages
919,588
Members
124,001
Latest member
Howzarion01
Top