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 / Loading bars

Author
Message
Dr Crazy
20
Years of Service
User Offline
Joined: 13th Apr 2004
Location:
Posted: 13th Apr 2004 13:32
Hey guyz. I aint that new to darkbasic but how u make a loading bar?
My game (The SAS Elite which is a fps) contains a load of objects and takes some secons to load. How can I create a loading bar to show when all the objects are loaded?

Who dares; wins.
MikeyP
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Manchester, UK
Posted: 13th Apr 2004 13:46
Well as far as I kinow you can't update the bar say half way through loading an object but if you say it contains aload of objects you can update the bar after each object. To find out how much to update it you could say find out what % of the total bytes to load the object took up and then add that to a variable of total % of bytes...
Dr Crazy
20
Years of Service
User Offline
Joined: 13th Apr 2004
Location:
Posted: 13th Apr 2004 13:57
Well maybe.

Who dares; wins.
MikeyP
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Manchester, UK
Posted: 13th Apr 2004 13:58 Edited at: 13th Apr 2004 13:58
Tisn't as complicated as it sounds
Dr Crazy
20
Years of Service
User Offline
Joined: 13th Apr 2004
Location:
Posted: 13th Apr 2004 14:07
O ok. Well I gotta another issue. Yes the most bliddy hardest thing to programme - OBJECT COLLISION . I kinda figured out how to use it because I made a wall but I cant figure out the coordinates for most things.
Here is the code I used to make a wall.
Thats only the function. Theres some other stuff but this is just an example.

Who dares; wins.
Dr Crazy
20
Years of Service
User Offline
Joined: 13th Apr 2004
Location:
Posted: 13th Apr 2004 14:07
Function DecoCollide(X#,Y#,Z#)

for u = 1 to 1
for v = 1 to 1
if X#>u*10000-10000
if X#<u*10000+110
if Z#>v*10000-110
if Z#<v*10000+110
if Y# < Get ground height(1,u*5000,v*10000)+575
Collide=1
Exitfunction Collide
endif
endif
endif
endif
endif
next v
next u
Collide=0

Endfunction Collide

Who dares; wins.
Dr Crazy
20
Years of Service
User Offline
Joined: 13th Apr 2004
Location:
Posted: 13th Apr 2004 14:08
Plz explain what means what!

Who dares; wins.
MikeyP
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Manchester, UK
Posted: 13th Apr 2004 15:20 Edited at: 13th Apr 2004 15:20
I'm quite sure there is an Object Collision command where it checks for collision with another object. [Commands: Object Hit and Object Collision] And if you would like to check for collision with a wall. I'd make sure that objects 1-200 [Or whatever] are walls and then do...



The code might not work but it should give you an idea.
Dr Crazy
20
Years of Service
User Offline
Joined: 13th Apr 2004
Location:
Posted: 13th Apr 2004 20:21
Well I'll give it a shot. You see, the code I typed originally worked but when I tried to copy the function and call it DecoCollide2 or whatever - it didn't detect. By the way, what is playerobject?

Who dares; wins.
Dr Crazy
20
Years of Service
User Offline
Joined: 13th Apr 2004
Location:
Posted: 13th Apr 2004 20:30
Are you sure that code works? Don't forget, Im using DarkBASIC Classic not DarkBASIC PRO!

Who dares; wins.
muscles
20
Years of Service
User Offline
Joined: 12th Apr 2004
Location:
Posted: 13th Apr 2004 21:35
okay, there are a few major problems with what your doing here. firstly, the code you're using for your collision (DecoCollide?!) is strangely reminiscient of the code in the monster hunt tutorials. its great that you're using the tuts, but it appears you don't really know what you're doing. firstly, using object collision is an easy solution. the problem is that it has a tendency to be unbearably slow. i prefer math collision.
let me back up a minute. the reason you have trouble positioning stuff is that when you place something in coordinate space, the origin for an object is the center of the object, so if you put a cube in space that's 10 units across and want it's bottom corner at 0,0,0, you need to position it at 5,5,5 for the corner to be at 0,0,0.
where was I? okay, so, for math collision, say you have a plain that's 100 units across and 50 units tall for your wall. it's positioned at 50,25,100, so it's sitting on the floor with one edge at x = 0, 100 units from the origin on the z-axis. to check for collision, just set up some if statements. for example
IF objectz# >= 98 and <= 102
IF objectx# >= 0 and object x# <= 100
you hit the wall!
ENDIF
ENDIF
MikeyP
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Manchester, UK
Posted: 13th Apr 2004 22:03
I never knew you were using DBC, and I dont know whether it would work in DBP or DBC.
Dr Crazy
20
Years of Service
User Offline
Joined: 13th Apr 2004
Location:
Posted: 13th Apr 2004 22:55
Dont worry now. I have figured out what the monster tut code means. I also figured that for object collision, you can fit it all in function DecoCollide (It means Decrease Collide because DECO means DECREASE). Thanks for your help anyway. At least your code gave me a taste of MATH COLLISION.
Thanks again,
Nick Rakosi
PS. I will need your help in future!

Who dares; wins.

Login to post a reply

Server time is: 2024-11-26 12:22:57
Your offset time is: 2024-11-26 12:22:57