So today i added more objects to one of my levels in my game. all the sudden the simulator would crash everytime i open it. i delete one of the inserts of an object to my localGroup, and it runs fine, it does not matter which i delete, it just seems like it has hit a number and that i cant take anymore. anyone else have any information on this? [import]uid: 19620 topic_id: 7449 reply_id: 307449[/import]
how many? do you have code to share i can look at and see why crash?
[import]uid: 24 topic_id: 7449 reply_id: 26374[/import]
well i was at 54, what im doing is i have a initVars() function for when i start my level, inside of this i have my giant lists to import my objects into my display groups. What i found though was it seems like that list maxed out, because if i now add more objects to the displaygroup outside of the initVars function it seems to be working fine. kinda strange, id like to provide some code but its pretty huge. what would you like to see? [import]uid: 19620 topic_id: 7449 reply_id: 26377[/import]
the code to reproduce the crash?
c [import]uid: 24 topic_id: 7449 reply_id: 26381[/import]
[code]
local function initVars()
–LOCAL GROUP INSERTS
–Inserts
–localGroup INSERTS
localGroup:insert(highsky)
localGroup:insert(wall1 )
localGroup:insert(wall2 )
localGroup:insert(wall3 )
localGroup:insert(wall4 )
localGroup:insert(wall5 )
localGroup:insert(wall6 )
localGroup:insert(rect1 )
localGroup:insert(rect2 )
localGroup:insert(rect3 )
localGroup:insert(rect4 )
localGroup:insert(rect5 )
localGroup:insert(rect6 )
localGroup:insert(rect7 )
localGroup:insert(rect8 )
localGroup:insert(rect9 )
localGroup:insert(rect10 )
localGroup:insert(rect11 )
localGroup:insert(rect12 )
localGroup:insert(rect13 )
localGroup:insert(rect14 )
localGroup:insert(rect15 )
localGroup:insert(rect16 )
localGroup:insert(rect17 )
localGroup:insert(rect18 )
localGroup:insert(rect19 )
localGroup:insert(rect20 )
localGroup:insert(rect21 )
localGroup:insert(rect22 )
localGroup:insert(rect23 )
localGroup:insert(rect24 )
localGroup:insert(rect25 )
localGroup:insert(rect26 )
localGroup:insert(rect27 )
localGroup:insert(rect28 )
localGroup:insert(rect29 )
localGroup:insert(rect30 )
localGroup:insert(rect31 )
localGroup:insert(rect32 )
localGroup:insert(rect33 )
localGroup:insert(tireObject)
localGroup:insert(pit3)
localGroup:insert(pit4)
localGroup:insert(pit5)
localGroup:insert(pit6)
localGroup:insert(pit7)
localGroup:insert(pit8)
localGroup:insert(pit9)
localGroup:insert(pit10)
localGroup:insert(pit11)
localGroup:insert(pit12)
localGroup:insert(pit13)
localGroup:insert(pit14)
localGroup:insert(pit15)
localGroup:insert(pit16)
localGroup:insert(finishline)
–gameScreen INSERTS
gameScreen:insert(highsky)
gameScreen:insert(wall1)
gameScreen:insert(wall2)
gameScreen:insert(wall3)
gameScreen:insert(wall4)
gameScreen:insert(wall5)
gameScreen:insert(wall6)
gameScreen:insert(rect1)
gameScreen:insert(rect2)
gameScreen:insert(rect3)
gameScreen:insert(rect4)
gameScreen:insert(rect5)
gameScreen:insert(rect6)
gameScreen:insert(rect7)
gameScreen:insert(rect8)
gameScreen:insert(rect9)
gameScreen:insert(rect10)
gameScreen:insert(rect11)
gameScreen:insert(rect12)
gameScreen:insert(rect13)
gameScreen:insert(rect14)
gameScreen:insert(rect15)
gameScreen:insert(rect16)
gameScreen:insert(rect17)
gameScreen:insert(rect18)
gameScreen:insert(rect19)
gameScreen:insert(rect20)
gameScreen:insert(rect21)
gameScreen:insert(rect22)
gameScreen:insert(rect23)
gameScreen:insert(rect24)
gameScreen:insert(rect25)
gameScreen:insert(rect26)
gameScreen:insert(rect27)
gameScreen:insert(rect28)
gameScreen:insert(rect29)
gameScreen:insert(rect30)
gameScreen:insert(rect31)
gameScreen:insert(rect32)
gameScreen:insert(rect33)
gameScreen:insert(tireObject)
gameScreen:insert(pit3)
gameScreen:insert(pit4)
gameScreen:insert(pit5)
gameScreen:insert(pit6)
gameScreen:insert(pit7)
gameScreen:insert(pit8)
gameScreen:insert(pit9)
gameScreen:insert(pit10)
gameScreen:insert(pit11)
gameScreen:insert(pit12)
gameScreen:insert(pit13)
gameScreen:insert(pit14)
gameScreen:insert(pit15)
gameScreen:insert(pit16)
gameScreen:insert(finishline)
–RESET VARIABLES
gameScreen.x = 0; gameScreen.y = 0
local total_collisions = 0
local vx = 0
local vy = 0
tireObject.angularVelocity = 0
tireObject:setLinearVelocity (0,0)
tireObject.linearDamping = 0
game.isActive = true
gameActive = false
physics.start(true)
scanlines.x = display.contentWidth / 2 ; scanlines.y = display.contentHeight / 2
–OBJECT POSITIONS
tireObject.x = 280 ; tireObject.y = 250
–START GATE
local function removestartGate()
startGate:removeSelf();startGate=nil
end
local function startgameActive()
transition.to( startGate, { time=100, y = -100 } )
gameActive = true
timer.performWithDelay(4000, removestartGate)
end
startGate = display.newImage(“light1.png”)
startGate.y = -100
transition.to( startGate, { time=1000, y = 0 } )
timer.performWithDelay(4000, startgameActive)
end
[/code] [import]uid: 19620 topic_id: 7449 reply_id: 26384[/import]
can u send code? easier to debug on my system than copy paste and then doesn’t crash.
c. [import]uid: 24 topic_id: 7449 reply_id: 26387[/import]
I sent you an email with my code, but i recorded what the simulator is saying before it crashes, it says “932: function at line 825 has more than 60 upvalue”
line 932 is where my initVars function starts
line 825 is the creation of a sprite animation, using jon beebes class, i wonder if thats the problem? [import]uid: 19620 topic_id: 7449 reply_id: 27089[/import]