RPG Maker MV Script Call List

Discussion in 'RPG Maker MV' started by Archeia, Oct 24, 2015.

  1. jkweath

    jkweath Goes Fast Veteran

    Messages:
    192
    Likes Received:
    155
    First Language:
    English
    Primarily Uses:
    N/A
    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. nerochepiace

    nerochepiace Veteran Veteran

    Messages:
    48
    Likes Received:
    2
    First Language:
    italian
    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. DiscoZombie

    DiscoZombie Villager Member

    Messages:
    5
    Likes Received:
    1
    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. Andar

    Andar Veteran Veteran

    Messages:
    28,310
    Likes Received:
    6,435
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    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. LadyBaskerville

    LadyBaskerville Hell-poodle Veteran

    Messages:
    645
    Likes Received:
    484
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    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. Kingdommangas

    Kingdommangas Veteran Veteran

    Messages:
    42
    Likes Received:
    21
    Location:
    France
    First Language:
    French
    Primarily Uses:
    RMMV
    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
     
    Last edited by a moderator: Oct 8, 2016
  7. LadyBaskerville

    LadyBaskerville Hell-poodle Veteran

    Messages:
    645
    Likes Received:
    484
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    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);
     
    Dad3353 likes this.
  8. Kingdommangas

    Kingdommangas Veteran Veteran

    Messages:
    42
    Likes Received:
    21
    Location:
    France
    First Language:
    French
    Primarily Uses:
    RMMV
    It works! thanks a lot for your help :D



     





     








     
     
    LadyBaskerville likes this.
  9. cdaz

    cdaz Villager Member

    Messages:
    22
    Likes Received:
    2
    First Language:
    Thai
    Thank very much this is really helpful topic.
     
  10. penguwin

    penguwin DESIGNER Member

    Messages:
    26
    Likes Received:
    0
    Location:
    San Diego
    First Language:
    English
    How do I check current MP% with script call? For conditional branches...
     
  11. penguwin

    penguwin DESIGNER Member

    Messages:
    26
    Likes Received:
    0
    Location:
    San Diego
    First Language:
    English
    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. Ste

    Ste Veteran Veteran

    Messages:
    38
    Likes Received:
    17
    Location:
    Parma, Italy
    First Language:
    Italian
    Primarily Uses:
    RMMV
    For the Wait Script Call:


    doesn't work


    $gameInterpreter.wait(frames);


    it works

    Code:
    this.wait(frames);
     
  13. nerochepiace

    nerochepiace Veteran Veteran

    Messages:
    48
    Likes Received:
    2
    First Language:
    italian
    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. Marston

    Marston Veteran Veteran

    Messages:
    179
    Likes Received:
    33
    Location:
    Germany
    First Language:
    German
    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
     
    Last edited by a moderator: Dec 11, 2016
  15. Dreadshadow

    Dreadshadow Lv 38 Tech Magician Moderator

    Messages:
    3,834
    Likes Received:
    2,480
    First Language:
    Greek
    Primarily Uses:
    RMMV


    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?
     
  16. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,551
    Likes Received:
    14,232
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM


    You don't have to. It's part of the program and we provided it so everyone can easily use script calls :)
     
    Dreadshadow likes this.
  17. Nol

    Nol Veteran Veteran

    Messages:
    91
    Likes Received:
    6
    First Language:
    english
    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 !
     
  18. LadyBaskerville

    LadyBaskerville Hell-poodle Veteran

    Messages:
    645
    Likes Received:
    484
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    @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.
     
  19. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,467
    Likes Received:
    2,861
    Location:
    Philippines
    First Language:
    Tagalog
    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
     
    Last edited by a moderator: Jan 12, 2017
    LadyBaskerville likes this.
  20. Nol

    Nol Veteran Veteran

    Messages:
    91
    Likes Received:
    6
    First Language:
    english
    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 !
     

Share This Page