JavaScript questions that don't deserve their own thread

● ARCHIVED · READ-ONLY
Started by Shaz 3413 posts Page 14 of 171 View original ↗
  1. Quick question.

    Is there a way to check the number of weapons my character has equipped in the damage formula?  Essentially, I want to lower the damage for Dual Wielding characters, but only if they have two weapons equipped.  If a Dual Wield character only has one weapon equipped, I want them to deal normal damage.

    Essentially I want to know if I can check to see if a weapon is equipped in the off hand.  
  2. Hello. Just a quick question.. I have set  a number in an array so.. $gameVariables.setValue(10, [1]); then I wanted to add another value in the array.. my question is how can I add value to the array? thats all thank you :)
  3. What is the proper experience rate? I want to make a gauge in the window but I don't know what is the proper rate for experience. I tried 

    actor.currentExp() / actor.nextRequiredExp()but it doesn't go well.

    Anyone?
  4. Milena said:
    What is the proper experience rate? I want to make a gauge in the window but I don't know what is the proper rate for experience. I tried 

    actor.currentExp() / actor.nextRequiredExp()but it doesn't go well.

    Anyone?
    actor.nextRequireExp() doesn't return the total amount required, only the amount needed to get to the level from the current amount. So say you need 50 exp to get to level 2, and you have 11 exp. That function will return 39. What you  need is the total amount (50 in my example). Try using actor.nextLevelExp()
  5. It works now, thanks a lot.
  6. How would I check which scene is active at the moment?

    SceneManager._scene returns a format like this: Scene_Title { ... some stuff ... }

    But there's no "name" property or something similar within the curly brackets, so I can't compare those...

    Using SceneManager._scene === Scene_Title returns false even if the current scene is indeed Scene_Title...
  7. Luxanna said:
    How would I check which scene is active at the moment?

    SceneManager._scene returns a format like this: Scene_Title { ... some stuff ... }

    But there's no "name" property or something similar within the curly brackets, so I can't compare those...

    Using SceneManager._scene === Scene_Title returns false even if the current scene is indeed Scene_Title...
    Try using https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof
  8. Thanks a bunch :)
  9. If i wanted to assign the event ID for the current event to a variable how would I reference it in a script call?

    Code:
    $gameVariables.setValue(n,???)
  10. If the script is executed from a "Script..." event command, you can use

    Code:
    this.eventId();
    This is because "this" is an instance of Game_Interpreter. Otherwise, it wouldn't be possible to identify the current event.
  11. Iavra said:
    If the script is executed from a "Script..." event command, you can use

    this.eventId();This is because "this" is an instance of Game_Interpreter. Otherwise, it wouldn't be possible to identify the current event.
    Thank you, this will help a bunch.
  12. I would like to call some information, (the price,) of any item from the items.json file and put that information into a variable. Is this possible with scriptcalling or does it require a plugin?

    Something like $gameVariable[1] = item[1].price ?

    I'd also like to know if I can choose which item's price I call based on the value of a second variable.

    Like, $gameVariables[1] = item[$gameVariables[2]].price.

    I know these don't make much sense, but I hope someone understands! :(

    EDIT -- I tinkered around a bit more and figured out that I can do it like this:

    Control Variables: #10 = Scriptcall [ $dataItems[$gameVariables.value(1)].price; ]

    Hope that someone else finds it useful.
  13. Hello guys!

    So, as most of the non-programmers and enthusiasts with RPG Maker MV, my Project's JS folder is exploding with plugins since there are so many wonderful ones around and more yet to come. This left me with questions:

    1. When too much is too much? At which plugin count you should back off and rethink?

    2. Is it better (performance-wise) to have 60 plugins each with 500 lines of coding or one single plugin with 30000 lines of codings?

    3. Is is wrong, by ethical means, to merge plugins, even with the original creators being given credit at the help file, and for personal use (not reproducing the modified franken-plugin at the forum) only?
  14. Cristovao said:
    1. When too much is too much? At which plugin count you should back off and rethink?

    2. Is it better (performance-wise) to have 60 plugins each with 500 lines of coding or one single plugin with 30000 lines of codings?

    3. Is is wrong, by ethical means, to merge plugins, even with the original creators being given credit at the help file, and for personal use (not reproducing the modified franken-plugin at the forum) only?
    1. This is more dependent on what the plugins are doing then the amount you have, but this is also something you need to think about from a design perspective, do you need all the plugin bloat? As some plugins are definitely not going to work well with others.

    2. See #1, mainly the first part about what the plugins are doing. Some things code wise are faster than other things, and if the plugin is doing a lot of slow things it doesn't matter how many lines it has. A plugin with 30000 lines could be faster than a plugin with 500 lines, if the plugin with 500 lines is doing a lot of performance heavy things.

    3. By ethical means it really depends on what the terms of use of the plugin is, some plugins may have really strict terms of use where you are not allowed to reproduce/modify it, and doing what you describe may fall under that category.
  15. So in MV is there a way a can check if a skill is a certain element during the damage steps?
  16. forteller said:
    So in MV is there a way a can check if a skill is a certain element during the damage steps?
    If you mean for the damage formula box, the variable "item" is exposed, which holds information regarding the item or skill. So you can do something like:

    item.damage.elementId * 2
    in the formula box to make the damage 2x the item's element id.  "item.damage.elementId" (without quotes) is the value of the item/skills element id though.

    If however you mean for a conditional statement, you will need/should use a more advanced damage evaluation plugin. I believe Yanfly has one made.
  17. Is there a way to directly manipulate an enemy's stats using scripts and variables?

    for example:

    enemy's attack stat = (variable 67 + variable 32)/ variable 43
  18. ragnorak6608 said:
    Is there a way to directly manipulate an enemy's stats using scripts and variables?

    for example:

    enemy's attack stat = (variable 67 + variable 32)/ variable 43
    This would require a plugin to change their stats depending on when in the battle you wanted it to apply.
  19. Liquidize said:
    This would require a plugin to change their stats depending on when in the battle you wanted it to apply.
    would it be possible without a plugin if it was just at the start?
  20. Using your example in the above post, you could do something like this in a script call event (with the page settings as Battle and Turn 0):

    (function(){$gameTroop.members().forEach(function(member){member.enemy().params[2] = ($gameVariables.value(67) + $gameVariables.value(32))/$gameVariables.value(43);});})();
    It would set all enemies attack to the formula you provided when the battle starts, but again a plugin would be better, as this script call would need to be in every troop event.