JavaScript questions that don't deserve their own thread

● ARCHIVED · READ-ONLY
Started by Shaz 3413 posts Page 117 of 171 View original ↗
  1. RMMV: Attempting to make a state deal a set amount damage to an enemy at the start of their turn, not using a negative hp regen trait... using Yanfly's Buffs&StatesCore

    Buffs & States Core (YEP) - Yanfly.moe Wiki
    I've been teaching myself the javascript as I go but I cant seem to figure this one out. Any help appreciated
  2. SSAyato said:
    RMMV: Attempting to make a state deal a set amount damage to an enemy at the start of their turn, not using a negative hp regen trait... using Yanfly's Buffs&StatesCore
    Welcome!

    Looking at the plugin instructions, we can find:
    "Turn Start: Whenever the battler's turn starts."

    Then you might reference the pinned thread with MV script calls (or just Google "rpg maker mv script deal damage" or something like that). You end up with:
    Code:
    <Custom Turn Start Effect>
    user.gainHp(-X);
    </Custom Turn Start Effect>
    where X is the amount of HP to lose.

    If it doesn't display the damage on its own, you might need to add a line with user.startDamagePopup()
  3. ATT_Turan said:
    Welcome!

    Looking at the plugin instructions, we can find:
    "Turn Start: Whenever the battler's turn starts."

    Then you might reference the pinned thread with MV script calls (or just Google "rpg maker mv script deal damage" or something like that). You end up with:
    Code:
    <Custom Turn Start Effect>
    user.gainHp(-X);
    </Custom Turn Start Effect>
    where X is the amount of HP to lose.

    If it doesn't display the damage on its own, you might need to add a line with user.startDamagePopup()
    Thank you so much!
  4. Not sure if it's the right thread, but I was wondering how hard would it be to make it so the RMMZ software allows to drag and drop the Common Events in the Databse menu so you are able to reorganize them visually without changing their unique ID.

    And the same with the Switch/Variables/all similar lists in the Database.
  5. Narch said:
    Not sure if it's the right thread, but I was wondering how hard would it be to make it so the RMMZ software allows to drag and drop the Common Events in the Databse menu so you are able to reorganize them visually without changing their unique ID.

    And the same with the Switch/Variables/all similar lists in the Database.
    You can't modify the editor. Plugins can only affect gameplay.
  6. ATT_Turan said:
    You can't modify the editor. Plugins can only affect gameplay.
    I mean, I was not speaking of plugins. But I realise now this whole section of forum is in Javascript/Plugin Support.
  7. Narch said:
    I mean, I was not speaking of plugins. But I realise now this whole section of forum is in Javascript/Plugin Support.
    Well, you posted in a specific thread entitled "JavaScript questions," and JavaScript is used in MV and MZ to write plugins. :wink:

    But the first part of my initial response still applies - you can't modify the editor. All of the database tabs list in order of ID and that can't be changed.
  8. How can I make a state that removes a state category as soon as it is applied to the user of the state? I'm trying to make a state that removes all negative states as soon as one is applied, and for that I created a state that would serve as a dummy for all negative states, so I just need to check if that dummy state is about to affect the battler. Apart from that I know that you need to put something between this tags: <Custom React Effect></Custom React Effect>, but I don't know much apart from that. Can you please help me? Thanks a lot for reading!

    This are the plugins I know I need to make this thing to work.

    Buffs & States Core (YEP) - Yanfly.moe Wiki State Categories (YEP) - Yanfly.moe Wiki
  9. ATT_Turan said:
    Well, you posted in a specific thread entitled "JavaScript questions," and JavaScript is used in MV and MZ to write plugins. :wink:

    But the first part of my initial response still applies - you can't modify the editor. All of the database tabs list in order of ID and that can't be changed.
    I think it's technically not impossible to modify the editor but it was not what I was thinking about. More about something that would interpret the database prior to its display and/or inject new data before it's displayed in the vanilla menu.

    It's beyond my level of execution but I was seeking for possible ways of attaining it. Also JSON might be too different from Javascript to be talked on this section I would guess?
  10. Narch said:
    I think it's technically not impossible to modify the editor but it was not what I was thinking about.
    Feasible and allowed under the license is two different things. You can't modify the editor itself.

    Narch said:
    More about something that would interpret the database prior to its display and/or inject new data before it's displayed in the vanilla menu.
    That is definitely possible. When the game is launched, all the database info gets transferred into global objects, so it would be possible to modify those.

    Narch said:
    Also JSON might be too different from Javascript to be talked on this section I would guess?
    I don't see why it can't be discussed in here. Coding sections are mainly divided into everything coding related for RMMZ and RMMV (javascript) and the RMVXA, VX, and XP section (ruby/rgss). So anything coding relating to RMMZ and RMMV is fine.
  11. Narch said:
    I think it's technically not impossible to modify the editor but it was not what I was thinking about. More about something that would interpret the database prior to its display and/or inject new data before it's displayed in the vanilla menu.

    It's beyond my level of execution but I was seeking for possible ways of attaining it. Also JSON might be too different from Javascript to be talked on this section I would guess?

    Your best bet would probably to build a tool that parses all the game files, and lets you dragon and drop the order of various things, and then detects (upon hitting save) all the users of all the old variables / switches / common events and updates them everywhere.

    It wouldn't be a trivial tool to build though.
  12. Gargoyle77 said:
    How can I make a state that removes a state category as soon as it is applied to the user of the state? I'm trying to make a state that removes all negative states as soon as one is applied, and for that I created a state that would serve as a dummy for all negative states, so I just need to check if that dummy state is about to affect the battler.
    This seems like a roundabout way to do it. Is there some reason you can't just give the skill that would apply this dummy state the notetag from the plugin you linked to: <Remove State Category: x> ?
  13. ATT_Turan said:
    This seems like a roundabout way to do it. Is there some reason you can't just give the skill that would apply this dummy state the notetag from the plugin you linked to: <Remove State Category: x> ?
    Sorry if I didn't explain myself properly. What I want is a state that'd serve as a shield that will block and remove the next negative state that targets the user. In my project, the state doesn't need to remove negative states already affecting the user because the state won't be applied if the user already has negative states (I already know how to do this last part, I just wanted to give more context).
  14. Gargoyle77 said:
    Sorry if I didn't explain myself properly. What I want is a state that'd serve as a shield that will block and remove the next negative state that targets the user.
    Okay - the trick here is that you're looping around the standard process for this in RPG Maker (give your state the State Resist trait for all states you want to block). You can do it this way, but you'd be allowing the negative state to apply then removing it immediately after, so it won't stop any, say, Custom Apply Effects that negative state might have.

    The other problem is the timing - Custom Respond happens before the incoming attack applies effects, e.g. states.

    So I'd suggest you add a State Resist for each state in your category, then give it:
    Code:
    <Custom Deselect Effect>
    if (this.item().effects.some(effect => effect.code==EFFECT_ADD_STATE && $dataStates[effect.dataId].category.contains("debuff")));
        target.removeState(X);
    </Custom Deselect Effect>
    where "debuff" is the name of the state category you're blocking and X is the ID of your protective state.

    That should cause it to resist applying the state and then be removed. If that doesn't work, you should post your own thread in plugin support.
  15. I have :
    gameVariables.value(1)
    gameVariables.value(2)
    gameVariables.value(3)

    I want to use a conditional branch to check if 1 = 1 + (2 x 3)

    What should I put in the event command?
  16. Narch said:
    I have :
    gameVariables.value(1)
    gameVariables.value(2)
    gameVariables.value(3)

    I want to use a conditional branch to check if 1 = 1 + (2 x 3)

    What should I put in the event command?
    I assume you mean the variables 1, 2 and 3 and not the integers.
    Script : $gameVariables.value(1) = $gameVariables.value(1) + $gameVariables.value(2) * $gameVariables.value(3)
  17. Narch said:
    I have :
    gameVariables.value(1)
    gameVariables.value(2)
    gameVariables.value(3)
    That's not correct syntax - you need to prepend $ to the beginning of $gameVariables.

    Narch said:
    I want to use a conditional branch to check if 1 = 1 + (2 x 3)

    What should I put in the event command?
    Code:
    !$gameVariables.value(2) || !$gameVariables.value(3)

    The only that mathematical equation can happen is if variable 2 or 3 is 0.

    AquaEcho said:
    Script : $gameVariables.value(1) = $gameVariables.value(1) + $gameVariables.value(2) * $gameVariables.value(3)
    That's not quite right - one = is to assign a value. Narch asked how to check if it is equal to that. So you'd use == (and also the whole thing can be shortened, as above :wink:)

    Also, you can't assign using the value() method like that, you would have to use setValue().
  18. ATT_Turan said:
    That's not quite right - one = is to assign a value. Narch asked how to check if it is equal to that. So you'd use == (and also the whole thing can be shortened, as above :wink:)
    Yeah, I just noticed that after I posted it. I didn't proofread.
  19. I'm trying to edit a window from a plugin (Terms of service says i can) so I was wondering what line i'm looking for to change the font of the plugin window. Is there a certain line im looking for or is it different with each plugin
  20. alltheyuriz said:
    I'm trying to edit a window from a plugin (Terms of service says i can) so I was wondering what line i'm looking for to change the font of the plugin window. Is there a certain line im looking for or is it different with each plugin
    This is at least the third time you asked for help with a plugin without saying what the plugin actually is.