Decoda Debugging support

RaptormeatRaptormeat Join Date: 2012-05-05 Member: 151602Members
I'm loving Decoda- it's a complete lifesaver and I bought a licence. My only problem with it is that I can't get the__towatch() function to work.

I'm using Luabind, so perhaps that's the problem, but I can't seem to figure out how to write a __towatch() function that Decoda will discover.

I've also tried just bypassing this altogether and writing __towatch() directly in Lua. I've found that this doesn't work either. When I put an object in the watch window, it gives the "no operator defined" error. When I call the __towatch() function directly though, even if done in the watch window, it works fine.

Can anyone offer any tips about this? I tried emailing support but I never received a response.

Comments

  • fsfodfsfod uk Join Date: 2004-04-09 Member: 27810Members, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    You need to return 2 values from your __towatch function the first has tobe the type name that shows up in the decoda watch window and the second being the the table of members and there values which I guess you were already returning before
  • RaptormeatRaptormeat Join Date: 2012-05-05 Member: 151602Members
    I never replied to this to thank you for your suggestion. It was very helpful.

    Additionally, the main problem I was dealing with was a misunderstanding of how Luabind's class system worked. It turns out that all userdata "classes" registered with Luabind use the same metatable. What I was doing wasn't working, and trying to give them all individual __towatch() functions also wasn't going to work.

    What I did was create a single watch function in Lua, which calls a C++ method which all of my Luabind classes have defined, and returns the data according to the requirements fsfod laid out. Then I created an instance of ANY Luabind class, grabbed its metatable, and set __towatch() to this function. Now all Luabind classes call this function in the watch window.

    Hope that makes sense and helps out anyone from Google with a similar problem.
Sign In or Register to comment.