Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How do i save multiple objects in 1 file dbo? Am using arrays?

Author
Message
darkvee
19
Years of Service
User Offline
Joined: 18th Nov 2005
Location:
Posted: 4th Dec 2006 23:36
Hi i got a problem am using arrays right.
But it won't save them!
here is my code



sync on:sync rate 85
dim array(20)
set camera range 1,20000
set camera fov 45
for x = 1 to 20
array(x)=x
load object "test2.x",x
position object x,1600*rnd(15),0,1600*rnd(15)
scale object x,1600,3200,1600
next x
randomize timer()
do
if spacekey()=1
for x = 1 to 20
array(x)=x
Save Object "test12.dbo",x+array(x)
next x
endif

MOVE CAMERA (UPKEY() - DOWNKEY())*2.5

ROTATE CAMERA WRAPVALUE(CAMERA ANGLE X()+(MOUSEMOVEY()*1.1)), WRAPVALUE(CAMERA ANGLE Y()+(MOUSEMOVEX()*1.1)),0
text 200,200,"polys : "+str$(STATISTIC(1))
text 400,200,"fps : "+str$(screen fps())
sync
loop

Kolp try72y
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 5th Dec 2006 00:42
Your saving each and every file to the same filename, so of course it will only be one file

Here is corrected code.



-Mansoor Siddiquie

Bozzy
18
Years of Service
User Offline
Joined: 10th Sep 2006
Location: Birmingham, UK
Posted: 18th Mar 2007 11:32
I dont understand this... Can you like save a manually placed game level into 1 dbo then?

Login to post a reply

Server time is: 2024-11-25 21:23:14
Your offset time is: 2024-11-25 21:23:14