AggrorJorn Posted March 16, 2010 Posted March 16, 2010 I'm trying to get Create, Play and Stop Source to work in Lua. Who can tell me what I am doing wrong here? Using this results in crashing the engine. ambient=LoadSound("abstract::ambient.ogg") test =CreateSource(ambient,SOURCE_LOOP) -- a part of the MAIN LOOP if KeyHit(KEY_E)==1 then PlaySource(test) end if KeyHit(KEY_F)==1 then StopSource(test) end Quote
AggrorJorn Posted March 16, 2010 Author Posted March 16, 2010 already got it. SOURCE_LOOP has to be 1 in LUa Quote
Pancakes Posted March 23, 2010 Posted March 23, 2010 already got it. SOURCE_LOOP has to be 1 in LUa good thing you got it working, but what do you mean by SOURCE_LOOP has to be 1? Quote Core I5 2.67 / 16GB RAM / GTX 670 Zbrush/ Blender / Photoshop CS6 / Renoise / Genetica / Leadwerks 3
macklebee Posted March 23, 2010 Posted March 23, 2010 good thing you got it working, but what do you mean by SOURCE_LOOP has to be 1? he means with the code he showed, this line: test =CreateSource(ambient,SOURCE_LOOP) needs to be this: test =CreateSource(ambient,1) but if he added this to the top of his script: require("Scripts/constants/engine_const") he could have left it as SOURCE_LOOP, because SOURCE_LOOP is defined as 1 in that script... or he could have just made his own script that had that defined in it... or he could have just defined SOURCE_LOOP=1 in his script Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel
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.