[r109] this.eventvar is null

0 favourites
  • 7 posts
  • I'm getting the following popup:

    Javascript error!

    TypeError: this.eventvar is null

    localhost/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.

  • 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)

  • 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.

  • 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?

  • 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!

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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).

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)