How to implement every possible Yanfly Tips & Tricks effect in MZ with VisuStella plugins

● ARCHIVED · READ-ONLY
Started by Trihan 251 posts Page 5 of 13 View original ↗
  1. I have sorted my problem with the Cleric Stance. The problem was exactly as ATT_Turan suggested it could be, which was I had added the Add State trait as an effect as well.
  2. Did you ever get around to the injury system?
  3. Dark_Ansem said:
    Did you ever get around to the injury system?
    You're going to have to remind me of what I hadn't gotten around to, I don't have anything in my memory banks for outstanding work in this thread. XD
  4. Trihan said:
    You might have missed it because it was quite small.
    oh doh, it's because the injuries themselves are not there, thanks!
  5. As requested all effects are now in spoiler tags so that they're easier to scroll through and find what you need.
  6. Trihan said:
    Stockpile state:
    JavaScript:
    <JS On Add State>
    // Default the stockpile stacks to 0.
    target._stockpile = target._stockpile || 0;
    // Increase the stockpile stack by 1
    target._stockpile += 1;
    // Cap the stockpile stack at 3
    target._stockpile = Math.min(target._stockpile, 3);
    // Update the state counter for the stockpile stack
    target.setStateDisplay(state.id, target._stockpile);
    </JS On Add State>
    
    <JS On Erase State>
    // Set the user's stockpile stack to 0
    target._stockpile = 0;
    // Update the state counter for the stockpile stack
    target.setStateDisplay(state.id, target._stockpile);
    </JS On Erase State>
    I try to edit the code with my lack skill of JS but the code doesnt work ;_;. I want to make an actor gain a bonus mat based on stockpile stacks as a passive and it doesnt consuming stockpile (and stockpile stack increased every 3 turns.
    can anyone help me to achieve it?
  7. zotezha said:
    I try to edit the code with my lack skill of JS but the code doesnt work ;_;. I want to make an actor gain a bonus mat based on stockpile stacks as a passive and it doesnt consuming stockpile (and stockpile stack increased every 3 turns.
    can anyone help me to achieve it?
    What code have you tried and what is it not doing?
  8. Trihan said:
    What code have you tried and what is it not doing?
    This is the code :kaoswt:

    Code:
    <JS On Add State>
    target._stockpile = target._stockpile || 0;
    target._stockpile += 1;
    target._stockpile = Math.min(target._stockpile, 3);
    target.setStateDisplay(state.id, target._stockpile);
    </JS On Add State>
    
    <JS Pre-Damage As User>
    if ($gameParty.inBattle()) {
    const turns = user.turnCount();
    let target._stockpile = Math.floor(turns / 3);
    target._stockpile = target._stockpile.clamp(0, 3);
    target.mat = 10 * target._stockpile;
    }
    </JS Pre-Damage As User>
    
    <JS On Erase State>
    target._stockpile = 0;
    target.setStateDisplay(state.id, target._stockpile);
    </JS On Erase State>

    This is embarrassing, I just put my logic, and edit the code as I thought it will work :rswt
  9. Okay, so the issue is that you're trying to set .mat directly. That won't work, the property doesn't have an integer value you can modify.

    What you would need to do is edit the param formula so that if the param ID is 4 (mat), it adds the user's _stockpile value to the result.
  10. ATT_Turan said:
    Just change the letter in all places in the formula. The only difference is there's no such thing as "mtp," it's just 100.
    Thanks for this. So, I was wondering, if I make a mana burn that hurts all 3 of the stats (HP, MP AND TP) would it look a bit like this?

    JavaScript:
    <Bypass Armor Scaling>
    
    <Damage Formula>
    // Calculate 10% of target's current MP.
    let mp = Math.ceil(b.mp * 0.1);
    let tp = Math.ceil(b.tp * 0.1);
    // Calculate the cap: 20% of user's MaxMP.
    const cap = Math.ceil(a.mmp * 0.2);
    const cap = Math.ceil(a.100 * 0.2);
    // Determine if the MP cap is to be used.
    mp = Math.min(mp, cap);
    // Target loses MP.
    b.gainMp(-mp);
    b.gainTp(-tp)
    // Damage is equal to 50% of MP + TP damage dealt.
    value = Math.ceil((mp + TP) * 0.50);
    </Damage Formula>
  11. Dark_Ansem said:
    Thanks for this. So, I was wondering, if I make a mana burn that hurts all 3 of the stats (HP, MP AND TP) would it look a bit like this?

    JavaScript:
    <Bypass Armor Scaling>
    
    <Damage Formula>
    // Calculate 10% of target's current MP.
    let mp = Math.ceil(b.mp * 0.1);
    let tp = Math.ceil(b.tp * 0.1);
    // Calculate the cap: 20% of user's MaxMP.
    const cap = Math.ceil(a.mmp * 0.2);
    const cap = Math.ceil(a.100 * 0.2);
    // Determine if the MP cap is to be used.
    mp = Math.min(mp, cap);
    // Target loses MP.
    b.gainMp(-mp);
    b.gainTp(-tp)
    // Damage is equal to 50% of MP + TP damage dealt.
    value = Math.ceil((mp + TP) * 0.50);
    </Damage Formula>
    This won't work. You can't declare a const twice, and even if you could you'd just be replacing the first one with the second because it uses the same identifier.
  12. I see, no wonder it didn't work. Can you declare two different const values?
  13. Dark_Ansem said:
    I see, no wonder it didn't work. Can you declare two different const values?
    What do you need the second one for? You're not using it for anything.
  14. Dark_Ansem said:
    const cap = Math.ceil(a.100 * 0.2);
    Aside from the invalid syntax of declaring a variable with the same name twice (how would the computer know which one you're talking about later?), there's no such thing as a.100. It's just 100. Y'know, when you're in a battle and your TP gauge can't fill up any more, it's at 100? :stickytongue:

    So unless you're using a plugin to modify that, 20% of any actor's max TP is always just the number 20.
  15. Trihan said:
    Okay, so the issue is that you're trying to set .mat directly. That won't work, the property doesn't have an integer value you can modify.

    What you would need to do is edit the param formula so that if the param ID is 4 (mat), it adds the user's _stockpile value to the result.

    Actually my problem is the same like HiddenAlchemist

    HiddenAlchemist said:
    I used your Stockpile code exactly as you have it. I tested this with an Attack Buff state set to * 200% and used it an enemy with 10 ATK, which Libra then shows it has grown to 20 ATK as expected. However, subsequent applications of the state keeps the ATK at 20 (should be 40) even though the state counter goes up.

    I want stockpile can stack the parameter
  16. ATT_Turan said:
    Aside from the invalid syntax of declaring a variable with the same name twice (how would the computer know which one you're talking about later?), there's no such thing as a.100. It's just 100. Y'know, when you're in a battle and your TP gauge can't fill up any more, it's at 100? :stickytongue:

    So unless you're using a plugin to modify that, 20% of any actor's max TP is always just the number 20.
    I mean to do the same effect as manaburn but as a result of burning MP and TP together.
  17. zotezha said:
    Actually my problem is the same like HiddenAlchemist



    I want stockpile can stack the parameter
    Yes, and I'm telling you that

    target.mat = whatever

    Won't do anything.
  18. The "Jump" spell doesn't seem to work for me, my character stays stuck in the air and never falls...
    (After 2 turns he can act again but does not come back)
    And the target is affected by the jump state, that doesn't seem normal to me x)