JavaScript questions that don't deserve their own thread

● ARCHIVED · READ-ONLY
Started by Shaz 3413 posts Page 65 of 171 View original ↗
  1. Okay, you made me look into the actual js file. In your case specifically, you get the variable item by calling this.item() so, yes, you can do that. I'm not sure what else you need.
  2. caethyril said:
    Oh, just checked the code of Yanfly's Skill Core; looks like you should replace skill with item, i.e.
    JavaScript:
    if (!user.isLearnedSkill(item.id)) {
      user.learnSkill(item.id);
      var text = user.name() + ' discovered the formula for ';
      text += item.name + '!';
      $gameMessage.add(text);
    }
    Worked like a charm! Thanks so much!
  3. Hi, in Yanfly's YEP_X_AftermathLevelUp.js there is a variable called TextManager.exp, which prints the text from the database field "EXP:" (Terms / Basic Statuses). I would love for it to fetch from the field "EXP (abbr.):" instead. Is there a way I can make that happen?

    Edit: TextManager.expA worked
  4. Hi, simple question (I hope^^). It's about the Yanfly Core Engine Plugin. You can use "digit grouping" for numbers to group with a comma.
    Because my game is german, I want to change the comma "," to a dot "."
    Someone knows where in the code I can find this?
  5. This ought to be a simple question but I am having a devil of a time trying to figure it out.

    All I want to do is a straight up conditional branch that checks if the party leader is Actor 1. That should look like
    JavaScript:
     $gameParty.leader().actorId == 1
    ... right? No plugin, nothing crazy. Literally just a simple conditional statement in an event that shows green text if Actor 1 is the leader, and purple if he's not. BUT, I'm getting purple text all around. I feel like this should be easy but it's driving me up the wall and making me feel really stupid.

    EDIT 1: I also thought maybe I was missing some syntax, so I did $gameParty.leader().actorId == '1'. Same result.

    EDIT 2: I tried $gameParty._battleMembers(0) == 1 and got a game-crashing error. I want to cry.
  6. BlueBomber000 said:
    All I want to do is a straight up conditional branch that checks if the party leader is Actor 1. That should look like
    JavaScript:
     $gameParty.leader().actorId == 1
    ... right?

    I am not familar with JS and I don't know if it makes any difference, but according to the RMMV Script Call List it should be:

    JavaScript:
    $gameParty.leader().actorId() == ID
  7. Zion said:
    I am not familar with JS and I don't know if it makes any difference, but according to the RMMV Script Call List it should be:

    JavaScript:
    $gameParty.leader().actorId() == ID

    OMG, I feel SO dumb. Thank you so much, Zion! Great googly moogly, I don't know HOW I missed that. What RMMV Script Call List are you referring to, because I didn't catch it in the one I have?

    EDIT: Given that you literally just schooled me on something simple, I'm probably the last person you want to take an answer from :confused: (haha), but regarding your question on where in to find the digit grouping code in YEP Core Engine, I saw this near the very bottom of the script:

    JavaScript:
    //=============================================================================
    // New Function
    //=============================================================================
    
    Yanfly.Util = Yanfly.Util || {};
    
    Yanfly.Util.toGroup = function(inVal) {
      if (typeof inVal !== 'string') { inVal = String(inVal); }
      if (!eval(Yanfly.Param.DigitGroup)) return inVal;
      return inVal.replace(/(^|[^\w.])(\d{4,})/g, function($0, $1, $2) {
        return $1 + $2.replace(/\d(?=(?:\d\d\d)+(?!\d))/g, "$&,");
      });
    };

    I would imagine replacing "$&," with "$&." would do what you need, but again, given my history, I'm probably not who you should be listening to :biggrin:
  8. BlueBomber000 said:
    OMG, I feel SO dumb. Thank you so much, Zion! Great googly moogly, I don't know HOW I missed that. What RMMV Script Call List are you referring to, because I didn't catch it in the one I have?
    No problem, glad I could help you out :rhappy:
    This is the script call list:

    click


    BlueBomber000 said:
    I would imagine replacing "$&," with "$&." would do what you need, but again, given my history, I'm probably not who you should be listening to :biggrin:
    Thank you for your help, I really appreciate that :rhappy:
    Unfortunately, this is the same idea I had myself - but it doesn't work.
  9. I don't know where to put this, so I'll put this here. I got several yanfly plugins and put them in my game early last year, but I heard he changed the TOS recently when they went paid. Can I still use them, or do I have to pay to use them now? I plan on buying the plugins if I put them in any future games.
  10. From Yanfly's post on Pa tre on [since the autofilter seems to think the full word is a url] (which you can see without being a Patron):

    Q2. If an individual already owns the plugins before the paywall, can that individual keep them? And how can old users be distinguished from new users?

    A2. Any individual that already owns the plugins prior to the paywall are free to keep and use them provided that follow the new ToS regarding redistribution. There is no way to distinguish old users from new users. All I can do is just believe in whatever honor people have left.

    And this is the ToS regarding distribution:
    Redistribution of the plugins and its code, outside the scope of game projects, is strictly forbidden outside of the host website, Yanfly.moe, and by the following sites/members: itch.io. However, special permission has been granted to these individuals/entities for redistribution of the plugins as long as the plugins remain in their updated form: Archeia, Visustella, Ækashics Librarium, Caz Wolf, Raim, DreamX, Fallen Angel Olivia, Atelier Irina, Aries of Sheratan, Arisu's Dollhouse, Munokura of FunGameMake. This list may be updated in the future.

    So yes, you're allowed to keep and use the plugins as long as you got them before they went paid.
  11. How would i go about editing some plugins so that they add a close menu command at the end of the command window?
    For example I would like to have a close menu command in my skill, item and equip scenes. I'm using yep's plugins and notice that some of the other yep plugin menus have a cancel or return command, like the status menu core plugin, but these main ones don't.
  12. Is there a way to do a check for "if player has been standing still for x frames"? I know there's $gamePlayer.isMoving() for checking whether they're moving or not, but I'm trying to do a check for if the player has been standing still for, say, 30 frames.
  13. Hello, I am looking for a code that will allow me to gain resources based on the damage I have taken after mitigation.
    my knowledge of JS is nonexistence
    It is for the MV game engine.
    thank you a lot for the time and help.
  14. Hi all, i think this is the right place to ask ^^: though its only a small question so i dont think it needs its only thread,

    want to know if there is a plug in that allows for characters that are in the reserve party to appear when at camp, or in place's like a pub, or Inn? or will i have to install a autorun trigger, to empty the party and switch on any characters that have been entered into the party

    (note that im planning to have several characters for the player to choose from as well as pets and pet like characters, and if the player does not have them or has not found them yet, i dont really want 20 odd random characters sitting on top of the other party members.)
  15. So I've installed the yanfly freebie plugins for the sole purpose of fixing the game's stupid "only the basic attack skill gets to use the weapon motions" limitation. I fixed the problem, but now whenever my character uses the skill, it plays the powerup2 animation before playing skill motion and animation. How do I get rid of this?
  16. FirestormNeos said:
    So I've installed the yanfly freebie plugins for the sole purpose of fixing the game's stupid "only the basic attack skill gets to use the weapon motions" limitation. I fixed the problem, but now whenever my character uses the skill, it plays the powerup2 animation before playing skill motion and animation. How do I get rid of this?

    In the battle plugins settings change the animation to be played to 0.
  17. Zuque said:
    Hello, I am looking for a code that will allow me to gain resources based on the damage I have taken after mitigation.
    my knowledge of JS is nonexistence
    It is for the MV game engine.
    thank you a lot for the time and help.
    You may need to expand on the details. do you want it to be the type of damage taken, or the amount of damage taken? Are you using any of yanfly's plugins? I'm pretty sure one of the battle plugins will let you run some code after taking damage, so technically any code that was offered would go there.

    Also, I have my own question for the other more coding oriented:

    I am using SRD CharacterCreatorEx plugin, I haven't made any changes to the script yet, but I need to add scroll-ability to the command window that displays the folder list.... (categories like "Body" "Faceshape")
    Actually super easy to do so if anyone else runs into this problem. The code to implement is this:

    Spoiler
    Code:
    Window_CharacterCreator_FolderList.prototype.windowHeight = function() {
        return this.fittingHeight(16) + 12;
    };

    I added it right under.


    Spoiler
    Code:
    Window_CharacterCreator_FolderList.prototype = Object.create(Window_Command.prototype);
    Window_CharacterCreator_FolderList.prototype.constructor = Window_CharacterCreator_FolderList;
    
    Window_CharacterCreator_FolderList.prototype.initialize = function(mandatories) {
        this._combines = {};
        this._mandatories = mandatories;
        Window_Command.prototype.initialize.call(this);
    };
  18. Hello people!
    I learned how to call number input through sript call ($gameMessage.setNumberInput(var, digits)
    and I have it inside of my js file but the code just runs through it and doesnt wait for input
    how do I make it so the script would pause at number input and continue after an input?
  19. The solution to your problem depends on where and how you're using the number input. The engine typically handles the waiting by stopping anything from updating if $gameMessage is busy. Take a look in rpg_objects of rpg_scenes and you'll see this frequently.

    Code:
    if (!$gameMessage.isBusy()) {
       //code
    }

    What this is saying is if $gameMessage is not busy we can execute the code, otherwise don't.

    As I don't know what you're trying to achieve though, I can't say if this solution works for you. If you're creating a new object in the game that routinely updates, or adding to an existing similar object then it probably does. If you're not then you'll probably need a different solution. Potentially via aliasing the processOk method of Window_NumberInput and having it execute the rest of your code under a specific condition (again, I can't provide any specific insight without more information).
  20. In Yanfly's Battle Engine Core plugin, where is the option that lets me move the player character to the left side of the screen and what do I put in so that it performs that?