Navigation

    forum

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    1. Home
    2. JustMonkeyCode
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups
    • Blog

    JustMonkeyCode

    @JustMonkeyCode

    19
    Posts
    1236
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    JustMonkeyCode Follow

    Posts made by JustMonkeyCode

    • RE: Mysterious error without stack trace

      I've been having strange undefined errors as well.

      First thing I've found out. It appears there have been some changes to the scoping of variables. Before a variable instantiated like myVar = "test", without a var was globally visible. This no longer seems to be true, but on the up side we now can say global.myVar = "test" and have it work fine everywhere except from the console. This is due the second change I've noticed today.

      The console now seems to happen before the main script (and so before anything we write is defined) instead of after as it had be doing. I'm also seeing some console statements being issued multiple times at random intervals after being entered. It does not seem to happen for a console.log issued at the console but when I started getting strange behavior, I added the following code at the very start of my main module:

      console.log('--')
      if(global.test) console.log('from console', global.test);
      

      From the console, issuing test = "a test" just once results in the conditional being triggered once on the very next tick and then around a half dozen more times on random ticks latter. I was still collecting information when I saw your post.

      posted in Technical Issues and Bugs
      JustMonkeyCode
    • RE: Is there any way to execute some function from console?

      The scoping I posted about earlier no longer functions. sigh Time for a major rewrite of all my code.

      posted in Help
      JustMonkeyCode
    • RE: Add the node "global" object to the environment. so that methods declared on it become global to all modules

      While my post was true at the time I posted it, this no longer works, which is not awesome. I was using that fact to expose my constructors globally.

      posted in Feature Requests
      JustMonkeyCode
    • RE: Is there any way to execute some function from console?

      To expand a bit on TheNumberOne's answer, if you defined your function like

      func = function () {dosomethin}
      

      it will be accessible globally (which includes the console). This removes the need to require anything on the console. Note the lack of var, this is important. Both var func and function func limit the scope. If you want it to all hang out, don't dress it up 🙂

      posted in Help
      JustMonkeyCode
    • Unable to expand some watch entries of the `Memory` tab in a windowed editor

      When the code editor is in a separate window, clicking the Memory root entry on the Memory tab has no effect. Other watch paths may or may not expand seemingly at random. Occasionally when another watch path fails to expand, it will acquire a striped animated background which remains until windowed editor is closed.

      None of these issues occur in the docked version of the editor.

      posted in Technical Issues and Bugs
      JustMonkeyCode
    • The ability to preview forum responses before posting and edit after posting

      This forum is naturally going to discuss a lot of code and other technical ideas. Markdown is valuable in helping to communicate clearly, but a poorly placed type-o can render the post difficult to read. Right now the only way to correct a mistake, AFAK, is to delete the offending post and create a new one, but this leads to noise in the inboxes of anyone following the thread.

      posted in Feature Requests
      JustMonkeyCode
    • RE: Add the node "global" object to the environment. so that methods declared on it become global to all modules

      I don't know if this will help you, but objects created without var are visible globally.

      myModule:

      myGlobalVar = "immaglobal";
      var myLocalVar = "immalocal";
      

      myOtherModule:

      console.log(myGlobal); // "immaglobal"
      console.log(myLocal); // error, undefined
      

      main:

      require('myModule');
      require('myOtherModule');
      console.log(myGlobal); // > "immaglobal"
      console.log(myLocal); // > error, undefined
      
      posted in Feature Requests
      JustMonkeyCode
    • API access to Player 2

      In response to a little mishap involving the sim room (I lost all my code), I've written a local script to post my code using the user API and I was wondering if it were possable to access the sim room Player 2 via that same API.

      posted in Help
      JustMonkeyCode
    • RE: Switching between players in sim room may result in loss of code

      Thanks chris, glad to know they respond. I'm not going to take advantage of that this time around. I think I can do a better job starting over and this time I'll be working locally using their API to post code, but just for future reference (and for other's who may run into the same issue), where did you post that rollback request?

      posted in Technical Issues and Bugs
      JustMonkeyCode
    • Switching between players in sim room may result in loss of code

      To test a few lines of code in isolation, I switched to Player 2 then replaced all of my live code with the few lines in question. I have done this previously successfully. When finished, I switched back to my account's Player. My code was not restored. Both players now possessed only the few lines that I had been testing.

      posted in Technical Issues and Bugs
      JustMonkeyCode