JavaScript questions that don't deserve their own thread

● ARCHIVED · READ-ONLY
Started by Shaz 3413 posts Page 51 of 171 View original ↗
  1. Anyone mind helping me with a small issue with Yanfly's Class Base Parameters?

    It allows a custom formula for stats based on class through the use of notetags. An example from Yanfly is shown below.

    <Custom Class Parameters>
    maxhp = level * 30 + 300;
    </Custom Class Parameters>

    What I would like is for it use defense, like this:
    <Custom Class Parameters>
    maxhp = level + 30 + def;
    </Custom Class Parameters>

    However, that does not work. It works correctly aside from adding in the users defense.

    Thanks!!
  2. Hi,
    I have a small question about critical popups. Is it possible to add an exclamation mark when a hit is critical? In the same damage popup (e.g. 100 !). I have seem some plugins that add a "Critical" text but it is a separate popup.
  3. Shinma said:
    Anyone mind helping me with a small issue with Yanfly's Class Base Parameters?
    ...
    However, that does not work. It works correctly aside from adding in the users defense.

    It works, it's just that its meant to help with base parameters, not something dynamic to change anytime you change defense.
  4. @DarkHyudrA Thanks for the response. I use Yanfly's debugger to test out changes. I can alter the level of the character through the debugger and see the HP increase by the level increase. If I am understanding you correctly, there is no way to have it pull in the current 'def' value?
  5. Exactly @Shinma , it only updates when you level up, its doesnt update all the time.
  6. @DarkHyudrA Right, that part works as intended. I cannot get it to add in the defense value to the equation, though.

    As an example:
    <Custom Class Parameters>
    maxhp = level + 30 + def;
    </Custom Class Parameters>

    Starting off at level 1, with 1 defense should start with 32 HP. ( 30 = 1 + 30 + 1). If you are getting that to work properly then I need to see if I have a conflict somewhere.

    *Edit*
    For anyone else that would like an answer on this. The official response from @Yanfly is: You can use user.def to represent it, but this is something I don't recommend doing as it can cause a potential infinite loop.
  7. I am trying to access the region an event is currently on at any specific time. It looks like, from the script call list, that this is the script check I need to use: $gameMap.regionId(x, y);

    However, since the event is not stationary, I need the X and Y to be wherever it currently is. I see that I can set variables equal to the event's X and Y positions. In order to call that in the above script call, would be something like:

    $gameMap.regionId($gameVariable(1), $gameVariable(2));

    If not, how would I allow that to read a variable for the X and Y?
  8. $gameMap.regionId($gameVariable(1), $gameVariable(2));

    Should be:
    Code:
    $gameMap.regionId($gameVariables.value(1), $gameVariables.value(2));
    $gameVariables itself contains an array of data, so the value(x) function is used to grab the value of the given variable x

    If you know the event id, you can do it on one line like this without having to use game variables:
    Code:
    $gameMap.regionId($gameMap.event(ID).x, $gameMap.event(ID).y));
    (replace ID with the event ID)
  9. Slight question about the rules on this thread.
    If we ask a Javascript question on here, and it goes unanswered for almost 4 months, what would be the best thing to do? (Ie, wait for it to be answered, re-post the question, post the question in a different thread, etc.)
  10. @Aloe Guvner Thank you so much!

    edit:
    @GameFire Sorry I missed your question the other day - I don't think you need to wait 4 months to repost your question. If it's been even say, a week, and there have been other replies and your question is now a bit buried, please feel free to repost it.
  11. I posted this elsewhere but figured I'd try again here. Hopefully putting this here isn't out of line (feel free to move my post mods)!

    I haven't made too many posts here and wouldn't be surprised if I missed an existing thread for this, but I was wondering about how to go about making a skill that does the following:

    -Upon using this skill, the actor gains a state in which finishing off an enemy gives the affected actor a magic attack boost of x until the end of battle.

    I am using a number of Yanfly Engine plugins and I am confident that there's a relatively simple way to implement this type of skill/state using them. I tried modifying a bit of code from his tips and tricks video about Mejai's Soulstealer from League of Legends, but what I'm trying to do involves a skill/state rather than an equipable item (in the Tips and Tricks video, Yanfly uses Equip Core and Battle Statistics Core, but I imagine that for what I'm trying to do I need Buffs and States Core/Skill Core/Auto Passive States?). The code I tried was the following in a state notebox:

    <Custom Parameters>

    var furnace = 0;

    furnace += user.killCount() * 1;

    mat = furnace * 5;

    </Custom Parameters>

    I used this code with the Battle Statistics Core, so at the very least the game should be keeping track of the user's kill count. With that said, Yanfly's tip video on the matter applies the effect to an item, not a skill. My javascript knowledge is relatively small so there are probably other factors I missed in trying to alter the code, but I do understand some of the basics. Any assistance would be greatly appreciated!
  12. Gray96 said:
    I posted this elsewhere but figured I'd try again here. Hopefully putting this here isn't out of line (feel free to move my post mods)!

    I haven't made too many posts here and wouldn't be surprised if I missed an existing thread for this, but I was wondering about how to go about making a skill that does the following:

    -Upon using this skill, the actor gains a state in which finishing off an enemy gives the affected actor a magic attack boost of x until the end of battle.

    I am using a number of Yanfly Engine plugins and I am confident that there's a relatively simple way to implement this type of skill/state using them. I tried modifying a bit of code from his tips and tricks video about Mejai's Soulstealer from League of Legends, but what I'm trying to do involves a skill/state rather than an equipable item (in the Tips and Tricks video, Yanfly uses Equip Core and Battle Statistics Core, but I imagine that for what I'm trying to do I need Buffs and States Core/Skill Core/Auto Passive States?). The code I tried was the following in a state notebox:

    <Custom Parameters>

    var furnace = 0;

    furnace += user.killCount() * 1;

    mat = furnace * 5;

    </Custom Parameters>

    I used this code with the Battle Statistics Core, so at the very least the game should be keeping track of the user's kill count. With that said, Yanfly's tip video on the matter applies the effect to an item, not a skill. My javascript knowledge is relatively small so there are probably other factors I missed in trying to alter the code, but I do understand some of the basics. Any assistance would be greatly appreciated!

    So, first off, it's worth noting that this won't give a boost of X, but rather just set MAT to X * 5. I'm sure you're aware of that.
    Off the top of my head, I'd use Yanfly's Skill Core for this. I, actually myself, already do. Not for this specific thing, of course, but similar.

    Code:
    if (a.isStateAffected(StateID)) {
    if (b.hp <= 0) {
    Code Here
    };
    user.startDamagePopup();
    };

    The big thing I'm thinking is going to be an issue, is that you're overwriting what MAT is. So, after the battle ends, how does it know to scale it back down? Or what to scale down to?
  13. ZServ said:
    So, first off, it's worth noting that this won't give a boost of X, but rather just set MAT to X * 5. I'm sure you're aware of that.
    Off the top of my head, I'd use Yanfly's Skill Core for this. I, actually myself, already do. Not for this specific thing, of course, but similar.

    Code:
    if (a.isStateAffected(StateID)) {
    if (b.hp <= 0) {
    Code Here
    };
    user.startDamagePopup();
    };

    The big thing I'm thinking is going to be an issue, is that you're overwriting what MAT is. So, after the battle ends, how does it know to scale it back down? Or what to scale down to?

    I fiddled around for a bit and settled on a magic attack BUFF instead of a boost of X, so the skill in question simply adds a state with the notetag:

    <Custom Establish Effect>

    if (target.hp <= 0) {

    user.addBuff(4, 2);

    }

    </Custom Establish Effect>

    So while the state is active, getting a finishing blow successfully adds a magic attack buff for 2 turns. In conjunction with Yanfly's Buffs and States Core, I have the parameters set such that getting another killing blow while one buff is active will indeed stack the buff, while simply resetting the turns to 2 rather than adding an additional 2. Basically, the player is rewarded for more killing blows during this "time limit". Thank you for your post though, just wanted to let you know how I went about modifying my original problem to more or less solve it. Happy RPG making!
  14. Hello. i have a action sequence that i like but i want it to go faster. how do i increase the sequence speed.
    (its an attack where the actor dashes through the enemy, from the same direction multiple times. kinda like the flash running around the world to keep hitting the guy from the same direction multiple times.


    The Sequence
    <Target Action>

    move user: BACKWARD, 100, 30

    face user: target

    move user: BACKWARD, 100, 30

    face user: target

    motion escape: user

    move user: BACKWARD, 100, 20

    face user: target

    wait: 30

    move user: forward, 1200, 1

    move user: target, back base, 30

    wait for movement

    motion swing: user

    action animation

    action effect

    move user: forward, 300, 30

    move user: backward, 1500, 1

    wait for movement

    move user: home, 40

    move user: BACKWARD, 100, 30

    face user: target

    move user: BACKWARD, 100, 30

    face user: target

    motion escape: user

    move user: BACKWARD, 100, 20

    face user: target

    move user: forward, 1200, 1

    move user: target, back base, 30

    wait for movement

    motion swing: user

    action animation

    action effect

    move user: forward, 300, 30

    move user: backward, 1500, 1

    wait for movement

    move user: home, 40

    move user: BACKWARD, 100, 30

    face user: target

    move user: BACKWARD, 100, 30

    face user: target

    motion escape: user

    move user: BACKWARD, 100, 20

    face user: target

    move user: forward, 1200, 1

    move user: target, back base, 30

    wait for movement

    motion swing: user

    action animation

    action effect

    move user: forward, 300, 30

    move user: backward, 1500, 1

    wait for movement

    move user: home, 40

    move user: BACKWARD, 100, 30

    face user: target

    move user: BACKWARD, 100, 30

    face user: target

    motion escape: user

    move user: BACKWARD, 100, 20

    face user: target

    move user: forward, 1200, 1

    move user: target, back base, 30

    wait for movement

    motion swing: user

    action animation

    action effect

    move user: forward, 300, 30

    move user: backward, 1500, 1

    wait for movement

    move user: home, 40

    perform finish

    </Target Action>
  15. @GenoGold that's not really a Javascript question, that seems more like an Action Sequence question. I assume you mean Yanfly Action Sequences?
    You may want to post to the Action Sequence thread.
  16. Hi guys! I'm using Moghunter's Chrono Engine for a game I have made a lot of custom art for and finally making some traction. I was wondering if anyone could help me or direct me towards the correct thread/information regarding changing the 'walking battlers' in this engine to another spritesheet I have prepared for this purpose?

    Basically Chrono Engine uses a character's default walking sprite as a battler and I'm wanting to change this.
  17. Hi, I believe this has been answered but can't find the thread for it.

    I want to swap the default font for Calibri Light:
    Spoiler
    Untitled.png

    I've managed to change the font to the one I want, but the outline and colors don't change even when I change the font's html color to black, rgba outline color to white, and outline thickness to 0 in rpg_core

    I've tried Yanfly's font plugin with message core, but no changes happened.

    So, how do I swap fonts?
  18. Hello, I have what might be a simple question, but I can't seem to figure how to do it.

    So I'm redesigning the UI for my project, using Yanfly's Menu Manager and other plugins (Equip Core, etc), that change the UI as a base. For the main menu (the first of the ones I'm working on) I've been trying to add some space between the Command Window's text so they are not all so close together for when I do the final graphics (I already have a plugin based on the Alt3 Menu plugin done that will give a transparent background for all the windows that I can insert the graphics into).

    I already have a plugin written that arranges the main menu how I want it, so all I need help on figuring out is the code to get the spacing I need. I've already tried:

    Window_MenuCommand.prototype.textPadding = function() {
    return 25;
    };

    But all that does is add padding to the left of the text. (And possibly the right as well, since the higher the number I put in the more squished the text starts to look. I'd like to put the padding on the bottom instead.

    That said, what I would really prefer to do is adjust the hight of the rows for the command selections. since I suspect padding the bottom will just throw off the highlighting when a command is selected.

    This is a screenshot of what the Command Windows looks like with no spacing or padding at all:

    Screen%20Shot%202018-08-09%20at%201.50.21%20PM_zps0auyr5dq.png

    And this is what it looks like when I use the code I noted above and give it 25 padding:

    Screen%20Shot%202018-08-09%20at%202.19.02%20PM_zps1skedce8.png
  19. @Morrigan01 Try adjusting the "lineHeight" for that window.

    Code:
    Window_MenuCommand.prototype.lineHeight = function() {
        return 36;
    };
  20. Aloe Guvner said:
    @Morrigan01 Try adjusting the "lineHeight" for that window.

    Code:
    Window_MenuCommand.prototype.lineHeight = function() {
        return 36;
    };

    @Aloe Guvner

    Yes! That worked! Thank you so much!