RPG Maker MV / MZ Script Call List

Kes

Regular
Regular
Joined
Aug 3, 2012
Messages
23,915
Reaction score
13,943
First Language
English
Primarily Uses
RMMZ
@whiteswords12 and @caethyril

I wonder if there is an easier way to do this?

Conditional
Code:
$gameParty.leader() == $gameActors.actor(17)
If yes: Show text command. In the dialogue box to get the face and name of the leader (party position 0) I would type
\PartyFace[0] \P[0]
Then type the dialogue

Else: do whatever

That pulls up the face and the party leader and puts the party leader's name in the name box.

But maybe I've missed something that whiteswords12 is trying to do.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,755
Reaction score
11,366
First Language
English
Primarily Uses
RMMV
In the dialogue box to get the face and name of the leader (party position 0) I would type
\PartyFace[0] \P[0]
Then type the dialogue
The first one isn't an RPG Maker escape code. It might be from a VisuStella Message plugin or something.
 

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,276
Reaction score
1,709
First Language
English
Primarily Uses
RMMV
Is there a script call to change (the bottom layer) terrain tag on a tile? I cant finish this script without it

JavaScript:
//Change region id x to terrain tag x

var regionToChange = 4;

for (var x = $gameMap.width(); x--;) for (var y = $gameMap.height(); y--;)
if ($gameMap.regionId(x, y) === regionToChange){

//Script call to change the terrain, below is wrong
$gameMap.terrainTag(x,y) = regionToChange;

}
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,755
Reaction score
11,366
First Language
English
Primarily Uses
RMMV
Is there a script call to change (the bottom layer) terrain tag on a tile?
No, because the tags are read from the tileset's properties in the database on demand - it's not an editable property.

You'd have to use something like Shaz's Tile Changer to change to a similar tile with a different tag.

Or use the region ID for everything (instead of terrain tag) and use that plugin to change the region ID.
 

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,276
Reaction score
1,709
First Language
English
Primarily Uses
RMMV
No, because the tags are read from the tileset's properties in the database on demand - it's not an editable property.

You'd have to use something like Shaz's Tile Changer to change to a similar tile with a different tag.

Or use the region ID for everything (instead of terrain tag) and use that plugin to change the region ID.
All right, well, that's going to complicate the solution to a certain someone's problem. Thanks for the help.
 

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,276
Reaction score
1,709
First Language
English
Primarily Uses
RMMV
Could I get a script to return the value of the equipment type dropdown (1-4) from the armors database for armor id x?
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
5,268
Reaction score
4,754
First Language
EN
Primarily Uses
RMMZ
To get the Equipment Type ID:

$dataArmors[x].etypeId
To get the Armor Type ID:

$dataArmors[x].atypeId
These both start counting at 1: they correspond to the lists on the Types tab of the Database.

Equip type also works for weapons, just replace $dataArmors with $dataWeapons. Weapon type is wtypeId instead of atypeId.
 

Kes

Regular
Regular
Joined
Aug 3, 2012
Messages
23,915
Reaction score
13,943
First Language
English
Primarily Uses
RMMZ
I have a piece of gear which has a 40% chance of inflicting state(64)
However, I also want it to remove state(55) if the target has it and if state 64 is successfully applied.
I came up with this:
Code:
<JS Post-Damage as User>
if (!target.isDead() && Math.random()<.4)
target.addState(64);
target.removeState(55);
</JS Post-Damage as User>

Is the semi-colon after target.addState(64); sufficient to prevent adding the new state being affected by the 40% chance? I want this to be definite if state 64 has been added.

Thanks
 

Another Fen

Regular
Regular
Joined
Jan 23, 2013
Messages
709
Reaction score
404
First Language
German
Primarily Uses
Right now your if-statement only includes the next command up to the next semicolon. If you wanted target.removeState(55) to also be conditional, you would add curly brackets around the code that you want your if-statement to include:

if (condition)
{
...
}

That said, right now state 55 gets removed regardless of whether state 64 is active on the target.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
5,268
Reaction score
4,754
First Language
EN
Primarily Uses
RMMZ
I have a piece of gear which has a 40% chance of inflicting state(64)
However, I also want it to remove state(55) if the target has it and if state 64 is successfully applied.
For future reference, I feel your question might be better posted here:
To answer your question, elaborating on what Another Fen said:
JavaScript:
if (!target.isDead() && Math.random()<.4) {
  // not dead and 40% chance roll passed
  target.addState(64);
  if (target.isStateAffected(64)) {
    // and target has state 64
    target.removeState(55);
  }
}
It's just like nesting Conditional Branch commands.

Without plugins, you might just add an Attack State: 64 trait to the weapon, then give state 64 a Resist State: 55 trait. That would only be transmitted through Skills/Items with an Add State: Normal Attack effect, though, and would cause state 64 to always remove state 55 regardless of how it is applied.
 

Norintha

Regular
Regular
Joined
Feb 27, 2023
Messages
80
Reaction score
445
First Language
English
Primarily Uses
RMMZ
It might be obvious to more experienced people but I got stymied by the need to remove leading zeros from map and event id#s without seeing that requirement anywhere in the first post or documents.
 

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,276
Reaction score
1,709
First Language
English
Primarily Uses
RMMV
It might be obvious to more experienced people but I got stymied by the need to remove leading zeros from map and event id#s without seeing that requirement anywhere in the first post or documents.
I don't think you CAN remove those 0s. They're hard coded. Just don't use the leading zeros in formulas or variable references as Javascript will parse it as octal instead of decimal.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,755
Reaction score
11,366
First Language
English
Primarily Uses
RMMV
I don't think you CAN remove those 0s. They're hard coded. Just don't use the leading zeros in formulas or variable references as Javascript will parse it as octal instead of decimal.
I think that's what Norintha is saying. The IDs are displayed in the editor software with leading zeros, but when using script calls from the first post in this thread, you must not include them.

I agree that would be a good instruction to include in the first post.
 

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,276
Reaction score
1,709
First Language
English
Primarily Uses
RMMV
The devs probably thought most users wouldn't be using scripts, and the ones that did were advanced users who knew Javascript and not to use leading zeros.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,755
Reaction score
11,366
First Language
English
Primarily Uses
RMMV
@AquaEcho And that's perfectly fair. But it's kind of the point of this post (which has become a thread) - to give information on the engine's script calls to users who are not advanced and don't know JavaScript (because if you do, you can just look it up in the code). :wink:
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
5,268
Reaction score
4,754
First Language
EN
Primarily Uses
RMMZ
None of the examples use leading zeroes. Point noted, though. :kaohi:
 

JeemVL

Warper
Member
Joined
Jun 28, 2023
Messages
2
Reaction score
1
First Language
Eng
Primarily Uses
RM2k3
Nice, thanks for this list Archie. Perhaps this is the only place where I could find them
 

Latest Threads

Latest Posts

Latest Profile Posts

So in my SRPG, when kill monsters, they leave an aura that grants +20% Crit, +20% PDMG MDMG. Aura lasts only for 1 turn, it forces players when and where to last hit.

1702177938686.png
So frustrating when you just wanna work on your game but people want to do stuff in RL... :p
Day #9 of Advent is all ready in one spot! Do you prefer doing your shopping way before Xmas, or…do you like the chaos? Are you done shopping and/or crafting for Xmas?
Fast test with Wagon and horse no animation. yes it looks strange horse is Ralph and wagon is follower xDDDD
Should first boss be easy or maybe little medium, I don't want to be overwhelmingly hard

Forum statistics

Threads
136,887
Messages
1,271,058
Members
180,662
Latest member
funky-taco
Top