JavaScript questions that don't deserve their own thread

● ARCHIVED · READ-ONLY
Started by Shaz 3413 posts Page 61 of 171 View original ↗
  1. Bryling said:
    I'm trying to figure out how to keep track of the number of basic attacks a character makes. I don't think it can be done by eventing, and I don't know how it would be scripted. Anyone know? Best regards.
    It'd be considerably easier to only track hits - you can do that just by sticking a counter into the damage formula, wrapped in an if statement that checks which character is attacking.

    If you want to be more elaborate, easiest way is to use yanfly's action sequence pack to increment the counter in the first phase of your basic attack, before it hits or misses.
  2. Restart said:
    It'd be considerably easier to only track hits - you can do that just by sticking a counter into the damage formula, wrapped in an if statement that checks which character is attacking.

    If you want to be more elaborate, easiest way is to use yanfly's action sequence pack to increment the counter in the first phase of your basic attack, before it hits or misses.

    Thanks, Restart. I'll try that.
  3. Sorry, I have another question. It's about a plugin: NeMV Tags. I can figure out the basics, but I'm completely stumped on this. I'm trying to have a weapon inflict 20% more damage when used on a enemy tagged "monster". I'm not really sure how I would do this though. Anyone familiar with the plugin and knows how it's done?
  4. Hope this is the right thread for this. Don't think it needs its own thread... I just bought Atelier Irina's new plugin. It's a recruiting board that allows me to hire party members. Only problem I'm facing is that it allows me to buy them all at once, it's not taking the party limit into account. There is a bit in the Lunatic mode that allows the user to customise the recruiting process.

    <Custom Recruit Enable>
    JavaScript Code
    JavaScript Code
    enable = JavaScript Code
    </Custom Recruit Enable>
    - Replace the JavaScript Code inside the notetags with JavaScript.
    This code will determine custom enable requirements for the recruit list.
    - 'actor' variable will refer to the actor being recruited.
    - 'enable' variable is a true/false that determines if recruiting is enabled


    So basically my question is, is there a code to make it possible to only enable a actor to be recruited if the party limit has not been reached? (Basically if i have 4 party members I will have to get rid of one to be able to recruit more?
  5. @Myst88 Hmm, well, I do not have access to the plugin to check, so the following is a bit of a guess on my part :

    Code:
    <Custom Recruit Enable>
    enable = $gameParty.size() < 4;
    </Custom Recruit Enable>
  6. Myst88 said:
    Hope this is the right thread for this. Don't think it needs its own thread... I just bought Atelier Irina's new plugin. It's a recruiting board that allows me to hire party members. Only problem I'm facing is that it allows me to buy them all at once, it's not taking the party limit into account. There is a bit in the Lunatic mode that allows the user to customise the recruiting process.

    <Custom Recruit Enable>
    JavaScript Code
    JavaScript Code
    enable = JavaScript Code
    </Custom Recruit Enable>
    - Replace the JavaScript Code inside the notetags with JavaScript.
    This code will determine custom enable requirements for the recruit list.
    - 'actor' variable will refer to the actor being recruited.
    - 'enable' variable is a true/false that determines if recruiting is enabled


    So basically my question is, is there a code to make it possible to only enable a actor to be recruited if the party limit has not been reached? (Basically if i have 4 party members I will have to get rid of one to be able to recruit more?
    Code:
    <Custom Recruit Enable>
       if ($gameParty.members().length >= 4){
       enable = false
       } else {
       enable = true
       }
    </Custom Recruit Enable>
    That should do it.
  7. @ramza Perfect. Thank you so much!
  8. Does anybody know a script call for Yanfly's In-Battle Status?
    I'd like to call it from somewhere other than the party menu.
  9. @Okk it's the last line of

    Code:
    Window_PartyCommand.prototype.makeInBattleStatusCommand = function() {
      if (!$gameSystem.isShowInBattleStatus()) return;
      var index = this.findSymbol('escape');
      var text = Yanfly.Param.IBSCmdName;
      this.addCommandAt(index, text, 'inBattleStatus', true);
    };

    if you're searching for a way to add command. If you want to merely call the window, it's more complicated than that as you need to hide everything and then show that window.

    But you show the window using
    Code:
    SceneManager._scene.commandInBattleStatus();
  10. Poryg said:
    if you're searching for a way to add command. If you want to merely call the window, it's more complicated than that as you need to hide everything and then show that window.

    But you show the window using
    I'm having some trouble. I managed to add a Status command to the actor command menu in battle, but it doesn't actually do anything. Maybe it's an issue with the privacy of Yanfly's command symbol? I don't really know javascript well enough to be sure.
    I also tried calling it in a common event, and you were right about that being more complicated; it called the status window, but never went back to the command menu, effectively soft locking the game.
  11. No, I forgot to attach the setHandler.

    The last two lines show the attachment of the handler.

    Code:
    Yanfly.IBS.Scene_Battle_createPartyCommandWindow =
      Scene_Battle.prototype.createPartyCommandWindow;
    Scene_Battle.prototype.createPartyCommandWindow = function() {
      Yanfly.IBS.Scene_Battle_createPartyCommandWindow.call(this);
      var win = this._partyCommandWindow;
      win.setHandler('inBattleStatus', this.commandInBattleStatus.bind(this));
    };

    I've also made some MV Javascript tutorial series if you're interested in knowing more.
  12. Poryg said:
    No, I forgot to attach the setHandler.

    The last two lines show the attachment of the handler.

    Code:
    Yanfly.IBS.Scene_Battle_createPartyCommandWindow =
      Scene_Battle.prototype.createPartyCommandWindow;
    Scene_Battle.prototype.createPartyCommandWindow = function() {
      Yanfly.IBS.Scene_Battle_createPartyCommandWindow.call(this);
      var win = this._partyCommandWindow;
      win.setHandler('inBattleStatus', this.commandInBattleStatus.bind(this));
    };

    I've also made some MV Javascript tutorial series if you're interested in knowing more.

    No luck, just a bunch of undefined errors. This is a more complicated problem than I thought.
    And apparently you can't actually program anything without knowing the "Syntax" or whatever.
  13. Hoping this is the right place. I don't know if it deserves it's own thread. Not sure where just a 'general discussion' section is, but this sounded like it?

    Alright. So I am importing my maps from XP to MV. Naturally, huge hurdle. However, I have been told about things like TileD. Which would ultimately lead into parallax mapping, right?

    What is THE best plugin for having multiple parallax levels? Something that wont conflict with other scripts like MOG's Weather (since that seems to have multiple weather layers).

    When looking it up, I only found old threads. One from 2015 saying to not use Bind Pictures to Map due to huge memory issues. I also had read that RMMV had memory leaking issues to begin with... but in 2016, a thread mentioned an update 1.3.2 that fixed the memory leak issue.

    I am essentially planning to do a lot of things. And I want my game to run as smoothly as possible without eating up memory or costing FPS.

    Any plugin ideas would be greatly appreciated!
  14. Hey, guys!

    So I'm using SRD's Battle Status Customizer, and I'm showing some text through it, like: `Health[${actor.hp}/${actor.mhp}]`
    I'm wondering how can I make it so that the ${actor.xx} values are a different color, since text codes don't seem to work there.
    I tried with \C[x] but it doesn't work. Since it says in the description that it should be a javascript evaluation,
    I'm guessing I should use a script for the color change as well? I just don't know what the script would be.

    Cheers!
  15. @Almightypebble Hmm, if it is evaluating the script, then try the following :

    Code:
    // 'colorId' points to the colors on the windowskin
    this.changeTextColor(colorId);
    
    // Then after your code, reset the color ...
    this.resetTextColor();
  16. @Ossra
    Ah, if I try that it just returns the new color eval as undefined.
    So if I use:
    `Health[${this.changeTextColor(10)}${actor.hp}]`
    it shows up as:
    Health[undefined100]
  17. @Almightypebble Ah, yeah, actually looking at the code, what I suggested will not work. I do not think there is a way to do so without modifying the plugin.
  18. Is it good or bad thinking to keep plugins private, because of knowing that there exist already at least one (probably better) plugin from another author, that serves the same purpose?
  19. BurningOrca said:
    Is it good or bad thinking to keep plugins private, because of knowing that there exist already at least one (probably better) plugin from another author, that serves the same purpose?

    Is it a JavaScript related question, or simply one about etiquette? If it's a question about JavaScript, I don't understand it.
  20. Anarcho-paladin said:
    Is it a JavaScript related question, or simply one about etiquette? If it's a question about JavaScript, I don't understand it.
    @Anarcho-paladin: Neither: As plugins are written in javascript I thought this is the right place to post this question.
    I just want to know if it makes sense to release another plugin for the same purpose of an already existing one. Some plugin authors do that, but I see no much sense in doing that. People might not even pick it up, as they have already a working plugin for the purpose. Maybe my opinion is completely wrong.