JavaScript questions that don't deserve their own thread

● ARCHIVED · READ-ONLY
Started by Shaz 3413 posts Page 124 of 171 View original ↗
  1. Hello all. Is there a way to use states to check for misses in MV? Ideally I want to check and apply a state counter for each miss, but "if (b.result().missed){" doesn't seem to work w/Custom Action Effects
  2. @MiddleMang You might want to start your own thread with greater detail.

    Per the first post in this thread, it's not for plugin support - state counters come from a plugin, and I'm not sure what you're referring to with Custom Action Effects, but that sounds like plugin stuff, too.

    So as far as the JavaScript question goes, that conditional is correct for seeing if an attack missed. For help getting it to do what you want with plugins, I'd suggest making a thread with the names and links to plugins you're using.
  3. Is there a plugin for MZ that changes damage output per weapon? I would like to make this possible in MZ the way that HIME’s Weapon Damage plugin worked for MV. Apologies if this is the wrong thread in which to post this question.

    Right now, my workaround is to use @ATT_Turan's custom hit formula plugin serve as a means for Armor Class, have Max MP serve as Armor Class, and relegate the Defense stat to a 'damage die' variable, but this will only work for 1d4-1d12. I'm not too concerned with following 5e to the T, so this workaround might end up being my method, but it would be great if there was a proper solution somehow.
  4. [using MZ]

    I'm trying to make a small plugin just to disable the "step forward" when a character takes an action in SV battle, but i've only managed to find the function that plays the sprite animation (.requestMotion), so the character remains in their ready pose, but still moves forward and back when it's their turn.

    Can someone point me to where i can find the code that initiates that step forward? If i can just find it, i think i'll be able to figure things out on my own.

    Thank you.

    (The way i've been teaching myself is to just poke around until i find what i need, but that gets a bit confusing sometimes, and googling it has been a bit hard because i don't know the correct term for some stuff.)
  5. bookco said:
    Is there a plugin for MZ that changes damage output per weapon? I would like to make this possible in MZ the way that HIME’s Weapon Damage plugin worked for MV. Apologies if this is the wrong thread in which to post this question.
    Well, it is and isn't. The way you're asking it is about plugins, and the first post of this thread says it's not about plugins. This should be a new thread in Plugin Requests. However, it can be done without one, it's just not a great solution.

    You could put it in the damage formula.
    Code:
    if (a.isActor() && a.weapons().length)
    will make everything right after it only execute if the attacker is an actor wielding a weapon, since enemies don't have weapons. Then you'd do:
    Code:
    if (a.weapons()[0].id==X)
    where X is the ID of the weapon you're checking. So you'd have to do this long, nested thing:
    Code:
    if (a.isActor() && a.weapons().length) {if (a.weapons()[0].id==1) some_formula; else if (a.weapons()[0].id==2) some_other_formula; ... } else enemy_formula

    bookco said:
    Right now, my workaround is to use @ATT_Turan's custom hit formula plugin serve as a means for Armor Class, have Max MP serve as Armor Class, and relegate the Defense stat to a 'damage die' variable, but this will only work for 1d4-1d12.
    I don't understand how doing that would limit you to what "die size" is in the Defense stat. But, honestly, I suggest asking for help with a plugin. I'm pretty sure you can do this with VisuStella's Battle Core, there are notetags for different damage calculations.

    ShockerWizard said:
    I'm trying to make a small plugin just to disable the "step forward" when a character takes an action in SV battle, but i've only managed to find the function that plays the sprite animation (.requestMotion), so the character remains in their ready pose, but still moves forward and back when it's their turn.

    Can someone point me to where i can find the code that initiates that step forward?
    It is - appropriately and amusingly? - stepForward()

    So if you just want to entirely disable it, you can do:
    Code:
    Sprite_Actor.prototype.stepForward = function() {};

    ShockerWizard said:
    (The way i've been teaching myself is to just poke around until i find what i need, but that gets a bit confusing sometimes, and googling it has been a bit hard because i don't know the correct term for some stuff.)
    I'm surprised - I Google "rpg maker mz step forward" and I find several threads. None of them are about disabling the step, but they all reference the name of the function.
  6. Thank you for the help.

    ATT_Turan said:
    I'm surprised - I Google "rpg maker mz step forward" and I find several threads. None of them are about disabling the step, but they all reference the name of the function.

    Well, i feel silly now. The only time i even considered calling it a "step forward", was when i was trying to figure out how to explain it more clearly in here (to make that post), but not when i was messing around with the code. Sorry about that.
    Edit: I feel double silly now, because the sprites.js was a file i wouldn't have thought to check. I thought it would be core, or object, or even manager, but sprites? :p
  7. ShockerWizard said:
    Edit: I feel double silly now, because the sprites.js was a file i wouldn't have thought to check. I thought it would be core, or object, or even manager, but sprites? :p
    I suggest ignoring the files. That is, just search for stuff in the entire js directory. That way it will come up regardless of which file you think it might be in.
  8. Hey all,

    If I use a <JS Pre-Start Action> note tag that sets the value for m as var m = (my code here to get value) will that m be usable in a damage formula? Or do I have to set var = m in the damage formula itself always?
  9. Puppet Knight said:
    If I use a...note tag that sets the value for m...will that m be usable in a damage formula?
    No. Code inside notetags is executed by another function (eval() ), so nothing you declare inside of it can go back out to a larger scope, unless you declare it globally (which is both poor practice and unnecessary).

    I mean, even if it weren't executed by a third function, just the fact that your notetag and your damage formula aren't the same function means you can't use locally-declared variables back and forth unless you're passing them as function arguments.

    The obvious-ish alternative is to do what you might see in a ton of Yanfly Tip & Tricks, where you put the variable on the battler.
    In a notetag,
    Code:
    user.m=whatever;
    can then be accessed in a damage formula with
    Code:
    a.m

    You could also, of course, use one of MZ's global variables.
  10. Is it possible to make a skill that deals damage to an enemy while healing the caster in the process?
  11. DrBuni said:
    Is it possible to make a skill that deals damage to an enemy while healing the caster in the process?
    Damage Formulas 101
    But it's better not to put things like gainHp in the damage formula, so the preferred solution would be to use something like Yanfly's Skill Core to execute additional code when you use a skill.
  12. ATT_Turan said:
    Damage Formulas 101
    But it's better not to put things like gainHp in the damage formula, so the preferred solution would be to use something like Yanfly's Skill Core to execute additional code when you use a skill.
    I have Skill Core installed, so that shouldn't be a problem. But I have to ask why is it ill advised to put things such as gainHp in damage formulas?
  13. How would I call the item window used in battle via script call?

    Trying to set up a "Use" skill that functions like the item command without taking up a command window spot.
  14. Hi everyone. Does anyone know what this selection window called inside Window_BattleActor (RPG Maker MV)?
    I am trying to make its height taller so it goes all the way to the bottom:
    1687460093238.png
  15. The gauge or the rectangle cursor?
  16. The rectangle cursor
  17. @TESTOSTERONE I think you're talking about Window_BattleActor, "The window for selecting a target actor on the battle screen."

    There's also a corresponding Window_BattleEnemy.
  18. ATT_Turan said:
    @TESTOSTERONE I think you're talking about Window_BattleActor, "The window for selecting a target actor on the battle screen."

    There's also a corresponding Window_BattleEnemy.
    There's that rectangle selection cursor inside Window_BattleActor, and I haven't been able to figure out yet how to change its height or when/how this selection cursor gets created.

    Edit: Oooh, is it this thing?
    1687461496966.png
  19. TESTOSTERONE said:
    There's that rectangle selection cursor inside Window_BattleActor
    I think you need turn plugins on and off to figure out what's is creating it - that's not a part of the default engine.

    Are you using any Mog stuff? I feel like I've seen frilly windows-inside-windows from his suite.