Jump to content
majoris

Covering Fire script

Recommended Posts

Hey everyone.

First off, I'd like to introduce myself. I'm an infantryman in the US Army Reserves, 28th Inf. Division, and I've been playing Operation Flashpoint for quite some time, just now getting into scripting.

I'm looking to implement real-life tactics and concepts that I've learned during my training into the game through scripts, my current project being a proper covering fire script.

I'm new to scripting but I have a pretty firm grasp on most concepts, but I'm looking to you all for help now haha.

I'd like to have a script that calls for a player or multiple players to pour down rifle/mg fire on a designated area. This designated area would be clicked on the map, similar to most artillery barrage scripts to mark the target. I'd like to have the shooters lay down fire in a spread of 10 meters from the designated area on the map (could be a marker I'm assuming?).

Here's an example of how this script could be used...

" You (the Officer in the group) would like to rush to a nearby building, but the path is in the direct line of fire of the enemy. You mark the estimated location of the enemy on the map, and the machine gunners of your squad lay down fire in a spread around this area to cover you while you move. "

I can get the position of the marker, and get the shooter to fire, but it's normally straight up in the air, and without a human target to shoot at, they won't fire their weapon. How would I get the shooter to fire at an inanimate object with a spread to the fire?

* Note - I have already tried using the invisible target addons, but I would like to have the player select the target on the map and fire in a spread (not pin-point accuracy)

Thanks for helping a grunt out smile_o.gif

Hooah

Pte Majoris

1/110

28 inf.

Share this post


Link to post
Share on other sites

Howdy, grunt.

Wow! What a coincidence. I am currently in the process of writing a system of scripts to do just what you described!

Maybe we could work together? smile_o.gif

Share this post


Link to post
Share on other sites

Hey keystonegrunt, always nice to see fellow reservists around here (although I'm in the marines). I've been planning on making a script like this, basically by using the invisible targets addon, but by setting the target's location according to where the player clicks on the map. That might be similar to what AgentFox2 is making, so his might be better (or released sooner).

Anywho, I'm a blatant self-promoter, so I'll just advertise some scripts that I've written. I'm only doing this because you say you want to script things you have learned in training, and that is generally what I try to do as well.

squad rush script

create your own formations (for better spacing)

Other scripts I've released here

Share this post


Link to post
Share on other sites

I have a small suggestion that might make this kind of script seem a little more realistic. Being prior Army infantry myself, I know how useful a script like this is for making missions realistic.

My suggestion is, how about adding more than one invisible target, such as a few of them spread apart within that 10m area and in a more circular pattern. The center of the pattern would be the point of the map clicked on, and the script would place the others in a pre-set pattern around the first one.

grouping1.jpg

Then in the script, it could call for the soldier to fire at one of the targets for a set amount of time, and at a certain interval, randomly fire at a different target. For example, soldier starts firing at the first target for a few seconds, then shifts to the next, fires for a few seconds, then shifts to the next, etc. Any soldiers firing at this area will continue to shift fires until they are told to stop or when ever you choose them to stop their covering fire. This will give the appearance of the soldier shifting his fire but within a small area, instead of just firing at a single spot. As you had said, covering fire is dispersed over an area, not just at one point. A script that allows this might look better, what do you think?

Share this post


Link to post
Share on other sites

I had a go at creating a similar script where grenadiers would use indirect fire after a map click. I tried using this script from OFPEC., but it was beyond my meager abilites and my crap PC that can't ALT+TAB out of OFP. Perhaps this script might help you?

BTW..... I was after a very small demo mission of the above script in action. Would be great if somebody erm....cough!...General Barron..cough could whip one up. biggrin_o.gif

As for my contribution so far..... not much!

I'm really looking forward to trying out this script once you (fellas) have released it!

PS. Out of curiousity, what's the difference between covering fire and surpressing fire? Might help me enjoy "Band of Brothers" that little bit more smile_o.gif

Share this post


Link to post
Share on other sites

@Chops

Hey buddy, that trap script was hardly "not much", I personally loved it and have used it in several personal SP missions biggrin_o.gif

Quote[/b] ]PS. Out of curiousity, what's the difference between covering fire and surpressing fire?

They are pretty much the same thing. "Covering fire" is a term used to describe a base of fire that is meant to suppress the enemy while your fellow soldiers maneuver.

Quote[/b] ]Fire directed at the enemy to keep him from seeing, tracking, or firing at the target is suppressive fire. Suppressive fire does not have to be 'aimed' fire in the sense that you are firing at a particular identifiable target; it can be 'area' fire in this respect, directing fire into known or suspected enemy positions such as woodlines, buildings and likely avenues of approach to your position.

(From US ARMY, FM 21-75, 3 AUG 1984)

Hope this helps you understand the term more smile_o.gif

Share this post


Link to post
Share on other sites

Getting the units to fire in a spread formation is the first dynamic of this. However you will also face the problem of actually surpressing the AI. Keycat's Group Link Script has a suppression script built into it. I use it for most of my missions, but I don't really know how effective it is. I never really tested it specifically. Its based on rate of fire.

Keycat's GL 1.91

Share this post


Link to post
Share on other sites
Quote[/b] ]I had a go at creating a similar script where grenadiers would use indirect fire after a map click. I tried using this script from OFPEC., but it was beyond my meager abilites and my crap PC that can't ALT+TAB out of OFP. Perhaps this script might help you?

BTW..... I was after a very small demo mission of the above script in action. Would be great if somebody erm....cough!...General Barron..cough could whip one up.

Okay, I just spent a while working on this. I can get the grenadiers to accurately shoot at and hit any location I pass the script (as long as it is within range), using the (slightly modified) technique from Soultaker's awesome tutorial. Its tons of fun. Unfortunately, I'm running into a lot of unexpected problems, but I should hopefully have the script finished next week.

Share this post


Link to post
Share on other sites

Good to see some other servicemembers around here smile_o.gif

I've been working on this script and came up with a fairly simple one, but it's effective.

You place an invisible target in some odd corner of the map, and when you click a location where you need covering fire, it moves the invisible target to that location. I also have it moving around constantly in a small area (the mission maker can actually adjust the size of the area) so the machine gunners can fire in a spread.

The only bad thing is that the Invisible object is classified as an enemy unit, and you end up having your entire team fire at it. It works well for taking down walls with rockets though, and it adds a lot of depth and immersiveness to a firefight when you see all the tracers going around.

Soooo, try this out guys and see what you think.

Quote[/b] ]

; SUPPRESSIVE FIRE

;

; For Operation Flashpoint v1.96

; by KEYSTONEGRUNT

; mikemajoris23@hotmail.com

;

; Version 1.0

;

; onMapSingleClick {[_pos,machinegunner,invtarget,10]

; Just replace machinegunner with the units name, and invtarget with the invisible targets name, 10 with the spread size.

;-----------

_pos = _this select 0

_unit = _this select 1

_target = _this select 2

_area = _this select 3

_x = _pos select 0

_y = _pos select 1

_area2 = _area * 2

#Update

_target SetPos [_x,_y,0]

~1

_unit doTarget _target

~1

_newx = _x + Random(_area2)

_newy = _y + Random(_area2)

_target SetPos [_newx,_newy,0]

~1

goto "Update"

exit

Share this post


Link to post
Share on other sites

Can't you guys (looks at General_Barron) make the invisible targets get placed on the most known enemy to the leader of the group or something like that? Would be great if you could use the script for AI too. Or maybe make a script that makes the a AI group flee and use the covering fire script, and the invisible target(s) is moved around the pos of the leader of a group that the mission maker chooses when he executes the script...

Now I got myself confused crazy_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]The only bad thing is that the Invisible object is classified as an enemy unit, and you end up having your entire team fire at it.

What's more not only your group will fire at invisible targets but all other friendly groups. I tried to make use of invisible targets some time ago but I ended with two armies fireing not at each other but at inv targets  rock.gif  sad_o.gif   mad_o.gif

I haven't tried it but I think there can be solution:

-use setcaptive true on invisible target

-order only soldiers you want to use for covering fire to fire at this target "_x doFire _name_of_inv_target" forEach [array_of_soldiers_to_fire]

Share this post


Link to post
Share on other sites

can't do civvies, you're own team will frag you if you kill too many..

i'm not sure on the command, how do you spawn an object? i've seen missions where you can build sandbag emplacements and stuff.

Share this post


Link to post
Share on other sites
Quote[/b] ]i'm not sure on the command, how do you spawn an object? i've seen missions where you can build sandbag emplacements and stuff.

Object1 = "classname" createVehicle [3-element position array]

Share this post


Link to post
Share on other sites
Quote[/b] ]can't do civvies, you're own team will frag you if you kill too many..

Nope. I assume you are using Lester's invisible targets addon. In that case, the targets never "die". Check the readme; you will see that normal targets (east west res) are considered the highest priority by AI, and thus they will always shoot at them if they are able to. Civillian targets, however, will never be shot at by the AI, unless ordered to via "dofire". That is what you should be using. Delete the targets when you want the guys to stop firing at them.

Share this post


Link to post
Share on other sites

@grunt249

Ah gee whiz mate! You've made me feel all warm and fuzzy! biggrin_o.gif Didn't know anybody ever used that little old script. Thanks for clearing up that military jargon for too.

@General Barron

Can't wait to have a crack at that script when done. Your efforts are appreciated.

You two gentlemen might even make me start playing OFP on the US side again

biggrin_o.gif

As for the covering fire script. I think the ideal would be to select the numbers in your squad, then use the box thingy that then appears to designate the area to fire on/at. Is this possible? Mapclick would remove the possibility to fire on windows in buildings, wouldn't it?

Cheers!

Share this post


Link to post
Share on other sites
Quote[/b] ]Mapclick would remove the possibility to fire on windows in buildings, wouldn't it?

From what I understand, you can order the AI to fire on specific objects, including buildings, trees, rocks, etc. As long as it has an ID # in the editor, then it can be targeted within a script. But for windows, I would think that you need to pre-place a target object at the window's location first. So yes, the map-click method would not work for firing at windows, unless the windows were marked with invisible targets and in the script it called to detect the nearest "window" target from the map-click and fire on that. I think it would be possible, but only with a lot of advanced mission setup and target marker placement, as well as a custom script for that specific mission.

One thing I am curious about, which brings up a question for the scripters reading this topic. How difficult would it be to implement a script that allows you to choose the soldiers from your squad that will provide covering fire, and who will not? An example is the fast-rope scripts used in the BAS helicopters. When you call for a fast-rope insertion, you must first select the soldiers from your squad that you want to rope out, and then you click on the map where you want them to rope at. How hard would it be to add this type of function to the covering fire script, so that you can choose which soldiers will provide the covering fire? This way, you can order half of your team to stay and shoot, while the other half leap-frog ahead to their next position. It would also allow you to choose only specific team members to fire based on their assigned weapons, or to provide an amount of fire based on need. For example, if there are only a few enemy soldiers you need to suppress, no need in having all 11 men opening up on them, why not just order say your MG or AR soldiers and one or two riflemen to fire, while the others are ordered to flank, advance, retreat, etc.

@Chops

Quote[/b] ]Didn't know anybody ever used that little old script.

I think it's great to have a script such as this that doesn't use any addons, and is a creative way to simulate something that in most cases would require some sort of addon. Simple but effective, and makes those 'Nam missions much more interesting  biggrin_o.gif

Share this post


Link to post
Share on other sites
From what I understand, you can order the AI to fire on specific objects, including buildings, trees, rocks, etc. As long as it has an ID # in the editor, then it can be targeted within a script. But for windows, I would think that you need to pre-place a target object at the window's location first. So yes, the map-click method would not work for firing at windows, unless the windows were marked with invisible targets and in the script it called to detect the nearest "window" target from the map-click and fire on that. I think it would be possible, but only with a lot of advanced mission setup and target marker placement, as well as a custom script for that specific mission.

Yes, that is correct. To put targets in windows you would have to pre-place them in the mission editor. The only way to do it dynamically would be to catalog every window or door position of every building in OFP. Then you would have to find the nearest building, find out which building it is, then figure out which pre-configured window you want to use. Obviously that would be a lot of tedius work for not much benefit.

Quote[/b] ]One thing I am curious about, which brings up a question for the scripters reading this topic. How difficult would it be to implement a script that allows you to choose the soldiers from your squad that will provide covering fire, and who will not? An example is the fast-rope scripts used in the BAS helicopters. When you call for a fast-rope insertion, you must first select the soldiers from your squad that you want to rope out, and then you click on the map where you want them to rope at. How hard would it be to add this type of function to the covering fire script, so that you can choose which soldiers will provide the covering fire? This way, you can order half of your team to stay and shoot, while the other half leap-frog ahead to their next position. It would also allow you to choose only specific team members to fire based on their assigned weapons, or to provide an amount of fire based on need. For example, if there are only a few enemy soldiers you need to suppress, no need in having all 11 men opening up on them, why not just order say your MG or AR soldiers and one or two riflemen to fire, while the others are ordered to flank, advance, retreat, etc.

I have already done this. biggrin_o.gif In the current test version of my script, you select the soldiers you want to lay down fire, and click on the map. The invisible target is spawned and the guys begin to spray the whole place! When I was testing it out, I had one fireteam stop and lay down fire while myself and the other fireteam flanked around. Then I'd make the second fireteam stop and target the same area, and advance the first fireteam past our position. Worked great and was great fun! Even without enemies to shoot at! biggrin_o.gif

I am also working on other functions. I should have a beta version for everyone to try out soon.

Share this post


Link to post
Share on other sites

@AgentFox2

Sounds great so far! biggrin_o.gif

So in regards to some of the functions you stated, please keep us informed on your tests against live AI. I'm curious to see how it will be implemented so that the AI will actually be suppressed by the fire, such as hitting the dirt and keeping down. It shouldn't prohibit the AI from firing completely, but maybe to set a random number of the AI in the area on "Hold Fire" while the rest are set to "Stay Down" and return fire. This would simulate a few grunts too afraid to fire, while others are not. It would also prohibit this script from being used like a cheat, in that the AI will still pose a threat if you are not careful.

Also, how likely are "friendly-fire" incidents? For example, FT 1 on the left opens fire while FT 2 on the right moves out. AI don't exactly move in a straight line to their ordered positions, and it's possible that at times the AI from FT 2 might cross the line of fire of FT 1. Will the soldiers from FT 2 try and steer clear of the lead, or will FT 1 chew them up for their "careless" movements? I have a feeling that they will in fact get mowed down, so is there a way to ensure soldiers will not cross paths of the soldiers laying fire? I know the chances of this are not as likely, due to a squad in line formation is usually spread out enough to have fairly wide sectors of fire. But just in case, since the AI likes to move like a bunch of retarded gimps at times.

Share this post


Link to post
Share on other sites
So in regards to some of the functions you stated, please keep us informed on your tests against live AI. I'm curious to see how it will be implemented so that the AI will actually be suppressed by the fire, such as hitting the dirt and keeping down. It shouldn't prohibit the AI from firing completely, but maybe to set a random number of the AI in the area on "Hold Fire" while the rest are set to "Stay Down" and return fire. This would simulate a few grunts too afraid to fire, while others are not. It would also prohibit this script from being used like a cheat, in that the AI will still pose a threat if you are not careful.

Well, I am working on such a feature! smile_o.gif Hopefully with the changes I make it will make suppressive/covering fire an effective tool for the player (or enabled AI squads).

Quote[/b] ]Also, how likely are "friendly-fire" incidents? For example, FT 1 on the left opens fire while FT 2 on the right moves out. AI don't exactly move in a straight line to their ordered positions, and it's possible that at times the AI from FT 2 might cross the line of fire of FT 1. Will the soldiers from FT 2 try and steer clear of the lead, or will FT 1 chew them up for their "careless" movements? I have a feeling that they will in fact get mowed down, so is there a way to ensure soldiers will not cross paths of the soldiers laying fire? I know the chances of this are not as likely, due to a squad in line formation is usually spread out enough to have fairly wide sectors of fire. But just in case, since the AI likes to move like a bunch of retarded gimps at times.

Well, OFP's AI can take care of a lot of those type of things up close. In the editor, try setting up a battle between two squads, and then run back and forth right in front of your squad's firing line. You'll notice that as you pass each one, they stop firing and wait for you to pass. At further distances however the AI is less thoughtful, because by the time you are actually "inside" their direct firing line -- and they stop firing -- the previous rounds are already on the way. Obviously they cannot recall these rounds. biggrin_o.gif

As an illustration to my answer, an example: I was testing out the script by trying to assault a base with a heavy MG team. I had one fireteam of the 2nd fireteam leader, a heavy machine gunner, and an assistant machine gunner laying waste to one entrance to the base by telling them to target the entrance on that side of the perimeter wall. The second MG team and myself flanked a bit off to their left, and I set my machine gunners target as one of the wall sections, but kept him on hold fire. I took down that section with an AT-4 and let him go. As I ran into the opening with the assistant machine gunner, I told my machine gunner to hold it and fall in. As I was clearing the base, I rounded a house corner and then *KERPHAT!* I bit it. As the camera zoomed to my killer...it was none other than the other machine gun team, who I had forgot was firing into the base!

Just a small example to show that yes, it is quite effective (even against friendlies biggrin_o.gif)

Share this post


Link to post
Share on other sites

just on the sideline gentlemen, try it with BNN880 tracers!

ghostface.gif

Im no scripting whiz but this would make missions extremely good, Im making missions on new Najaf map, and well its MOUT so you know why I would like this and maybee this helps?

http://forums.opflashpoint.org/viewtopic.php?t=10348

and I cannot resist

http://forums.opflashpoint.org/viewtopic.php?t=15784&start=60

Warning lots of pics so needs time... SCROLL DOWN A BIT! blues.gif

The screenshots so far, and by the way It would be sweet if the MGer could do cover fire from standing pos aswell like in one of the screenshots with the m240...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×