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 / Character movement and other things...

Author
Message
DARKGuy
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 29th Nov 2003 22:55
Hi!, i'm a total newbie in DARKBasic. I have both DB and DBP in demo version (DBP = Alienware DBP demo).

I live in Caracas, Venezuela (South America). I'm 15 years old and my english is good so I hope all of you to understand me

Well....I'm trying to make a game to that Alienware competition, but i'm having some problems:

1. I can't make my character move correctly. I can move him, but it moves like shaking, you know, sorta like that, but I want a smooth movement & rotation but I can't do it

2. I can attach the camera to the player object, but I can't rotate it according to the player's angle, you know, like a 3rd person camera, I have looked at some examples but they're fixed cameras, not smooth cameras, like Tomb Raider.

3. I can animate my object, but when I do something like this:

if upkey()=1
rem walk animation 670-720
play object 1,670,720
endif

it only remains in the frame 670 and don't move!, I have tried to use play object, loop object, set object frame....everything! but it doesn't work

Please help me, i'm a bit newbie on these things but I know that I can do something, even if it's simple

This is my first post so please don't blame me if something isn't correct

See ya!!

I'm a newbie
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 30th Nov 2003 19:26
first of all, welcome to the forums

i made a small example for myself showing the animations of the alienware model(which you are useing i take it) and here is the code....

controls
arrow keys to move
x and c to use atacks


good luck,
Bishop

p.s.- the animations may be a little jolty....

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."
Tywald
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sweden
Posted: 1st Dec 2003 12:45 Edited at: 1st Dec 2003 12:46
DARKGuy

Aren't your character animating when you release the key? If it does then i know your problem and how to fix it.

- Tywald
DARKGuy
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 2nd Dec 2003 05:29
First of all, thanks for welcoming me

Well, I downloaded your example, but my motherboard resets, it happens randomly when I use Direct 3D based programs or when I use VESA video modes on DOS, it's strange that Warcraft III and even the DARKBasic (the first DB) works!! I don't know why, but it's like that, for example I can't view the StarCraft videos or play Counter-Strike using the Direct3D driver on full screen, so I have to play it windowed. These are the reasons on why I didn't tested your program. I would loved to see it working, but as you see...

And Tywald...no...see this:

--CODE--

rem The standing animation
loop object 1,0,100

do

if upkey()=1
loop object 1,670,720
move object 1,20
endif

sync
loop

--CODE ENDS HERE--

That's the problem, I have tried using Play Object and Loop Object and nothing works, also, I'm using DB, not DBP, so I don't know if it's the same on DBP.

Thanks

I'm a newbie
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Dec 2003 10:13
Well, your restarting the whole animation everytime you press a key, use something like:



This will store the movement mode in the variable 'mode', use different numbers for different directions, basically you need to know if the object is already looping; for example, to check for forward and backward movement:



Now because the animation handling is more advanced, it's a good idea to keep control of movement, using a 'moving' variable, if it's one then the object is moving, if it's 0 then the object is still - so you can stop the animation when you stop moving, you'll probably want to go into the idle animation instead of just stopping, so you could replace the moving line with:

if moving=0 and mode<>-1 then Loop object 1,1,150 : mode=-1

This is not usually how I'd handle animation, I'd most likely store all the animation details in arrays and have a more complex mode system, a lot of setting up but it sorta keeps itself smooth and is easier to code around, instead of worrying about keeping track of frames etc, I'd just set the mode to suit what was happening to the character. This is not really for beginners, but why not try and come up with a system that does more for itself, a good place to start is an array of frame start and end positions, and a record of the object mode and frame numbers, you might find this approach actually saves a lot of time in the long run.


Van-B


I laugh in the face of fate!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Dec 2003 11:44
There's a nice demo that comes with DB showing how to properly setup different stages of animination of a character.

Login to post a reply

Server time is: 2024-09-21 11:52:18
Your offset time is: 2024-09-21 11:52:18