Hello,
I'm learning how to make a plugin, and I would like to know how to import javascript files inside a plugin.
When I do it with import it says :
Thanks for the answers !
I'm learning how to make a plugin, and I would like to know how to import javascript files inside a plugin.
When I do it with import it says :
cf my js sample
JavaScript:
/**
* utilities function for global event
*
* @target MZ
*/
import { Vector2 } from './BE_Vector2.js'; // here is my non working import
var Imported = Imported|| {};
var BE = BE || {};
BE.Util = BE.Util || {};
(() => {
const pluginName = "BE_GlobalEvents";
const VarMoveTimer = 1;
const PlayerLastTile = 2;
const PlayerCurrentTile = 3;
var __lastKnownPosition = Vector2(-1, -1);
BE.Util.logVariables = function (interpreter) {
$gameVariables.setValue(PlayerCurrentTile, 'It works');
}
BE.Util.isLastPositionChanged = function (interpreter) {
currentPos = Vector2($gamePlayer.x, $gamePlayer.y);
if (__lastKnownPosition.equal(currentPos) != true) {
__lastKnownPosition = currentPos;
return true;
}
return false;
}
})();
Thanks for the answers !