Home   Help Search Login Register  

Author Topic: "force offensive driving" script  (Read 1850 times)

0 Members and 1 Guest are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:"force offensive driving" script
« Reply #15 on: 09 Jul 2005, 17:09:43 »
so where it says MAX_SPEED do i put the fastest  speed i want it to go. and does this also make it so it cant stop?

how are you planing on doing it linear?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:"force offensive driving" script
« Reply #16 on: 09 Jul 2005, 19:37:17 »
whoa i didn't think of it that way
penguin with the way his works the AI should still be driving but he just speeds them up little by little to the maxspeed
it should work on jeeps as well

one problem is you still have to worry about objects in the way of your jeep...

edit: problem solved
here is a script to execute on the objects that the jeep might hit

Code: [Select]
_jeep = _this select 0
_obj = _this select 1

#loop
?_jeep distance _obj <= 1.5:goto "slam"
?nomorejeeps:exit
~.001
goto "loop"

#slam
_obj setvelocity [0,0,5]
~.1
_obj setvelocity (velocity _jeep)
goto "loop"

[jeep_name, object_name] exec "hit_stuff_with_your_car.sqs"

when the jeep is gone (say you use a trigger to tell) make the variable nomorejeeps true
to exit the script

this is untested, and you might want to mess with the first setvelocity (it might go too high - that was just meant to get it off the ground so the other setvelocity would work better - or not high enough) also maybe the distance form the object
Code: [Select]
?_jeep distance _obj <= 1.5:goto "slam"
« Last Edit: 09 Jul 2005, 19:50:13 by Triggerhappy »

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:"force offensive driving" script
« Reply #17 on: 10 Jul 2005, 04:57:52 »
so where it says MAX_SPEED do i put the fastest  speed i want it to go. and does this also make it so it cant stop?

MAX_SPEED is a global variable. In my mission, as the boats would enter certain parts of the river, they would hit a trigger which would change this variable. That way I could speed up and slow down the boats depending on how far along their preset path they had gone.

I'm not sure if this would work in your mission or not. The best thing you can do is to just plop it down into your mission and give it a go.

One more thing I should mention is that by changing the bolded number in the line below, you can increase the acceleration (increase the number) or decrease it (decrease the number):

_boat setvelocity [(velocity _boat select 0)*1.1, (velocity _boat select 1)*1.1, (velocity _boat select 2)]

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!

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:"force offensive driving" script
« Reply #18 on: 10 Jul 2005, 05:06:10 »
i'm pretty sure it would work cause the ai would still but driving but forced to go faster... maybe a bit messier but thats ok!  ;D

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:"force offensive driving" script
« Reply #19 on: 10 Jul 2005, 19:42:18 »
ok, but how would i change the global variable in triggers

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:"force offensive driving" script
« Reply #20 on: 11 Jul 2005, 00:47:30 »
triggers or a script, doesn't matter
max_speed = some #