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 / problems with implenting spookys timed movement?

Author
Message
Cliff 3degs network
21
Years of Service
User Offline
Joined: 23rd May 2003
Location: Sweden
Posted: 8th Jun 2005 02:25
i have bin struggeling with this as i dont want an locked sync rate in my game anymore.
but iam getting nowhere so please help me out on this.
the on helping me will get credits for it in the game later on.

this is spookys code sample.


the problem aint in his code its when iam trying to implennt it to my collision code the player figure dosent move at all when using 20.0*move# instead of wspd=4.5 that simply means iam moving him in steps of 4.5 in all directions.
my collision code or rather jopie dopies.


i yust dont know where the problem is?

AMD ATHLON 1.8 XP WITH AN GEFORCE 4 TITANIUM 4600 (128 MB) AND 256 MB DDRAM (266).
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 8th Jun 2005 07:11
First off, wspd looks like an integer variable to me, so it can't hold fractional values, unless you have defined it as a float variable somewhere else. If not change it to wspd#

also, as all your collision stuff is in a function, it can not know about move# and will default to 0, and so either pass it as a parameter with your other two variables, or define it as a global variable.


Cliff 3degs network
21
Years of Service
User Offline
Joined: 23rd May 2003
Location: Sweden
Posted: 9th Jun 2005 05:24
thanks spooky it worked only crappy thing is to go thru 2500 lines of code to adjust the speed for every object ingame.
i set move# to gloabal but have one question is it neaded to terminate that command somehow and when?
i did t know this?
---------------------------
First off, wspd looks like an integer variable to me, so it can't hold fractional values, unless you have defined it as a float variable somewhere else. If not change it to wspd#
--------------------------
but heck iam not really an programmer yust an happy wannabe.

the game currently runs betwen 45 and 56 fps thats really good compared to have it locked at 30 before.
screenie included but sadly when i snatched it it lowered to only 40 fps.

AMD ATHLON 1.8 XP WITH AN GEFORCE 4 TITANIUM 4600 (128 MB) AND 256 MB DDRAM (266).

Attachments

Login to view attachments
Cliff 3degs network
21
Years of Service
User Offline
Joined: 23rd May 2003
Location: Sweden
Posted: 9th Jun 2005 05:48
yust one more thing spooky do you know how i could use this time stuff when decreasing an value to with the dec command?
i want the value aan to lower it self acording to the movement speed iam using this when animating my player objects plain so that it looks like he walks.
dec aan

AMD ATHLON 1.8 XP WITH AN GEFORCE 4 TITANIUM 4600 (128 MB) AND 256 MB DDRAM (266).
Cliff 3degs network
21
Years of Service
User Offline
Joined: 23rd May 2003
Location: Sweden
Posted: 9th Jun 2005 06:56
i fixed it now it was this simple task again you spoke about float or integer values.
i dont know crapp about anything like this but i have an book called c and c++ for dummies and found some explanations about everything as i noticed that dbp uses some of the same symbols and stuff.
this is what happens when an gfx artist decides to start programming and dosent now jack of it.
and i have bin using dbp now for over a year


thsi solved it
-------------------------------------------
dec aan#,50.0*move#
if aan#=0 or aan#<0 then aan#=28`--------walk animation
if aan#>21 and aan#<28 then ania=411
if aan#>14 and aan#<21 then ania=412
if aan#>7 and aan#<14 then ania=413
if aan#>0 and aan#<7 then ania=414

AMD ATHLON 1.8 XP WITH AN GEFORCE 4 TITANIUM 4600 (128 MB) AND 256 MB DDRAM (266).
Cliff 3degs network
21
Years of Service
User Offline
Joined: 23rd May 2003
Location: Sweden
Posted: 9th Jun 2005 06:57
do you know a good place to get simple explaining about stuff like this.

AMD ATHLON 1.8 XP WITH AN GEFORCE 4 TITANIUM 4600 (128 MB) AND 256 MB DDRAM (266).
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 9th Jun 2005 09:07
Nope.

Simple really.

Integers are whole numbers, like 1, 2, 456, etc and are denoted in db as simple named variables like a, b, c

Floats are fractional value, like 1.2, 678.543 and are denoted in db as variables followed by #, like a#, b#, c#

The thing to be careful of is doing things like:

a=123.456

because a can only hold integer values it will lose the .456 bit and just hold 123

The other thing to look out for is assigning integers to float variables, like:

a=1
b=2
c#=a/b

you would thing a# would then hold 0.5 but you would be wrong. Because all arguments are integers then result is also an integer, so answer is 0 - to gget around this problem you have to introduce a float into equation, like c#=(a+0.00)/b or c#=a*1.0/b

Hope that lot confused you!


Login to post a reply

Server time is: 2024-09-23 21:14:30
Your offset time is: 2024-09-23 21:14:30