JavaScript questions that don't deserve their own thread

● ARCHIVED · READ-ONLY
Started by Shaz 3413 posts Page 21 of 171 View original ↗
  1. Reaxus said:
    tried this out, sadly the skill works even if the party leader isnt actor 3.
    thanks for replying tho!

    What do you mean by "the skill works"? This is a condition for a state.


    If you mean state:


    It's working for me. The state is applied when leader has the id 3, then removed when the leader does not have the id 3.


    Make sure that your <Passive State: x> notetag is ONLY on the actor with id 3 for this state.


    Here's the condition also with that other condition about learning a skill:


    <Custom Passive Condition>
    if ($gameParty.leader() && $gameParty.leader().actorId() === 3 && $gameParty.leader().isLearnedSkill(26)) {
    condition = true;
    }
    else {
    condition = false;
    }
    </Custom Passive Condition>


    Replace 26 with the skill id.
  2. DreamX said:
    What do you mean by "the skill works"? This is a condition for a state.


    If you mean state:


    It's working for me. The state is applied when leader has the id 3, then removed when the leader does not have the id 3.


    Make sure that your <Passive State: x> notetag is ONLY on the actor with id 3 for this state.


    Here's the condition also with that other condition about learning a skill:



    <Custom Passive Condition>
    if ($gameParty.leader() && $gameParty.leader().actorId() === 3 && $gameParty.leader().isLearnedSkill(26)) {
    condition = true;
    }
    else {
    condition = false;
    }
    </Custom Passive Condition>


    Replace 26 with the skill id.

    OMG! now it's working!!!!! thanks a ton!!!
  3. Hello, I'm having trouble reading $gameVariables from a note tag and storing it into a variable to be used later.


    What I want to do is have a note tag like <VAR X> or something to that extent, then in the script, have it take the value and store it into another variable for later use. How do I parse it right?
  4. Hi,


    I would like to know if there's a way to check the enemy party HP with a script call ?


    Because I would like to trigger a dialog when one of the enemy is low HP (so not a specific one) in a conditionnal branch.
  5. Chaos17 said:
    Hi,


    I would like to know if there's a way to check the enemy party HP with a script call ?


    Because I would like to trigger a dialog when one of the enemy is low HP (so not a specific one) in a conditionnal branch.

    Try


    $gameTroop.members().some(function(member) { return member.hpRate() <= .5});


    Replacing .5 with whatever you want.
  6. @DreamX


    Nothing happened.
  7. Chaos17 said:
    @DreamX


    Nothing happened.

    It's a condition, so it put in the script section of a conditional branch like you said.
  8. @DreamX


    I did.


    But I think the problem is the battle condition itself.


    Even if I put turn 0, the condittional branch isn't triggered :(
  9. Chaos17 said:
    @DreamX


    I did.


    But I think the problem is the battle condition itself.


    Even if I put turn 0, the condittional branch isn't triggered :(

    Try using turn end with turn as the span.
  10. DreamX said:
    Try using turn end with turn as the span.

    It works!


    Thank you :D
  11. I have a problem. In my Game_Actor class I made two new things, being sizeX and sizeY. Now, I want to use those variables as the value of each different actors when they are created in battle:


    Spriteset_Battle.prototype.createActors = function() {
    this._actorSprites = [];
    for (var i = 0; i < $gameParty.maxBattleMembers(); i++) {
    this._actorSprites = new Sprite_Actor();
    this._actorSprites.scale.x = $gameParty.members()._sizeX;
    this._actorSprites.scale.y = $gameParty.members()._sizeY;
    this._battleField.addChild(this._actorSprites);
    }
    };


    This to be exact. When I console.logged it, there's an extra thing that is printed that says it is undefined. I wonder where that came from. This is the reason why the code does not work because it equates to an undefined variable afterwards. That's why you'd have to be specific instead of using the variable i.


    Any possible solution for this?
  12. Unless you have a particular reason, there's no need to do it in that function. The actor sprite index does not necessarily correspond to the game party members index, anyway.

    Code:
        alias_Game_Actor_initMembers = Game_Actor.prototype.initMembers;
        Game_Actor.prototype.initMembers = function () {
            alias_Game_Actor_initMembers.call(this);
            this._sizeX = 1;
            this._sizeY = 1;
        };
    
        // alias the Sprite_Actor.prototype.updateBitmap function
        alias_Sprite_Actor_updateBitmap = Sprite_Actor.prototype.updateBitmap;
        Sprite_Actor.prototype.updateBitmap = function () {
            // call the original function we are aliasing
            alias_Sprite_Actor_updateBitmap.call(this);
            // check if we didn't already scale.
            if (!this._scaled) {
                // scale the sprite according to the scale variable of the actor.
                this._mainSprite.scale.x = this._battler._sizeX;
                this._mainSprite.scale.y = this._battler._sizeY;
                // mark that we scaled
                this._scaled = true;
            }
        };
  13. Ahhh that helped, DreamX. Looks okay now! <3
  14. Hello, 


    I apologize if this has been answered already, but I'm having a slight annoyance with Yanfly's Message Core. It involves the plugin command "MessageWith 400" and how it seemly goes everywhere I don't want it. Even when I don't put it in an event, it shrinks the text box regardless. The problem even bleeds into the combat where the text windows shrink and cut off words. Is there a way to turn it off and I just do not see it?


    Please and thank you. 
  15. Rizzle said:
    Hello, 


    I apologize if this has been answered already, but I'm having a slight annoyance with Yanfly's Message Core. It involves the plugin command "MessageWith 400" and how it seemly goes everywhere I don't want it. Even when I don't put it in an event, it shrinks the text box regardless. The problem even bleeds into the combat where the text windows shrink and cut off words. Is there a way to turn it off and I just do not see it?


    Please and thank you. 

    Does it not work if you just call the plugin command again with the original message box size?
  16. Is there a way to prevent an event with Event Touch activating if the event is on the edge of a cliff and player happens to walk past it (i.e. check for collisions)? I'm trying to make visible enemy encounters, but it's a bit awkward when the player gets into a battle with a monster which shouldn't be able to reach them.
  17. DreamX said:
    Does it not work if you just call the plugin command again with the original message box size?

    I could try this, but I don't know what the default size is. Please, do you know?
  18. Hi folks,


    I am curious about the funciton $gameScreen.startFlash(color, duration) used in battle.


    In the Animations tab there is a window to adjust the "SE and Flash Timing" see below:

    Spoiler
    Ux3DBCW.png


    I was wondering where the function is that knows whether it is screen / target / hide target?


    For example, in Game_Screen.startFlash:


    Game_Screen.prototype.startFlash = function(color, duration) {
    this._flashColor = color.clone();
    this._flashDuration = duration;
    };


    is the function that does flash on the screen. but no parameters for the type (screen, target, hide) etc.


    Curious on this because I want to have character's flash on conditions.


    Thanks!
  19. I may have suggested it already, but there are countless questions about how to remove or skip stats and I'm suggesting to Shaz that perhaps there can links to certain answers in the original post?
  20. I have a question about blt and numbers. I want to change the texts Lv and the HP MP numbers into an image. For example, if I use sprite, it becomes cluttered and since it gets created everytime, the sprite will just double up in the window. Is there a proper way to make the text LV into an image? How about the numbers?