Home   Help Search Login Register  

Author Topic: Constant Speed  (Read 765 times)

0 Members and 1 Guest are viewing this topic.

O Neil

  • Guest
Constant Speed
« on: 11 Jan 2004, 02:11:37 »
Hey

Could a script tell a car too keep maximum speed at all times ? I wanna re-do a cut-scene of the video clip to the song "Show me how to live" By AudioSlave.

Its about renegade drivers who tear it up on the road, but I can't do that if the guys sorta, crawl around the corners.

I'd try setvelocity, but the take too long to accelerate back up again.

Any help ?

(O'Neil

Offline .pablo.

  • Former Staff
  • ****
  • When in doubt, empty the magazine.
Re:Constant Speed
« Reply #1 on: 11 Jan 2004, 02:44:26 »
i gave up trying to get the ai to do anything fast

since ur making a movie with the ai (and not trying to get them to do it during gameplay, like me) you could try messing with setacctime.  if use the right camera angle and dont accelerate it too much, i doubt anyone would notice, unless they were looking for it.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Constant Speed
« Reply #2 on: 11 Jan 2004, 05:11:09 »
Quote
I'd try setvelocity, but the take too long to accelerate back up again.I'd try setvelocity, but the take too long to accelerate back up again.

 ??? ??? ???

What do you mean? Setvelocity almost immediately increases the velocity of an object to whatever you set. Just use setvelocity to shoot them in the direction you want them to go, and possibly make slight course adjustments using setdir. However, this would only really be simple to do on fairly straight courses.

If the AI ends up messing it up (like they brake right after you use setvelocity, or whatnot), then use an empty car, camcreate a person (so he has no AI), then moveindriver the new unit into the car.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

O Neil

  • Guest
Re:Constant Speed
« Reply #3 on: 11 Jan 2004, 07:21:50 »
Hey

Setacctime sounds OK, dunno if this could be done but would there be a way for him to skid around corners & KEEP his speed ?

(O'Neil

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Constant Speed
« Reply #4 on: 12 Jan 2004, 04:25:47 »
Quote
dunno if this could be done but would there be a way for him to skid around corners & KEEP his speed ?

Use setvelocity.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

O Neil

  • Guest
Re:Constant Speed
« Reply #5 on: 12 Jan 2004, 05:42:50 »
Already told you the prob with that

(O'Neil

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Constant Speed
« Reply #6 on: 12 Jan 2004, 06:28:59 »
And what was that? I don't understand.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

O Neil

  • Guest
Re:Constant Speed
« Reply #7 on: 12 Jan 2004, 07:22:58 »
I want the car to skid around the courner, and take off instantly, as iff in a hurry, with the set acctime, it sorta looks ghey, with the setvelocity, it's OK, but it takes a while for the car to get back to speed again.

(O'Neil

Sol Fire

  • Guest
Re:Constant Speed
« Reply #8 on: 13 Jan 2004, 03:59:14 »
Just a suggestion, try using setvelocity to shoot him out of the corner

i personally have never used SetVelocity but if your looking for him to speed into a corner and shoot out of the corner like he would if he was street racing with Noss and lost too much speed entering the corner, setvelocitying him out of the corner might work  :-\

i'll fiddle with this and see what all i can do with it  ;)

[EDIT:] I wasnt able to get the desired affect using only one trigger but maybe if you used multiple triggers accelerating him faster and faster and then one at the end of the corner shooting him forward at the desired speed may cause what you are looking for to keep him going fast and to make him skid setvelocity him to the side a bit

if its a 90 degree turn i wouldnt know
« Last Edit: 13 Jan 2004, 04:37:40 by Sol Fire »

O Neil

  • Guest
Re:Constant Speed
« Reply #9 on: 13 Jan 2004, 10:02:56 »
Yea, I thought of that . . .1 = I think it looks a lil ghey, but 2 = sometimes when the car is PUSHED it depends if he skids to the right or the left ;)

Enough said ;)

(O'Neil

Komuna

  • Guest
Re:Constant Speed
« Reply #10 on: 13 Jan 2004, 15:04:55 »
SetSpeed:
_veh setvelocity [_v*(cos (getdir _veh +90)),_v*(sin (getdir _veh +90)),velocity _veh select 2]


SetAcceleration

_acc='value'  --> defined by user

_vinit = (speed _veh)/3.6

_d = _df-_di   --> Final position less the initial position or, in other words, the travelled distance

_v = SQRT((_vinit^2) - 2*_acc*_d)

-------------------------------------------------
The above calculations allows you to accelerate the vehicle (or deaccelerate if replace + with '-' in the last equation. It won't disturb the direction of the vehicle. If the direction must be disturbed (!) in order to make the corner, then check in a few days for my dinamic rotation function at the ECP server. Note: the dinamic rotation allows you to force the car make the corner  while givin the car a different direction for realism effects.
« Last Edit: 13 Jan 2004, 15:05:45 by Komuna »