deltadaedalus/vudu

unable to load vudu in either MacOs or iOS due to "attempt to concatenation global '_vdreq' (a nil value)" error

Closed this issue · 9 comments

Hi.

Vudu looks very interesting. However, I'm unable to get it to load. I followed the instruction s on GitHub by dropping vudu folder into a project. To just test out the bare bones of vudu (e.g. to test running commands in the console), I didn't include any game code and just made my main.lua file as:

vudu = require("vudu")
function love.load()
vudu.initialize()
end

Then zipped up that main.lua file and the the other files in the vudu folder to make a .love file. When I then tried to load it either using Love2D either on my iPad (ios) or Mac Desktop (OSX), I consistently got the following error:

vudu.lua:1: attempt to concatenation global '_vdreq' (a nil value).

Do you have any suggestions to try and correct the error?

Thanks!

Howdy,

It's been a long time since I've touched this, but I have a hypothesis about your issue:
Require ("vudu") should be pulling in the folder titled vudu, which should be basically equivalent to actually requiring the file vudu/init.lua. Either this mechanism doesn't work quite the same on OSX, or you've added the contents of the vudu folder to your project instead of the whole intact folder, which would mean it's directly requiring vudu.lua and not getting the setup it's supposed to from init.lua (i.e. defining _vdreq).

Let me know what you find, if there's some change I need to make to support OSX, or some clarification I need to make in the docs due to some differing behaviour of OSX's file explorer, then I'd of course like to make that change.

Thanks

Thanks, @deltadaedalus, I apologize: I didn't realize I was suppose to require the folder and not vudu.lua. When I moved main.lua up a level in the same level of the vudu folder, it worked fine.

Follow up question: can I "live code" graphics with vudu (i.e. can I type a graphical command in the vudu console and display a vudu graphics object)? I tried that but didn't seem to work. I know a lot of other lua debuggers don't let you display graphics from simply typing graphics commands in the terminal and instead need to be included in the actual main.file love.draw or love.update game loop but was just wonder (would be great if could test out love/vudu graphics commands live that I type into the console).

Thanks!

Again with it in mind that I haven't worked on this code in a long time: I think that those graphics commands should work from the console, I'd first try a "ping" in a spot that you know it will show, since those are meant to persist across frames. vudu graphics objects are put into a persistent list, and are rendered within the love.draw loop at the end of every frame for as long as they persist. Perhaps you are giving them too short a time-to-live for them to actually render? I could be misremembering, but I at least see no good reason vudu.graphics.drawPing shouldn't work from the console.

Love graphics from the console isn't something I think can be supported easily, I do have an old local change which would allow creation of watch windows for canvas objects, which could do something like that, but really it's a problem I'd have to think about more.

Thanks, @deltadaedalus.

When I try to drawPing (e.g. vudu.graphics.drawPing({1,0,0},60,150,50,5) from the vudu console, I get the following error (both on Love2D 11.3 running in iOS [iPad] or OSX [iMac]):

Error
vudu/vudugraphics.lua:67: attempt to index global 'vdUtil' (a nil value)

Traceback
[love "callbacks.lua"]:228: in function 'handler'
vudu/vudugraphics.lua:67: in function 'setColor'
vudu/vudugraphics.lua:149: in function 'draw'
vudu/vudugraphics.lua:28: in function 'draw'
vudu/vudu.lua:219: in function 'draw'
vudu/vudu.lua:189: in function 'draw'
[love "callbacks.lua"]:168: in function <[love "callbacks.lua"]:144>
[C]: in function 'xpcall'

If you think of any solutions (at your convenience), please let me know, and I'll try further to get vudu.graphics to work in the console.

Have a good rest of your weekend.

Silly error on my end (which I've made a few times, unfortunately), vdUtil was globally defined in my test project, rather than locally defined as it should have in some of the other files (graphics and physics). Made the change on master, let me know if this helps.

Thank you very much, @deltadaedalus, that fixed it, and now it works great! I can live code and test out Love2D graphics directly on my iPad using Vudu :-). I'm now looking forward to live coding/testing out vudu's physics system. I've now got a mini-IDE to create Love2d directly on my iPad (Textastic editor + Love2d plug in to write scripts, Vudu to debug and try out Love2D graphics, and Love2d app for iOS to run the apps). I don't think anyone else has yet created an app that lets you live code Love2d graphics directly inside of a .love app) :-)

I realize I do need to keep in mind that vudu's graphics commands are slightly different syntax than love2d's.

@deltadaedalus,
One more shout out for how awesome your Vudu editor is!
Here's a snapshot of me editing the 3DreamEngine Library with Vudu live on my iPad :-)

IMG_1232

That's awesome! I would never have guessed my goofy little tool would just magically work in such a specialized environment!

As the foremost (known) power user of vudu, do you have any pie-in-the-sky recommendations for what features would be most helpful to you?

Thanks, @deltadaedalus, for granting me the title of "Vudu Power User". I am honored :-).

For now, Vudu exceeds all my expectations and pie-in-the-sky hopes. Perhaps as I become more of an experienced love2D programmer, I can email/post you back with suggestions. I was very pleasantly surprised yesterday about how well it worked with the 3DreamEngine. The 3DreamEngine developer seems to do some advanced things with his engine, and I was trying to figure out where he stored the vec3 positions of the 3D models I imported. I used Vudu to try and look for the positions as properties under my models but surprisingly, he does not store the models positions in real time directly in the "positions" tables of each mesh. The api explains that one uses a function to change a 3D model's coordinates (e.g. shipmodel:translate(x,y,z). I didn't think I'd be able to use the engines code in Vudu's REPL but on a whim gave it a try and it worked-- the model's position changed! That will save me a lot of time in terms of deciding where I want to position my models (as opposed to the alternative older workflow of "guessing" 3D coordinates in the 3D world, drafting script with those coordinates, zipping up my love 2D project, loading and running it in love2D on my iPad and then seeing the results and repeating that process every time the coordinate is not right.

I also plug Vudu to different developers whenever I get the chance. Recently a developer posted on the love2D showcase forum that they were trying to develop a cross-platform spelling teacher for kids based on a love2D text editor that he made from scratch. Unfortunately, on the mobile devices (like iOS), for some reason the text is not displayed (despite him using the love2D command to enabling text for mobile in his project). I told him that love2D project that I use with the most interactive text is Vudu and recommended he look at how you made your REPL, and he appreciated that suggestion. :-)