RPG Maker MV / MZ Script Call List

● ARCHIVED · READ-ONLY
Started by Archeia 569 posts Page 26 of 29 View original ↗
  1. @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.
  2. Kes said:
    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.
  3. 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;
    
    }
  4. AquaEcho said:
    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.
  5. ATT_Turan said:
    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.
  6. Could I get a script to return the value of the equipment type dropdown (1-4) from the armors database for armor id x?
  7. 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.
  8. 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
  9. 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.
  10. Kes said:
    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.
  11. @Another Fen and @caethyril Thank you both for your answers.
    @caethyril I always find your little //... comments very helpful in understanding exactly what the code is doing.

    Once again, thank you both.
  12. 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.
  13. Norintha said:
    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.
  14. AquaEcho said:
    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.
  15. 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.
  16. @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:
  17. None of the examples use leading zeroes. Point noted, though. :kaohi:
  18. Very good link... thanks!!!
  19. Nice, thanks for this list Archie. Perhaps this is the only place where I could find them