JavaScript questions that don't deserve their own thread

● ARCHIVED · READ-ONLY
Started by Shaz 3413 posts Page 73 of 171 View original ↗
  1. DarkPlasmaBall said:
    I'm using Yanfly's EquipCore plug-in to allow my party members to each equip up to 4 accessories at the same time, using the class notetag <Equip Slot: 1, 2, 3, 4, 5, 5, 5, 5> where "5" represents accessories. This works perfectly so far. My question is: Is it possible to prevent a party member from wearing duplicate/identical accessories? I want to force each of those 4 equipped accessories to all be different, to prevent a single party member from wearing 2 or 3 or 4 of the same accessory. (I'm fine with each party member wearing accessories A, B, C, and D; I just don't want any party member wearing accessories B, B, B, and B.) Thank you!

    I don't believe it's possible without having to change the code.
  2. @DarkPlasmaBall Didn't you make a separate post about this? I'm sure I remember giving you a solution that did this.
  3. Okay, thanks Lanzy! I don't believe so, Trihan.
  4. Hoping my request is a really trivial/silly one, but would love some help with it all the same.
    I'm using Yanfly's Equip Battle Skills plugin: http://www.yanfly.moe/wiki/Equip_Battle_Skills_(YEP)

    When you go into your skills menu, it shows
    Equip Skills
    Magic
    Is there any way to make Magic show up first on the list? It seems backwards and it's kind of driving me crazy ^^;
  5. Hey everyone! I'm butting heads against an issue that's leaving me really frustrated. I've got this piece of code below, where it shows choices, but when I try to add a message to the choice action, nothing happens. There are other commands like flash screen that work, but for some reason messages don't work. Can someone help me with this?

    Code:
    $gameMessage.setBackground(0);
    $gameMessage.setPositionType(2);
    $gameMessage.setFaceImage('Actor1',0);
    
    choices = []; params = []; $gameMessage.setChoices(choices, 0);
    
    choices.push("Yes");
    choices.push("No");
    params.push();
    
    $gameMessage.setChoiceCallback(function(responseIndex)
    
    {if (responseIndex ===0) {$gameMessage.add("aaaaa");}
    
    else {$gameMessage.add("bbbb");}
    
    });
  6. Creative Ed said:
    Hey everyone! I'm butting heads against an issue that's leaving me really frustrated. I've got this piece of code below, where it shows choices, but when I try to add a message to the choice action, nothing happens. There are other commands like flash screen that work, but for some reason messages don't work. Can someone help me with this?

    Code:
    $gameMessage.setBackground(0);
    $gameMessage.setPositionType(2);
    $gameMessage.setFaceImage('Actor1',0);
    
    choices = []; params = []; $gameMessage.setChoices(choices, 0);
    
    choices.push("Yes");
    choices.push("No");
    params.push();
    
    $gameMessage.setChoiceCallback(function(responseIndex)
    
    {if (responseIndex ===0) {$gameMessage.add("aaaaa");}
    
    else {$gameMessage.add("bbbb");}
    
    });


    According to the core code, you require a cancelType value aswell.
    Perhaps that lead to the function not being executed.

    JavaScript:
    Game_Message.prototype.setChoices = function(choices, defaultType, cancelType) {
        this._choices = choices;
        this._choiceDefaultType = defaultType;
        this._choiceCancelType = cancelType;
    };

    Edit:
    Nevermind. I misread your post. It's been a long day. Sorry.

    Edit2:
    I found this in the forum, seems to have the same problem.
    click me
  7. Lanzy said:
    According to the core code, you require a cancelType value aswell.
    Perhaps that lead to the function not being executed.

    JavaScript:
    Game_Message.prototype.setChoices = function(choices, defaultType, cancelType) {
        this._choices = choices;
        this._choiceDefaultType = defaultType;
        this._choiceCancelType = cancelType;
    };

    Edit:
    Nevermind. I misread your post. It's been a long day. Sorry.

    Edit2:
    I found this in the forum, seems to have the same problem.
    click me

    Thanks for the response! It seems like this will be really hard to do, which will make what I want to do very difficult. Thanks anyway!
  8. So lately, I've been trying out HimeWorks' "Weapon Damage" plugin to try to do the following: incorporate an actor's level to the scaling of a weapon's damage. To Reword, effectively I want the weapon to get stronger as they level up, using an algorithm. I've tried a couple things and searched around with little success, and am asking this for the following:
    -If possible with this plugin, how would I go about it?
    -If not possible with this plugin, is there another plugin I can use to create this feature?
    -If it's already possible without a plugin, how would I go about doing it?

    EDIT: Ended up finding a solution.
  9. So, I wish to make a state that is like a hybrid of poison and Pokemon's paralysis. I'll call it Neurotoxin and it's a state that lasts for 5 turns. Every turn the opponent will take poison damage (slightly stronger than the normal poison) but there is a 1/4th chance that instead of getting poison damage for that turn they instead get immobilized, unable to fully execute the action they're suppose to do in that turn. For my poison I prefer using Yanfly's Custom DoT and I am also aware of Yanfly's Paralysis Tips and Tricks. The question is: is it possible to make this state?
  10. Hi, I'm using this script to set the name of a skill.
    It seems to be working but, during the action, it is shown with its original name.
    Code:
    $dataSkills[438].name = $gameActors.actor(16).name()
  11. Super015 said:
    Hi, I'm using this script to set the name of a skill.
    It seems to be working but, during the action, it is shown with its original name.
    Code:
    $dataSkills[438].name = $gameActors.actor(16).name()

    Where exactly do you put this code?
  12. Lanzy said:
    Where exactly do you put this code?
    In a script call, after deciding on a hero's name.
  13. Super015 said:
    In a script call, after deciding on a hero's name.

    The problem with changing $dataSkills in itself, is that it is a copy of the Skills.json in the data folder and everytime you start the game it will load the games data from the database. Meaning that you would have to change $dataSkills[438].name every time the game loads.

    So we need to change the skill name, when the skill name is being called. You said during the action it shows the original name. Do you mean during a battle? That means everywhere else it works?
  14. The original name is shown only at the top, with the icon, during the animation.
  15. Does anyone know if there's a way to make damage over time damage (from Yanfly's Extended Damage Over Time plugin) appear in the battle log up the top of the screen (i.e. 'Slime took 200 damage from Poison')?
  16. Is there a way to speed up, slow down, or stop frames from sideview characters.

    Like if I make a character faster, the frame rate of that character changes from this:
    ani1.gif
    to this:
    ani2.gif

    Or if if time freezes then the character dose this:
    1.png

    Any way to do this.
  17. @unholywolf You could use the following :

    Code:
    (function () {
    
      var OssraQuickEdit_GameActor_initMembers = Game_Actor.prototype.initMembers;
    
      Game_Actor.prototype.initMembers = function() {
        OssraQuickEdit_GameActor_initMembers.call(this);
    
        this._motionSpeed = 12;
      };
    
      var OssraQuickEdit_SpriteActor_motionSpeed = Sprite_Actor.prototype.motionSpeed;
    
      Sprite_Actor.prototype.motionSpeed = function() {
        return this._actor ? this._actor._motionSpeed : 12;
      };
    
    })();

    Then you could control the animation speed as well as what motion is being used.

    Code:
    // Fast animation
    $gameActors.actor(1)._motionSpeed = 5;
    
    // Change motion being displayed
    $gameActors.actor(1).requestMotion('wait'); // 'Freeze' the character in place
  18. Is there an equivalent to Yanfly Skill Core's Custom Executions for items?

    I'm trying to make an item that will target all members of a battle, but only have an effect on those who have a certain state.

    This is the code I have, and it only works for skills, not items:
    <Custom Execution>
    if (a.isStateAffected(25)) {
    a.addState(30);
    };


    if (b.isStateAffected(25)) {
    b.addState(30);
    };
    </Custom Execution>
  19. Silly question, but I'm seeing some unexpected behavior.

    II'm trying to modify a plugin that I already have installed.

    In plugin A we have:
    JavaScript:
    var ExampleFunction = Game_Player.prototype.startMapEvent;
    Game_Player.prototype.startMapEvent = function(x, y, triggers, normal) {
        //stuff
    };

    I want to overwrite this method, I've tried simply copying it into another file and rewriting the function but that does not appear to work?

    I've also tried the following, to no avail:
    JavaScript:
    var ExampleFunction = Game_Player.prototype.NEWFUNCTION;
    Game_Player.prototype.NEWFUNCTION = function(x, y, triggers, normal) {
        //Modified stuff
    };

    EDIT: I fixed it, It seemed that in my File B I was missing a };
  20. Are there any script calls I can use to store the last Skill ID used, and the last actor/enemy ID to have acted? Ideally, I would use these in a common event directly after the skill is used.