[Resolved] Storyboard and require ("store")

I have been working with IAP which seems to be fine when running it in the simulator. However, if I build to xcode or to device all i get is a black screen. I am using storyboard to transition between scenes. I find, that if I comment out local store = require (“store”) then the page will load on xcode and on the device. Has anyone run into this?

[import]uid: 90818 topic_id: 25712 reply_id: 325712[/import]

Hey there,

I just did a double check on this by adding;
[lua]local store = require “store”[/lua]
to the start of the Storyboard sample code that ships with Corona and I wasn’t able to reproduce any issues.

I would think it is likely a user error however if you want to confirm there are no issues with your current build I would suggest you run the same test I just did - if you get issues then let us know a build number, please.

Else, try commenting out your other store code and leaving require store in and see what happens.

Peach :slight_smile: [import]uid: 52491 topic_id: 25712 reply_id: 104029[/import]

Hi Peach,

Thanks for your response. I still have the same issue so here is more information. I’m using daily build 797, my xcode is an older version 4.2 (need a new mac before I can upgrade), and Iphone 3GS 5.0.1 (cannot upgrade because of old xcode).

Here is the lua file - I have removed everything I commented out for easier viewing.

[lua]-- main.lua
display.setStatusBar (display.HiddenStatusBar)

local storyboard = require “storyboard”
vars = require(“beebegames”)
saveValue = vars.saveValue
loadValue = vars.loadValue
widget = require “widget”
util = require “util”
tnt = require “transMan”
sprite = require “sprite”

physics = require (“physics”)
physics.start()
physics.setGravity(0,0)

cannonFire = audio.loadSound(“fire.wav”)
boom = audio.loadSound(“boom2.wav”)
crash = audio.loadSound(“crash.wav”)
reloadSound = audio.loadSound(“reload.wav”)
winLevel = audio.loadSound(“success.wav”)
menuMusic = audio.loadStream(“menuBackground.wav”)
gameBGM = audio.loadStream(“gameBGM.wav”)
spriteBoom = audio.loadSound(“spriteBoom.wav”)

storyboard.gotoScene( “ccstore” )

–ccstore.lua
local storyboard = require( “storyboard” )
local scene = storyboard.newScene()

local store = require(“store”)

local buyBut1
local buyBut2
local buyBut3
local backBut
local resBut
local storeBG
local buttonPressed = 0

function scene:createScene( event )
local group = self.view

storeBG = display.newRect(0, 0, 480, 320)
storeBG.x = display.contentWidth / 2
storeBG.y = display.contentHeight / 2
group:insert( storeBG )

buyBut1 = display.newImageRect(“su250.png”, 128, 140)
buyBut1.x = display.contentWidth / 2 / 3
buyBut1.y = display.contentHeight / 2
group:insert( buyBut1 )

buyBut2 = display.newImageRect(“su500.png”, 128, 140)
buyBut2.x = display.contentWidth / 2
buyBut2.y = display.contentHeight / 2
group:insert( buyBut2 )

buyBut3 = display.newImageRect(“ss.png”, 141, 140)
buyBut3.x = display.contentWidth / 2 + 160
buyBut3.y = display.contentHeight / 2
group:insert( buyBut3 )

backBut = display.newImageRect(“back.png”, 40, 40)
backBut.x = display.contentWidth / 2 + 160
backBut.y = display.contentHeight / 2 + 100
group:insert( backBut )

end

function scene:enterScene( event )
local group = self.view
storyboard.removeAll()

end

function scene:exitScene( event )
local group = self.view

end

function scene:destroyScene( event )
local group = self.view

end

scene:addEventListener( “createScene”, scene )

scene:addEventListener( “enterScene”, scene )

scene:addEventListener( “exitScene”, scene )

scene:addEventListener( “destroyScene”, scene )


return scene[/lua]

If I comment line 4 in ccstore.lua it loads find in xcode.

My next steps - Now that I’ve written this out, I’m checking to see if I have any conflict with the variable store in one of my other modules. I did try [lua] local iap = require( “store” ) [/lua] with the same problem. Not sure still if I’m on the right track. I’ll post any updates I find later today. [import]uid: 90818 topic_id: 25712 reply_id: 104040[/import]

So, I have it working - but I still don’t know why. I ended up starting a new project, then I copied and pasted my code (and relevant files) into the auto generated files, and tested. Then it worked! I’m not sure if I’ll run into a module later that will cause a conflict, but I will be on the look out as I port it over to the new project. [import]uid: 90818 topic_id: 25712 reply_id: 104132[/import]

Hey again,

That’s interesting, I’m unsure what the issue may have been however now it’s working just ensure you keep regular backups and I’m sure you will be fine.

Am marking this as resolved but if it comes up again just bump :slight_smile:

Peach [import]uid: 52491 topic_id: 25712 reply_id: 104157[/import]

Hi Peach,

No problem marking it resolved. Just for the sake of completion - I ended up porting everything to the new project folder everything is working great!

Thanks for your help. [import]uid: 90818 topic_id: 25712 reply_id: 104225[/import]

Great, thank you for following up - happy to hear it is working well now :slight_smile: [import]uid: 52491 topic_id: 25712 reply_id: 104371[/import]