Jump to content

FLAK Script Update help


NineLine

Recommended Posts

  • ED Team

So I have a decent flak script with the help of a number of you a few months back, but I want to make it more better... right now its basically a random explosion in a circle between a range of altitude. What I would prefer is that when an aircraft enters the "guns" range that the position of the explosion is some how random within an area around the aircraft in the zone. Is something like this possible?

 

So basically a target bubble around the aircraft as it travels through a zone, so its still random if the aircraft gets hit, but a better possibility of it.

 

If you need me to past my old code I can, but I am at work, on a Mac and am not sure how it will look pulling it out of a mission I have here :)

  • Like 1

64Sig.png
Forum RulesMy YouTube • My Discord - NineLine#0440• **How to Report a Bug**

1146563203_makefg(6).png.82dab0a01be3a361522f3fff75916ba4.png  80141746_makefg(1).png.6fa028f2fe35222644e87c786da1fabb.png  28661714_makefg(2).png.b3816386a8f83b0cceab6cb43ae2477e.png  389390805_makefg(3).png.bca83a238dd2aaf235ea3ce2873b55bc.png  216757889_makefg(4).png.35cb826069cdae5c1a164a94deaff377.png  1359338181_makefg(5).png.e6135dea01fa097e5d841ee5fb3c2dc5.png

Link to comment
Share on other sites

So I have a decent flak script with the help of a number of you a few months back, but I want to make it more better... right now its basically a random explosion in a circle between a range of altitude. What I would prefer is that when an aircraft enters the "guns" range that the position of the explosion is some how random within an area around the aircraft in the zone. Is something like this possible?

 

So basically a target bubble around the aircraft as it travels through a zone, so its still random if the aircraft gets hit, but a better possibility of it.

 

If you need me to past my old code I can, but I am at work, on a Mac and am not sure how it will look pulling it out of a mission I have here :)

Just add/substract a random value to/of the 3 axis of the targets position? With a range from -r to +r (with r = bubble radius)?

 

But is that really better/more realistic? If I understood you correctly, your current solution is a cylinder with the target in the center. Wouldn't that not be already quite realistic? I mean, in RL it would probably be a flat cone as the origin of the shells would be one point on the ground. Depending of the target's elevation, that cone's sides would be perhaps rather flat angled - i.e. almost disc/cylinder shaped.

Link to comment
Share on other sites

  • ED Team

Current solution is a random in a stationary zone, with a random altitude range. I would rather it get the information of the aircraft within the zone, and then trigger an explosion randomly within a bubble around the target.

 

Where the explosions happen are linked to a zone, I want to link them to the aircraft flying within a zone, but unsure how or if I can do that.

 

I want to try to mimic the movement of the gun tracking the target, as well as increase the % chance of a hit. Right now, once you figure out the explosions one happen over or above the altitude range they would become easy to avoid, if that makes sense....


Edited by NineLine

64Sig.png
Forum RulesMy YouTube • My Discord - NineLine#0440• **How to Report a Bug**

1146563203_makefg(6).png.82dab0a01be3a361522f3fff75916ba4.png  80141746_makefg(1).png.6fa028f2fe35222644e87c786da1fabb.png  28661714_makefg(2).png.b3816386a8f83b0cceab6cb43ae2477e.png  389390805_makefg(3).png.bca83a238dd2aaf235ea3ce2873b55bc.png  216757889_makefg(4).png.35cb826069cdae5c1a164a94deaff377.png  1359338181_makefg(5).png.e6135dea01fa097e5d841ee5fb3c2dc5.png

Link to comment
Share on other sites

Current solution is a random in a stationary zone, with a random altitude range. I would rather it get the information of the aircraft within the zone, and then trigger an explosion randomly within a bubble around the target.

 

Where the explosions happen are linked to a zone, I want to link them to the aircraft flying within a zone, but unsure how or if I can do that.

 

I want to try to mimic the movement of the gun tracking the target, as well as increase the % chance of a hit. Right now, once you figure out the explosions one happen over or above the altitude range they would become easy to avoid, if that makes sense....

Sounds like typical "Sperrfeuer" (barrage? barrage fire?) for areal denial. But I think, I understand what you are looking for.

 

Now the center of that "target area" is a point in the air above a ME zone. But you need the coordinate of the aircraft instead. Sadly, I am not too fluent in LUA script and can not really help you here any further, but I am pretty certain that MIST has functions that return such a coordinate for a unit.

Link to comment
Share on other sites

  • ED Team

Dont get me wrong, it works pretty decent right now, and I have taken damage from the explosions, but it feels rather low percentage right now from what I think flak should be, as well I would like to see it adjust for different flight paths, otherwise it will be easier to avoid if you were to use it in a MP environment.

 

Another option would just be layering more zones over each other and different elevations but it seems silly to have FLAK going off at 1000 feet when an aircraft is at 8000 feet.... or whatever....

64Sig.png
Forum RulesMy YouTube • My Discord - NineLine#0440• **How to Report a Bug**

1146563203_makefg(6).png.82dab0a01be3a361522f3fff75916ba4.png  80141746_makefg(1).png.6fa028f2fe35222644e87c786da1fabb.png  28661714_makefg(2).png.b3816386a8f83b0cceab6cb43ae2477e.png  389390805_makefg(3).png.bca83a238dd2aaf235ea3ce2873b55bc.png  216757889_makefg(4).png.35cb826069cdae5c1a164a94deaff377.png  1359338181_makefg(5).png.e6135dea01fa097e5d841ee5fb3c2dc5.png

Link to comment
Share on other sites

Shouldn't the more modern flak gun computer calculate TOF to target and then lead the target and set the fuze timing accordingly ie. the shell will explode somewhere in a cylindrical volume at the lead point after TOF.

 

TOF is a function of lateral range and altitude difference. You could probably build a table with some simulated values and then interpolate between those to get about right TOF. Then you get the position and velocity vector of the target and calculate an estimate for the target position (which is the aimpoint) after TOF. Then you schedule an explosion to happen in a volume which size is dependent of TOF and which is placed at the aimpoint. This way you should have a pretty realistic flak simulation. If you want to simulate proximity fuses then you make the explosions happen at the current altitude of the target at explosion time but still within the aimpoint zone. I'm pretty sure all of this should be possible with SSE.

DCS Finland: Suomalainen DCS yhteisö -- Finnish DCS community

--------------------------------------------------

SF Squadron

Link to comment
Share on other sites

This may be unrelated- I was trying to get a real feel for one of my missions by creating the quintessential Baghdad night broadcast 1991- tracer fire +++

 

Unfortunately, "fire at point" is ground level only and so far as I know there is no way to get it going into the air without a target.

 

I ended up having to put a drone up in the sky- invulnerable obviously... and have it circle. I got close, but no real cigar.

 

The only reason I bring it up is that quite often when you're trying to get the sense of flak, a big part of it is the tracer. Or... did they not have that tracer technology this early on? Not being sarcastic... now that I think about it- I'm not sure they had tracers back then.

 

Anyway- it's loosely related to the subject. Any way to add a third dimension to that "fire at point" command?

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

  • ED Team

I have submitted a feature request for that very thing ENO ;) As of right now I dont know a way of getting what you are shooting for, no pun intended, but I agree, systems like the Zu23 should be allowed to fire at a point in the sky.

 

As for tracers, they did have them in WWII, although I dont know about something the size of the 88.

64Sig.png
Forum RulesMy YouTube • My Discord - NineLine#0440• **How to Report a Bug**

1146563203_makefg(6).png.82dab0a01be3a361522f3fff75916ba4.png  80141746_makefg(1).png.6fa028f2fe35222644e87c786da1fabb.png  28661714_makefg(2).png.b3816386a8f83b0cceab6cb43ae2477e.png  389390805_makefg(3).png.bca83a238dd2aaf235ea3ce2873b55bc.png  216757889_makefg(4).png.35cb826069cdae5c1a164a94deaff377.png  1359338181_makefg(5).png.e6135dea01fa097e5d841ee5fb3c2dc5.png

Link to comment
Share on other sites

I'd love to try the current script. Link?

AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS

 

Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow.

Link to comment
Share on other sites

kool. waiting for it

AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS

 

Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow.

Link to comment
Share on other sites

will try it later tonight and report back. Cheerios.

AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS

 

Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow.

Link to comment
Share on other sites

I'll be trying to make a more realistic version of it ... won't be easy or quick though.

 

cool!

btw Sithspawn, i tested it and really really like what you came up with already!

of course, some tracking of the planes by the flak would be neat, but its already immersive!nice job, very much appreciated!

Link to comment
Share on other sites

  • ED Team

Yeah, I think I will focus on my actual gun and see what GG and others can do with this script. If it could be made to track aircraft inside a specific zone, that would be a huge boost to this script... and change those damn generic explosions :P

64Sig.png
Forum RulesMy YouTube • My Discord - NineLine#0440• **How to Report a Bug**

1146563203_makefg(6).png.82dab0a01be3a361522f3fff75916ba4.png  80141746_makefg(1).png.6fa028f2fe35222644e87c786da1fabb.png  28661714_makefg(2).png.b3816386a8f83b0cceab6cb43ae2477e.png  389390805_makefg(3).png.bca83a238dd2aaf235ea3ce2873b55bc.png  216757889_makefg(4).png.35cb826069cdae5c1a164a94deaff377.png  1359338181_makefg(5).png.e6135dea01fa097e5d841ee5fb3c2dc5.png

Link to comment
Share on other sites

this is AWESOME!!! keep going!

AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS

 

Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow.

Link to comment
Share on other sites

  • 2 weeks later...

I've been adding this script to a WW2 style mission and wanted to confirm that the accuracy of the barrage is controlled by increasing or decreasing the 8000 number in the line

y = land.getHeight(newpoint) + math.random(0, 8000),\\\

 

or is it simply a random barrage with no controllable accuracy and the explosion happens at a point somewhere between 0 and 8000 m above the ground?

 

I think it is the second one but am too new at lua to be sure.

 

Thanks for any help offered.

 

Cheers,

Stonehouse

 

<edit> ok it is the second point, all you can do to make the flak more deadly is either increase the explosion from 500 or have more "flak" zones overlapping so that you get more flak explosions within the main "flakzone" zone.


Edited by Stonehouse
solved
Link to comment
Share on other sites

I've been trying to approach the flak script a different way and after doing some reading of the Mist manual came up with the script below - which as I am pretty inexperienced - not surprisingly doesn't work. Can anyone give me a bit of a hand and please advise if there are obvious goofs in the code? For instance I haven't got completely comfortable with the vec3 co-ords and would not be surprised if I have my y and z around the wrong way. I'm trying to get the land height at the 2D blue plane position and then subtract the land height from the aircraft height and adjust this result by a random number between -500 and 500 to simulate a plus or minus 500 accuracy.

I was also hoping this would happen for each aircraft in the zone.

 

Also I'm running this as a continuous evaluated trigger that fires when any of the blue coalition enters zone "test" and then executes a DO SCRIPT with the lua below as the script.

 

Thanks,

Stonehouse

 

do

 

local bluePlanes = mist.makeUnitTable( {'[blue][plane]'} )

 

local inZoneUnits = mist.getUnitsInZones(bluePlanes, {'test'})

 

if #inZoneUnits > 0 then

for i = 1, #inZoneUnits do

local Position_vec3 = inZoneUnits:getPoint()

local elevation =

land.getHeight{x = Position_vec3.x, y = Position_vec3.z}

local vec3 = {

x=Position_vec3.x,

y=(Position_vec3.z - elevation + math.random(-500,500)),

z=Position_vec3.y}

 

trigger.action.explosion(vec3, 500)

end

end

end


Edited by Stonehouse
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...