JavaScript questions that don't deserve their own thread

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

  1. Shaz

    Shaz Veteran Veteran

    Messages:
    36,940
    Likes Received:
    10,870
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Feel free to ask any questions here that you feel do not warrant their own threads.

    If you need help getting a plugin working, please start a NEW thread and include a link to where you downloaded the plugin from.
     
    #1
    Philsco and Volis like this.
  2. ??????

    ?????? Diabolical Codemaster Veteran

    Messages:
    6,199
    Likes Received:
    2,110
    Location:
    Your OS
    First Language:
    Binary
    Primarily Uses:
    RMMV
    I've been really enjoying JS so far, but I'm not sure if that deserves its own thread or not... Thoughts? :)
     
    #2
  3. Shaz

    Shaz Veteran Veteran

    Messages:
    36,940
    Likes Received:
    10,870
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    If you want to discuss impressions/thoughts of Javascript, you can either start a thread here or in the Learning Javascript forum (that might be the more appropriate place) and I'll pin it for you.  That's definitely not what we want in THIS thread, as it's not a support question ;)
     
    #3
    ?????? likes this.
  4. Torqus

    Torqus Veteran Veteran

    Messages:
    169
    Likes Received:
    26
    First Language:
    English
    Hey everyone. In VX Ace, with help from the forum, I made a new window to remove actors from party with a list. The problem now is that the new RM doesn't come with a "script" editor. Am I supposed to go to the "js" folder and edit the base scripts there? It seems a lot harder than before,  all the scenes, windows are together in 1 file now.
     
    #4
  5. Jackkel Dragon

    Jackkel Dragon Veteran Veteran

    Messages:
    45
    Likes Received:
    24
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Out of curiosity, is there a simple way to create persistent switches/variables that works like Fomar's VXAce script? I'm converting a project that used persistent data, but I've yet to see any persistent data plugins/scripts.
     
    #5
  6. Zalerinian

    Zalerinian Jack of all Errors Veteran

    Messages:
    4,691
    Likes Received:
    918
    Location:
    The Internet.
    First Language:
    English
    Primarily Uses:
    N/A
    Yes! MV actually makes it easier, but you will still need a plugin. MV has a GlobalData file that is created and used across saves that persistent data could be put in, but like I said, this would need a plugin. I might look into it if I have time later.

     

     


    You need to create a new plugin by creating a new JavaScript file (file extension is .js) in the plugins folder. for development sake, it's easier to work with the default classes split up rather than compiled into the large files that they come as.
     
    Last edited by a moderator: Oct 24, 2015
    #6
  7. Hellreaper

    Hellreaper Villager Member

    Messages:
    27
    Likes Received:
    6
    Location:
    Belgium
    First Language:
    Dutch
    Hi guys, I'm a c++ coder in training. If thats how you say it in english.

    I wanted to try and get the map to display on the top left corner when you are walking around in town.

    I got that working by saving the map as an image and drawing that image on the screen.

    Not sure if I need to make a thread for this kind of thing but w/e.

    is it possible to get the player location to display on the world map I made.

    and if so how? an arrow would be sufficient. just so u can see on what part of the map you are currently located.

    Thx
     
    #7
  8. Nelderson

    Nelderson Coding Bitch Veteran

    Messages:
    164
    Likes Received:
    157
    Location:
    Rhode Island
    First Language:
    English
    Primarily Uses:
    RMMV
    Get an arrow image and use a ratio of x to y of your actual map and the size of your mini map.
     
    #8
  9. Bearsmith

    Bearsmith Villager Member

    Messages:
    22
    Likes Received:
    5
    First Language:
    English
    How do I get the value of a variable? I know how to set the value but I can't figure out how to get it back. It seems to be different from VXAce.
     
    #9
  10. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,294
    Likes Received:
    2,838
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Code:
    var variableId = 1; $gameVariables.value(variableId);
     
    #10
  11. tati light

    tati light Veteran Veteran

    Messages:
    160
    Likes Received:
    107
    First Language:
    English
    Newbie question. When I create an array via script inside event, how can I get the string value to appear in a text message of another event?

    (The following example: the second picture/event doesn't work, of course ^^')

    [​IMG]

    [​IMG]
     
    #11
  12. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,294
    Likes Received:
    2,838
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    If you want to display the array inside a text message, you need to set it's value to a RM variable and use \v to display it.
     
    Last edited by a moderator: Oct 24, 2015
    #12
    tati light likes this.
  13. tati light

    tati light Veteran Veteran

    Messages:
    160
    Likes Received:
    107
    First Language:
    English
    Is there no way to get the value of a self-made array? I wanted to avoid using the game variables because I will need to work with multi-dimensional arrays.
     
    #13
  14. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,294
    Likes Received:
    2,838
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Not inside a message, unless someone made a plugin that let you run a script inside a message, but that could get messy.

    The easiest way is to just set the value to a temp variable before showing the message:

    $gameVariables.setValue(1, ar[0]);You can even use the same variable (in this example, 1) everytime.
     
    #14
    tati light likes this.
  15. tati light

    tati light Veteran Veteran

    Messages:
    160
    Likes Received:
    107
    First Language:
    English
    Ah... I see... so I would need to pre-set the values I want inside gameVariables for temporary use... yes, it will be more work to do, but definitely possible. I think I got it, I will test here... Thanks very much!

    Edit: It worked as intended, thanks again!
     
    Last edited by a moderator: Oct 24, 2015
    #15
  16. laaghisce

    laaghisce Red Dragon Veteran

    Messages:
    32
    Likes Received:
    23
    First Language:
    English
    Primarily Uses:
    RMMV
    I'm unsure about asking this but I'll give it a shot.  ;_;  
    Can I ask for help on how a plugin works that involves knowledge of JS? I do not know anything about any scripting language and I doubt it's something I can learn in a few minutes.

    For an example of what I'm asking help for: Yanfly's Main Menu Manager. I've looked over the video many times and have tweaked the examples that came with the plugin already but still do not understand anything.  :(
     
    #16
  17. babykgar

    babykgar Villager Member

    Messages:
    14
    Likes Received:
    1
    First Language:
    English
    I've got a question about a function in Window_Base. Can someone tell me exactly what .fittingHeight() does? Here's the code from dev tools window, as seen in the file rpg_windows.js:

    Window_Base.prototype.fittingHeight = function(numLines) {    return numLines * this.lineHeight() + this.standardPadding() * 2;};

    I'm reading through plugins that change up menus, and I keep seeing this being used, but I'm still not sure what's going on with this...
     
    #17
  18. Torqus

    Torqus Veteran Veteran

    Messages:
    169
    Likes Received:
    26
    First Language:
    English
    Are you using the help from the plugin? You'll have more details there.

    Also you should give more details on what your problem is, I might be able to help actually.

    I'm also having problems with that plugin, need to make a "Main Bind" open a Event Selector window (kadokawa plugin) but can't make it work :S
     
    #18
  19. laaghisce

    laaghisce Red Dragon Veteran

    Messages:
    32
    Likes Received:
    23
    First Language:
    English
    Primarily Uses:
    RMMV
    I have looked at the help window in the program for this plugin, but I still do not understand what certain terms mean. ;c

    I've looked up some, such as 'eval' and 'bind' but can't make any sense out of those.

    And I'd love any help with understanding this script! Would you like me to pm you or post what I'd like to implement with this plugin?
     
    #19
  20. Shaz

    Shaz Veteran Veteran

    Messages:
    36,940
    Likes Received:
    10,870
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Yeah, fitting_height was also used in Ace, and maybe even VX.

    So we're saying the number of lines by the height of each line, which will give the height of all the items combined. Adding standardPadding * 2 gives enough room for some spacing at the top and bottom of the contents.

    @laaghisce, what you are asking for is a detailed walkthrough of a plugin. First I have to ask why you want to look at the script, if you have no scripting experience? Are you trying to use it, or to learn how to make one yourself? To use a plugin, you should not have to go into the script at all. If you want to learn how to make one, this is not the thread for it to happen in.

    If you want your detailed walkthrough, could you please post a new thread in the Learning Javascript forum, state what plugin you're going to look at, ask what questions you would like answered, and someone will help you out :)
     
    Last edited by a moderator: Oct 24, 2015
    #20
    laaghisce and babykgar like this.

Share This Page