RPG Maker MV / MZ Script Call List

● ARCHIVED · READ-ONLY
Started by Archeia 569 posts Page 11 of 29 View original ↗
  1. Does anyone know how I can set a variable to the troop ID of whatever troop the party's facing?


    I'm trying to make an ability where a character says something different based on the troop they're facing. I'm trying to use a common event that utilizes a script call to set a variable equal the current troop ID but i can't seem to get it to work. thanks
  2. Is there a way to add a buff (luck, for example) to an actor using a script?


    Something like $gameActors.actor(1).addBuff(ecc, ecc);
  3. Hello, guys!
    I can't find how to call button(or function called by button), for example "Ok" (z, space, enter) from script.


    I need to call pressing button without pressing it physical, only by script.


    May be somebody knows and could help me?  
  4. DiscoZombie said:
    I need to call pressing button without pressing it physical, only by script.

    That is a really, really, really bad idea.


    It has been asked and discussed before, and instead of trying to simulate a button (that would do something else, whatever that might be) you should make it a direct function call to that "whatever you want to trigger".


    I suggest you make a new topic where you explain what exectly you want to do (instead of how you want to do it), because your idea of the "how to" will not work, you cannot enter something into the keyboard buffer itself.
  5. First of all: Thank you very much for this useful list!


    But - it might have already been mentioned - there seem to be a few mistakes on the lower part of the list (probably VXAce code that hasn't been updated, judging from the non-Javascript variable names and comments; also, the list still links back to the script calls topic for VXAce ;) ). For some of those there are corrections(?) next to them, but not for all, and the VXAce code is still written in bold in the very left column, suggesting it is the correct one.


    For example, to check whether an actor is affected by a certain state, the list suggests:


    $game_actors[actorID].states.include?($data_states[stateID])


    which does not work in MV - instead I found this scipt call to work, which is nowhere on the list:


    $gameActors.actor(actorID).isStateAffected(stateID)


    Thought I'd let you know, since I was extremely confused by this ;)
  6. Thanks you for the list, it's very usefull.


    I have just a problem, I would like to create bar control by variable with picture, I found this in the list.


    $gameScreen.showPicture(pictureId, name, origin, x, y,
    scaleX, scaleY, opacity, blendMode)


    I tried this


    $gameScreen.showPicture(1, Jauge_1, 0, 100, 100,
    [$gameVariables.value(2)], [$gameVariables.value(2)], 255, 0)


    but I have a error message, I'm not a scripter and I don't know where is the problem, if someone can help me, this is very nice.


    PS: Excuse my english, it's not my native language



    EDIT: For the picture definition, it's resolve with this


    Jauge_1 = "img/Pictures/Jauge_1.png";


    The game d'ont crash but the picture does'nt appear.


    0000000.jpg
  7. Try using just the name of the picture without the actual path and ".png", but in quotation marks, that solved it for me. (And make sure your variable #2 is not set to 0, else the picture will be scaled down to nothing ;) ) Apart from that, you don't need the square brackets around the variable calls. Your script call should look similar to this:

    Code:
    $gameScreen.showPicture(1, "Jauge_1", 0, 100, 100, $gameVariables.value(2), $gameVariables.value(2), 255, 0);
  8. It works! thanks a lot for your help :D



     





     








     
  9. Thank very much this is really helpful topic.
  10. How do I check current MP% with script call? For conditional branches...
  11. penguwin said:
    How do I check current MP% with script call? For conditional branches...

    I'm trying to check the percentage of the current MP for a custom battle HUD via events. For some reason it's not working through variables... 
  12. For the Wait Script Call:


    doesn't work


    $gameInterpreter.wait(frames);


    it works

    Code:
    this.wait(frames);
  13. How is used the script call for Showing Choices?


    Ok, I'm using choice.push to have appear the choices, but how I know what the player is selecting?
  14. So, I would like to completely clear out the players inventory. Since you need script calls for this and it seems like I am too stupid, what are the script calls to remove a specific item?


    In VX Ace I could use this to remove items/weapons/armors from the players inventory:

    Code:
    $game_party.gain_item($data_items[$game_variables[6]], -150)
    
    $game_party.gain_item($data_armors[$game_variables[7]], -150, true)
    
    $game_party.gain_item($data_weapons[$game_variables[8]], -150, true)

    I assume something like that is still possible, but what does it look like? As far as I understand the script call list, I would do something like this:


    $gameParty.gainItem($dataItems[$gameVariables[2]], -150);


    ...but that doesn't work. Probably because of the $gameVariable, but how do I need to change it so it does work?


    Edit:


    I forgot the Javascript Thread existed, so this post could basically be deleted. xD
  15. Dreadshadow said:
    Who do I credit for this if I want to include this knowledge to a personal project and how1 do I give credit?


    [1] I mean what sould I write? A link on this thread? Your name @Archeia?



    You don't have to. It's part of the program and we provided it so everyone can easily use script calls :)
  16. I'm looking for a Script check to verify if a target is affected by one of 5 states, i'm sure target.isStateAffected(x) would work, but i don't know how to add multiple states .. :x


    target.isStateAffected(1,2,3) doesn't seem to work !
  17. @Nol There might be a shorter way, but I would use 


    target.isStateAffected(1) || target.isStateAffected(2) || target.isStateAffected(3) || target.isStateAffected(4) || target.isStateAffected(5)


    || means "or"; this whole expression will be true if the target is affected by any of the states 1-5.
  18. or maybe something like


    var st = [1,2,3,4,5]; var has = false; for (x in st) {if (target.isStateAffected(x)) {has = true; break;}};


    This way, it will loop thru every ID you put inside the array named st, and will set the variable "has" to true if the target has any of those states. It might not look way shorter right now, but if you're gonna make the same kind of "if" situation which a larger list, it would be way shorter this way
  19. While i will save this in my "adulte-java" folder, i'll keep eating my sand and play with the long version for a while longer.


    Scary adult things.


    Thanks for sharing you time and knowledge !