Storyboard - error on device

Hey,

I am trying to implement the storyboard module into my game and it works fine - in the simulator.

But when I build my app for the device and want to open it, I get the following error message:

Dec 26 17:51:39 iPhone StoryBoard[3317] : Lua Runtime Error: lua_pcall failed with status: 2, error message is: loop or previous error loading module ‘storyboard’

I did some research and could not find a solution. So if anyone has an idea what is going on, please post your suggestions.

That´s my main.lua file:

  
-- hide the status bar  
display.setStatusBar( display.HiddenStatusBar )  
  
-- include the Corona "storyboard" module  
local storyboard = require "storyboard"  
  
centerX = display.contentWidth \* 0.5  
centerY = display.contentHeight \* 0.5  
  
-- load menu screen  
storyboard.gotoScene( "menu" )  

and that is my menu.lua:

[code]module(…, package.seeall)

local storyboard = require (“storyboard”)
local scene = storyboard.newScene()

require(“buttoncode”)

print(centerX)

– local forward references

local function buttonHit(parm)
–storyboard.gotoScene (parm, {effect = “fade”})

storyboard.gotoScene (parm)
end
function scene:createScene( event )

local group = self.view

makeButton(“Play Game”, centerX, centerY, buttonHit, “level1”, group)
makeButton(“Options”, centerX, centerY + 40, buttonHit, “options”, group)
makeButton(“Credits”, centerX, centerY + 80, buttonHit, “gamecredits”, group)
end
function scene:enterScene(event)

local group = self.view

end

function scene:exitScene(event)

local group = self.view

end

function scene:destroyScene(event)

local group = self.view

end

scene:addEventListener(“enterScene”, scene)

scene:addEventListener(“createScene”, scene)

scene:addEventListener(“exitScene”, scene)

scene:addEventListener(“destroyScene”, scene)

return scene
[/code]

I can not figure out the problem because it seems to work fine in Corona simulator.

Kind regards,

Max [import]uid: 138330 topic_id: 34303 reply_id: 334303[/import]

I think we need to see the code for your makeButton function since we have no idea what “parm” is when it hits your handler function.

[import]uid: 199310 topic_id: 34303 reply_id: 136372[/import]

@Rob Miracle:

“parm” is a string for the different scenes. If you hit one of these buttons you get the “parm” value that will direct storyboard to the specified scene in line 24-26 in the “makeButton” function.

… Hm, this function might cause the error. I will exclude it from the project and try it again. Thanks for your help so far :slight_smile:
EDIT: Hm, this does not work either. I am using the latest daily build and Xcode Developer Preview v4. I also tried to build the storyboard example and this does work. So there must be a problem with my code… [import]uid: 138330 topic_id: 34303 reply_id: 136375[/import]

You could put a print statement in right before calling storyboard.gotoScene() to make sure it’s what your expecting.

The only other thing is to make sure your .lua files match the strings you’re using. In other words calling “level1” will try to invoke “level1.lua” but it will fail to load “Level1.lua”. The device file systems are case sensitive where as the simulator is not. This is the leading cause of “It works in the sim but not the device” problem… like 95% of the time.
[import]uid: 199310 topic_id: 34303 reply_id: 136376[/import]

Uhm… I added print(“before gotoScene”) into the main.lua file and now it does work… But I noticed that the servers were not available for at least two minutes… Did you change anything? Because I don´t think that just one “print” line could make my app work…

Anyway :smiley: Thanks a lot ! [import]uid: 138330 topic_id: 34303 reply_id: 136380[/import]

I think we need to see the code for your makeButton function since we have no idea what “parm” is when it hits your handler function.

[import]uid: 199310 topic_id: 34303 reply_id: 136372[/import]

@Rob Miracle:

“parm” is a string for the different scenes. If you hit one of these buttons you get the “parm” value that will direct storyboard to the specified scene in line 24-26 in the “makeButton” function.

… Hm, this function might cause the error. I will exclude it from the project and try it again. Thanks for your help so far :slight_smile:
EDIT: Hm, this does not work either. I am using the latest daily build and Xcode Developer Preview v4. I also tried to build the storyboard example and this does work. So there must be a problem with my code… [import]uid: 138330 topic_id: 34303 reply_id: 136375[/import]

You could put a print statement in right before calling storyboard.gotoScene() to make sure it’s what your expecting.

The only other thing is to make sure your .lua files match the strings you’re using. In other words calling “level1” will try to invoke “level1.lua” but it will fail to load “Level1.lua”. The device file systems are case sensitive where as the simulator is not. This is the leading cause of “It works in the sim but not the device” problem… like 95% of the time.
[import]uid: 199310 topic_id: 34303 reply_id: 136376[/import]

Uhm… I added print(“before gotoScene”) into the main.lua file and now it does work… But I noticed that the servers were not available for at least two minutes… Did you change anything? Because I don´t think that just one “print” line could make my app work…

Anyway :smiley: Thanks a lot ! [import]uid: 138330 topic_id: 34303 reply_id: 136380[/import]