dennis Posted December 22, 2012 Share Posted December 22, 2012 Hey guys, I'm using sqlite3 for my game now but I have some small problems with it. as I'm coding: require("Scripts/constants/collision_const") require("Scripts/constants/engine_const") require("Scripts/constants/keycodes") require("Scripts/LinkedList") require("Scripts/filesystem") require("Scripts/math/math") require("scripts/classes/bullet") require("Scripts/hooks") require("Scripts/spline") RegisterAbstractPath("") package.loadlib("lsqlite3.dll", "luaopen_lsqlite3")() local db = sqlite3.open('game.s3db') Graphics(800, 600) fw = CreateFramework() for row in db:nrows("SELECT * FROM graphx") do bloom = SetBloom(row.Bloom) end why doesn't this work? when I open up my script editor, and want to use this value inside it it returns: no such table: graphx and when I use this and open up "engine.exe" it doesn't show up any error but still doesn't work. why? and is there any explanation how to use this inside LE2? I hope someone can help with this. Cheers Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted December 22, 2012 Share Posted December 22, 2012 Are you using Rick's sql package? http://www.leadwerks.com/werkspace/files/file/302-sqlite-for-les-lua/ I have successfully used it. Have you created the table? http://www.w3schools.com/sql/sql_create_table.asp Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted December 22, 2012 Share Posted December 22, 2012 I am writing a database wrapper and migration library atm. So boring. Quote Link to comment Share on other sites More sharing options...
dennis Posted December 22, 2012 Author Share Posted December 22, 2012 Are you using Rick's sql package? http://www.leadwerks...te-for-les-lua/ I have successfully used it. Have you created the table? http://www.w3schools...reate_table.asp That problem is fixed now but now the main problem which is I can't read the data from that database and use that tp set the bloom for example which was my actual problem. And Last one to actually show that it doesn't show the bloom Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted December 23, 2012 Share Posted December 23, 2012 I've never used SQLite before but generally in SQL syntax you would reference the field by the table name not the row as you appear to be doing when passing the parameter. I'm assuming that row just increments the table cursor: So you might try replacing row.Bloom with graphx.Bloom [EDIT] I just looked at Ricks example and he does seem to reference the row object so perhaps row is a container object that acts as a temp storage object for the rows returned from the SQL statement, in which case your original syntax seems ok! Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
dennis Posted December 23, 2012 Author Share Posted December 23, 2012 I've never used SQLite before but generally in SQL syntax you would reference the field by the table name not the row as you appear to be doing when passing the parameter. I'm assuming that row just increments the table cursor: So you might try replacing row.Bloom with graphx.Bloom [EDIT] I just looked at Ricks example and he does seem to reference the row object so perhaps row is a container object that acts as a temp storage object for the rows returned from the SQL statement, in which case your original syntax seems ok! Thanks for the help I appreciate that but I found the problem, it was an real pain in the ***. but now I'm thinking off I'm stupid lol! I forgot to add: camera = fw.main.camera that line just helped perfectly I mentioned it at the moment when I realized that an camera is needed to give graphical feedback. Thanks guys! Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 23, 2012 Share Posted December 23, 2012 Unless you were using the variable 'camera' somewhere else (as it wasn't shown in the code above), then adding that 'camera=fw.main.camera' would make no difference. Framework automatically creates cameras for all three worlds and does not require you to assign them to another variable for it to work. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
dennis Posted December 23, 2012 Author Share Posted December 23, 2012 but it now works really strange but it does Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.