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.

DarkBASIC Discussion / how do i know how many object do i loaded?

Author
Message
Shafan
21
Years of Service
User Offline
Joined: 22nd Dec 2003
Location: israel
Posted: 14th Apr 2004 19:44
i make a level editor software and i need to know how many object i loaded...how do i do it?
Shafan
21
Years of Service
User Offline
Joined: 22nd Dec 2003
Location: israel
Posted: 14th Apr 2004 20:08 Edited at: 14th Apr 2004 20:08
never mind i found a way to do it....thanks anyway
DARKGuy
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 19th Apr 2004 00:15
how did you did it??

:: Pentium 300 Mhz, old 8Mb video card, 64Mb RAM, 5 gb & 1.6 gb HD's, W98 SE, Sound Blaster AWE 32 ::
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 19th Apr 2004 01:42
for i=1 to 30000000
if object exist (i)=1 then inc objects_loaded
next i

print objects_loaded

BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 19th Apr 2004 02:50
To save your processing time, you can change 30000000000000 to 65535. Otherwise, that's some clever code

Crazy Donut Productions, Current Project: KillZone
Web Site Button Does Not Work, Visit Here: http://www.geocities.com/crazydonutproductions/index.html
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 19th Apr 2004 19:40
Otherwise, every time you add an object in the program make it add one to a variable. Say maxobj. Then at the end do this:
for i=1 to maxobj
if object exist (i)=1 then inc objects_loaded
next i

Current Projects: 'Level Editor 3D' and 'Animation Package v2.0'
[email protected]
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 20th Apr 2004 11:27
but basically no one uses all the objects in an ascending order, heck my sky is usually number 10000 basically so they never clash with the enemys or landscape, and that would mean you have to call a function or add in a line every time you load a model

@bear i wasnt sure of the number so i put something high :-P

BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Apr 2004 15:51
I don't see how it's not possible to know how many objects you have loaded.
You have to load them programmatically, so surely you just track them as you load them.

BatVink
http://facepaint.me.uk/catalog/default.php
AMD 3000+ Barton, 512K Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Tywald
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sweden
Posted: 20th Apr 2004 18:10
I prefer to keep track of each objects number using a variable that increases when a new object is loaded. I don´t use fixed numbers when loading and removing objects since that means if i have loaded up say 200 objects, i have to keep track of each ones number.
I also have a second variable that increases and decreases when objects are created and removed.

Check the "Source" Button for a small example on what i´m talking about.

I usually use functions for this kind of stuff but to just make things simple and easier to understand i wrote that code.

- Tywald

Login to post a reply

Server time is: 2025-05-23 22:49:16
Your offset time is: 2025-05-23 22:49:16