Jump to content

Is it possible to create training missions where the AI will engage you without using live ammo?


Recommended Posts

Posted

For some context, say I wanted to create a single player campaign that is sort of like a Top Gun fighter school program. I want to be able to go out and fly against AI aggressors but not actually shoot each other down.

Can this be done? 

Posted
On 12/17/2021 at 12:56 AM, Tree_Beard said:

For some context, say I wanted to create a single player campaign that is sort of like a Top Gun fighter school program. I want to be able to go out and fly against AI aggressors but not actually shoot each other down.

Can this be done? 

Silly question: In the loadout for each plane - why don't you simply remove all ammo and weapons from the AI units? Does that work?

 

Posted

You could set yourself to immortal and that would keep them from shooting you down. AFAIK, you can’t do the same for the AI. Then again, I’ve never really been interested in the latter and, so, have never looked into it.

YouTube Channel: https://www.youtube.com/channel/UCU1...CR6IZ7crfdZxDg

 

_____

Win 11 Pro x64, Asrock Z790 Steel Legend MoBo, Intel i7-13700K, MSI RKT 4070 Super 12GB, Corsair Dominator DDR5 RAM 32GB.

Posted
On 12/17/2021 at 10:56 AM, Tree_Beard said:

For some context, say I wanted to create a single player campaign that is sort of like a Top Gun fighter school program. I want to be able to go out and fly against AI aggressors but not actually shoot each other down.

Can this be done? 


Two potential ways you could do this:

 

1) Use the immortal option

 

2) Use a script (can't remember where it is though) that will detonate missiles just before they hit aircraft. This won't work for bullets however, so if you're wanting to include guns and not just missiles, then #1 may be the better option.

Posted (edited)

Well, you can simply create an onEvent() processor that triggers on the 1 event (shot). Look at the weapon in the event, and if the weapon.target is a player, simply delete the weapon. That way, all missiles fired at a player disappear in pixel dust 🙂

Something like this (untested, written free-hand). Must add to your world event handlers:

guardianAngel = {}
function guardianAngel:onEvent(event)
	local ID = event.id	
	if ID == 1 then 
		-- someone shot something. see if it is fired at a player 
		local theWeapon = event.weapon 
		if not theWeapon then return end -- ignore
		theTarget = theWeapon:getTarget() 		
		if not theTarget then return end 
		if not theTarget:isExist() then return end 
		
		-- if we get here, we have weapon fired at a target
		local playerTarget = theTarget:getPlayerName()
		if not playerTarget then return end
		-- if we get here, a weapon was fired at player 
		
		-- say "hey!"
		trigger.action.outText("Tsk, Tsk, Tsk. Weapon fired at " .. playerTarget .. " begone!", 30)
		-- destroy it		
		theWeapon:destroy()
		-- all is well
	end
end

 

Edited by cfrag
  • Thanks 1
Posted
9 hours ago, Ironhand said:

That was for SAMs wasn’t it? Or did it work for all missiles?

I thought it was all missiles, but could be wrong. If not - it could be tweaked. CFRAG has shown how it can be done above. The only difference is that the script I saw allowed the missile to get close first to allow practicing of evasive maneuvers and notching. 

For me - I'd use invincible. You know if you've been hit so it's better for practicing - but if the idea is to create a 'top gun' training center sort of experience with simulated weapons instead - then that may not be the best approach. 

Posted

Thanks for the input gents.

It is sounding like there really isn't a smooth way to get this done the way I am envisioning it. I think it should be something you have an option to do so maybe I'll make a wishlist thread. 

  • 3 weeks later...
Posted

I did create the first mission for an NTTR F-5E aggressor campaign that is currently on hold.  In this particular mission you carry out a FAM navigation exercise that shows the western 'red' entry corridor from the west and crosses airspace where other Aggressor F-5Es are in a series of mock engagements with Aussie F/A-18Cs before exiting via the eastern blue corridor - all using correct navigation procedures. 

To accomplish the mock dogfight engagement I set trigger zones at waypoints which both flights of aircraft would fly to at either end of the (Caliente Alpha?) airspace and provide ready status, all this with radio calls on the frequency.  Once both sets are checked in the call is made "fight's on" and they head towards the engagement area with immortal set on.  If either side get a hit then a "kill notification" is made and all the relevant comms ie "knock it off" and the immortal setting is removed with a delay (I found if it was immediate the aircraft would go mortal while the explosion or cannon rounds were still going).  If both sides still have ammunition they return to the start points and report ready and go again.  If the hard deck is broken then that triggers a knock it off, as well as a bingo fuel or winchester call.

If by some twist an aircraft goes down in all this the comms go crazy with trying to communicate and locate the mission aircraft and a SAR helicopter launches from Tonopah.

It was pretty cool sitting back watching it all happen, the idea of it being you will be on frequency while the fight is occurring and hearing all the chatter while transitting at low level but if you look up you might see some action high above.

Sadly though there is no way of doing this without live weapons.  It would be nice if they did add simulated weapons into the sim given thats the whole point of the NTTR.

Sorry for lack of detail though but I haven't touched this mission in quite some time.

  • Like 1
  • 3 years later...
Posted (edited)
On 12/21/2021 at 4:41 PM, cfrag said:

Well, you can simply create an onEvent() processor that triggers on the 1 event (shot). Look at the weapon in the event, and if the weapon.target is a player, simply delete the weapon. That way, all missiles fired at a player disappear in pixel dust 🙂

Something like this (untested, written free-hand). Must add to your world event handlers:

guardianAngel = {}
function guardianAngel:onEvent(event)
	local ID = event.id	
	if ID == 1 then 
		-- someone shot something. see if it is fired at a player 
		local theWeapon = event.weapon 
		if not theWeapon then return end -- ignore
		theTarget = theWeapon:getTarget() 		
		if not theTarget then return end 
		if not theTarget:isExist() then return end 
		
		-- if we get here, we have weapon fired at a target
		local playerTarget = theTarget:getPlayerName()
		if not playerTarget then return end
		-- if we get here, a weapon was fired at player 
		
		-- say "hey!"
		trigger.action.outText("Tsk, Tsk, Tsk. Weapon fired at " .. playerTarget .. " begone!", 30)
		-- destroy it		
		theWeapon:destroy()
		-- all is well
	end
end

 

Anyone handy with scripts could turn this into a something like

"If the target is unit named Aerial-1-1 and it is inside moving zone MySafetyZone then destroy missile else let the missile continue" or even better if it can be applied to any unit inside the zone then i wouldn't have to duplicate it for every playable plane in the mission and it would work for dynamic slot planes also.

This would totally make my day because currently it is impossible to make part of a group invisible and having every member of a flight be a seperate group wont play well with datalinks etc. I'm trying to make a growler escort where any plane in formation with them is safe but other could be shot.

Edited by Grodin

Fighting for peace is like screwing for virginity.

Posted
Just now, Grodin said:

This would totally make my day because currently it is impossible to make part of a group invisible and having every member of a flight be a seperate group wont play well with datalinks etc. I'm trying to make a growler escort where any plane in formation with them is safe but other could be shot.

Perhaps have a look at the "GuardianAngel" module in DML.

  • Like 2
Posted
9 hours ago, cfrag said:

Perhaps have a look at the "GuardianAngel" module in DML.

Thanks, that works great!

  • Like 1

Fighting for peace is like screwing for virginity.

  • Recently Browsing   0 members

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