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 / Cube Racer

Author
Message
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 20th Apr 2008 19:27
Hi, i have had this script for a while now, just thought i would post it because when i first started i was looking for a decent driving script to study and i couldnt find one, so here one is for everyone!




Hope it helps someone, if anyone updates it into anything please post it here so i can see it progress.

I Know i posted this in the Code Snippet section but i thought it would be more appropriate here instead but i cant remove my other post ><

Thanks

Svothe

A Violent Pigeon is a good Pigeon.
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 20th Apr 2008 20:36
One with Grass and Sky:



Hope you like it!

A Violent Pigeon is a good Pigeon.
DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 21st Apr 2008 12:07 Edited at: 21st Apr 2008 12:08
Here is a edited version. I was look through here and was board so I changed some things.

Added:
Smooth Camera
Acelleration, Deacelleration
You now can't turn when not moving
How fast your moving depends on how fast you can turn

Changes:
Tidyed code
Change how it makes the grass texture
Removed a matrix that I couldn't see a reason for
Change Timer Based Movement



BTW very nice work Violent Pigeon.


I'm Pro grammer.
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 21st Apr 2008 20:10
Thanks, im just learning so its nothing fancy and sorry for any unneatness lol

Reading through all the docs as well as having Sniperx and my friend Raven who are both really good DBP programmers here to help to. only bought it yesterday so im hoping its a okay first try, i should be impelementing myself:

A Media version so you drive as a tank.
Shoot ability
Enemies to shoot

as well as updating the racer one with some bumpy terrain once i get to that page in the docs

Thanks for making it better

Svothe

A Violent Pigeon is a good Pigeon.
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 21st Apr 2008 20:12
Hmm Variable Perftimer not in script.

Think one of us missed something

A Violent Pigeon is a good Pigeon.
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 21st Apr 2008 20:14
Woah i wish i had a edit button >< Anywho i deleted Perftimer than you cant move lol, Oops :s

A Violent Pigeon is a good Pigeon.
DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 22nd Apr 2008 12:00
Quote: "Thanks, im just learning so its nothing fancy and sorry for any unneatness lol "


No problem i'm not neat with my code myself.

Quote: "only bought it yesterday so im hoping its a okay first try"


It's wonderfull for a first try!

Quote: "Thanks for making it better"


Your welcome.

Quote: "Hmm Variable Perftimer not in script.

Think one of us missed something"


What do you mean? Will it not compile? If so what version do you have. If it just doesn't show up in the ide that's just because it's a undocumented command.

Quote: "Woah i wish i had a edit button "


It should be right under your avatar.

Quote: "Anywho i deleted Perftimer than you cant move lol"


Your still moving you just can't tell.

BTW if you need any help and Raven and SniperX are busy or somthing you can post it here and me or somone else will help you


I'm Pro grammer.
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 22nd Apr 2008 18:37
Okey How come you cant tell if your moving :S
Version 1.054

A Violent Pigeon is a good Pigeon.
RedFlames
17
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 22nd Apr 2008 19:28 Edited at: 22nd Apr 2008 19:31
Quote: "How come you cant tell if your moving :S"

possibly you're really not moving, because "60/screen fps()" returns an integer and if screen fps() is bigger than 60 this will be 0.
(e.g. if FPS are 70 -> 60/70 is <1 and converted to integer gives 0)
That means you just cant move with fps being greater than 60 :p

to fix it just replace


with

(Explanation: if one of the numbers is a float the result is float too)

or easier:

(i hope you dont mind the little inaccuracy of fps being 1 too high )

DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 23rd Apr 2008 00:08
Good catch RedFlames.



This code uses a float named targetFPS instead of dividing it by 60. I tried it above 60 FPS and it seems to work. BTW Violent Pigeon try updating your version of DBPro that *should* fix the perftimer() thing.


I'm Pro grammer.
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 26th Apr 2008 16:52
Where can i update my copy ><

A Violent Pigeon is a good Pigeon.
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 26th Apr 2008 17:06 Edited at: 26th Apr 2008 17:23
Ok well after alot of editing i have confuddled myself, how do i get the tanks animations to play, its the tank from darkmatter but i dont have a clue how to make its animations play, the tanks file name is DarkTank.x and its texture is tank03 But how do i make the animation play so when it moves the tracks spin, it is animated to move :s



I Cant let you have the model because its from Darkmatter but thats my current progress.

A Violent Pigeon is a good Pigeon.
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 29th Apr 2008 03:50
perftimer was removed a while ago, I think it's DB PROgrammer who needs to update!

Use "Play Object" to run the animation.

Don't post the same thing in multiple boards, by the way.

Unterseeboot - Has you played it?
Los Mineros are on leave...
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 30th Apr 2008 03:21
I Know, i posted my excuse at the top >< also thanks for the command big help

Thanks

VP

A Violent Pigeon is a good Pigeon.
DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 2nd May 2008 19:25 Edited at: 2nd May 2008 19:29
Quote: "perftimer was removed a while ago, I think it's DB PROgrammer who needs to update!"


Are you sure? I have version 1.66 and it works, although I know I am a version behide I didn't know they had removed it. Oh well, that was a very good way to get a random number as timer() wasn't fast enough in some caculations meaning you could get the same number more then once.



That should do the trick for animating it, I havn't tried it so it might have some bugs


I'm Pro grammer.
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 3rd May 2008 02:48
Hmm, nope that makes the car go sideways for some reason lol but still no animation ><
This is my script


This is the one i want to get the animations going on:


Thanks, Svothe

A Violent Pigeon is a good Pigeon.
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 3rd May 2008 03:23
You're right, it works

Maybe they put it back, it definitely didn't work in the last version.

Unterseeboot - Has you played it?
Los Mineros are on leave...
DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 3rd May 2008 08:46
This code works for me.



You may have to replace the model and texture paths.


I'm Pro grammer.
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 3rd May 2008 13:48
Ok DBP yours works great but i still cant get the animations working ><
Im learning the language as i progress so eventually im sure ill sort myself out but any help until then is welcome

A Violent Pigeon is a good Pigeon.
Penfold
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 10th May 2008 12:44
Hope you don't mind DB Programmer I've taken a copy of your grass making routine I've also changed it a little.

Change 1. It now makes the texture on an invisible bitmap so yo udon't see it flash up on the screen.

Change 2. Changed second rgb statement in the random colour mix to 0 as you don't see the background when you mamke a box. (makes no difference just a little bit less the computer has to work out )

hope thsts ok



I'll leave to one of you guys to put it back into your code if you want to.

'Ooh 'eck chief'...'crumbs'
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 30th May 2008 15:36
Alright guys, bear with me here as im going to try and morph this into a RPG :s i will try and keep this updated with my problems

A Violent Pigeon is a good Pigeon.

Login to post a reply

Server time is: 2024-11-15 20:00:18
Your offset time is: 2024-11-15 20:00:18