JavaScript questions that don't deserve their own thread

Discussion in 'Javascript/Plugin Support' started by Shaz, Oct 23, 2015.

  1. IAmVianca

    IAmVianca Veteran Veteran

    Messages:
    99
    Likes Received:
    4
    Location:
    Philippines
    First Language:
    English
    Hey guys, I have a question.


    Right now, I'm not using a plugin to zoom in and out of a particular area/character/scene. What I am using is this:


    var xPos = $gameMap.event(5).screenX();
    var yPos = $gameMap.event(5).screenY();

    $gameScreen.startZoom(xPos, yPos, 1.5, 20);


    And, I am using this one to zoom out:


    $gameScreen.clearZoom();


    My question (and problem) is: How do I zoom out slowly? At the moment, when I zoom out, it does so immediately and it's kind of jarring. So, is there a code out there, or something I can add to the code I am already using, to make that possible?


    Also, I am not sure if it is an issue with the editor itself or the code I am using, but when zooming in, I see a line of pixels above one of the sprites. Is that supposed to be normal given the code I am using (considering there is nothing wrong with the sprite of that event/character?


    Thank you for any help or feedback you may give me.
     
  2. Ossra

    Ossra Formerly Exhydra Veteran

    Messages:
    723
    Likes Received:
    529
    First Language:
    English
    Primarily Uses:
    RMMV
    @IAmVianca Here is what I  use :


    // Zoom-In
    px = $gamePlayer.screenX();
    py = $gamePlayer.screenY() + (48 * 3);
    $gameScreen.startZoom(px, py, 2.0, 120)

    // Zoom-Out
    px = $gamePlayer.screenX();
    py = $gamePlayer.screenY() + (48 * 3);
    $gameScreen.startZoom(px, py, 1.0, 120)


    You were basically there. The third argument is scale, and all you need to do is return it to 1.0 to zoom out. 
     
  3. gizzmito

    gizzmito Villager Member

    Messages:
    20
    Likes Received:
    13
    First Language:
    spanish
    Hello people!


    I'm using a script call to move the player to a certain position:


    $gameTemp.setDestination(x, y);


    but I would want to avoid another possible action until the player gets to the destination. The same as the "wait" option you can use in movement routes.


    Is that possible?


    Thank you 
     
  4. Ossra

    Ossra Formerly Exhydra Veteran

    Messages:
    723
    Likes Received:
    529
    First Language:
    English
    Primarily Uses:
    RMMV
    @gizzmito If you are in an event, you can use the following :

    Code:
    
    ◆Loop
      ◆If:Script:$gamePlayer._realX == $gameTemp._destinationX && $gamePlayer._realY == $gameTemp._destinationY
        ◆Break Loop
        ◆
      :End
      ◆Wait:1 frame
      ◆
    :Repeat Above
     
  5. gizzmito

    gizzmito Villager Member

    Messages:
    20
    Likes Received:
    13
    First Language:
    spanish
    Thank you, that was fast!


    But unfortunately I have tried and it doesn't work.


    If I put something in the same event, the movement stops (well, the player doesn't move at all). So the condition never is true and the game freezes.


    It's the same reason I can't put "wait" in the line below "$gameTemp.setDestination(x, y)" because the "wait" order is executed and the "$gameTemp.setDestination(x, y)" doesn't work.
     
  6. Ossra

    Ossra Formerly Exhydra Veteran

    Messages:
    723
    Likes Received:
    529
    First Language:
    English
    Primarily Uses:
    RMMV
    @gizzmito Here is a plugin that will do what you are after.


    Exhydra Character Control - Set Destination Ex


    // destinationX - The destination x coordinate
    // destinationY - The destination y coordinate
    // direction - The direction to face upon reaching the destination
    $gamePlayer.setDestinationEx(destinationX, destinationY, direction);




    You can use it with $gamePlayer or even events ($gameMap.event(eventId)). With this you can use the loop pause I posted above without an issue.
     
  7. gizzmito

    gizzmito Villager Member

    Messages:
    20
    Likes Received:
    13
    First Language:
    spanish
    @Exhydra  Thanks a lot!  


    That works perfectly now.
     
  8. IAmVianca

    IAmVianca Veteran Veteran

    Messages:
    99
    Likes Received:
    4
    Location:
    Philippines
    First Language:
    English


    Thanks for the help!!! :)
     
  9. SwiftIllusion

    SwiftIllusion Veteran Veteran

    Messages:
    107
    Likes Received:
    180
    First Language:
    English
    I'd like to ask if possible how you can get access to the value of something in your plugin, from inside RPG Maker MV.


    I have "$gameTemp._bchainData[16]" with a number value, but I'd like to be able to check its value in an action sequence (Via Yanfly Plugins).


    I tried looking at other plugins for reference but couldn't find any example that allowed me to figure this out,


    so I'd really appreciate if anyone can let me know what I'd need to do for this.
     
  10. lokirafael

    lokirafael Veteran Veteran

    Messages:
    152
    Likes Received:
    77
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    A question... Theres some way to check in damage formula if the skill will hit a allied or a enemy?


    Aka: If hit allied do X, else do Y.


    Thanks
     
  11. Ice Bear

    Ice Bear Ice Bear for President Veteran

    Messages:
    60
    Likes Received:
    20
    Location:
    Somwhere
    First Language:
    English
    Hmmm... I'm am unsure if this belong here but I have at least one thing I need help with, in which it requires Yanfly's Buff's and State Core and some other of their plugins.


    1. I am trying to create a state/buff in which it boosts a parameter based on the remaining HP the user has but I want to use lunatic mode to accomplish this.


    This can go in multiple ways: one, is to multiply the remaining HP with a percentage of the parameter that is being buffed, or two, when the user is at a certain HP percentage, it boosts a static percentage.
     
  12. Milena

    Milena The woman of many questions Veteran

    Messages:
    1,282
    Likes Received:
    106
    Location:
    Ireland
    First Language:
    Irish
    Primarily Uses:
    N/A
    How do you exactly read something like this:


    <Action Stat + x>


    <Action Bump (User): x>


    as a regular expression. I want to detect the User and X as a variable by the way.
     
  13. Lear

    Lear Veteran Veteran

    Messages:
    56
    Likes Received:
    11
    Is there a way to implement something along the lines of:


    $gameActors.actor(1).forgetSkill(1051.. 1055)
    ?
     
  14. Ossra

    Ossra Formerly Exhydra Veteran

    Messages:
    723
    Likes Received:
    529
    First Language:
    English
    Primarily Uses:
    RMMV
    @Lear You could try something like the following :

    Code:
    [1051,1052,1053,1054,1055].forEach(function(id) { $gameActors.actor(1).forgetSkill(id) } );
     
  15. DreamX

    DreamX Veteran Veteran

    Messages:
    816
    Likes Received:
    812
    First Language:
    English
    Check out the DataManager functions for Yanfly plugins that use that format.
     
  16. sundricat

    sundricat Veteran Veteran

    Messages:
    35
    Likes Received:
    2
    First Language:
    English
    I'm looking to use a script call to fade out to white, but remain in the same map.
     
  17. Ossra

    Ossra Formerly Exhydra Veteran

    Messages:
    723
    Likes Received:
    529
    First Language:
    English
    Primarily Uses:
    RMMV
    @sundricat The following should work :

    Code:
    // Fade Out
    SceneManager._scene.startFadeOut(duration, booleanWhite);
    
    // Fade Out to Black
    SceneManager._scene.startFadeOut(60, false);
    
    // Fade Out to White
    SceneManager._scene.startFadeOut(60, true);
    
    
    // Fade In
    SceneManager._scene.startFadeIn(duration, booleanWhite);
    
    // Fade In from Black
    SceneManager._scene.startFadeIn(60, false);
    
    // Fade In from White
    SceneManager._scene.startFadeIn(60, true);
     
    Last edited by a moderator: Sep 4, 2016
  18. Sinvergil

    Sinvergil Villager Member

    Messages:
    17
    Likes Received:
    7
     


    What'd be a way to check a skill'suser? I'm using all of Yanfly's current up to date plugins at the moment as an FYI. I am trying to do a


    <Before Eval> that checks if the user is an actor or an enemy. What I've tried is something like this to test



    <Before Eval>
    if (user.isActor) {
    $gameMessage.setBackground(1);
    $gameMessage.setPositionType(0);
    $gameMessage.add("\\c[6]I AM AN ACTOR!\\c[0] ");
    } else {
    $gameMessage.setBackground(1);
    $gameMessage.setPositionType(0);
    $gameMessage.add("\\c[2]I AM AN ENEMY!\\c[0] ");
    }
    </Before Eval>



     


    However even though an enemy is using the skill only the first part actually happens (where what I want in this scenario is the second message


    of "I AM AN ENEMY" to pop up). Any help would be greatly appreciated! :D :D :D


     


     


    EDIT:   Figured it out from a friend! Couldn't delete the post 
     
    Last edited by a moderator: Sep 6, 2016
  19. sol003

    sol003 Villager Member

    Messages:
    13
    Likes Received:
    5
    First Language:
    Filipino
    Yanfly redirected me here with regards to this question and I feel it's a small enough thing that it does not warrant a thread.


    Is there a way to get the max limit of weapons and/or armor from Item Core for eval purposes? Like say you have 50/50 weapons already and you found a treasure chest with a sword in it, it will check if current weapon count >= max weapon limit?

    I'm aware that you can intentionally get more than the max limit, I'm just curious if it's possible to put the max weapon limit for conditional purposes?
     
  20. Milena

    Milena The woman of many questions Veteran

    Messages:
    1,282
    Likes Received:
    106
    Location:
    Ireland
    First Language:
    Irish
    Primarily Uses:
    N/A
    I want to get the actual screen x and y of a specific event. How would I go on that? Since $gameMap._events[1]._x or _realX just shows me the x and y from the editor...not the actual screen.
     

Share This Page