Ahoy mates!
I've got a little problem that's making my coding progress come to a screeching halt.
here are two functions from my code:
function distributecollectables(no as integer)
activecollectables = no
clearcollectables()
for c = 1 to no
collectables(c).objectno = c + collectablestartno
collectables(c).xpos = rnd(190)-95
collectables(c).ypos = rnd(140)-70
collectables(c).zpos = 0
collectables(c).xrot = rnd(360)
collectables(c).yrot = rnd(360)
collectables(c).zrot = rnd(360)
rem make object cube collectables(c).objectno, 4
load object "gem.x",collectables(c).objectno
position object collectables(c).objectno,collectables(c).xpos,collectables(c).ypos, collectables(c).zpos
rotate object collectables(c).objectno, collectables(c).xrot, collectables(c).yrot, collectables(c).zrot
rem COLOR OBJECT collectables(c).objectno, RGB(0,255,0)
next c
endfunction
function checkplayergrabcollectible()
coll = 0
for c = 1 to maxcollectables
if collectables(c).objectno > 0
if OBJECT COLLISION (collectables(c).objectno, player.objectno)
DELETE OBJECT collectables(c).objectno
collectables(c).objectno = 0
dec activecollectables, 1
inc coll, 1
endif
endif
next c
endfunction coll
ok, the problem is that when I first call distribute collectables (to place collectable items in my level), then everything works fine. Before every sync, checkplayergrabcollectible is called to check of the player has grabbed any collectables. The problem is that, when all collectables have been, well, collected and I'm making the next level, then I get a error when calling the distributecollectables. The error is: "Runtime error 7018. Could not load 3d object at line..." When I used a cube for the collectable instead of an .x object (see the rem'ed line above the load object in distributecollectables), then everything worked like a charm, but now it's just fubar.....
Any takers????
- If nothing sticks to teflon, then how do they make teflon stick to the pan???