Home   Help Search Login Register  

Author Topic: Fire DoFire and Clay Pigeon Shooting  (Read 612 times)

0 Members and 1 Guest are viewing this topic.

Samhain

  • Guest
Fire DoFire and Clay Pigeon Shooting
« on: 10 Apr 2003, 04:35:09 »
I am having trouble creating a simple supressive fire script. I want my MG guys to fire off a few bursts of ammo in the direction of the enemy while my rifle guys try and get closer.

When I am equppied with an MG (M60 for instance) I can see the enemy in their postition from a long way off and give excellent supressing fire. But AI MG soldiers tend to run off toward the enemy till they are in range of the enemies guns before they start shooting.

I tried the Fire command but all I get is the AI aiming at the sky. I used the DoTarget as well but they still shoot up in the air like certain middle eastern characters that have been in the news lately.

This script would work wonders for a clay pigeon shooting simulation or a gun salute at a funeral, but not for making the enemy keep his head down.

I tried the SetDir command and the DoWatch but my guys have no discipline :(

Anyone know how I can get a soldier to shoot his/her weapon in a succession of bursts in the general direction of the enemy?

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Fire DoFire and Clay Pigeon Shooting
« Reply #1 on: 10 Apr 2003, 07:55:47 »
Try to put the MG soldiers skill at maximum. Might help.

MorMel

  • Guest
Re:Fire DoFire and Clay Pigeon Shooting
« Reply #2 on: 10 Apr 2003, 11:34:18 »
Your soldiers seem to be very indisciplinated... ;D

As "The real Armstrong" said, increase their skill. Then use a script which stops your machine gunners, reveals the target and orders your MG's to fire. Yes, "fire" command is stupid... I tried it with mortars and... BOOM! 500 meters away.
Use MyMG reveal EnemySoldier, MyMG dofire EnemySoldier and dostop MyMG.
Your 'MyMG' will probably look at direction '0' (North) if you use 'dostop' command, but i think that if you set his group formation direction to the one you want them to head, they (as long as 'MyMG') will obey you:


The following script is just an incomplete sample:

[MachineGunner,Target list,Direction] exec ">name<.sqs"

Code: [Select]
_MG = _this select 0
_Targetlist = _this select 1
_dir = _this select 2

_grp = group _MG

_grp setformdir _dir

_n=0

#loop
~.3

? count _targetlist == 0 : exit

_Target = _targetlist select _n

_n=_n+1

_MG reveal _Target
_MG dofire _Target

@!(alive _target) or !(alive _MG) or (count _targetlist == 0)

? alive _MG and (count _targetlist > 0) : Goto "loop"

_MG dofire ObjNull

exit

The script sets the formation direction and reveals targets for the MGunner.
Then you could have another script which orders the MGunner to move to a certain position and makes him stop at that specified position:

Code: [Select]
_MG = this select 0
;[x,y]
_Pos = this select 1

;if MG belongs to group player, change domove to command move
_MG domove _Pos

@UnitReady _MG

dostop _MG

exit

Change these scripts as you want... But don't forget to verify their reliability! ;)