(Resolved) Error with this.now function


#1

I was trying to implement a “wait” function in Deadly Dungeon Rescue, however I am getting the error:
“Line 8: tmp180[tmp181] is not a function”

I’m wondering if this is a bug or something I’m missing.


#2

Is your call to “wait(time)” nested in other function calls? If so try straight out calling it or calling it from your main loop to see if that makes a difference. (calling functions that call functions that call functions that… can get messed up along the way.)

Other than that I’d suggest reloading the level (and/or closing the browser). (I find that reloading when it starts to seem slower & slower or it starts getting weird errors, beats both things back.)


#3

Useful reading :

http://discourse.codecombat.com/t/information-about-functions/700/2

Also, another way to do, as shown in the campain (later in the mountain) is to modify the this library (? unsure of the name) by adding a new function to it. It’s useful because any function from this is available within the function you’re defining.

this.functionName = function(_param1 , _param2 ) {
    // body
    this.say( _param1 +_param2 ) ;
};

this.functionName(2,3) ;

#4

I was actually thinking that might be the problem later that day. Thank you very much. That resolves this particular issue.


#5

It’s resolved now, but thanks for the help!