Undefined

firststef

Veteran
Veteran
Joined
Jan 3, 2017
Messages
79
Reaction score
9
First Language
Romanian
Where can i effectively define a variable because it seems no matter where i put

var a = 0;
console.log(a)

it shows undefined.

Currently modifying a plugin and i need a new variable.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
That is exactly the problem - it depends on where you put which command.
And that is not the same answer everywhere, because in some positions it becomes a global definition, in others an instance definition and in still other positions it won't work at all.

Please give a link to the website of the plugin you want to modify and tell us where you want to modify it, then we can help
 

firststef

Veteran
Veteran
Joined
Jan 3, 2017
Messages
79
Reaction score
9
First Language
Romanian
Sorry for the late answer i was in vacation.

I managed it eventually. I was supposed to put the variable above ALL the code and not in a function that i would call, and also remove it from
function(variable) to just function().
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top