RPG Maker Forums

I was just curious if we can make a global variable via the script call event command.

I have tried this

Code:
if ($test == null) {
  console.log("new");
  var $test = new TextCache();
}
but everytime I activate the event it shows "new" which means $test is null before it runs

but if I put this line in a plugin

Code:
var $test = null;
and edit the script call from
Code:
var $test = new TextCache();
into
Code:
$test = new TextCache();
everything works fine, it showed the "new" message only once.

I also tried putting the var $test = null; in a different event (of course removing the line from the plugin), and it also didnt work. I activated that event first before the main one but it resulted to also showing "new" everytime I activate the main event.

So it made me think that we cannot define a new global variable via the script call command. Is that the case?

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top