The official VisuStella notetag help thread

● ARCHIVED · READ-ONLY
Started by Trihan 1458 posts Page 64 of 73 View original ↗
  1. Razren said:
    I assume using the Battle Core it's possible using one of the many "pre-apply" "pre-damage" etc
    yep
    Razren said:
    but im not sure at which one I'd need and then expanding on that what code i'd even need to do that, if possible.
    that depends on what you intend to do with the skills and when the effects should happen.

    for example, if you have a skill that doesnt deal damage then post/pre damage notetags will not run and youll need post/pre apply. but if the skill does do damage, pre/post apply both run regardless of the skill actually hitting the target and youll be triggering effects on misses. you'd have to write extra code to catch misses or use post/pre damage as those necessitate having hit the target.

    Then since pre notetags run before the actual action effects have taken place, states that get removed on taking damage would be removed if you tried to apply one with a pre-damage/apply effect on a damaging skill, but if you wanted a skill to apply the skill and then execute the skill youd do need to use a pre apply/damage notetag

    Razren said:
    You cast Fire on the enemy. Enemy's element rate to Fire is 105%. The skill now has a 20% chance to inflict Burn on the enemy.
    very basic form of it you can try:

    Code:
    <JS Post-Damage>
    if (this.calcElementRate(target) > 1 && Math.random() < .2)
      target.addState(x)
    </JS Post-Damage>
    x would be the id for the burn state
  2. Robro33 said:
    yep

    that depends on what you intend to do with the skills and when the effects should happen.

    for example, if you have a skill that doesnt deal damage then post/pre damage notetags will not run and youll need post/pre apply. but if the skill does do damage, pre/post apply both run regardless of the skill actually hitting the target and youll be triggering effects on misses. you'd have to write extra code to catch misses or use post/pre damage as those necessitate having hit the target.

    Then since pre notetags run before the actual action effects have taken place, states that get removed on taking damage would be removed if you tried to apply one with a pre-damage/apply effect on a damaging skill, but if you wanted a skill to apply the skill and then execute the skill youd do need to use a pre apply/damage notetag


    very basic form of it you can try:

    Code:
    <JS Post-Damage>
    if (this.calcElementRate(target) > 1 && Math.random() < .2)
      target.addState(x)
    </JS Post-Damage>
    x would be the id for the burn state
    Thank you for the quick reply! That does indeed work. However, i was hoping to be able to use it to replicate the skill i mentioned before (being able to have a chance to instakill if the target is weak to the element) though it seems that the notetag (from my testing) really doesn't like trying to apply the death state through that method.

    Is there any recommendations you have for a way to go about this? I thought about just applying a different state that has an on-apply effect that reduces the targets HP to 0 but i'm not sure how feasible that is either. Maybe i'm just too ambitious for my own good with weird effects lol
  3. Razren said:
    Is there any recommendations you have for a way to go about this? I thought about just applying a different state that has an on-apply effect that reduces the targets HP to 0 but i'm not sure how feasible that is either
    if addState(1) doesnt work within both pre and post effects then trying to set their hp to 0 is a good direction. I wouldnt give it a state with an apply effect to set their HP to 0 though.

    id just have the skill set the target's HP to 0 with target.setHp(0) or target.die() directly instead. I think the battlers do get refreshed after all the skill effect tags run, so bringing the target's hp to 0 should be sufficient in each case

    Razren said:
    Maybe i'm just too ambitious for my own good with weird effects lol
    if you want weird, i do suggest taking a few JS tutorials so that you you know the basics. then once those are good, you learn what you can about the engine either online or within the JS files. the weirder you want to go, the more likely youll have to know JS and the engine well enough to make it happen
  4. Robro33 said:
    if addState(1) doesnt work within both pre and post effects then trying to set their hp to 0 is a good direction. I wouldnt give it a state with an apply effect to set their HP to 0 though.

    id just have the skill set the target's HP to 0 with target.setHp(0) or target.die() directly instead. I think the battlers do get refreshed after all the skill effect tags run, so bringing the target's hp to 0 should be sufficient an each case


    if you want weird, i do suggest taking a few JS tutorials so that you you know the basics. then once those are good, you learn what you can about the engine either online or within the JS files. the weirder you want to go, the more likely youll have to know JS and the engine well enough to make it happen
    The reason I had wanted to do it via a state was to allow the enemy/player to be capable of resisting the insta-death effect, thankfully the target.setHP worked for the state so now it works as I wanted it to! I appreciate you helping me out with it. I have a very basic understanding of javascript though am not quite skilled enough to write my own code. I appreciate the advice though! I should definitely try to find some tutorials for RPG makers functions so im not always lost wondering what the syntax is for each function lol.
  5. One thing to note
    Razren said:
    The reason I had wanted to do it via a state was to allow the enemy/player to be capable of resisting the insta-death effect
    once youre using JS in those notetags, you have to outline exactly what needs to be done. if you were to add a state through addState(), state rates arent factored in. You would have to add code within the notetag to do so. And if you were going to add the code to do that, it would be even easier to make the skill kill the target based on the same calculations you would have used to apply the state instead of applying the state to do it.
  6. Robro33 said:
    One thing to note

    once youre using JS in those notetags, you have to outline exactly what needs to be done. if you were to add a state through addState(), state rates arent factored in. You would have to add code within the notetag to do so. And if you were going to add the code to do that, it would be even easier to make the skill kill the target based on the same calculations you would have used to apply the state instead of applying the state to do it.
    Ah. I see. Well, while I understand it is significantly easier to just forgo the extra step, is it possible for me to make it so that the state rate is factored into the calculation? I apologize if I'm making this more complicated than it has to be, I was just hoping to give actors passive states that would allow them to become resistance and/or immune to the instadeath effect from applying.

    I know that the "dead" state can be easily "resisted" by setting the state rate to 0 so I was hoping to accomplish something similar here though now I worry that perhaps it is more trouble than it's worth.
  7. Razren said:
    Ah. I see. Well, while I understand it is significantly easier to just forgo the extra step, is it possible for me to make it so that the state rate is factored into the calculation?
    yes, but thats where knowing JS and the engine comes in. so that you know whats needed to set it up and how.

    Razren said:
    I know that the "dead" state can be easily "resisted" by setting the state rate to 0
    yes and no. you can use the state rate to decrease the odds of add state skill effects and attack state traits applying the state, but thats because they already factor it in. if you just use addState() itll bypass it entirely even if the state rate is 0. the only consideration itll make is the state resist trait.

    if you have passives to reduce the odds of being killed by hama/mudo and you dont mind that resistance being shared between the 2, then you can give your resist passives state rate traits for the death state and then change the "if" line to
    Code:
    if (this.calcElementRate(target) > 1 && Math.random() < .2 * target.stateRate(1))
    and now a battler with a passive with a 25% state rate for death gets killed 5% of the time, no state rate is 20%, 200% state rate is 40%, and 0% cannot be killed
    if you do want to split between hama and mudo though, youll need separate states, use light/dark element rate, or some other attribute
  8. Robro33 said:
    yes, but thats where knowing JS and the engine comes in. so that you know whats needed to set it up and how.


    yes and no. you can use the state rate to decrease the odds of add state skill effects and attack state traits applying the state, but thats because they already factor it in. if you just use addState() itll bypass it entirely even if the state rate is 0. the only consideration itll make is the state resist trait.

    if you have passives to reduce the odds of being killed by hama/mudo and you dont mind that resistance being shared between the 2, then you can give your resist passives state rate traits for the death state and then change the "if" line to
    Code:
    if (this.calcElementRate(target) > 1 && Math.random() < .2 * target.stateRate(1))
    and now a battler with a passive with a 25% state rate for death gets killed 5% of the time, no state rate is 20%, 200% state rate is 40%, and 0% cannot be killed
    if you do want to split between hama and mudo though, youll need separate states, use light/dark element rate, or some other attribute
    I appreciate that you were willing to still help me find the solution whilst offering the advice to learn more about the program. Many people probably would have said "go learn to code" and left it at that, so i appreciate it greatly. I can more fully understand now why this is written the way it is and what it does.

    Do you have any advice for sources that could help me learn more about RPG Maker's systems? I know you said that I could simply look through the files themselves but i didn't know if you had any other suggestions or advice. I know looking up basic javascript tutorials are easy enough but Im more than willing to learn stuff so im not just constantly coming back here for help.
  9. Razren said:
    Do you have any advice for sources that could help me learn more about RPG Maker's systems?
    Prefacing al of these with "once you know the JS basics"
    RPGMakerMV Library is a good one. MV and MZ share most of their code with a few areas of difference, but generally speaking - long as you arent looking into windows and scenes, the code youll find is going to be relevant.

    Yanfly's tips and tricks section isnt bad for just figuring some stuff out for the most part, although its not going to be 1:1 for you. Theyre beginner friendly in that theyre all commented to tell you what each bit does and you get the overall description so you can know the goal from the start, but the relevant notetags for visustella plugins are going to be different than the Yanfly versions. Trihan has a thread that has proper adaptations for many of them in terms of notetags and needed code adjustments.

    The best one for MZ is going to be the js files within your projects, but you really cant just jump into it without knowing JS well enough to read it
  10. Razren said:
    EX: You cast Fire on the enemy. Enemy's element rate to Fire is 105%. The skill now has a 20% chance to inflict Burn on the enemy. But only because that enemy is weak to fire. (I am sorry if I am terrible at explaining it)
    @Razren

    Put this in your skill's notes:
    Code:
    <JS Post-Damage>
    if (target.elementRate(x) > 1.0 && (Math.randomInt(100)+1 <= z * target.stateRate(y)) && !target.states().includes($dataStates[y])) {
        target.addState(y);
    }
    </JS Post-Damage>

    Replace 'x' with the element id.
    Replace 'y' with the state id.
    Replace 'z' with the state infliction rate (i.e.: If there's a 20% chance of inflicting Burn, replace 'z' with 20).
  11. Thanks much for all your guys' help! Will definitely keep this thread in mind if i end up needing any help in the future with the visustella stuff.
  12. In MV I had the Organic Deconstruction set up as like a bleeding effect which could only be inflicted by weapons or skills that had the Bleed elemental property. Using the MZ version of the notetag coding here, I've tried to emulate the same thing, but can't seem to get it to work.

    I've tried a few different ways regarding checks, and I currently thought if I simplified the if statement down to checking if the action has the bleed elemental ID attached to it (that way it should work for both weapon attacks and skills?).
    This is what I've got in the Bleed state (ID 16 for me):
    Code:
    <JS Pre-Damage As User>
      const stage1 = 17;
      const stage2 = 18;
      if (this._action.item().damage.elementId === 10) {
        if (!target.isStateAffected(stage1) && !target.isStateAffected(stage2)) {
          target.addState(stage1);
        } else if (target.isStateAffected(stage1)) {
          target.removeState(stage1);
          target.addState(stage2);
        } else if (target.isStateAffected(stage2)) {
          target.removeState(stage2);
          target._deconstructDamage = target.mhp * 0.3;
        }
      }
    </JS Pre-Damage As User>
    
    <JS Post-Apply As User>
      if (target._deconstructDamage) {
        if (target.isAlive()) {
          $gameTemp.requestAnimation([target], 101);
          target.startDamagePopup();
          target.gainHp(-target._deconstructDamage);
          target.startDamagePopup();
        }
        delete target._deconstructDamage;
      }
    </JS Post-Apply As User>

    So far all this does is inflict the Bleed state that contains all the notetags, but doesn't go on to evolve to 17 and then 18 and then the damage output.

    Anyone see what I'm missing?
  13. When checking for the element, I've used in the conditional just this.item().damage.elementId === X
  14. rpgLord69 said:
    When checking for the element, I've used in the conditional just this.item().damage.elementId === X
    I had that originally as well, but no luck. Just tried it again to be sure and nope, just inflicted the Bleed but doesn't add the stage 1 effect of it. Very weird!

    EDIT: Got it to work! I just have weapons that would inflict bleeding just use an attack skill that applies the state and that all seems to work as it should.

    HOWEVER, the Undead state doesn't seem to apply healing as damage...? Though it's the same as the MV version, essentially, which worked. I tried it in a clean project and doesn't work there either.

    Code:
    <JS Pre-Damage>
      if (this.isHpRecover()) {
        value = Math.abs(value);
      }
    </JS Pre-Damage>

    ALSO, I'm not quite sure how to set up/use counters anymore. I had a pretty cool mechanic (I think anyway lol) in MV where when a target was afflicted with the Petrify status, it took 6 turns, enemy or ally, before they turned to stone. Had a counter visible and everything.

    This was on the Petrify APPLY state:
    Code:
    <Custom Apply Effect>
    target.setStateCounter(14, 6);
    </Custom Apply Effect>

    And then I had a passive state that all players and enemies had that had this:

    Code:
    <Custom Action End Effect>
    $gameTroop.aliveMembers().forEach(battler => {
    
    // Petrify effect
    if (battler.isStateAffected(14)) {
         battler.addStateCounter(14, -1);
         if (battler.getStateCounter(14) == 0) {
            battler.addState(15);      
            battler.removeState(14);
         }
    }
    });
    
    $gameParty.aliveMembers().forEach(battler => {
    
    // Petrify effect
    if (battler.isStateAffected(14)) {
         battler.addStateCounter(14, -1);
         if (battler.getStateCounter(14) == 0) {
            battler.addState(15);      
            battler.removeState(14);
        }
    }            
    });
    </Custom Action End Effect>

    Assistance to figure that out would be helpful as well! Thanks!
  15. Firaga said:
    For - VS Movement Effects plugin
    Considering - Smart Rush
    So for Smart Rush events there has been a lot of issue where it goes through a player touch event and then as it doesn't stop exactly on the player touch, that becomes a issue if I have set movement command in that player touch for cut scenes , etc.
    As those maps also have puzzles such as spikes coming from ground, the spike rush manages to go beyond them but also triggers them.
    Unlike Smart Blink and Smart Jump, the Rush one doesnt has a option to restrict regions.
    Is there a way to stop the Smart Rush exactly where-ever there is a Player Touch/Event Touch Event?
    I have a lot of cutscenes, it will be extremely hard and also I have to include a feature to increase your Smart Jump level,Kindly Help!! Thank you in advance!!
    Sorry this is late @Firaga, but I ran into the same problem and could not find a solution anywhere. It's kind of nuts to me that there isn't any kind of option to make the player stop a Smart Rush on touch events. It seems like a lot of people would run into the same kinds of problems you mention pretty quickly. (There may be cases where you want that default behavior, but certainly there are also many where you don't.)

    I found a way to do this manually. Unfortunately, it'd mean you have to edit all your cutscene/trap/etc. events, but if you add this script call to the beginning of your "Player Touch" event, it'll stop Smart Rush in its tracks (without crashing):
    Code:
    $gamePlayer.endSmartRush();
  16. starguy said:
    HOWEVER, the Undead state doesn't seem to apply healing as damage...? Though it's the same as the MV version, essentially, which worked. I tried it in a clean project and doesn't work there either.
    starguy said:
    <JS Pre-Damage>
    thats a notetag for skills. i think you want <JS Pre-Damage as User>

    starguy said:
    ALSO, I'm not quite sure how to set up/use counters anymore.
    AFAIK, that functionality was renamed to state display and is within the skills and states core plugin. I believe it functions exactly the same but with an altered name
    1740605181181.png
    But also FWIW, you could have gotten the mechanical aspect of it working just by using properties instead of the state counter. it wouldnt let you display it on the state icons though.
  17. Robro33 said:
    thats a notetag for skills. i think you want <JS Pre-Damage as User>


    AFAIK, that functionality was renamed to state display and is within the skills and states core plugin. I believe it functions exactly the same but with an altered name
    View attachment 332668
    But also FWIW, you could have gotten the mechanical aspect of it working just by using properties instead of the state counter. it wouldnt let you display it on the state icons though.
    Hmmmm...
    So for the Undead state, I tried <JS Pre-Damage as User> and that didn't work. I also tried <JS Pre-Damage as Target> and <JS Pre-Regenerate> and even changed value = Math.abs(value); to value = Math.abs(-value); for each of those note tags but yet when using a healing item on the affected battler, the item still healed as opposed to doing damage.

    For the counters in the Petrify state, I didn't clarify well enough I think! I mean I can't figure out how to store a number in a variable and then have it lower by 1 per turn taken. Originally, target.setStateCounter(14, 6); would add the counter, here it's 6, and then in the 'every turn' segment of the passive state battler.addStateCounter(14, -1); would lower it by 1 per turn. I've scoured this thread and forum looking for a solution and I've tried a ton of things but haven't yet landed on something working. I've tested the 'every turn' functionality itself and it works, so that's good at least!

    So right now, on the Petrify Apply state, I have
    Code:
    <Reapply Rules: Ignore>
    <JS On Add State>
    user._petrifyCounter = 6;
    </JS On Add State>

    And in the Every Turn passive state I have
    Code:
    <JS Post-End Turn>
    $gameTroop.aliveMembers().forEach(battler => {
    if (user.isStateAffected(13)) {
         user._petrifyCounter--;
         if (user._petrifyCounter == 0) {
            user.addState(14);     
            user.removeState(13);
         }
       }
    })
    
    $gameParty.aliveMembers().forEach(battler => {
    // Petrify effect
    if (user.isStateAffected(13)) {
         user._petrifyCounter--;
         if (user._petrifyCounter == 0) {
            user.addState(14);     
            user.removeState(13);
         }
      } 
    })
    </JS Post-End Turn>

    Not sure what I'm missing here.

    EDIT: Got it! For Petrify, I had to change 'user' in the apply state to 'target' and 'user' in the Every Turn state to 'battler'. So now I just have to get the counter number to show, if possible.

    The Undead state is still a mystery, however.
  18. starguy said:
    I also tried <JS Pre-Damage as Target>
    oops, yeah, meant as target, but you tried it already.
    try just
    Code:
    value = -value
    or
    Code:
    value = -Math.abs(value);
    i forget when healing is meant to be negative and when its meant to be positive, but everything youve shown would result in a positive number

    starguy said:
    <JS On Add State>
    user._petrifyCounter = 6;
    </JS On Add State>
    i mentioned that using properties alone wouldnt let you display it. youd have to use setStateDisplay to show that value

    starguy said:
    addStateCounter
    logically, if addStateCounter takes the previous value and adds to it, you can do the same thing with the state displays with get and set without needing a function to add to it directly.
    Code:
    user.setStateDisplay(state.id, user.getStateDisplay()-1)
    would accomplish the same thing as
    Code:
    battler.addStateCounter(stateId, -1);
  19. ninjatone said:
    Sorry this is late @Firaga, but I ran into the same problem and could not find a solution anywhere. It's kind of nuts to me that there isn't any kind of option to make the player stop a Smart Rush on touch events. It seems like a lot of people would run into the same kinds of problems you mention pretty quickly. (There may be cases where you want that default behavior, but certainly there are also many where you don't.)

    I found a way to do this manually. Unfortunately, it'd mean you have to edit all your cutscene/trap/etc. events, but if you add this script call to the beginning of your "Player Touch" event, it'll stop Smart Rush in its tracks (without crashing):
    Code:
    $gamePlayer.endSmartRush();

    Hmmm, it allows you to play a once parallel CE or control switches (that can turn on parallel common event) when smart rushing. Can't you use that to check if the player is standing on a tile that has player touch trigger and then stop the rush with your script? If the player touch event won't activate like that, just activate the event on the tile the player is standing on in the common event with a script after ending the rush.

    EDIT:
    I tested it and it seems to work with parallel common event tied to rush switch:
    ◆Get Location Info:TEST, Event ID, Player
    ◆If:TEST > 0
    ◆Control Variables:#0019 TEST 2 = $gameMap.event($gameVariables.value(20))._trigger
    ◆If:TEST 2 = 1
    ◆Script:$gamePlayer.endSmartRush();

    :End

    :End
    ◆Wait:1 frame
  20. For the Action-Boost plugin, is there anyway to make it so that Boost Points act like MP? I want to make it so the player never boosts up or down. Is there a way to make this work? My thought is to create a skill note tag similar to:

    IF <Boost Points: >2> <User Boost Points: -3> : (else hide skill)

    INTENDED LOGIC/ACTION:
    If the user has more than 2 boost points available, the skill fires and the user loses 3 boost points. If the user does NOT have more than 2 boost points available, the skill is greyed out.