The official VisuStella notetag help thread

● ARCHIVED · READ-ONLY
Started by Trihan 1458 posts Page 34 of 73 View original ↗
  1. Trihan said:
    Post-Apply runs after damage, so at that point value is meaningless. Do JS Pre-Damage instead.
    I actually did try Pre-Damage before. It was the same thing. 0 dmg with or without states.
  2. HiddenAlchemist said:
    I actually did try Pre-Damage before. It was the same thing. 0 dmg with or without states.
    The documentation for the Battle Core doesn't say these notetags recognize a and b. It says to use user and target.

    If it doesn't know what a is, then all of your conditionals involving a.isStateAffected() will be false, which means it will always default down to your last statement of value=0;
  3. HiddenAlchemist said:
    I actually did try Pre-Damage before. It was the same thing. 0 dmg with or without states.
    Probably because value already exists and you're trying to redefine it, so it's probably causing an error and returning 0. (edit: I thought you had "const" on the beginning of that line but you don't. Try adding console.log statements to each part and see where it stops logging)

    @ATT_Turan It actually does.

    1646509832155.png
  4. Trihan said:
    It actually does.
    Hrm, I dunno then. @hiddenone I'd guess you don't actually have either of those states on. I don't see anything else that would make it 0 out.

    After you make changes, you're saving your database and starting a new play test, right? Saved games won't recognize database changes, and the battle test can sometimes be wonky with plugins.
  5. ATT_Turan said:
    You shouldn't need a notetag, you can just add a Trait to the armor and select Add Skill. Do you mean something else?
    No, because it's tied to the Notetag javascript conditions mentioned in the first part of my comment.
  6. @hiddenone These are regular states you're checking for, right? VisuStella passive states won't be recognized by isStateAffected().

    Seacliff said:
    No, because it's tied to the Notetag javascript conditions mentioned in the first part of my comment.
    Ah, so you want the item to add a skill only if it's in the first of your two Armor slots?
  7. ATT_Turan said:
    @hiddenone These are regular states you're checking for, right? VisuStella passive states won't be recognized by isStateAffected().


    Ah, so you want the item to add a skill only if it's in the first of your two Armor slots?
    I figured it wasn't passives since he said negative state, but good question.
  8. ATT_Turan said:
    @hiddenone These are regular states you're checking for, right? VisuStella passive states won't be recognized by isStateAffected().


    Ah, so you want the item to add a skill only if it's in the first of your two Armor slots?
    Yeah, I wanted to separate the two unless there was only an answer for one of them, but I could have worded that more clearly.
  9. Am I being mis-tagged?

    So I realized the issue (thanks Trihan on Discord!) as I completely missed the else = 0 in the javascript. I don't know nor remember how that got there. It all works as intended now.
  10. Hi! :)

    I'm thinking about ways to make my debuff-curing items a little more useful. Therefore, I would like to check whether a target has any negative states — that is, states with the '<Negative State>' notetag. How would I do that?

    And if it isn't overly complicated, I would also like to have the option to grant a bonus (like some TP) per debuff cleared, so if you could also tell me how to count those negative states, that'd be awesome!
  11. Saireau said:
    Hi! :)

    I'm thinking about ways to make my debuff-curing items a little more useful. Therefore, I would like to check whether a target has any negative states — that is, states with the '<Negative State>' notetag. How would I do that?
    target.hasStateCategory("negative")
    Saireau said:
    And if it isn't overly complicated, I would also like to have the option to grant a bonus (like some TP) per debuff cleared, so if you could also tell me how to count those negative states, that'd be awesome!
    target.statesByCount("negative").length
  12. Thank you! :)
  13. Trihan said:
    JavaScript:
    <JS Pre-Damage As User>
        user.gainHp(user.skillTpCost(this.item()));
    </JS Pre-Damage As User>

    Hi again!

    You provided me with the code above for a piece of armour which, after using a skill, restores HP equal to the TP cost of that skill. It worked perfectly for skills, but seems to cause this error when a healing item is used:

    1647039598428.png

    Is there another way of doing it which prevents this error?
  14. Saireau said:
    Hi again!

    You provided me with the code above for a piece of armour which, after using a skill, restores HP equal to the TP cost of that skill. It worked perfectly for skills, but seems to cause this error when a healing item is used:

    View attachment 219478

    Is there another way of doing it which prevents this error?
    Ah, sorry. That's because items don't have a TP cost I think. Try

    JavaScript:
    <JS Pre-Damage As User>
        if (DataManager.isSkill(this.item()) user.gainHp(user.skillTpCost(this.item()));
    </JS Pre-Damage As User>
  15. That works, thank you. :)

    With this out of the way, I was able to test the other code snippet for bonus effects when removing negative states. What I have is this:

    <State Negative Category Remove: All>
    <JS Pre-Apply>
    target.gainTp(target.statesByCount("Negative").length * 5);
    </JS Pre-Apply>

    Which, unfortunately, doesn't work. Do you have an idea why?

    Ideally, the item would only generate TP for each state actually removed, not just counted. To be honest, I don't have any plans of including states of the 'Negative' category that can't be removed with this item, but it's better to have too much design space than too little, right? :) So, should you have an idea how to implement this, that would be even better.
  16. Saireau said:
    That works, thank you. :)

    With this out of the way, I was able to test the other code snippet for bonus effects when removing negative states. What I have is this:

    <State Negative Category Remove: All>
    <JS Pre-Apply>
    target.gainTp(target.statesByCount("Negative").length * 5);
    </JS Pre-Apply>

    Which, unfortunately, doesn't work. Do you have an idea why?

    Ideally, the item would only generate TP for each state actually removed, not just counted. To be honest, I don't have any plans of including states of the 'Negative' category that can't be removed with this item, but it's better to have too much design space than too little, right? :) So, should you have an idea how to implement this, that would be even better.
    Yeah, that should be doable. I'll have a crack at it later, got kitchen renovations and coding today!
  17. Having trouble starting my game after installing Visustella Plugins. When ever I Playtest, I get this message.

    Screenshot 2022-03-19 142055.png

    Here are my plugins.

    Screenshot 2022-03-19 142202.png

    Screenshot 2022-03-19 142317.png


    Screenshot 2022-03-19 142337.png

    Any help would be greatly appreciated.
  18. Paladain_377 said:
    Having trouble starting my game after installing Visustella Plugins. When ever I Playtest, I get this message.

    View attachment 220368

    Here are my plugins.

    View attachment 220369

    View attachment 220370


    View attachment 220371

    Any help would be greatly appreciated.
    You need the PIXI JS filters plugin. It comes in the 8 Waves Bundle. Put it all the way at the top in the Plugin Manager. Or turn off Bright Effects and Horror Effects. There might be a couple more that use PIXI, but those are the two I know off the top of my head.
  19. Hello,

    I am trying to create a state that changes an actor's image along with their stats, like "mini" or "frog" in the Final Fantasy series. I have referred to Yanfly's Actor Transformation Tutorial and also looked around for similar solutions on different forums, but I have not found anything that will help me do this with JS in MZ.

    When I test the state in RMMZ, the most important parts of the state seems to work fine, but the SV Battlers do not transform. Is there a way to use Yanfly's Actor Transformation using VisuStella's Skills and States Core? In the case of this state I do not need it to change the Actor's name or face, only the Battler Image, but I have included the character and face names and indexes to try to match the original tutorial.

    The script I am trying to use is below:
    <JS On Add State>

    if (user.isActor()) {

    user._prevCharName = user._prevCharName || user._characterName;
    user._prevCharIndex = user._prevCharIndex || user._characterIndex;
    user._prevFaceName = user._prevFaceName || user._faceName;
    user._prevFaceIndex = user._prevFaceIndex || user._faceIndex;
    user._prevBattlerName = user._prevBattlerName || user._battlerName;
    if (user.actorId() === 1) {
    var charName = ‘PackageMZ3_mvt’;
    var charIndex = 0;
    var faceName = ‘Package3_mvt';
    var faceIndex = 0;
    var battlerName = ‘Carol_SV_Mega’;
    } else if (user.actorId() === 2) {
    var charName = ‘Marsha-character-pack1’;
    var charIndex = 0;
    var faceName = ‘Marsha-character-pack1';
    var faceIndex = 0;
    var battlerName = ‘Marsha-_SV_Mega’;
    } else if (user.actorId() === 3) {
    var charName = ‘PackageMV1’;
    var charIndex = 3;
    var faceName = ‘Package1MV';
    var faceIndex = 3;
    var battlerName = ‘Hayatemaru_SV_Mega’;
    } else if (user.actorId() === 4) {
    var charName = ‘PackageMZ3_mvt’;
    var charIndex = 4;
    var faceName = ‘Package3_mvt';
    var faceIndex = 4;
    var battlerName = ‘Alan_SV_Mega’;
    }
    user.setCharacterImage(charName, charIndex);
    user.setFaceImage(faceName, faceIndex);
    user.setBattlerImage(battlerName);
    user.refresh();

    </JS On Add State>

    <JS On Erase State>
    var charName = user._prevCharName;
    var charIndex = user._prevCharIndex;
    var faceName = user._prevFaceName;
    var faceIndex = user._prevFaceIndex;
    var battlerName = user._prevBattlerName;
    user.setCharacterImage(charName, charIndex);
    user.setFaceImage(faceName, faceIndex);
    user.setBattlerImage(battlerName);
    user._priorityCharacterName = undefined;
    user._priorityCharacterIndex = undefined;
    user._prevFaceName = undefined;
    user._prevFaceIndex = undefined;
    user._priorityFaceName = undefined;
    user._priorityFaceIndex = undefined;
    user._prevFaceName = undefined;
    user._prevFaceIndex = undefined;
    user._priorityBattlerName = undefined;
    user._prevBattlerName = undefined;
    user.refresh();

    </JS On Erase State>

    <JS On Expire State>
    var charName = user._prevCharName;
    var charIndex = user._prevCharIndex;
    var faceName = user._prevFaceName;
    var faceIndex = user._prevFaceIndex;
    var battlerName = user._prevBattlerName;
    user.setCharacterImage(charName, charIndex);
    user.setFaceImage(faceName, faceIndex);
    user.setBattlerImage(battlerName);
    user._priorityCharacterName = undefined;
    user._priorityCharacterIndex = undefined;
    user._prevFaceName = undefined;
    user._prevFaceIndex = undefined;
    user._priorityFaceName = undefined;
    user._priorityFaceIndex = undefined;
    user._prevFaceName = undefined;
    user._prevFaceIndex = undefined;
    user._priorityBattlerName = undefined;
    user._prevBattlerName = undefined;
    user.refresh();

    </JS On Expire State>



    Thanks for taking the time to respond to my question. I appreciate any advice or directions you can give.
  20. WilsonE7 said:
    You need the PIXI JS filters plugin. It comes in the 8 Waves Bundle. Put it all the way at the top in the Plugin Manager. Or turn off Bright Effects and Horror Effects. There might be a couple more that use PIXI, but those are the two I know off the top of my head.
    Thanks, your advice helped me to fix my problem. I didn't use the PIXI JS filter plugin. What is that used for anyway? Also does anyone know where I can find a plugin for targetting enemies in groups (like lines of enemies)? If not that's fine.