The official VisuStella notetag help thread

● ARCHIVED · READ-ONLY
Started by Trihan 1458 posts Page 71 of 73 View original ↗
  1. Hmmm, you could try to edit Window_BattleEnemy.prototype.show and Window_BattleEnemy.prototype.select to show stuff when you select a new index (like maybe with just the text picture plugin). You get the dude with BattleManager._subject and then the enemy in the functions with I think like this.enemy() and the skill with BattleManager.inputtingAction()._item Then you can calculate stuff depending on what accuracy formula you use (depending on plugins) or maybe call stuff with whatever functions they use to calculate the hit.
  2. rpgLord69 said:
    Hmmm, you could try to edit Window_BattleEnemy.prototype.show and Window_BattleEnemy.prototype.select to show stuff when you select a new index (like maybe with just the text picture plugin). You get the dude with BattleManager._subject and then the enemy in the functions with I think like this.enemy() and the skill with BattleManager.inputtingAction()._item Then you can calculate stuff depending on what accuracy formula you use (depending on plugins) or maybe call stuff with whatever functions they use to calculate the hit.
    I'm not too familiar with scripting yet, so I've no idea how to implement the suggestion here. Could you show me what you mean with an example, if possible?
  3. Well, below is an example (using a hit formula of attack hit - defender eva), BUT, for the lines that have to do with showing the number, I myself am not very familiar with that sprite/bitmap stuff, so I just put something basic for that stuff there that I copied elsewhere. Don't know if it'd be better to add the child or whatever to some other place etc.

    Also, this is just the base, you would need to add stuff like checking if the inputting action is magical or certain hit and change the formula in those cases. You'd also need to check if the attack is for all instead for one and make changes in that case. And if you're using notetags to change the hit/eva rates, you'd need to add checks for the notetags too. (You might also want to make the method by first calling window selectable select and adding the extra stuff after it + making this stuff an iife, to make the coders happy).

    Window_BattleEnemy.prototype.select = function(index) {
    this._index = index;
    this.refreshCursor();
    this.callUpdateHelp();
    if (this._hitPercentSprite) {
    SceneManager._scene.removeChild(this._hitPercentSprite);
    this._hitPercentSprite.destroy();
    }
    if (BattleManager._currentActor && this.enemy()) {
    const hitRate = (Math.round((BattleManager._currentActor.hit - this.enemy().eva)*100)).toString() + "%";
    const bitmap = new Bitmap(200, 100);
    bitmap.fontSize = 24;
    bitmap.drawText(hitRate, 0, 0, 200, 100, "left");
    this._hitPercentSprite = new Sprite();
    this._hitPercentSprite.bitmap = bitmap;
    this._hitPercentSprite.x = this.enemy().screenX();
    this._hitPercentSprite.y = this.enemy().screenY()-50;
    SceneManager._scene.addChild(this._hitPercentSprite);
    }
    };

    Window_BattleEnemy.prototype.hide = function() {
    Window_Selectable.prototype.hide.call(this);
    $gameTroop.select(null);
    if (this._hitPercentSprite) {
    SceneManager._scene.removeChild(this._hitPercentSprite);
    this._hitPercentSprite.destroy();
    }
    };
  4. rpgLord69 said:
    Well, below is an example (using a hit formula of attack hit - defender eva), BUT, for the lines that have to do with showing the number, I myself am not very familiar with that sprite/bitmap stuff, so I just put something basic for that stuff there that I copied elsewhere. Don't know if it'd be better to add the child or whatever to some other place etc.

    Also, this is just the base, you would need to add stuff like checking if the inputting action is magical or certain hit and change the formula in those cases. You'd also need to check if the attack is for all instead for one and make changes in that case. And if you're using notetags to change the hit/eva rates, you'd need to add checks for the notetags too. (You might also want to make the method by first calling window selectable select and adding the extra stuff after it + making this stuff an iife, to make the coders happy).

    Window_BattleEnemy.prototype.select = function(index) {
    this._index = index;
    this.refreshCursor();
    this.callUpdateHelp();
    if (this._hitPercentSprite) {
    SceneManager._scene.removeChild(this._hitPercentSprite);
    this._hitPercentSprite.destroy();
    }
    if (BattleManager._currentActor && this.enemy()) {
    const hitRate = (Math.round((BattleManager._currentActor.hit - this.enemy().eva)*100)).toString() + "%";
    const bitmap = new Bitmap(200, 100);
    bitmap.fontSize = 24;
    bitmap.drawText(hitRate, 0, 0, 200, 100, "left");
    this._hitPercentSprite = new Sprite();
    this._hitPercentSprite.bitmap = bitmap;
    this._hitPercentSprite.x = this.enemy().screenX();
    this._hitPercentSprite.y = this.enemy().screenY()-50;
    SceneManager._scene.addChild(this._hitPercentSprite);
    }
    };

    Window_BattleEnemy.prototype.hide = function() {
    Window_Selectable.prototype.hide.call(this);
    $gameTroop.select(null);
    if (this._hitPercentSprite) {
    SceneManager._scene.removeChild(this._hitPercentSprite);
    this._hitPercentSprite.destroy();
    }
    };
    Oof, this might be beyond my current skill level when it comes to coding anything. Still, thanks for the example, I'll keep looking around cause I'm certain this has been something asked and solved before.
  5. Hello,
    I'm having some difficulty getting this CoreEngine JS notetag to work. I'm trying to make a State that increases your Hit Rate based on the value of a variable. It's supposed to increase Hit Rate by 1% per +1 value above 1. Here is the script I currently have:

    JavaScript:
    <JS HIT Plus:
      const lvl = $gameVariables.value(3) || 1;
      value += 0.01 * Math.max(0, lvl - 1);
    >

    Am I doing something wrong here? It's supposed to be a permanent state, and reapplied every time the variable changes.
    Any help is greatly appreciated.

    Edit: Adding a console.log to it doesn't even make anything appear in the console, it's like the tag isn't even being called. I've looked at the help section for this tag over and over, and I'm pretty sure this was the correct way to write this tag. I've also tried putting it in Actor and Class sections and it won't do anything there either. I've also tried structuring it like this: <JS HIT Plus> code </JS HIT Plus>.

    The help section has it written like this:

    <JS xparam Plus: code>

    And says here:
    - Replace 'xparam' with 'HIT', 'EVA', 'CRI', 'CEV', 'MEV', 'MRF', 'CNT', 'HRG', 'MRG', 'TRG' to determine which X parameter to modify.
  6. Did you try using return to return a value? Something like:
    const X = $gameVariables.value(1)+5;
    return X;
    Or try writing just a single line "formula" there?
  7. @Dainck
    Try this:
    Code:
    <JS HIT Plus: Math.max(0.00, (($gameVariables.value(3) / 100) - 0.01))>
  8. CrocPirate said:
    @Dainck
    Try this:
    Code:
    <JS HIT Plus: Math.max(0.00, (($gameVariables.value(3) / 100) - 0.01))>
    This actually seems to have worked, thank you so much. This was driving me insane.
  9. @rpgLord69
    Thank tyou very much !
    Since I'm a begginer, I have some struggles running the script call.
    I didn't understand if I should set the position of the Click Triggers in the script. So if the position of the event is in X=8 and in Y=7 it would give:

    let x = $gameMap.canvasToMapX(TouchInput.x);
    let y = $gameMap.canvasToMapY(TouchInput.y);
    if ($gameMap.eventIdXy(8, 7)) {
    let id = $gameMap.eventIdXy(8, 7);
    if ($gameMap.event(id).event().meta.ClickTrigger){
    $gameMap.event(id).start();
    }
    }

    And this script is compatible with the code to disable mouse movements, right?
    (Note: the code I'm using :)

    Game_Temp.prototype.setDestination = function(x, y) {

    };
  10. @KMSTONE Nah, leave the x and y there, don't change anything. But there has to be a <ClickTrigger> notetag (written together) on the event.

    EDIT: You might also want to add another check on the conditional, like put in the script field TouchInput.isPressed() && !$gameMap.isEventRunning()
  11. I got myself the Weakness Display thing but I'm having issues where the weakness is not displaying on the enemies. Here are the images and I do hope someone helps me figure this one out.

    1758746475003.png1758746560149.png1758746577047.png
  12. @rpgLord69

    Sorry, I still have some struggles ^^'. I will attach screenshots to make sure I understand what you are advising me to do :

    There is this script that runs at the start of the game to disable character movement with mouse clicks.


    image.png

    This is the event I want to run when I click on it with the mouse :
    image.png
    And so in order for me to be able to enable it on it, despite the fact that I have disabled the player's movements with mouse clicks, I have to put this script in parallel:



    image.png

    Since it doesn't work, there is something I didn't do right, but where?
  13. @KMSTONE Yeah like I said you need to write ClickTrigger together (it's written separately for the VS plugin). Also, it's better to put that setDestination override as a plugin file instead of event (copy paste it into notepad, save as .js file in the plugins folder and add it through plugin manager).

    @Soldiernith If you show what's happening and tell what you'd want to happen, people might be able to help you better.
  14. @rpgLord69
    It's perfect, thank you so much !!
  15. rpgLord69 said:
    @KMSTONE Yeah like I said you need to write ClickTrigger together (it's written separately for the VS plugin). Also, it's better to put that setDestination override as a plugin file instead of event (copy paste it into notepad, save as .js file in the plugins folder and add it through plugin manager).

    @Soldiernith If you show what's happening and tell what you'd want to happen, people might be able to help you better.
    Eh I did explain what I want to happen. What I want to happen is to have the plugin show the Elemental Weakness Icons that my enemies and possibly for my characters as well, are weak to. Basically, what the plugin is supposed to do. But, as of now, nothing is happening.

    Image from the Plugin document site

    1759157632355.png
  16. Nah man, it wasn't 100% obvious that nothing's happening. Anyway, it works for me (my plugins aren't updated to the newest versions though). If your elements are protected, it'll show the break shield protect icon though.
  17. Welp. As soon as I was about to send what I was getting, the engine liked fixed itself for me.
    1759182005153.png1759182060514.png
  18. Hello!
    I'm using the "Anti-Damage Barriers" plugin.
    I'm using one of the barriers the plugins provides, the absorption barrier.
    It's possible to add a regeneration or degeneration effect to the barrier.
    I have a regenerating absorption barrier, and was wondering if it would be possible to create a popup to display how much of the barrier was regenerated, much alike to standard regeneration popups for HP and such.
  19. Hmmm, put like on same line (example):

    <Absorb Barrier Regen: const amount = Math.randomInt(10); user.setupTextPopup(amount.toString(), {'textColor': '#a020f0', 'flashColor': [255, 0, 0, 160], 'flashDuration': 60}); amount>
  20. Hello, is it possible to use the notetags to have a skill disappear and/or prevent it from being used again once its used