Need help with walk speed value change

Blitz3D Forums/Blitz3D Programming/Need help with walk speed value change

Guy Fawkes(Posted 2009) [#1]
I have done some research on the camera wobble code in the code archives. I need to use BT_PickBelow() to align the player to any vector, and change the speed from walking to slowly running, to medium running, to running at a constant and close to constant speed.

i have tried everything, and cant get it to work. also when u hold shift and hold up & down, not up or down, same thing with left or right, it totally slows down the player to a complete halt. same with up and down, or left and right.

here's the code:



ANY help is GREATLY appreciated! :)

~DS~


GIB3D(Posted 2009) [#2]


Let's say your holding down shift and nothing else, then it would look like

Else If 1 And (0=0 or 0=0 or 0=0 or 0=0 or 0=0 or 0=0)


Then it would make sp = 0


Guy Fawkes(Posted 2009) [#3]
Ok, then how would I go about changing the speed depending on if ur say on a hill and slowly walking down, then it gets steeper, and ur speed slowly increases by the force of walking down the hill, and then slowly come to a halt, also depending on the force of the hill?


_PJ_(Posted 2009) [#4]
What do you mean Force of the hill and why would your speed slowly come to a halt?




If your entity has the collision set to allow sliding, and you have gravity implemented by default which should always translate your entity vertically downwards (assuming downwards is of course the direction of gravitational attraction), then acceleration will always be correct and you wont need to do anything else. Since if the player moves downhill ina addition to the gravity, they will move faster because more than one change will be performed on the entity location. Likewise, if they are moving uphill, then their movement will be countered by the translation down (let's hope they can move upwards faster than gravity can pull them down ;) )


Guy Fawkes(Posted 2009) [#5]
that answers part of my question. the other part is the exact point of tripping, falling, and rolling down the hill on 1 of the models sides. also controlled by gravity. and what do u expect i use for gravity?


_PJ_(Posted 2009) [#6]
TranslateEntity entity,0,-g,0,true ?


Guy Fawkes(Posted 2009) [#7]
That answers 75% of my question. Now how do I say make him literally roll down the hill on his side at a given speed dependent on the gravity or w/e?