Storyboard problems with declaration of variables?

Hi, this is so strange…I am having real problems declaring my variables when I use storyboard from time to time…

I am having my variables declared in the top of my code where there are no functions like scene:createScene( event ) or simliar. This has always worked well in the previous version and I am on the latest daily builds.

The error I am getting is:

Cannot transition to a scene that does not exist. If you called storyboard.removeScene() on a scene that is NOT represented by a module, the scene must be recreated before transitioning back to it.

Anyone knows whats going on here? How can my declared variables create this error? Should I move them to another place?

Joakim [import]uid: 81188 topic_id: 25657 reply_id: 325657[/import]

This is the new storyboard’s way of telling you that you have an error and giving you ZERO information about the error. Prior to the latest round of fixes, I’m pretty sure you got error messages on the console.

Director used to have the same problem, but with 1.4 at least, it now also tells you the error that it got.

The only work around I’ve found is to use CIDER (though the CoronaComplete debugger would probably work too) debugger, IDE. It trys to detect errors in your code before you run it. [import]uid: 19626 topic_id: 25657 reply_id: 103708[/import]

Yepp, I found a trick to show the error and it was not related to storyboard…

Joakim [import]uid: 81188 topic_id: 25657 reply_id: 103711[/import]

Joakim,

Would you mind sharing that tip, as well as what the error was? Same thing started happening to me out of nowhere this morning. Updated to latest daily build with same result. Any insight you have would be most appreciated!!

Thanks so much,

Chris [import]uid: 97836 topic_id: 25657 reply_id: 104727[/import]

The error is caused because the storyboard scene structure returns an object (“scene”) at the end of each lua file. So if you have a bug in there, most of the time that means that it doesn’t finish compiling, so scene = nil and you have nothing to transport to.

If you need to find out the error message and error line, the fastest way to do it is to require in the broken scene to main.lua.

[code]-- main.lua
local storyboard = require(“storyboard”) – usual stuff

local awesome = require(“awesome”) – …include the problem scene!
storyboard.gotoScene(“awesome”) – If awesome.lua is the problem…[/code]

For awhile this appeared to break storyboard.getCurrentSceneName() but that may have been resolved. In any case I recommend turning it off once you have the scene working again as it’s just a needless require otherwise. [import]uid: 41884 topic_id: 25657 reply_id: 104731[/import]

@Chris

I just made an “require” of the same file before the storybook API, gotoscene

 require("gameLogic")  
 storyboard.gotoScene("gameLogic");  

With that in place, you will get the correct error statement in the console. For my problem it was something about my up value was greater then 60. Shortly means that my function had to much up values?

Regards, Joakim [import]uid: 81188 topic_id: 25657 reply_id: 104732[/import]

This storyboard issue has been fixed internally and will be available in one of the next few daily builds (perhaps even the next one) [import]uid: 84637 topic_id: 25657 reply_id: 104738[/import]

@Joakim and @Richard9,

Thank you both so much. The require statement worked like a charm and I found the offending missing typo in under 10 seconds.

Now if I could just find a way to get back the 4 hours I wasted this morning… live and learn… I learned that next time I’ll search the forums before assuming I’ve done something terribly stupid!

@Danny - glad to hear it will be fixed soon :slight_smile:

Thanks so much,

Chris [import]uid: 97836 topic_id: 25657 reply_id: 104749[/import]