JavaScript questions that don't deserve their own thread

@Lonewulf123 That question is better for a Plugin Support post - or, really, sent to the VisuStella team.

Their plugins are obfuscated, which means we can't just open them up and read the code. If they don't tell you about the format of a script call in the plugin instructions, we can't look up the answer.
@Lonewulf123 That question is better for a Plugin Support post - or, really, sent to the VisuStella team.

Their plugins are obfuscated, which means we can't just open them up and read the code. If they don't tell you about the format of a script call in the plugin instructions, we can't look up the answer.
Yes, I know. I already asked there, but figured I would ask here just in case someone had any experience.
How can I disable the use of a specific item by a javascript condition?
How can I disable the use of a specific item by a javascript condition?
Alias the use item function to check for the item Id
If I had a plugin add a menu item and I wanted to hide it, how do I do that?
The plugin in question is in Japanese but I can provide a link or the JS file itself.
@herpinderpinlol That would depend on the plugin - many of them include plugin commands to show and hide their menu options.

Per the first post in this thread, it's not for asking for help with plugins. You should make a new thread in Plugin Support and provide the name of the plugin and a link to where it can be downloaded (don't redistribute plugins in your posts unless it was made just for you).
Hi everyone, sort of new here and I have a question that is probably not worth it's own thread.
I'm working on a MZ plugin to add some windows and scenes, I had everything on a big JS file for the plugin and it works great. However, I would like to have the new classes I added on separate files so this file stops being so big.
inside plugins/ I have lets say myPlugin.js, and in there I have import statements for all my classes:
Code:
import './classFolder/class1.js';
import './classFolder/class2.js';
import './classFolder/class3.js';
import './classFolder/class4.js';

(() => {
    const pluginName = "myPlugin";
// plugin implementation
When I try to run it I get an error 'Cannot use import statement outside a module'.

I havent been able to find a solution for this, anyone here has encountered this issue before? Does MZ not support modules?
Does buffRate have a coded value of 1? I'm using YEP_BaseParamControl. This is the MHP formula:

(base + plus) + buffRate + flat

An actor has a MHP of 3 and an enemy has a MHP of 15, but in-game, their respective MHP values are of 4 and 16, respectively. By removing buffRate from the formula, their in-game MHP values are as stated in the database.

Since I'm already asking about buffRate, if I'm using states as buffs, is there a point of leaving it in the formula?
Does buffRate have a coded value of 1? I'm using YEP_BaseParamControl. This is the MHP formula:
pretty sure the buff rate is 1+(buff stacks * stack value). its supposed to be a multiplicative factor.
the default given by the plugin's help file is (base + plus) * paramRate * buffRate + flat
pretty sure the buff rate is 1+(buff stacks * stack value). its supposed to be a multiplicative factor.
the default given by the plugin's help file is (base + plus) * paramRate * buffRate + flat
Thanks. I was just trying to understand why it's adding 1 to MHP value of the battlers. I'm aware of what the base formula is, I changed it on purpose.
@AldoJV That shouldn't be necessary. Everything you have included as a plugin will be loaded into the game in its order in the plugin manager, so it's all accessible across files (unless you've specifically encapsulated it in which case you can choose not to do that or you can look up how to code around it )

Take a look at how the default code is created and organized in rmmz_scenes and rmmz_windows - is your custom code taking up more space than everything created for the default engine?

To answer your question, from the documentation for import:
1713123422918.png
@ATT_Turan thanks for replying!
Its not a lot of code, I'm just trying to have one file per class for easier understanding.
I ended up looking at how main.js loads the scripts and did something similar to have my classes defined.
@AldoJV Something like that can make sense if you're creating your own program entirely. If you're making a plugin, that's generally harder to use - it probably makes more sense to put everything related to the plugin into one file.

Regardless, there should be no need for special syntax or commands to access things from other files. They're all a part of the same project.
How do I check if the player is inside a world map?
How do I check if the player is inside a world map?
define "world map". thats not a distinction within the engine. Forgot thats a tileset property and not a map property

if you have a map that youve designated as your world map, you can use "$gameMap._mapId == x" to check if the player is currently on it
If you have multiple world maps, $gameMap.isOverworld() might also work. Provided you are using "World Type" tile sets for your world maps, of course.
Hi,

I'm using this little scriptlet to increase the size of the Damage popups in my MZ game.

JavaScript:
Sprite_Damage.prototype.fontSize = function() {
  return $gameSystem.mainFontSize() + 20; 
};

However, it effects both the damage popup numbers and the state popups.

Is there a way to make it so it only effects the damage number popups?
I'm using this little scriptlet to increase the size of the Damage popups in my MZ game.
However, it effects both the damage popup numbers and the state popups.
What are "state popups"?
I am trying to write a plugin to rewind time (make events and the player move back a position every time you run the rewind function)
1. How do I log the player's "event id" or make it return 0 or -1 because right now it logs the player as undefined.
2. How do I call the function to rewind time from the Game Interpreter (or an event page or common event page)?

JavaScript:
var AquaEcho = AquaEcho || {};
AquaEcho.Rewind = AquaEcho.Rewind || {};
var AErewindLog=[];

AquaEcho.Rewind.setMovementSuccess = Game_CharacterBase.prototype.setMovementSuccess;
Game_CharacterBase.prototype.setMovementSuccess= function(success) {
  AErewindLog.unshift([this._eventId, this.x, this.y]); 
};

AquaEcho.Rewind.reserveTransfer = Game_Player.prototype.reserveTransfer;
  Game_Player.prototype.reserveTransfer = function(mapId, x, y, d, fadeType) {
      AquaEcho.Rewind.reserveTransfer.apply(this, arguments);
      AErewindLog=[];
    };

Game_Interpreter.prototype.rewind() = function(){
  if([AErewindLog[0][0]]<0){
    $gamePlayer.setPosition(AErewindLog[0][1],AErewindLog[0][2]);
  } else {
    this.character[AErewindLog[0][0]].setPosition(AErewindLog[0][1],AErewindLog[0][2]);
  }
  AErewindLog.pop(); 
}
1714448996366.png
1. How do I log the player's "event id"
You can't because it doesn't have one - the player isn't an event. You could do something someplace to check whether this == $gamePlayer and supply a special value there.

2. How do I call the function to rewind time from the Game Interpreter (or an event page or common event page)?
You have the wrong syntax for your function declaration. Just like the other functions above it, you don't put the parentheses after the function's name (rewind) - they go after the word function.
Code:
Game_Interpreter.prototype.rewind = function()

Original thread: https://forums.rpgmakerweb.com/threads/javascript-questions-that-dont-deserve-their-own-thread.46341/