Hi,
in this excel_sheet at sheet 'Advanced' the first entry
How is the correct syntax to get all 3 argunemts
["add", "weapon", "3"] in separat js.variables ?With kindest regards
and Thank you in advance
Nafraju
["add", "weapon", "3"] in separat js.variables ?The same way you use variables otherwise 😉
var arg1="add", arg2="weapon", arg3="3";
this.pluginCommand("ItemBook", [arg1, arg2, arg3]);
I'm sorry, I'm really not sure what you're asking. They are separate variables, I defined them one at a time in the first line of my code.
this.pluginCommand("ItemBook", [arg1, arg2, arg3]);It's basically the same. You can see if you just open the JS file and look at the code of the pluginCommand function. Here's also a reference for you:
var MyValiable_01 = args[0]; // of this array ["add", "weapon", "3"] set "add" I've split this into its own thread in Learning JavaScript. Thank you.
const args = ["add", "weapon", "3"];
console.log(args[0]); // > "add"
Game_Interpreter.prototype.pluginCommand = function(command, args) {
// to be overridden by plugins
};
args here. So, within that function, you can reference the value of the second argument passed into the function as args.Original thread: https://forums.rpgmakerweb.com/threads/how-is-the-correct-syntax-to-get-all-3-argunemts-add-weapon-3-in-separat-js-variables.147257/