The official VisuStella notetag help thread

● ARCHIVED · READ-ONLY
Started by Trihan 1458 posts Page 32 of 73 View original ↗
  1. Gallas said:
    Do not worry. I figured it out. Like RPGMaker, Visustella takes some time to digest especially the more complicated systems. Not sure whether she realizes it or not, but Olivia has the OTB system set up in VS to have more possibilities than dreamt of in Octopath Traveler.

    Thank you, again, Trihan for your assistance (and especially with porting the Yanfly Tips and Tricks to MZ). You have no idea how many hours of time and frustration you are saving people.
    Thanks for reminding me I'm due to do the next 30.
  2. i dont know how to delete a message, sorry
  3. Hi, I'm trying to make a passive state that ampliflies the power of the first TP skill you use in battle and then removes itself(it refreshes after each encounter, hence the Switch Condition). I have the following in my state's notebox:

    JavaScript:
    <Passive Condition Switch ON: 23>
    
    <JS Pre-Damage As User>
      user._effectUsed = false;
      if (value >= 0 && user.skillTpCost(this.item()) > 0) {
        value = Math.ceil(value * 3);
        user._effectUsed = true;
      }
    </JS Pre-Damage As User>
    
    <JS Post-End Action>
      if(user._effectUsed){
        $gameSwitches.setValue(23, false);
      }
      delete user._effectUsed;
    </JS Post-End Action>

    This works for skills that do damage but not for skills that heal. So, two questions:
    How to amplify the power for healing skills as well?
    &
    Can this be any easier to implement? lol

    Thanks.
  4. I think healing uses
    Code:
    <JS Pre-Regenerate>
    Instead of
    Code:
    <JS Pre-Damage>
  5. NaosoX said:
    I think healing uses
    Code:
    <JS Pre-Regenerate>
    Instead of
    Code:
    <JS Pre-Damage>
    Thanks Naosox, I figured it out. You do use Pre-Damage but when using HP recover as the damage type "value" returns a negative number. So using value >= 0 as a flag was a bad move, I think it's better to use this.isHpEffect().
  6. Jeivalien said:
    Thanks Naosox, I figured it out. You do use Pre-Damage but when using HP recover as the damage type "value" returns a negative number. So using value >= 0 as a flag was a bad move, I think it's better to use this.isHpEffect().
    Yeah, you're right. If you check for value being greater than 0, it will ignore healing.
  7. Hello,

    I'm trying to add a combo stack on state apply


    <JS On Add State>

    user._comboStacks ??= 0;

    let stacks = user._comboStacks.clamp(0, 10);

    stacks++;

    stacks = stacks.clamp(0, 10);

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

    user._comboStacks = stacks;

    </JS On Add State>

    but I get this error

    error2.PNG
    at the end of a battle.

    Does someone knows how to solve it?

    Thanks
  8. Hi,

    I'm trying to make a status effect which makes a new enemy to spawn when a status effect expires. I think I am close to right solution, but I am missing something.


    <JS On Expire State>

    const NewEnemy = new Game_Enemy(2,200,200);

    $gameTroop.members().push(NewEnemy);

    </JS On Expire State>

    I tried this as a simple test for this mechanic, but this only creates an enemy that exists in some kind of limbo where it isn't visible and it doesn't take any actions but you can attack and kill it. Using .appear() functions doesn't do anything. My novice level programming skills are quite rusty and I've never used Javascript before, so feel like I'm just missing something obvious, but I can figure this out.
  9. Krawzer_KOF said:
    Hello,

    I'm trying to add a combo stack on state apply


    <JS On Add State>

    user._comboStacks ??= 0;

    let stacks = user._comboStacks.clamp(0, 10);

    stacks++;

    stacks = stacks.clamp(0, 10);

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

    user._comboStacks = stacks;

    </JS On Add State>

    but I get this error

    View attachment 215492
    at the end of a battle.

    Does someone knows how to solve it?

    Thanks
    That error happens when you declare a variable with "const" then try to change it. I don't think it's the add state tag that's breaking it.

    Githgulcag said:
    Hi,

    I'm trying to make a status effect which makes a new enemy to spawn when a status effect expires. I think I am close to right solution, but I am missing something.


    <JS On Expire State>

    const NewEnemy = new Game_Enemy(2,200,200);

    $gameTroop.members().push(NewEnemy);

    </JS On Expire State>

    I tried this as a simple test for this mechanic, but this only creates an enemy that exists in some kind of limbo where it isn't visible and it doesn't take any actions but you can attack and kill it. Using .appear() functions doesn't do anything. My novice level programming skills are quite rusty and I've never used Javascript before, so feel like I'm just missing something obvious, but I can figure this out.
    Game_Enemy only contains the data for the enemy object. You still need to add a new Sprite_Enemy to the scene's spriteset and attach it to the newly-created enemy.
  10. Okay, it was another state somewhere in my database that was causing the error

    <JS On Add State>
    user._comboStacks ??= 0;
    const stacks = user._comboStacks.clamp(0, 10);
    stacks++;
    stacks = stacks.clamp(0, 10);
    user.setStateDisplay(state.id, 'x' + stacks);
    user._comboStacks = stacks;
    </JS On Add State>

    <JS On Erase State>
    user._comboStacks = 0;
    const stacks = user._comboStacks.clamp(0, 10);
    user.setStateDisplay(state.id, 'x' + stacks);
    </JS On Erase State>


    I replaced const stacks by var stacks and the error disappeared.

    Thanks for your help!
  11. Trihan said:
    Game_Enemy only contains the data for the enemy object. You still need to add a new Sprite_Enemy to the scene's spriteset and attach it to the newly-created enemy.
    Thanks! that helped a alot. Problem is that now I have no Idea what I am doing. :D How do I exactly add the new Sprite_enemy to the spriteset and attach it to the enemy?
  12. Githgulcag said:
    Thanks! that helped a alot. Problem is that now I have no Idea what I am doing. :D How do I exactly add the new Sprite_enemy to the spriteset and attach it to the enemy?
    const sprite = new Sprite_Enemy();
    sprite.setBattler(NewEnemy);
    const spriteset = SceneManager._scene._spriteset;
    spriteset._battlefield.addChild(sprite);
    spriteset._enemySprites.push(sprite);

    Try that.
  13. Trihan said:
    const sprite = new Sprite_Enemy();
    sprite.setBattler(NewEnemy);
    const spriteset = SceneManager._scene._spriteset;
    spriteset._battlefield.addChild(sprite);
    spriteset._enemySprites.push(sprite);

    Try that.
    I tried it and the enemy didn't appear.
  14. @Jeivalien you got your solution in that healing value is negative. I'm just curious - why are you calling Math.ceil()? Multiplying your initial value by 3 will always produce an integer.

    (unless you're specifically altering the rest of the system to allow that value to be a decimal, in which case I still don't know why you'd want to round it later :wink: )

    NaosoX said:
    I think healing uses
    Code:
    <JS Pre-Regenerate>
    That's referring to the regeneration phase at the end of each combat turn (i.e. when you'd see the negative regeneration from poison effects).
  15. I've been trying to solve my problem with other plugins, but nothing seems to have the function I need. The closest thing I found was taaspider's EnemyReinforcements but it only enables creation of skills that summons new enemies and I need the enemy to appear specifically on the expiration of a state. I've tried to look at the plugins code to figure out how it creates new enemies, but is too complicated code for me read and understand properly.
    Maybe I should seek help in another thread since my problem is only tangentially related to Visustella notetags.
  16. I've almost managed to make the code what I need it to do, but the newly created enemies won't do anything in time progress battle mode. They only take actions in turn based battle.

    <JS On Expire State>

    const NewEnemy = new Game_Enemy(2,200,200);

    $gameTroop.members().push(NewEnemy);

    const sprite = new Sprite_Enemy(NewEnemy);

    const spriteset = BattleManager._spriteset;

    spriteset.addChild(sprite);

    spriteset._enemySprites.push(sprite);

    BattleManager.setSpriteset(spriteset);

    </JS On Expire State>

    How do I make them work in TPB?
  17. Edit: Ignore

    Page didn't update. Was looking at something old
  18. ATT_Turan said:
    @Jeivalien you got your solution in that healing value is negative. I'm just curious - why are you calling Math.ceil()? Multiplying your initial value by 3 will always produce an integer.

    (unless you're specifically altering the rest of the system to allow that value to be a decimal, in which case I still don't know why you'd want to round it later :wink: )

    Hey Turan,

    Well, its not always going to be 3, the final multiplier could be anything, 3.14, 1.288, etc. I was planning on using small numbers, therefore the round down. Do you think I should avoid rounding?
  19. Jeivalien said:
    Hey Turan,

    Well, its not always going to be 3, the final multiplier could be anything, 3.14, 1.288, etc. I was planning on using small numbers, therefore the round down. Do you think I should avoid rounding?
    Not if you're planning to multiply by decimals. You just didn't have a value like that in the code you posted, so in that case it didn't make any sense to stick a number through Math.ceil() that couldn't possibly require rounding.