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 / Hi there! I'm a newbie!

Author
Message
Dung Beetle
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location:
Posted: 2nd Nov 2004 10:00 Edited at: 1st Nov 2005 02:34
Thanks to all who tried to help me.
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 2nd Nov 2004 13:24
Just don't ask any stupid questions without first consulting all the DB help files. Look through the tutorials supplied to learn the basics, then make your first game: Pong. If you have any specific questions, ask on the forum, but use good subject titles and good grammar (your post actually is well done grammar wise...)

Good Luck with DB

Xander Moser - Bolt Software - Firewall
Lukas W
20
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 2nd Nov 2004 16:12 Edited at: 2nd Nov 2004 16:12
yeah, dont use words like 'u', 'c ya', '4->', or any 1337.
since this is a english board speak english.

and welcome friend to the gigantic world of apollo (j/k)

its me n0id!

This is a Map Editor ver 2 DEMO Out now! http://www.tiame.tk
Dung Beetle
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location:
Posted: 2nd Nov 2004 20:26 Edited at: 1st Nov 2005 02:32
--
Damokles
20
Years of Service
User Offline
Joined: 28th May 2003
Location: Belgium
Posted: 2nd Nov 2004 20:31
First of all : Welcome !

A DB advice ?
Well, even if you foold around with DB. You could begin to complete games. I would suggest this order : Rock Paper scissors, Pong, Break Out, Tetris, Pacman, ...
You're not suppose to recreate the games exaclty how they were. Improving them is always better.

- Mind the gap -
Dung Beetle
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location:
Posted: 2nd Nov 2004 21:12 Edited at: 1st Nov 2005 02:32
-
Lukas W
20
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 2nd Nov 2004 22:06 Edited at: 2nd Nov 2004 22:07
ignore this post.
(I was just babling about nothing.. )

its me n0id!

This is a Map Editor ver 2 DEMO Out now! http://www.tiame.tk
Dung Beetle
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location:
Posted: 2nd Nov 2004 22:09 Edited at: 1st Nov 2005 02:32
-----
lickuidstylz
19
Years of Service
User Offline
Joined: 13th Aug 2004
Location: MD in USA
Posted: 3rd Nov 2004 00:37
What type of problems are you having with graphics? (could you clarify "drawn correctly"?) I'm sure if you give a small example of something you'd like to do, someone (like myself) would be more than happy to help point you in the right direction (or even give you an answer for that matter). I've gotten a lot of help from these guys so it's about time I do my part to spread the wealth.

The only limits we have are those we set.
IanG
19
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 3rd Nov 2004 02:12
the annoying "a mod has to allow your post" message will disappear after a month then you can start using the forum without waiting for a mod to stumble across your post

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2ghz, 512mb, geforce fx5200 128mb, 200gb, xp pro sp2
Dung Beetle
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location:
Posted: 3rd Nov 2004 04:31 Edited at: 1st Nov 2005 02:33
------
Mentor
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 3rd Nov 2004 05:05
well, sprites are as hard as

load image "monster.bmp",1
sprite 1,100,100,1

3d is much harder

load object "monster.x",1

just about covers it, then all you have to do in both instances is

wait key

to stop the program ending before you see the results, to get reliable and flicker free syncing you need to turn on sync with

sync on

then set a maximum framerate, a speed of 0 means flat out, other values are frames per second, eg

sync rate 40

then once you have positioned and set up your scenes action to your liking for that frame do

sync

at the end of your loop, there is a caveat here, if you set sync rate 40 at the start of your code, and then you need to do something (like reset the level after a lost life) that takes over 1/40th of a second then DB will sync anyway at 1/40th sec, and the partialy drawn scene will flash up for a frame or so, so use

sync rate 0

and control the main loop speed with the timer, this has the advantage that you can use the time elapsed to work out if you need to scale movement for slower computers to maintain the correct relative speed for all users, and if you take a long time to reload something then the screen will not be redrawn untill you have finished and called the next sync, cheers.

Mentor.

PC1: P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.
Static
20
Years of Service
User Offline
Joined: 4th Apr 2004
Location: United Kingdom
Posted: 3rd Nov 2004 05:07
Nope. I'm afraid there's no preview post option although the close all tags button can be use full when including code in a post. As for a PM system, I'm not quite sure what it is (I'm not an expert at forums).
Hope that helped.

PS: I tried my hardest with the grammar and spelling.
Dung Beetle
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location:
Posted: 3rd Nov 2004 05:16 Edited at: 1st Nov 2005 02:33
-------
Dung Beetle
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location:
Posted: 3rd Nov 2004 05:20 Edited at: 1st Nov 2005 02:33
--------
Static
20
Years of Service
User Offline
Joined: 4th Apr 2004
Location: United Kingdom
Posted: 3rd Nov 2004 05:20
I thought it might help you understand if I put Mentor's wise sayings into a few example codes.

This code is to simply display the sprite:

note: You don't really need the sync rate 40 command since the default rate is 40 anyway. Also I don't think you need the wait key command in DBC. Try it out and tell me.

This code is the same but with a 3D object:


note: If you can't see your 3D object it is because the camera is in the wrong position. Use the position camera and point camera commands to fix this.

If you need anymore help just ask.
Dung Beetle
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location:
Posted: 3rd Nov 2004 05:29 Edited at: 1st Nov 2005 02:33
---------
Static
20
Years of Service
User Offline
Joined: 4th Apr 2004
Location: United Kingdom
Posted: 3rd Nov 2004 05:35
The close tags button is located at the underneath the message box.

As for making a sprite move try this:


Try changing the code such as taking tha cls comand out and seeing what happens. And I've got a challenge for you. Try and stop the sprite from going of the screen.

PS:If you want to change the sprite to a circle all you would do is get rid of the load image command and replace the sprite command with circle x,y,5.
Mentor
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 3rd Nov 2004 05:37
@ chicken chaser : since autocam is on then the camera will be pointing at the object, autocam is on by default, normaly you turn it off to prevent the camera jumping about all over the place as objects are loaded and positioned.

@Dark Llama : the 100`s in the sprite command are the position on the screen, so in the example the sprite is positioned at the 100th pixel across the screen for the current resolution and the 100th pixel down the screen, the positions are in the order x,y (menmomics .. x is a-cross, y go down?).
if you want to alter the position of the sprite (make it move) then just alter the x,y positions repeatedly, eg

sync on:sync rate 0

load image "monster.bmp",1

x_position=100
y_position=100

do

if upkey()
y_position=y_position-1
endif

if downkey()
y_position=y_position+1
endif

if leftkey()
x_position=x_position-1
endif

if rightkey()
x_position=x_position+1
endif

sprite 1,x_position,y_position,1

sync

loop

will move a sprite around the screen under control of the cursor keys assuing you have the image monster.bmp in the project folder, as for moveing drawn images cleanly

sync on:sync rate 0

do

cls

for i=1 to 700
circle rnd(600),rnd(450),rnd(100)
next i

t=timer()

rem one second between swaps even though the screen is drawn faster than that
rem you won`t see anything until the sync is called

repeat
until timer()>t+1000

sync

loop

should redraw the circles cleanly and with no flicker at one second intervals, cheers.

Mentor.

PC1: P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.
Dung Beetle
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location:
Posted: 3rd Nov 2004 05:58 Edited at: 1st Nov 2005 02:33
----------
Static
20
Years of Service
User Offline
Joined: 4th Apr 2004
Location: United Kingdom
Posted: 3rd Nov 2004 05:59
@Dark Llama : Have you looked at the Binary moons tutorial? It's excellent. Here's a link:
http://developer.thegamecreators.com/?f=t02/bm_tutorial_index
Static
20
Years of Service
User Offline
Joined: 4th Apr 2004
Location: United Kingdom
Posted: 3rd Nov 2004 06:05
Damm it we keep posting things at the same time. . Anyway to make rnd work randomly type randomize timer() at the top of your code (not in the loop). And you do have to write "variable=variable+x" i'm afraid to say.
Mentor
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 3rd Nov 2004 06:27
you can use

inc var

or

inc var,val

but I wasn`t aware of your level of competence since we have have had some self proclaimed code experts pop up on the forum from time to time who don`t even understand variables
built in functions for movement are mostly in the 3D command set, you have

pitch object up/down
roll object left/right
turn object left/right
move object

pitch roll and turn use angles as the argument, move uses world units eg

move 1,0.01
move 1,12
move 1,-2
etc

the random numbers are created as in all languages by an algorythm that starts with the same seed unless you use the command

randomize var

var is often the system timer (timer() ), but you can use any variable you like, for example if your levels are created randomly, you could use the level number to ensure that the same levels occur each time the game is played, normaly you just call randomize the once at the start of the code.
perspective and other effects are handled by directx anyway, so you don`t need to worry about that, you can move objects into and out of the screen and they scale etc correctly, the tricky bit is when you want to override these effects, the system timer is slightly different from say VB, you have the one function

timer()

and it is best thought of as a clock you can check, it updates every 1000th sec, if you want to do the same as VB where you set an event to happen after so long (say 5 seconds), you have to keep checking the timer value, since it counts in m/secs then 5 seconds = 5000, so you get the time at the time you started the wait and add 5000

t=timer()+5000

for example, then you check for the timer PASSING the value in t, eg

if timer()>t
print "alarm call"
endif

and then act on the event, you can`t check for an exact match, eg

if timer()=t

since it may be that the system was busy when timer()=t and at the next check timer()=5001, so it would never trigger since timer() would just keep getting larger than t, hope thats some help, cheers.

Mentor.

PC1: P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.
Dung Beetle
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location:
Posted: 3rd Nov 2004 22:18 Edited at: 1st Nov 2005 02:34
-----------
Static
20
Years of Service
User Offline
Joined: 4th Apr 2004
Location: United Kingdom
Posted: 4th Nov 2004 00:54
Pitch Object Up object number,value of pitch(in degrees)
Dung Beetle
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location:
Posted: 4th Nov 2004 02:02 Edited at: 1st Nov 2005 02:34
------------
lickuidstylz
19
Years of Service
User Offline
Joined: 13th Aug 2004
Location: MD in USA
Posted: 4th Nov 2004 03:39
Wow, it looks as if I've been gone from this post for like a month or so lol. Anyway, I'm glad you're getting our questions answered Llama.

The only limits we have are those we set.
Dung Beetle
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location:
Posted: 4th Nov 2004 03:51 Edited at: 1st Nov 2005 02:32
---
Static
20
Years of Service
User Offline
Joined: 4th Apr 2004
Location: United Kingdom
Posted: 4th Nov 2004 04:28
well it's pitching up so it can only go in one direction. As for other commands such as yrotate object one way is negative the other is positive so for example if you want to turn an object on the Y axis you might say something like this:
yrotate object 1,-90

i'm not sure wich direction is negative and which is positive. You'll have to try for yourself and see what direction it rotates in.
Mentor
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 4th Nov 2004 06:28
up/down left/right are relative to the models axis, imagine a old fashioned flash gordon rocket, to the occupants down is always when the control room floor tilts down to the occupants, left (roll or turn) is just leke the left in a car etc, if the model is loaded and found to be facing the wrong orientation (inverted or upside down for example) then reposition the model with the rotate/pitch/turn commands and then do

fix object pivot

that fixes the models pivot to the same zero position as the rest of the worldspace, after that all the commands will move the object as you would expect, directional changes are in degrees and for the move/pitch/roll commands are cumulative, so if you keep rolling by one degree per frame then after 360 frames the model will have rotated around the long axis once, the xrotate etc commands are absolute, so repeated calling with the same value just holds it at the requested angle.
I tend to use the move/roll/pitch/turn commands and then find the objects position when i need it with object positionx commands etc, but you can use the absolute commands if they seem easier to you.
hope thats some help.

Mentor.

PC1: P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.
lickuidstylz
19
Years of Service
User Offline
Joined: 13th Aug 2004
Location: MD in USA
Posted: 5th Nov 2004 00:28
A Thousand Pardons Mr. DARK Llama...lol

The only limits we have are those we set.

Login to post a reply

Server time is: 2024-05-02 02:58:41
Your offset time is: 2024-05-02 02:58:41