Hey guys,
Ive created this script that looks if a variable is in use, and if it isnt it stores the event ID inside, and if it is in use, its gonna look at the next variable, etc etc.
Now my question is: How do I place this script inside a plugin, in - I suppose. a function, and let the function execute from within the game. Currently ive got this inside a plugin file:
which basically is the script i made + a function.
the function call script I made is:
But when I use this, I get the error "TypeError undefined is not a function".
Id love to know what im doing wrong, and maybe some insight on functions in general, as even through ive read tutorials, I have a hard time grasping how they work.
Thanks in advance!
Ive created this script that looks if a variable is in use, and if it isnt it stores the event ID inside, and if it is in use, its gonna look at the next variable, etc etc.
Now my question is: How do I place this script inside a plugin, in - I suppose. a function, and let the function execute from within the game. Currently ive got this inside a plugin file:
Code:
testtest = function() {
for(var VV = 21; $gameVariables.value(VV) !== $gameMap.event(this._eventId)._eventId && VV <= 21+39;) {
if($gameVariables.value(VV) === 0 || $gameVariables.value(VV) === $gameMap.event(this._eventId)._eventId) {
$gameVariables.setValue(VV, $gameMap.event(this._eventId)._eventId
)} else {
VV += 1;
}}};
the function call script I made is:
Code:
this.testtest()
Id love to know what im doing wrong, and maybe some insight on functions in general, as even through ive read tutorials, I have a hard time grasping how they work.
Thanks in advance!