I'm testing lua and i have the same kind of problem (a black screen) with this code
--Register abstract path
RegisterAbstractPath("D:\Leadwerks\LPisland")
--Set graphics mode
if Graphics(1024,768)==0 then
Notify("Failed to set graphics mode.",1)
return
end
--Create framewerk object and set it to a global object so other scripts can access it
framework=CreateFramework()
if framework==nil then
Notify("Failed to initialize engine.",1)
return
end
SetGlobalObject("framewerk",framework)
camera=framework.main.camera
scene=LoadScene("abstract::islands3.sbx")
if scene==nil then
AppLog('***************** NULL')
return
end
light=CreateDirectionalLight()
light:SetRotationf(45,45,0)
while AppTerminate()==0 do
framework:Update()
framework:Render()
Flip(0)
end
the console says ***************** NULL and the script ends.
- if i use "abstract::tunnels.sbx" like gordon it works.
- my RegisterAbstractPath is correct and points to my islands3.sbx directory
- islands3.sbx spelling is correct, and the path "D:\Leadwerks\LPisland" also.
- the same kind of code in pascal works fine, only my full lua experiment fails
- if i specify the full path like scene=LoadScene("D:\Leadwerks\LPisland\islands3.sbx") i still get the ********* NULL console message
Can someone try to do a LoadScene from a custom sbx file located elsewhere than in LE maps folder ?
if you have ideas how to solve this, you're welcome
i also wonder how actionsnake is loading it's sbx files ? i did not find any loadscene in actionsnake lua files ?
Thank you
EDIT : okey it's m fault , it works, the camera is just misplaced and i should not have tested "if scene==nil then", but rather "if scene==0 then" or maybe "if scene==nul then" because CreateFramework returns a pointer ... and loadscene a handle.