[r109] this.eventvar is null

Bugs will be moved here once resolved.

Post » Tue Nov 13, 2012 4:16 pm

I'm getting the following popup:

Javascript error!
TypeError: this.eventvar is null
http://localhost:50000/expressions.js, line 678 (col undefined)

This is either a bug in Construct 2 or a problem in a third party plugin or behavior - please report it to the developer!

---
Can't seem to figure out where in the event sheet this error is occurring, I had been switching out rex's Function events out for the new Function object. It had been working fine, then at some point it stopped working and disabling all functions didn't seem to solve the issue, which is why I can't reproduce this in a clean .capx.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Nov 13, 2012 5:56 pm

Yikes. I might try copying everything to a new project. Leave the functions until last, as you said the error happens without them. When you see it works, copy the functions to the new one.

(theory being that if the functions broke it, and you don't copy them first, it should work again.)

edit: (and you said it doesn't reproduce in a clean capx)Paradox2012-11-13 17:59:59
B
200
S
51
G
30
Posts: 896
Reputation: 36,494

Post » Wed Nov 14, 2012 1:10 pm

Okay, found the event causing this error.

Basically, I had a function call with string parameter. In the called function, there was another function call with Function.Param(0). I expected the string parameter to be taken.

When I removed the parameter and had the function instead refer the global variable instead, the error no longer pops up.

Hope that helps, @Ashley.

It was like this (with Variable at "Something"):

Event1: Call "SetStuff",Variable

On "SetStuff": Call "DoStuff",Function.Param(0)

This threw the this.eventvar is null error, for some reason.Mipey2012-11-14 13:11:32
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Wed Nov 14, 2012 1:57 pm

It's a known bug and already fixed that passing event variables as Function parameters doesn't work in r109. Does that sound like the same issue?
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Wed Nov 14, 2012 2:24 pm

I'm not sure, what do you mean by event variables? Variables that are only defined on the scope of event, such as Function.Param()? If that's the case, then I can rest easy, knowing it will be fixed in next release!
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Wed Nov 14, 2012 4:22 pm

@Ashley- Yes, this was what I encountered too. I think this is the same issue. Is it due to the scope of the variables? After changing out the local variables using instance variables, the error stopped.
B
7
Posts: 38
Reputation: 683

Post » Wed Nov 14, 2012 5:15 pm

@Mipey - 'event variables' means both local and global variables. Sorry, it's my own term I use in the engine (since they both share lots of implementation).
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest