How Do I Access a New Build I downloaded

I feel embarassed having to ask this but I have been having trouble getting corona to work with the physics engine using the code below:

local physics = require ( “physics” )

… and from what i found online i figured it’d just need me to update the build so i downloaded it but im not sure what to do next. Also in case that isnt the case it has been giving me the error that the physics module is not found.

Hi @slitt635,

It’s not “embarrassing” to ask questions here. :slight_smile:

It appears that you are using the proper code to include the physics engine in your project. As for the error, do you have some file in your project directory named “physics.lua”? If so, you should not have a file by that exact name.

Generally, I include and “start” the physics engine like this:

[lua]

local physics = require( “physics” )

physics.start()

physics.setGravity( 0, 9.8 )

physics.setDrawMode( “normal” )

[/lua]

Best regards,

Brent

Thanks for the reply Brent, i really appreciate it since im new to the lua language. As for the file I did start the physics engine i just didnt include it in my post, but it doesnt seem like i have any file by that name in my directory.

Hi @slitt635,

Can you run a sample physics project in your Corona Simulator? Try the one located in your local Corona SDK application folder here:

SampleCode > Physics > HelloPhysics

Brent

I just tried that (great idea by the way i should’ve tried that) and its giving me the same error, which i pasted below to maybe help me figure this out more:

lua: main.lua:7: module ‘physics’ not found:
    no field package.preload[‘physics’]
    no file ‘.\physics.lua’
    no file ‘C:\Program Files (x86)\Lua\5.1\lua\physics.lua’
    no file ‘C:\Program Files (x86)\Lua\5.1\lua\physics\init.lua’
    no file ‘C:\Program Files (x86)\Lua\5.1\physics.lua’
    no file ‘C:\Program Files (x86)\Lua\5.1\physics\init.lua’
    no file ‘C:\Program Files (x86)\Lua\5.1\lua\physics.luac’
    no file ‘.\physics.dll’
    no file ‘.\physics51.dll’
    no file ‘C:\Program Files (x86)\Lua\5.1\physics.dll’
    no file ‘C:\Program Files (x86)\Lua\5.1\physics51.dll’
    no file ‘C:\Program Files (x86)\Lua\5.1\clibs\physics.dll’
    no file ‘C:\Program Files (x86)\Lua\5.1\clibs\physics51.dll’
    no file ‘C:\Program Files (x86)\Lua\5.1\loadall.dll’
    no file ‘C:\Program Files (x86)\Lua\5.1\clibs\loadall.dll’

The strange thing is that my app is still running in the simulator

Thanks again for your help Brent i really appreciate it

Which build of Corona did you download? The latest official release?

Im using Corona Simuator 2015.2731 (2015.10.5) I just updated it last night with the same error as above

What are you using for a text editor?

just the simple lua 5.1 editor since i dont have the money for sublime text

I don’t know what the “simple Lua 5.1” editor is. I’ve seen things like this where someone might be editing in Microsoft Word and odd/invisible characters gets inserted and cause problems.

On Windows Notepad ++ seems to be the free editor of choice there, but you can also get Komodo Edit for Windows too.

I’m confused a bit by the path’s in the error message:

no file 'C:\Program Files (x86)\Lua\5.1\lua\physics.lua’

We don’t require you to have Lua installed to use Corona SDK. You don’t use the standalone version of Lua to do this. Just use a simple text editor to edit your code and point Corona SDK’s simulator at that folder to open.

Rob

Hi @slitt635,

It’s not “embarrassing” to ask questions here. :slight_smile:

It appears that you are using the proper code to include the physics engine in your project. As for the error, do you have some file in your project directory named “physics.lua”? If so, you should not have a file by that exact name.

Generally, I include and “start” the physics engine like this:

[lua]

local physics = require( “physics” )

physics.start()

physics.setGravity( 0, 9.8 )

physics.setDrawMode( “normal” )

[/lua]

Best regards,

Brent

Thanks for the reply Brent, i really appreciate it since im new to the lua language. As for the file I did start the physics engine i just didnt include it in my post, but it doesnt seem like i have any file by that name in my directory.

Hi @slitt635,

Can you run a sample physics project in your Corona Simulator? Try the one located in your local Corona SDK application folder here:

SampleCode > Physics > HelloPhysics

Brent

I just tried that (great idea by the way i should’ve tried that) and its giving me the same error, which i pasted below to maybe help me figure this out more:

lua: main.lua:7: module ‘physics’ not found:
    no field package.preload[‘physics’]
    no file ‘.\physics.lua’
    no file ‘C:\Program Files (x86)\Lua\5.1\lua\physics.lua’
    no file ‘C:\Program Files (x86)\Lua\5.1\lua\physics\init.lua’
    no file ‘C:\Program Files (x86)\Lua\5.1\physics.lua’
    no file ‘C:\Program Files (x86)\Lua\5.1\physics\init.lua’
    no file ‘C:\Program Files (x86)\Lua\5.1\lua\physics.luac’
    no file ‘.\physics.dll’
    no file ‘.\physics51.dll’
    no file ‘C:\Program Files (x86)\Lua\5.1\physics.dll’
    no file ‘C:\Program Files (x86)\Lua\5.1\physics51.dll’
    no file ‘C:\Program Files (x86)\Lua\5.1\clibs\physics.dll’
    no file ‘C:\Program Files (x86)\Lua\5.1\clibs\physics51.dll’
    no file ‘C:\Program Files (x86)\Lua\5.1\loadall.dll’
    no file ‘C:\Program Files (x86)\Lua\5.1\clibs\loadall.dll’

The strange thing is that my app is still running in the simulator

Thanks again for your help Brent i really appreciate it

Which build of Corona did you download? The latest official release?

Im using Corona Simuator 2015.2731 (2015.10.5) I just updated it last night with the same error as above

What are you using for a text editor?

just the simple lua 5.1 editor since i dont have the money for sublime text

I don’t know what the “simple Lua 5.1” editor is. I’ve seen things like this where someone might be editing in Microsoft Word and odd/invisible characters gets inserted and cause problems.

On Windows Notepad ++ seems to be the free editor of choice there, but you can also get Komodo Edit for Windows too.

I’m confused a bit by the path’s in the error message:

no file 'C:\Program Files (x86)\Lua\5.1\lua\physics.lua’

We don’t require you to have Lua installed to use Corona SDK. You don’t use the standalone version of Lua to do this. Just use a simple text editor to edit your code and point Corona SDK’s simulator at that folder to open.

Rob