Use script to get the page number of an event

NeptuneTron

The Salticid Scholar of the North
Member
Joined
Jan 13, 2018
Messages
24
Reaction score
11
First Language
English
Primarily Uses
RMMV
I want to be able to call a script to find the current page that an event is on, and move it to a variable. Does anyone have any idea how to do this?

If you could write out the script and also include an explanation, that would be extremely helpful. I'm pretty new to some of this scripting stuff, but I have some background in coding, so seeing the code is usually the most helpful way for me to learn stuff about scripting.

Thanks in advance!
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
1,701
Reaction score
559
First Language
Dutch
Primarily Uses
RMMV
what is the reason to know its page number?
On clever way is to make a variable page.
on the beginning of the events/npc's run variable page = Nr
Nr of the page number its on.

but if you can tell for which purpose you need for, coders might be able to help you
on that specific plugin on page number.
 

ozubon

surströmming?
Veteran
Joined
Oct 16, 2018
Messages
178
Reaction score
165
First Language
English
Primarily Uses
RMMV
NeptuneTron!
The page index is stored in $gameMap.event(id)._pageIndex
$gameMap is the map object, event(id) is a function that returns the event object, and then ._pageIndex is the variable that stores the page number.

So if you want to know the variable of event 1 you want to set a variable to $gameMap.event(1)._pageIndex

But for your purposes we can set a variable to
$gameMap.event(this.eventId())._pageIndex

The most makery way of doing that is using control variables, the operand script and just ploppin' in $gameMap.event(this.eventId())._pageIndex there ;)

You could alternatively use the script call
JavaScript:
$gameVariables.setValue(2, $gameMap.event(this.eventId())._pageIndex)
That sets variable 2 to the event's page number :')
 

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

Latest Threads

Latest Posts

Latest Profile Posts

So, uh, has anyone tried buying any resources from KokoroReflections? Because I've been looking for a 'buy' button on the site for like 10 minutes now and can't find one.
Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...
Everyone in the US right now: Please stay safe.
Symphony Celestia: Prophecy of the Falling Stars RPG Maker music pack WIP. Symphony Celestia is a new series that focuses on symphonic and orchestrated music to tell a story. Each story will include compositions that make up that story from beginning to end. Themes include: Battles, adventures, character themes, etc. Below is a video preview to the first story.

Jumping and gravitation 0.1 build - RPG Maker MV

Forum statistics

Threads
97,975
Messages
948,255
Members
129,228
Latest member
T-Rylo
Top