The official VisuStella notetag help thread

● ARCHIVED · READ-ONLY
Started by Trihan 1458 posts Page 66 of 73 View original ↗
  1. rpgLord69 said:
    Did you try my first suggestion? So you have a state add the element. That seemed to work for me, though I only tested it quickly (adding element 2 fire in the example).

    <JS Pre-Apply as User>
    let name = "VisuMZ_1_BattleCore";
    let command = "ActSeq_Element_AddElements";
    let addEle = JSON.stringify([`2`]);

    PluginManager.callCommand(this, name, command, {
    "Elements:arraynum" : addEle
    });
    </JS Pre-Apply as User>
    Yeah, it worked. Though it's not as ideal as changing the hit type (apart from enabling enemy immunity to all actions someone with the state makes, the point of the state is to turn all attacks magical, so adding the magic element to an otherwise physical attack would still make the skill use physical defense/Armor in damage calculation), it's good enough to run with for the time being.
  2. Xeri said:
    Yeah, it worked. Though it's not as ideal as changing the hit type (apart from enabling enemy immunity to all actions someone with the state makes, the point of the state is to turn all attacks magical, so adding the magic element to an otherwise physical attack would still make the skill use physical defense/Armor in damage calculation), it's good enough to run with for the time being.
    Yeah, did some damage calculation testing for dozens of skills, and it looks like I need the hit type change after all. Anyone have an idea how to attach it to the passive intended to turn all actions with a hit type to magical? It's a passive assigned through Element Status Core (every element but one has a passive assigned to battlers with its respective Main/Sub Element trait), if that matters.
  3. Hmmm, I'm not an expert with the item whatever stuff, but just doing it like this seemed to work for me:

    <JS Pre-Start Action>
    this.item().hitType = Game_Action.HITTYPE_MAGICAL;
    </JS Pre-Start Action>

    <JS Pre-End Action>
    this.item().hitType = Game_Action.HITTYPE_PHYSICAL;
    </JS Pre-End Action>

    If you have certain hit actions, you should add into the first (EDIT: BOTH) note tag to not run the code in case of certain hit skill.
    EDIT2: Oh yeah, of course you shouldn't run the tags when the original hit type is magical as well. So give them checks to run the code if the original hit type is physical.
  4. Hey guys trying to make a skill that does 10% more damage per state category “ Negative” that’s on the enemy. I found this
    Code:
    <JS Pre-Damage>
    if (target.isStateCategoryAffected('CATEGORYNAME')){
      value = Math.round(value * 1.5);
    }
    </JS Pre-Damage>

    Now I know to change the 1.5 to 1.1 but how can I make it count how many negative states are on the enemy?
  5. @jimmyshmo

    This code should work:
    Code:
    <JS Pre-Damage>
     var scale = 1.0;
     let states = target.states();
     const category = "CATEGORYNAME";
     while (states.length > 0) {
       const state = states.shift();
       if (state.categories.contains(category.toUpperCase())) {
         scale += 0.1;
       }
     }
     value = Math.round(value * scale);
    </JS Pre-Damage>
  6. I recently upgraded core VS plugins and the engine several revisions to latest. I am using 64x64 icons but the padding between icon and text seems to assume I am using 32x32. Is there an option to over-ride this in any VS or MZ plugins? Where an icon is used... the text now over-writes:
    Overlap.JPG
  7. Dark_Ansem said:
    veState(state
    Dark_Ansem said:
    I'm trying to follow the coat-tails of the Tips and Tricks thread, with my own attempt at creating a toggleable flame aura effect. I'd love for it to be checked for mistakes and syntax errors.

    Here is the notetag for the toggle skill, replacing stateId with the ID number of the "Aura of Flame" state. I did rely on other code snippets found a bit all over the forums.

    JavaScript:
    <JS Pre-Apply as User>
    if (user.isStateAffected(stateId)) {
      user.removeState(stateId);
      effect.result = false;
    } else {
      user.addState(stateId);
    }
    </JS Pre-Apply as User>

    and here is the notetag for the aura itself, taking into account elemental rate, maybe?

    JavaScript:
    <JS type Slip Damage>
    const targets = $gameTroop.aliveMembers(); // Change to $gameParty.aliveMembers() for allies.
    targets.forEach(target => {
      const baseFireDamage = 50; // Set the base amount of fire damage to deal.
      const fireElementId = x; // Replace x with the ID number of the "Fire" element created earlier.
      const resistance = target.elementRate(fireElementId);
      const fireDamage = Math.floor(baseFireDamage * resistance);
      target.gainHp(-fireDamage);
      target.startDamagePopup();
      target.clearResult();
    });
    </JS type Slip Damage>

    I thought getElementRate() is the correct function to use, but I wasn't sure how to use it?
    Only wanted to use the top portion of this code to make a state turn on and off but I couldn't for the life of me get it to work. I just used a conditional branch in an action sequence, seemed to work fine if anyone else is having trouble.
  8. I dunno if it’s addressed anywhere here, but I can’t find anything in the BTB documentation that can help me figure out how to implement Red Mage’s various Brave point manipulations from Bravely Default and Bravely Default 2; as they are largely conditional rather than flat increases and are based on equipped skills/states rather than just a result of specific skills or whatnot; as well as having BP affect other aspects.

    Unless I’m blind of course. It’d also be useful to be able to use these with some iteration of states; to best work with a Bravely Default style class system.
    IMG_6975.jpegIMG_6976.jpegIMG_6977.jpegIMG_6978.jpegIMG_6979.jpeg
  9. jimmyshmo said:
    Only wanted to use the top portion of this code to make a state turn on and off but I couldn't for the life of me get it to work. I just used a conditional branch in an action sequence, seemed to work fine if anyone else is having trouble.
    Auras have been overhauled as official effects in the new versions of the plugin so no idea honestly.
  10. @Arrogant McElfpants You can search here how to do all the VS plugin commands in script form (Battle Core has plugin command for gain/lose brave points). But if you open the BTB plugin and just use control-F to search the file for 'brave', you can see that there's stuff like:
    loseBravePoints
    setBravePoints
    gainBravePoints

    So it's like, get actor 1 bravepoints:
    $gameActors.actor(1).bravePoints();
    Make actor 1 gain 3 bravepoints:
    $gameActors.actor(1).gainBravePoints(3);

    You can use those with VS states action effects conditionals.
  11. rpgLord69 said:
    @Arrogant McElfpants You can search here how to do all the VS plugin commands in script form (Battle Core has plugin command for gain/lose brave points). But if you open the BTB plugin and just use control-F to search the file for 'brave', you can see that there's stuff like:
    loseBravePoints
    setBravePoints
    gainBravePoints

    So it's like, get actor 1 bravepoints:
    $gameActors.actor(1).bravePoints();
    Make actor 1 gain 3 bravepoints:
    $gameActors.actor(1).gainBravePoints(3);

    You can use those with VS states action effects conditionals.

    This is going to relate to my next question, but how would I make it so that the $gameActors.actor is specifically the one that's affected by the state?

    and on that note, would this be usable to find the actor's level for <JS param plus>? Especially since I doubt the following is acceptable?
    JavaScript:
    <JS MaxHP Plus: 5 * this.actor().level;>
  12. @Arrogant McElfpants
    VS Battle Core has state notetags like <JS Post-Apply as Target> where you can put code and use 'user' and 'target' to reference the battlers.

    Your other notetag would be (but it changes the general formula for that actor, I think), like:
    <JS MaxHP Plus: 5 * this.level>
  13. rpgLord69 said:
    @Arrogant McElfpants
    VS Battle Core has state notetags like <JS Post-Apply as Target> where you can put code and use 'user' and 'target' to reference the battlers.

    Your other notetag would be (but it changes the general formula for that actor, I think), like:
    <JS MaxHP Plus: 5 * this.level>
    Would Battle Core’s state notetags work for passives as well?

    And as an added corollary (since the this.level solution worked, THANK YOU SO MUCH BY THE WAY RPGLORD), is there a way for the Class Change system to include a class's Param Plus into a multiclass? I mostly ask because the solution I used to ensure the level curve works out was by setting the base stat to a specific number that never changes from level up.

    also while I'm here, can you set the damage style of a state's slip damage/regeneration or no?
  14. Yeah, you can put them on passives.

    Haven't used multiclasses ever, but don't you retain the original class too when you multiclass? Doesn't that mean you keep their notetag? Well, it's not like I know, LOL.

    I think VS damage styles are just for skills/items. VS states has the JS slip damage/heal notetag though. If you want to use something similar to damage styles, maybe you can just throw your own function in the game as a plugin and then just call that and give the arguments in the notetag to make the calculation?
  15. Trying to make a character have a 1/3 chance to get an additional turn after a skill
    so I have a Variable roll a random 1-3 and made a conditional branch Action sequence that
    If Varitable(4) = 3 then play an action sequence where I have them get ATB charge 100%.
    The problem is this runs before the turn ends then resets hits atb to zero at the end of the turn.
    So i'm trying to do it via
    Code:
    <JS Post-End Turn>
    if ($gameVariables.value(4) === 3) {
         user.setAtb(1.00))
    }
    else
    
    </JS Post-End Turn>
    But it isnt working and I think i'm close but dont understand java enough.
  16. They have the <JS ATB After Gauge> skill notetag. So I think it's like:

    <JS ATB After Gauge>
    if (Math.randomInt(3) == 2) {
    rate = 1;
    } else {
    rate = 0;
    }
    </JS ATB After Gauge>
  17. rpgLord69 said:
    They have the <JS ATB After Gauge> skill notetag. So I think it's like:

    <JS ATB After Gauge>
    if (Math.randomInt(3) == 2) {
    rate = 1;
    } else {
    rate = 0;
    }
    </JS ATB After Gauge>
    This works perfectly! As always thank you guys that take your time to help others in here.
  18. rpgLord69 said:
    Yeah, you can put them on passives.

    Haven't used multiclasses ever, but don't you retain the original class too when you multiclass? Doesn't that mean you keep their notetag? Well, it's not like I know, LOL.

    I think VS damage styles are just for skills/items. VS states has the JS slip damage/heal notetag though. If you want to use something similar to damage styles, maybe you can just throw your own function in the game as a plugin and then just call that and give the arguments in the notetag to make the calculation?
    I remember there may have been a way for a slip effect to inherit a formula in an MV version; maybe even YEP's iteration of the states core; is there something similar here?
  19. Hey, I'm back trying to make a state that acts like a bomb state ticking down then exploding on the enemy. I can't figure out why nothing happens when this state expires I think everything looks correct.
    Code:
    <JS On Expire State>
     const damage = origin.atk * 5;
     target.gainHP(-damage);
     $gameTemp.requestAnimation([target], 107);
    </JS On Expire State>
  20. jimmyshmo said:
    target.gainHP(-damage);
    its gainHp, not gainHP. when troubleshooting js stuff, i recommend having the console open when you do so you can see error messages. it would have told you gainHP isnt a function.