what a great resource! thank you :kaoangry:
RPG Maker MV / MZ Script Call List
● ARCHIVED · READ-ONLY
-
-
This Script Call list applies to both RPG Maker MV and RPG Maker MZ.
Link here to see the entire list.
[embedded media]
Supplementary Material for RPG Maker MZ:
RPG Maker MZ Data and Script Call Reference
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? -
not exactly.if I want to make a custom battle system plugin! Is it or am I interpreting it wrong?
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. -
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 I have probably slightly misunderstood what I should do.
With the call as
$gameMap.mapId(17)
the conversation runs everywhere. -
@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.
-
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. -
@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. -
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. -
the easiest way would be to switch pages to a page that has no autonomous movement before switching back to random movement.but I'm stuck on the stop random and resume random movement parts.
-
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.
-
@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. -
@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) -
@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. -
@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. -
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:
-
This is incredibly useful, thank you!
-
I want to run a troop event where there is a check if anyone in the party is inflicted with state (4). If there is, I want to remove state(4) and add state(62).
The script call I have for checking if anyone in the party is inflicted is:
Code:$gameParty.allMembers().some(who => who.isStateAffected(4))
Assuming that is correct (which it might not be) my problem comes with the remove/add state event command. My default options are 'Entire Party' or each individual actor.
It is highly unlikely that it will be the entire party, and I'm reluctant to make lots of individual conditionals. If I did that, I may as well ditch the first script call and use conditionals all the way down.
Is there a script call which would allow me to do what I want without knowing which actor(s) will be involved?
Thank you -
@Kes - that looks correct to me, but as you've noticed,
someisn't very helpful here. In this case you'd want to check all members for state 4, and for each one of them that has that state, they should get it replaced with state 62.
You could try something like this in a Script command:
$gameParty.members().forEach(actor => { if (actor.isStateAffected(4)) { actor.removeState(4); actor.addState(62); } });
Alternatively, usingfor...of:
for (const actor of $gameParty.members()) { if (actor.isStateAffected(4)) { actor.removeState(4); actor.addState(62); } }
Pick whichever you prefer! :kaohi: