RPG Maker MV / MZ Script Call List

● ARCHIVED · READ-ONLY
Started by Archeia 569 posts Page 18 of 29 View original ↗
  1. It would be nice to have some help here.
    I am not sure about the syntax of these commands.

    • $gameScreen.movePicture(pictureId, origin, x, y, scaleX, scaleY, opacity, blendMode, duration)
    • Sound Object: { name: filename, volume: n, pitch: n, pan: n }
    • AudioManager.playBgm( refer to sound object above );
    • AudioManager.fadeOutBgm(n);

    1. It would be nice to know what values these parameters can take.
    2. It would also be nice to see a few examples, so we can understand how to use them.
    • $gameScreen.movePicture(
      pictureId, = Any number between 1 and 100. It's the picture Id.
      origin, = 0 for top left, and 1 for center.
      x, = the x coordinate that you want to show on the screen
      y, = the y coordinate that you want to show on screen.
      scaleX, = 100 it's the normal scale. You can adjust for less or more.
      scaleY, = 100 it's the normal scale. You can adjust for less or more.
      opacity, = from 0 to 255. Higher the number, higher the opacity.
      blendMode, 0(normal), 1(additive), 2(multiply), 3(screen)
      duration = A time in frames.
      )
    • let myBgm = {
      name: filename(must be a string "myTown". Don't write the extension),
      volume: 0 to 100(I presume),
      pitch: 50 to 150(default is 100),
      pan: -100 to 100(default is 0)
      }
    • AudioManager.playBgm(myBgm );
    • AudioManager.fadeOutBgm(Put here the time in frames(or seconds) that will take for the bgm to fade);
  2. @Eliaquim Interestingly, using the script call, the pitch range goes from 0 to infinity, you can get some really low, slow drones from a short sound file.
  3. Thank you! This has been really handy for me!
  4. What's a script call to check if the party has a weapon in their inventory? I can find calls on the list to give them weapons and items, but not simply to check for possession.
  5. yoluko said:
    What's a script call to check if the party has a weapon in their inventory? I can find calls on the list to give them weapons and items, but not simply to check for possession.
    Weapon check.png
  6. That's not a script call. The script call that that event command calls is this:

    JavaScript:
    $gameParty.hasItem($dataWeapons[this._params[1]], this._params[2])

    So if you want to check weapon 4:

    JavaScript:
    $gameParty.hasItem($dataWeapons[4], true)

    Change true to false if you don't want to include equipped weapons.
  7. Solar_Flare said:
    That's not a script call. The script call that that event command calls is this:

    JavaScript:
    $gameParty.hasItem($dataWeapons[this._params[1]], this._params[2])

    So if you want to check weapon 4:

    JavaScript:
    $gameParty.hasItem($dataWeapons[4], true)

    Change true to false if you don't want to include equipped weapons.

    Thanks!
  8. $gameParty.addActor(n);
    $gameParty.removeActor(n);

    Am I able to use a variable rather than straight actorID where n is for these commands? How would I format that?
  9. I would try:

    $gameParty.addActor($gameVariables.value(19));

    That example uses variable 19 to hold the value of the actor id. You can use any variable that you want, of course.

    edit: Things like that are one of the main advantages of using scripts instead of sticking to the editor commands, in my opinion.
  10. Piyan Glupak said:
    I would try:

    $gameParty.addActor($gameVariables.value(19));

    That example uses variable 19 to hold the value of the actor id. You can use any variable that you want, of course.

    edit: Things like that are one of the main advantages of using scripts instead of sticking to the editor commands, in my opinion.

    Seems to work. Thank you.
  11. Just wanted to say a quick (huge) thanks for this great list and the thread. I'm a rmmv newbie but developing software for decades, and just had my first "hello world" script running in an event. Wow! That opens up a lot of possibilities!
  12. This list is wonderful and helped me along real well. I managed to fix all the errors I had going from VX to MV in this script. Although this list doesn't mention _targetActorId, _classId or currentExp(), it does have the learn all, or forget all skills script which I had no clue how to fix.


    x = $gameParty._targetActorId
    c = $gameActors.actor(x)._classId

    if (c !== 3) {

    $gameVariables.setValue(1, $gameActors.actor(x).currentExp())

    $dataSkills.forEach(function(skill){ if(skill) $gameActors.actor(x).forgetSkill(skill.id);});

    $gameActors.actor(x).changeClass(3, false)

    $gameActors.actor(x).learnSkill(9)

    $gameActors.actor(x).gainExp($gameVariables.value(1))

    }


    Thanks a ton! Now I can change everyone's class with items or spells, reset their skills and put them back at the same exp they were, learning all the skills of new class upto their obtained level before hand, and won't keep giving them xp once they changed class since it doesn't reset xp again once class changed. Now just need to make it more dynamic so all the different items and spells change different classes, without copy pasting this script for every class.. this scripting sure saves alot of hassle creating conditions in MV itself, _targetActorId is a time saver.

    For some reason x.currentLevelExp did work but returned 0, while $gameActors.actor(x).currentLevelExp returned the function, function () { return this.expForLevel(this._level); }

    Same with currentExp.. without the () it returns the function code I guess..

    Interesting to see how the function is written.
  13. Would there happen to be any script calls to change the mouse arrow cursor? [I mean the entire mouse cursor, not just in windows or battle, but the mouse moving on the map]
  14. @Phoenixsylph Do you mean the OS cursor? If so, then yes, you can use the following :

    Code:
    // Change cursor to an hourglass.
    document.getElementsByTagName("body")[0].style.cursor = 'wait';
    
    // Change cursor to a custom graphic.
    document.getElementsByTagName("body")[0].style.cursor = 'url(img/system/Shadow1.png), auto';

    See the list provided on this page to see what standard cursors you can use.
  15. You rock Ossra, thank you!
  16. Or slightly shorter:

    JavaScript:
    document.body.style.cursor = '...'
  17. Hi!, thank you for making this list. Im pretty new in this, but I'm trying to make the best I can.
    Actually, I have one question about the battle log script. I'm trying to do An alternativo fighting mechanic where the most important thing has to do with chance of narration. I have done a lot of things with skills, common skills, etc. So I saw thst script and tried to add some battlelog text as mentioned, but when I try the command it says "Cannot read property 'addText' of undefined.

    I am missing something? I am going to put the exact script that im using so you can see something wrong

    var text = "Ana olvidó leer con la luz encendida..."
    SceneManager._scene._logWindow.addText(text)
    SceneManager._scene._logWindow.clear();
  18. I know this is an old thread, but is there a way to detect what an actor's MP is at using this and/or any plugins?