RPG Maker MV / MZ Script Call List

● ARCHIVED · READ-ONLY
Started by Archeia 569 posts Page 14 of 29 View original ↗
  1. A few, hopefully small and easy questions:

    1) Is there a script call to remove all actors from the active party? I've found this one (Earlier in this thread actually)

    $gameParty.removeActor($gameParty.allMembers()[slotToRemove].actorId())
    Which apparently removes a single actor from the party by position (Which was plan A). I assume I'm doing it wrong as it's spitting out an error. I'm after this as I'm using Hime's Instance Actors so using an Id to remove them is a no go.

    2) Are there a collection of script calls that can, in essence, reset an actor to it's default state? I'm looking for things like: Remove all Skills, Set Stats/Params to X, Remove all equipment. I suppose the "easiest" way (BIG quotation marks around that) is to make a template actor and make the actor I'm trying to reset equal to that; although that sounds like plugin territory.
    Edit: Hime's Instance Actor Script doesn't work that way so this is no longer needed.​

    3) Is it possible to open the status menu for an actor that isn't in the party? I've got

    SceneManager.push(Scene_Status);​

    Which opens up the Status screen for the first actor but I can't figure out how to specify an actor.

    Thanks for your time.
  2. Anybody know how to call an item's icon via script? :)



    $dataItems[100].iconIndex gets me the icon number, just a case of actually drawing it :c.
  3. $gameActors.length is undefined
  4. @rokimoki
    What do you wanna do?
  5. can i call a local event to play during battle?
  6. Hello everyone. I have a question...
    What would the script call be to change the number of save files in-game?
    Pretty much what I would like to do is start with 1 save file in the game I am making, and have new save slots unlockable as rewards for Players...
  7. @Hunor. I may be missing something with your request, but it sound like you want to make an enemy's specific stat change to that of a specific actor.

    This may be a cheap workaround, but you could just have the skill formula call upon the target's str instead of his own
    value = b.atk - b.def // to call on target
    $gameActors.actor(actorId).atk // to call on specific actor ID [1- however many actor]
    $gameParty.members()[index].atk // to call on specific party member position [0-3]

    If you wanted it to only call on this when a state is applied make 2 copies of the skill, one that uses user stat and the other to use one of the above, and have the state forget the default skill and learn the new skill?





    I have some questions that I am trying call upon various variables

    The damage taken during the current turn so i make make a state that returns mana based on a percentage of damage taken
    a.gainMp(damagetaken*0.1)


    The damage that will be dealt during the current turn, so that I can make a state to return mana or increase / decrease the damage that will occur
    value = damage*0.5
    a.gainMp(damage*0.1)



    Is there a script to call on my entire party, or do i have to reference them each individually?
    Instead of the following
    $gameParty.members()[0].gainHp(500);
    $gameParty.members()[1].gainHp(500);
    $gameParty.members()[2].gainHp(500);
    $gameParty.members()[3].gainHp(500);

    Something like
    $gameParty.members()[ALL].gainHp(500);



    Similarly, is there a script to call upon all enemies currently in battle? this one is harder because I can't do the add them individually workaround as different battles may have different number of enemies.



    Is there a script to call on the last person that attacked me? The reason for these last 2 questions is that I have created a skill/ state that works as a 'final attack.' If the actor has the state applied, he will do damage before dying. I currently have this working to a random enemy as that's all I knew how to reference.
    I would like to add new skills that does a final attack to all enemies as I asked above
    And another skill which does a final attack to the character (player or enemy) that killed me. This would work as a deterrent for players killing their own character to trigger this 'final attack.'


    Thanks in advance for any help.
  8. I've even made an account to ask this question on the Forum... but lo and behold!
    Thank you very much, you just saved me a whole lot of pain and suffering.
  9. Hello!

    Cell A175 says 'add this scriplet'. How do I do that?
  10. Hello everyone, i need the MV version of the script call (VX version : ($game_map.data[x,y,0] = tileid)). It basically turn a specific tile into another. I need it to make my random map. I Do not need it to be saved, as the map is deleted when you leave her, and then randomly recreated.

    (For you to understand: I am making a project for mobile, and so i wanted to save space as i can, and having 1 specific map randomly generated is (i think) the best way to have a feeling of infinite land.. (And it avoid bug as in minecraft because you are going too far and so any computer crash...)
    This is at first just a garden to raise pet and decorate, but i wanted to add that feature)



    EDIT: So after i little time watching in the .js file, i think i may find the line that interest me... can anyone help me to be sure?
    line code from "Rpg Core.js"
    /**
    * @method _drawNormalTile
    * @param {Bitmap} bitmap
    * @param {Number} tileId
    * @param {Number} dx
    * @param {Number} dy
    * @private
    */
    Tilemap.prototype._drawNormalTile = function(bitmap, tileId, dx, dy) {
    var setNumber = 0;

    if (Tilemap.isTileA5(tileId)) {
    setNumber = 4;
    } else {
    setNumber = 5 + Math.floor(tileId / 256);
    }

    var w = this._tileWidth;
    var h = this._tileHeight;
    var sx = (Math.floor(tileId / 128) % 2 * 8 + tileId % 8) * w;
    var sy = (Math.floor(tileId % 256 / 8) % 16) * h;

    var source = this.bitmaps[setNumber];
    if (source) {
    bitmap.bltImage(source, sx, sy, w, h, dx, dy, w, h);
    }
    };

    /**
    * @method _drawAutotile
    * @param {Bitmap} bitmap
    * @param {Number} tileId
    * @param {Number} dx
    * @param {Number} dy
    * @private
    */
    Tilemap.prototype._drawAutotile = function(bitmap, tileId, dx, dy) {
    var autotileTable = Tilemap.FLOOR_AUTOTILE_TABLE;
    var kind = Tilemap.getAutotileKind(tileId);
    var shape = Tilemap.getAutotileShape(tileId);
    var tx = kind % 8;
    var ty = Math.floor(kind / 8);
    var bx = 0;
    var by = 0;
    var setNumber = 0;
    var isTable = false;
  11. Very helpful, thank you.
  12. Hi everyone, I found a script call for MV that allows to move up and down stairs in diagonal movement. It works super fine, but I'm trying to edit a single thing: instead of moving in diagonals when I press UP and DOWN, I would prefer to just have the character to look up and down. This is the command so far, what should I edit?

    PHP:
    if($gamePlayer._realX === $gameMap._events[this._eventId]._x && $gamePlayer._realY === $gameMap._events[this._eventId]._y){
      var dir = $gamePlayer._direction;
      if(Input.isPressed("up")||Input.isPressed("right")){
        $gamePlayer._through = true; $gamePlayer._direction = 6; $gamePlayer.moveDiagonally(6,8);
      }
      if(Input.isPressed("down")||Input.isPressed("left")){
        $gamePlayer._through = true; $gamePlayer._direction = 4; $gamePlayer.moveDiagonally(4,2);
      }
      $gamePlayer._through = false;
    }

    Thank you!
  13. !!!My Question got allready answered in this other Thread:
    https://forums.rpgmakerweb.com/inde...ve-their-own-thread.46341/page-48#post-832898

    Hello maybe you can help me?
    In VX-Ace i could insert the following Codeline into the Custom Moveroute of an Eventpage:
    Code:
    moveto(@event.x , @event.y)
    This made the Event Teleport back to its original Editor starting position, even after moving around.

    How would this look in RPG Maker MV?
    Edit: If this is the wrong place to ask this, please let me know and i make an extra Thread.
    -I also searched the Helpfile and the Linked List, the wanted information isnt there.

    Edit2: I understand that Scripts are now Plug inns, but where do i find the standard scripts with there awesome documentation like in vxace scripteditor? Where does it hide?
  14. Hey All,

    I'm trying to conditionally check certain Follower X and Y positions. Is there a way to do this? Either check the position in a conditional branch, or save them to a variable. I tried something, but not sure how close I am.

    $gameVariables.setVariable(7, $game_player.followers[n].x)
    Would that save a followers X position into variable 7? Or am I way off.

    Thanks in advance!
  15. Not $game_player, but $gamePlayer. And you are not off, that is actually correct. It would be much faster if you tried it yourself though :D You can, in order to find it faster, open a dev console (f8) and type in $gamePlayer. Then you find followers.. And x.
  16. Thank you for the reply Poryg!

    I guess I should have specified, I am at work and was trying to avoid opening RPG Maker on my work computer haha! But it's a slow day, so I did anyway :cutesmile: Looks like I was able to get the value I wanted by typing $gamePlayer._followers._data[followerID]._x (as suggested by OcRam on another thread) and then I can just put that into a conditional branch (I think).

    I tried saving it to a variable by typing $gameVariables.setVariable(7, $gamePlayer._followers._data[followerID]._x) but that didn't work. I may have something else wrong there.

    EDIT: I'm a dunce! It's $gameVariables.setValue(7, $gamePlayer._followers._data[followerID]._x) to get it to work. Just in case anyone is wondering :)
  17. So I was trying to use the message script call and change the color within in. Does anyone know what I am doing wrong?

    $gameMessage.add("\C[4]" & "Show Text Script Call");
    $gameMessage.add("\C[4]Show Text Script Call");
    $gameMessage.add("\C[4] Show Text Script Call");

    I know the answer will be simple, but I can get my text to appear, but it's not recognizing it. It is just showing up as text.
  18. You need "\\C[4]" instead. \ once is an escape character and is therefore automatically converted to nothing, because Javascript doesn't know \C. Also, use either the second one or the third one, but definitely not the first one. And just a side note, take a look at Javascript. You'll learn that you don't separate function parameters with "&", but with "," :D
  19. Poryg said:
    You need "\\C[4]" instead. \ once is an escape character and is therefore automatically converted to nothing, because Javascript doesn't know \C. Also, use either the second one or the third one, but definitely not the first one. And just a side note, take a look at Javascript. You'll learn that you don't separate function parameters with "&", but with "," :D

    Thanks for the help. :)