The official VisuStella notetag help thread

● ARCHIVED · READ-ONLY
Started by Trihan 1458 posts Page 51 of 73 View original ↗
  1. orphen89 said:
    Did you get it to work? Tried messing with those settings but still the same result unfortunately.
    I haven't used this plugin, but it seems weird if it lets you see skills that you can't use. You see these passive skills when they're set to Skill Type: None?
  2. I cannot seem to find any help resources for "area of effect" type damage (like the YEP plugin for MV). Does Visustella support this? Am I missing anything obvious?
  3. orphen89 said:
    Did you get it to work? Tried messing with those settings but still the same result unfortunately.
    I misunderstood your request, you're right, that's not what it does.
  4. First time posting here. I am trying to get the functions of my states down, the following is a test state just to get the code in check. I am using Visustella Skills and states core.


    <JS HP Slip Damage>
    damage = (user.atk * 500)
    </JS HP Slip Damage>;

    <JS On Add State>
    damage = target.gainHp(-777)
    </JS On Add State>;

    <JS On Expire State>
    origin.addState(37);
    origin.gainHp(444);
    </JS On Expire State>

    So far the state applies a DoT as per the first notetag, and it damages for a one time 777 upon Add State as per the second. When the state expires however it applies the new state(37) to the target that had the original state, not the caster of the state and the 444 heal is no where to be found at all. I have tried target, user and origin.addState and it just keeps putting the new state on the enemy/target that had the original state.. Actor A casts the main state on enemy A and when the state expires I want Actor A to gain State37 and a onetime heal for 444.
  5. AndreaMZ said:
    <JS On Add State>
    damage = target.gainHp(-777)
    </JS On Add State>;
    This doesn't mean anything - the gainHp() function is what deals the damage. Creating a damage variable equal to it doesn't do anything. gainHp() doesn't even return a value, so your damage is going to be undefined.

    AndreaMZ said:
    When the state expires however it applies the new state(37) to the target that had the original state, not the caster of the state
    Sounds like you should submit a bug report to VisuStella. You're correctly referencing origin, and the documentation says that variable is present in the On Expire notetag.
  6. AndreaMZ said:
    First time posting here. I am trying to get the functions of my states down, the following is a test state just to get the code in check. I am using Visustella Skills and states core.


    <JS HP Slip Damage>
    damage = (user.atk * 500)
    </JS HP Slip Damage>;

    <JS On Add State>
    damage = target.gainHp(-777)
    </JS On Add State>;

    <JS On Expire State>
    origin.addState(37);
    origin.gainHp(444);
    </JS On Expire State>

    So far the state applies a DoT as per the first notetag, and it damages for a one time 777 upon Add State as per the second. When the state expires however it applies the new state(37) to the target that had the original state, not the caster of the state and the 444 heal is no where to be found at all. I have tried target, user and origin.addState and it just keeps putting the new state on the enemy/target that had the original state.. Actor A casts the main state on enemy A and when the state expires I want Actor A to gain State37 and a onetime heal for 444.
    Instructions on how to submit bug report here: http://www.yanfly.moe/wiki/Troubleshooting_Plugins_RPG_Maker_MZ
  7. 1695371107507.png
    1695371156567.pngSo I added the tutorial plugin and made sure all settings was enabled but I think I need to add it to the Main Menu command list, but I dont know the codes and I cant find it in the Help of the plugin. Anyone has any idea
  8. Hello, I'm trying to create a rmmv skill where the character heals based on love stacks and consumes them all.
    Rmmv note tag
    <Damage Formula>

    user._loveStacks = user._loveStacks || 0;

    var stacks = user._loveStacks;

    stacks = stacks.clamp(0, 10);

    var loveStateId = 117;

    user.setStateCounter(loveStateId, 'x' + stacks);

    user._loveStacks = stacks;

    // Set the chain multiplier to a value if it doesn't exist.

    this._chainmultiplier = this._chainmultiplier || 1.0;

    // This is the damage formula.

    value = (a.mhp/10) *stacks;

    }

    </Damage Formula>





    <Post-Damage Eval>

    user._loveStacks = user._loveStacks || 0;

    var stacks = user._loveStacks;

    stacks -= stacks;

    stacks = stacks.clamp(0, 10);

    var loveStateId = 117;

    user.setStateCounter(loveStateId, 'x' + stacks);

    user._loveStacks = stacks;

    </Post-Damage Eval>
    I tried to recreate it rmmz but it doesn't seem to work.

    RMMZ note tags
    <JS Pre-apply>

    user._loveStacks ??= 0;

    user._loveStacks = stacks;

    stacks = stacks.clamp(0, 10);

    var loveStateId = 117;

    user.setStateDisplay(state.id, 'x' + stacks);


    // Set the chain multiplier to a value if it doesn't exist.

    this._chainmultiplier = this._chainmultiplier || 1.0;

    // This is the damage formula.

    value = (a.mhp/10) *stacks;

    }

    </JS Pre-apply>





    <JS Post-apply>

    user._loveStacks ??= 0;

    user._loveStacks = stacks;

    stacks -= stacks;

    stacks = stacks.clamp(0, 10);

    var loveStateId = 117;

    user.setStateDisplay(state.id, 'x' + stacks);

    user._loveStacks = stacks;

    </JS Post-apply>
    For some reason, the new note tag gives zero heal to my character when I have one love stack. Any help would be appreciated, thanks.
  9. JS Pre-Apply happens before the skill executes, so there's no damage value to modify.
  10. @Krawzer_KOF You didn't copy the code correctly.

    The second line in the original:
    Code:
    var stacks = user._loveStacks;
    Declares a variable and initializes it to how many love stacks are on the user.

    Your second line:
    Code:
    user._loveStacks = stacks;
    resets the number of love stacks to an undeclared variable, thus it is now undefined

    Also what @Trihan pointed out.
  11. I used the first part inside the formula box instead of a note tag but it still gives zero health.

    damage formula
    user._loveStacks ??= 0;

    user._loveStacks = stacks;

    stacks = stacks.clamp(0, 10);

    var loveStateId = 117;

    user.setStateDisplay(state.id, 'x' + stacks);


    // Set the chain multiplier to a value if it doesn't exist.

    this._chainmultiplier = this._chainmultiplier || 1.0;

    // This is the damage formula.

    value = (a.mhp/10) *stacks;

    }

    (fixed the repeating line in the second part too)
    post apply
    <JS Post-apply>

    user._loveStacks ??= 0;

    stacks -= stacks;

    stacks = stacks.clamp(0, 10);

    var loveStateId = 117;

    user.setStateDisplay(state.id, 'x' + stacks);

    </JS Post-apply>
  12. @Krawzer_KOF I suggest you copy the code more exactly. The only thing you need to change is the name of the notetags (and you'd place the Damage notetag into the damage formula).

    The error I pointed out in my previous post is still there. Additionally, your JS Post-Apply has numerous errors with this "stacks" variable.

    1 - it doesn't exist

    2 - you have stacks -= stacks which is useless, just set it equal to 0.

    3 - the following line of math is pointless when stacks is always equal to 0 (except it won't be in your existing code because it'll be Not a Number).

    If you don't know what you're doing with the code, why don't you just actually copy what's in the original MV notetag?

    Note that several of those errors are also present on the MV notetag, so I don't know where you got it from but it never functioned correctly.
  13. If you don't know what you're doing with the code, why don't you just actually copy what's in the original MV notetag?
    The basis for this note tag was the tips and tricks combo state in rmmv but it is written differently in rmmz. That's why I am trying to change stuff, I thought it would be obvious...
    Note that several of those errors are also present on the MV notetag, so I don't know where you got it from but it never functioned correctly.
    Works well in RMMV:rolleyes:
  14. Krawzer_KOF said:
    The basis for this note tag was the tips and tricks combo state in rmmv but it is written differently in rmmz. That's why I am trying to change stuff, I thought it would be obvious...
    Except it is not. Zero of this code needs to be different from MV to MZ except the name of the notetags and the setStateDisplay() - that's what people have been trying to tell you.


    Krawzer_KOF said:
    Works well in RMMV:rolleyes:
    It may do what you want, but then there is extra code doing nothing. Instead of being defensive about it, please read what I'm saying.

    The original Tip & Trick you're referring to said:
    Code:
    // Get user's combo stacks.
    var stacks = user._comboStacks;
    // Reduce user's combo stacks.
    stacks -= 2;
    // Set stack count min to 0, max to 10.
    stacks = stacks.clamp(0, 10);

    Read the commented lines for the description of what each line of code is doing.

    Your MV version says:
    Code:
    // Get user's combo stacks.
    var stacks = user._loveStacks;
    // Subtracting the value of stacks from itself ALWAYS produces 0
    stacks -= stacks;
    // This is meaningless because the value is already always 0
    stacks = stacks.clamp(0, 10);

    Now your MZ code from Post #1,011:
    Code:
    // You never declare or initialize stacks at all, which I pointed out before
    // Therefore, this line is undefined -= undefined which produces Not a Number, NaN
    // If you look at your console, you'll see this already produces an error
    stacks -= stacks;
    // This line never gets executed because you already had an error, but it would also produce an error 
    // trying to call a function of something that's undefined
    stacks = stacks.clamp(0, 10);

    And then, as I already said, you have similar errors in your damage formula because you're referencing this stacks thing without ever declaring or initializing it.

    You posted your first question telling us that your code didn't work, so I don't understand why you're reacting defensively when we're answering the question and telling you why it doesn't work.
  15. Got it to work with Chatgpt. Thanks for your help:thumbsup-left:
  16. ATT_Turan said:
    This doesn't mean anything - the gainHp() function is what deals the damage. Creating a damage variable equal to it doesn't do anything. gainHp() doesn't even return a value, so your damage is going to be undefined.
    Thanks for the help. Just to clarify, I am getting it to deal the one time 777... but you're saying that it does not need the 'damage =' part? The following would work just as well?

    <JS On Add State>
    target.gainHp(-777)
    </JS On Add State>

    Also I gave up on the origin.apply state bug thing. I was just seeing if it works in the test skill, and I dont think I will need that particular part.
  17. New question... I am using the Visustella Skills and states core, also have the battle core, elements status core and core engine. I am attempting to make a move for my DoT based class that deals x amount of damage to the target per DoT on the target. Kinda like Malefic Rapture from WoW Affliction Warlock.

    I have tried the b.states.length in the damage formula bar but that deals x damage for EVERY state on the target. My DoTs for this class in particular are categorized as DoT using the <Category: DoT> notetag.
    I checked that the category works right by having a skill use the
    <State DoT Category Remove: All> tag and removing the DoT but keeping other states.
    I have tried multiple variations of
    <JS Pre-Damage>
    $target.getStateCategoryAffectedCount('DoT')
    value = Math.round(value * 10);
    </JS Pre-Damage>
    and no luck. I have also tried a few with Pre Apply and Custom Damage Effect. I saw a script call with from MV called .getStateCategoryAffectedCount('text') but can't find something similar for MZ, nor would I really know where to put it to apply it in a skill.

    Overview: I need a skill that checks how many DoT categorized states are on the target and deal x damage per DoT... keeping the DoTs on the target. On the same note, how do i get a skill to use deal damage or use a damage formula from the Notetag, not the damage formula box... so that I can keep the mechanics out of the Damage Formula Box... My next skill is one that resets the DoT turns, only the DoTs if anyone has a clue for that direction.

    Many thanks in advance. I am new to this.
  18. @AndreaMZ
    For your 1st question, I haven't tested it but you can try this in your skill's notes:
    Code:
    <JS Pre-Damage>
     var addDamage = 0;
     let states = target.states();
     const category = "DoT";
     while (states.length > 0) {
       const state = states.shift();
       if (state.categories.contains(category.toUpperCase())) {
         addDamage += 1;
     }
     value = Math.round(value * (addDamage + 1));
    </JS Pre-Damage>

    As for your second question, about the skill that resets DoT turns, you can use the <Set State id Turns: x> notetag. Granted, since you have multiple DoT states, it will look something like this:
    Code:
    <Set State 4 Turns: 5>
    <Set State 5 Turns: 5>
    <Set State 8 Turns: 5>
    <Set State 12 Turns: 5>
    //etc

    I hope this helps.
  19. AndreaMZ said:
    I have tried multiple variations of
    There's no such thing as $target, just target.

    Aside from that, there's no real reason to believe that getStateCategoryAffected() method exists. Something existing in a different plugin for a different engine isn't a great reason to guess that will work for you :stickytongue:

    It's worth trying what CrocPirate suggests.

    Just out of idle amusement, what's the point of doing:
    CrocPirate said:
    Code:
     const category = "DoT";
       if (state.categories.contains(category.toUpperCase())) {

    You could just type it in upper case to begin with and do:
    Code:
    const category = "DOT";
    if (state.categories.contains(category))

    Or actually type less and not use the variable you never manipulate :wink:
    Code:
    if (state.categories.contains("DOT"))

    Don't get me wrong, it's not like the code is broken or anything, it just struck me as amusing to create extra hoops for yourself :smile:

    (and unless I'm brain farting, there's no reason to run it through Math.round() at the end. Since value will be provided as an integer, and addDamage can only be an integer, it can't produce a decimal result when you multiply them)
  20. AndreaMZ said:
    Also I gave up on the origin.apply state bug thing. I was just seeing if it works in the test skill, and I dont think I will need that particular part.
    It would have been useful to report it, as you weren't doing anything wrong, the error is in the code, apparently