RPG Maker MV / MZ Script Call List

Inkaline

Warper
Member
Joined
Jul 8, 2022
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMXP
what a great resource! thank you :kaoangry:
 

Artisticdog

Really ambitious (manager of project dogquest)
Veteran
Joined
Jul 10, 2022
Messages
55
Reaction score
18
First Language
English
Primarily Uses
RMVXA
This Script Call list applies to both RPG Maker MV and RPG Maker MZ.
Link here to see the entire list.


Supplementary Material for RPG Maker MZ:

Have fun eventing~
Wait this is so useful if I want to make a custom battle system plugin! Is it or am I interpreting it wrong?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,033
Reaction score
10,029
First Language
German
Primarily Uses
RMMV
if I want to make a custom battle system plugin! Is it or am I interpreting it wrong?
not exactly.

it is about 1% of what you need if you want to make a custom battle system.

If you want to make any modification to the battlesystem, please search the learning javascript forums for posts by the user DoubleX, especially the ones whose titles begin with "Basic Knowledge to the default RMMZ..."
That is what you'll need for creating your own battlesystem.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,973
Reaction score
12,518
First Language
English
Primarily Uses
RMMZ
I'm trying to set a conditional so that part of a dialogue in a common event only runs if you are on map 17.
I have tried using this in the script call part of a conditional branch:
$gameMap===(17)
No error message shows in the console, but neither does the bit of conversation run either.

Can anyone advise me what the correct script call should be?
Thank you.
 

rpgLord69

Veteran
Veteran
Joined
Oct 23, 2021
Messages
310
Reaction score
267
First Language
Finnish
Primarily Uses
RMMZ
@Kes Isn't the correct script call:

$gameMap.mapId()
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,973
Reaction score
12,518
First Language
English
Primarily Uses
RMMZ
@rpgLord69 I have probably slightly misunderstood what I should do.
With the call as
$gameMap.mapId(17)
the conversation runs everywhere.
 

rpgLord69

Veteran
Veteran
Joined
Oct 23, 2021
Messages
310
Reaction score
267
First Language
Finnish
Primarily Uses
RMMZ
@Kes I mean the above script call (without anything in the brackets) returns the map ID. So you should set that it's equal to 17.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,924
Reaction score
2,982
First Language
EN
Primarily Uses
RMMZ
For example:

$gameMap.mapId() === 17
I.e. "true iff the current map's ID is 17".

You don't actually need a script call for that, though. You can store the ID of the current map in a variable with Control Variables -> Game Data -> Other -> Map ID, then do Conditional Branch -> Variable.
 
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,973
Reaction score
12,518
First Language
English
Primarily Uses
RMMZ
@rpgLord69 and @caethyril
Thank you both very much. I think I understand the principle of the script call now, as well as the advantages of storing the map id in a variable.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,973
Reaction score
12,518
First Language
English
Primarily Uses
RMMZ
Back again.
In a cutscene I have an NPC set to random movement. At a particular point I want the NPC to stop moving, face the player while they say something and then resume random movement.

I know I can use the 'turn towards player' command for the second element, but I'm stuck on the stop random and resume random movement parts.

I know it should begin $gameMap.event[15] but everything I try after that doesn't work.

Can anyone help please.
Thank you.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,033
Reaction score
10,029
First Language
German
Primarily Uses
RMMV
but I'm stuck on the stop random and resume random movement parts.
the easiest way would be to switch pages to a page that has no autonomous movement before switching back to random movement.
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
658
Reaction score
368
First Language
German
Primarily Uses
An alternative could be to give your NPC a move route they can never finish (like a long wait and/or just having the NPC look at the player on repeat). The route will take precedent over autonomous movement and you can end the move route at any time by replacing it with an empty one.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,973
Reaction score
12,518
First Language
English
Primarily Uses
RMMZ
@Andar I had hped to make the change from within the cut scene as this NPC is already up to 9 pages. As the scene is player initiated (depends on them doing something in a side quest), it could end up quite messy. But thank you for the suggestion.

@Another Fen I think this is going to be the most straightforward solution. Thank you.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,973
Reaction score
12,518
First Language
English
Primarily Uses
RMMZ
@caethyril I was just wondering if it might be worth adding this to the list of script calls.

When the amount of gold the player holds is stored in a variable then the usual event command to check it in a conditional branch (e.g. for an inn event) won’t work.

Instead I used this:
Code:
$gameParty._gold >= $gameVariables.value(id)
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,924
Reaction score
2,982
First Language
EN
Primarily Uses
RMMZ
@Kes - this kind of thing works for me (Control Variables -> Game Data -> Other -> Gold):

◆Control Variables:#0004 = Gold ◆Control Variables:#0005 = 20 ◆If:#0004 ≥ #0005 ◆Text:None, None, Window, Bottom : :You have at least \v[5] gold! ◆ :Else ◆Text:None, None, Window, Bottom : :You need \v[5] gold to pass. : :You currently have \v[4]. ◆ :End
If you do need scripting for some reason, $gameParty.gold() (1st entry in the Inventory section of the script call list) should work A-OK and ought to be a better option than a raw value reference like _gold. I.e. "does the party have at least as much gold as the current value of variable ID 123?":

$gameParty.gold() >= $gameVariables.value(123);
If that's not working for you, maybe check your plugins. $gameParty.gold() is the standard core script reference for the party's gold total, so it should be returning the correct value.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,973
Reaction score
12,518
First Language
English
Primarily Uses
RMMZ
@caethyril I can see why I didn't get the standard to work. As so often I forgot that JS needs (), so in this instance $gameParty.gold().
Sigh. And there I was thinking I was making progress.
Thanks for the clarification.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,924
Reaction score
2,982
First Language
EN
Primarily Uses
RMMZ
No worries! I gather that in Ruby brackets are usually omitted for 0-argument function calls (style guide link), so that's probably a hard habit to break if you're going from VX Ace to MZ. :kaoslp:
 
  • Like
Reactions: Kes

Latest Threads

Latest Profile Posts

Sometimes I wonder why I still try and recruit others to help with my games. It never works.
ScreenShot_10_3_2022_4_27_17.png
welp, thanks to Luna MV, I was able to add the Balloon as a window... thus allowing me to edit the font color and outline... so now it looks like comic bubbles above characters. I have NO idea why I couldn't get this to work through more conventional means, but here we are.
CUTE CUTE CUTE.gif
I cannot cease doing cute art
War and Wonder is a 100% choice-based open-world visual novel.
1664821313732.png
1664821466359.png
1664821547746.png
Going live soon on Twitch, and will continue Fortunastreet's game "Verloren". For those who are curious, you are welcome to join ;)

-> Franz' Twitch channel

Forum statistics

Threads
125,749
Messages
1,173,223
Members
164,911
Latest member
KyzerKiba
Top