Home   Help Search Login Register  

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

0 Members and 1 Guest are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
"force offensive driving" script
« on: 20 May 2005, 00:14:28 »
hello,

I need a script for a mission im making;

I need a script that forces AI(using setvelocity maby?) to drive fast and more agressively,

I have a group of jeeps with MGs and I need them to,

not stop for anything and follow there waypoints exactly without taking detours stoping or slowing down.


I thought maby  just get the direction of the current waypoint,make the vehicle turn that direction,  use a setvelocity loop to make him drive there, and then when he gets to the waypoint to NOT stop but keep going and just turn(while still moving forward using setvelocity, but maby at a slower speed so he can turn sharper) to face the next waypoint and do the same thing,

I dont need to worry about him crashing because I am going to set exact waypoints so that there wont be anything for him to crash into.

thanks in advance

« Last Edit: 20 May 2005, 00:16:10 by penguinman »

Offline Morglor9

  • Members
  • *
Re:"force offensive driving" script
« Reply #1 on: 24 May 2005, 06:46:06 »
are u asking for this to make a Jeep MG assault mission/part of a mission?
Cymbaline

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:"force offensive driving" script
« Reply #2 on: 24 May 2005, 23:30:47 »
ya,  thats it,

bluehand

  • Guest
Re:"force offensive driving" script
« Reply #3 on: 25 May 2005, 00:17:40 »
I'm guessing you've tried:
this setBehaviour "Careless"; this setSpeedMode "Full"

Only I tried it on a jeep, then fired at him, and he ignored me.  He did react to a grenade, but only cos it disabled the jeep.  So the driver got out and hurried on foot to the next waypoint  :D

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:"force offensive driving" script
« Reply #4 on: 25 May 2005, 01:54:36 »
well yes but,

im having the jeeps race through an enemy camp running down infantry and barrels and tents and machinegunning everybody.

and even on those settings the jeep will stop if a person or object gets infront of it.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:"force offensive driving" script
« Reply #5 on: 25 May 2005, 16:00:34 »
penguinman what you are proposing will be difficult to the point of impossible.    You have to use setVelocity to overcome the collision avoidance routines in the game.     The means your script will have to keep track of the position, orientation and velocity of every object in the area, and move the vehicles accordingly.   Oh and it will have take account of building positions as well.    Even if you didn't run into framerate problems with the number of calculations, writing the script itself would be fiendishly complicated.
Plenty of reviewed ArmA missions for you to play

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:"force offensive driving" script
« Reply #6 on: 25 May 2005, 23:45:19 »
no, thats not what i ment,
im sorry, i should have explained better :)

the scripter dosent need to wory about all that stuff, thats what waypoints in the editor are for.

all i need is a script that makes a jeep turn to face its next waypoint, and setvelocitys it at a certain speed until it gets there and then without stoping(just making it turn and face the next waypoint) and do the same thing

im going to make very short precise waypoints so I can have him weave around buildings and stuff but go right though infantry or barrels or tents.

the ONLY thing the scripter needs to wory about is this

Quote
a script that makes a jeep turn to face its next waypoint, and setvelocitys it at a certain speed until it gets there and then without stoping(just making it turn and face the next waypoint) and do the same thing
:)

does that clarify,

thanks


« Last Edit: 25 May 2005, 23:47:30 by penguinman »

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:"force offensive driving" script
« Reply #7 on: 03 Jun 2005, 18:23:28 »
does anybody think they can make it?

Linear

  • Guest
Re:"force offensive driving" script
« Reply #8 on: 02 Jul 2005, 14:52:35 »
Hmm.. this is a nice idea for a script. I think I'm gonna try it
(In fact I joined this forum just to say that) :D

Linear

  • Guest
Re:"force offensive driving" script
« Reply #9 on: 02 Jul 2005, 17:38:30 »
this one's difficult but I think I'll have it soon..

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:"force offensive driving" script
« Reply #10 on: 02 Jul 2005, 18:18:54 »
we prefer it if, when yours is the most recent post in a thread, you modify your post instead of creating a new one, especially if it's just to say "work is going well". helps keep things nice and tidy, yes? :)

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:"force offensive driving" script
« Reply #11 on: 03 Jul 2005, 16:01:21 »
hey penguin, i see a problem with your idea. from what i've seen, jeeps running over any object doesn't much work, and barrels will be like ramming a concrete wall (not quite realistic.... ::) :P)

so no matter how you do it its going to be an extremely complicated script, unless the jeep avoids everything

also the script will still need to be custom tailored to your mission (sharper/wider turns, speeds,etc) plus launching the barrels when the jeep "hits" them (it can't actually hit them) if you want that as well

but it sounds like a kickass script and would be cool just to watch if it worked.
could i just take a look at your mission? I'd like to see it, and maybe try to script that, or at least do some of it and give someone an idea of how to do it

bdfy1

  • Guest
Re:"force offensive driving" script
« Reply #12 on: 04 Jul 2005, 01:20:05 »
Quote
and even on those settings the jeep will stop if a person or object gets infront of it.
Oh yes, that's annoying OFP bug - I really hate when not only jeeps but tanks(!) stops in front of enemy ...:(
Quote
a script that makes a jeep turn to face its next waypoin
And what is your problem ? You can't calculate right angle ? It's basic trigonometry ;) Try this for example
Quote
_unit = _this select 0;
_WP = _this select 1;
_DX = (getpos _WP select 0) - (getpos _unit select 0);
_DY = (getpos _WP select 1) - (getpos _unit select 1);
_ang = _DX atan2 _DY
_unit setdir _ang
then setvelocitty etc...
Note that you will have to use getWPPos  command instead ;)



Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:"force offensive driving" script
« Reply #13 on: 08 Jul 2005, 17:11:13 »
yes, i am custom tailoring it to my mission, i have all the waypoints set up but there are enemys all over and i want the jeep, racing through a enemy filled town and just running over all tents men and stuff in its path.

thanks

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:"force offensive driving" script
« Reply #14 on: 09 Jul 2005, 07:05:34 »
I made something similar to this in a mission I am/was working on. The mission has you sitting in the gunner's seat of a PBR boat, which is driving thru a river (in Dak Seang island).

The boat is supposed to haul @$$ down the river, with you shooting wildly at the enemies on both banks, while the enemys are trying to shoot at you. Problem is, the AI driver doesn't want to go very fast, like it would if you were in the open ocean. So I made a little script that forces him to keep driving fast:

Code: [Select]
;speeds up a boat, since the AI drivers don't want to go very fast

_boat = _this select 0

#loop
? speed _boat < MAX_SPEED : _boat setvelocity [(velocity _boat select 0)*1.1, (velocity _boat select 1)*1.1, (velocity _boat select 2)]
~1
? alive _boat && alive driver _boat : goto "loop"
exit

This script basically makes the boat constantly accelerate in the direction it is facing, until it hits the top speed (set in a global variable so I can adjust it when the boats reach certain points). The driver is still able to turn the boat towards his waypoints, and the whole thing usually ends up working very well.

The path of the boats in my mission is generally pretty straight though. There are only a few sharp turns, before which I lower the speed of the boats. If you want the jeeps to make 90* turns around building corners and stuff, this might not work. But hey, it's a start.
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!