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 / DBP-Array Object creation doesnt work like i want it to.

Author
Message
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 17th Nov 2006 15:51
OK,i made a code,and i meant it to save objects 1 to 9999 in one file("World.dbo")

HOWEVER,it seems it onlt saves my object 1 into it,then trying to re-save it with object 2 and so on.

This is my code:



What am i doing wrong?

...No Signature here...
iGd
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 17th Nov 2006 16:20 Edited at: 17th Nov 2006 16:20
Well i havent used darkbasic in a year and a half.
But i think i know the problem.

When you say "For S=1 to 99999"
it starts at 1 then saves it to the file.
at the bottum you are saying "NEXT S"
Which then moves on to 2, then 3 and so on.
So it is trying to save each one into a seperate document because of the for commmand.

well,
hope i helped,
-iGD

-----------------------------------------------------------------

----------------------- Coming 2008 ------------------------
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 17th Nov 2006 16:36 Edited at: 17th Nov 2006 16:36
the save object command uses filename not directory so you have to specify a different filename for each object example:
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 17th Nov 2006 16:42
But i need it to export 1 object,as thats how my complete editor works,and is build for.

else im having to re-start everything from scratch...

...No Signature here...
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 18th Nov 2006 17:00
BUMP,

after 1 day of big headaches and trying to find out,i still havent managed it...

...No Signature here...
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 18th Nov 2006 18:32
The save object command will only save 1 object at a time. You will first need to make them ADD LIMB and OFFSET LIMB and TEXTURE LIMB commands. 9999 objects may be a bit too many for one object though.

Another thing you could try is saving all of their positions+filenames and then making a function that would make objects based on those positions and filenames for your game.

Tutorials:
Array
Functions
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 19th Nov 2006 20:38 Edited at: 19th Nov 2006 21:08
i would have posted earlier but i was gone yesterday so

try this:

Login to post a reply

Server time is: 2024-11-14 01:12:39
Your offset time is: 2024-11-14 01:12:39