Jump to content

Dipping My Toe into Mission Creation, A Few Noob Questions...


IAS2424

Recommended Posts

Hello all,

 

I'm relatively new to mission building, and I think I have a good grasp on things like triggers, zones, tasking etc individually. Now I've been trying to tie them all together into a single mission.

 

Currently I have a few questions;

 

1) Is there a way to get the fuel level of a unit, (fixed-wing in this case) so I can create a trigger when their fuel level reaches a certain % they will break off and refuel from a tanker. Currently I don't see one listed under conditions and the manual only tells you how to get cockpit info from player a/c. (As far as I know anyway)

 

Alternatively when a unit/group hits a certain fuel level a tanker could spawn and once it reached its orbit waypoint the AI are tasked to refuel.

 

What is a good way to implement this?

 

2) Can the AI perform slingloading ops at this time? I see the option for ground transport under 'tasks' but they always simply turn and head for the nearest airport, even if there is a nearby FARP. If I'm understanding it wrong, how does the 'ground transport' work

 

My (very early version mission is attached)

SlingHook 1.2.miz

Link to comment
Share on other sites

1. There is a Triggered Action for RTB On Bingo Fuel. I looked briefly for a world.event that had something to do with low fuel but did not see anything (see the second post in this thread). For tankers, I keep one up in an orbit, they last about 5 hours, and then I will launch another, or upon the death of the first one :-) I wish there was a way to see how much fuel was left in an aircraft in F2 View on the status bar at the bottom of the screen. I would think there has to be a way to get that from unit attributes...

 

2. Don't know.

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

1. There is a Triggered Action for RTB On Bingo Fuel. I looked briefly for a world.event that had something to do with low fuel but did not see anything (see the second post in this thread).

 

I just tested using 'RTB on Bingo Fuel' and it worked! Thank you so much!

 

It's odd however that in the manual it's listed as:

This is a flag setting to allow/restrict the group to return to base upon reaching Bingo Fuel state (when there is only enough fuel left to return to base.) The default setting is ON (allow).

It says nothing about aircraft being able to rendezvous with a tanker as an alternative. Perhaps the function has changed since the manual was written?

Link to comment
Share on other sites

I have not seen an AI aircraft hook up to a tanker; they will go to the nearest airbase, and if their landing base is full they will land elsewhere. You're right, why would you need to order a default? The manual description is pretty clear. But it is just that you have to test every action that is significant to your mission story. I had a situation the other day where F-5E's were heading up the coast instead of out to targets, because there was an AWACS in the mission and the F-5E's wanted to kill it FIRST; after making the AWACS Invisible the problem was solved. Use LCntrl-Z a few/lots times to speed up the action, and LShft-Z to reset.

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

AI will hit the tanker when they're low on fuel, but they tend to be very stupid about it and will try to fly it on full afterburner and ending up running out of fuel before they get there. Of course, AI is terrible at joining up so even if they get to the vicinity of the tanker they often run out of fuel while trying to get into position.

 

Also, the M-2000C can't refuel in a turn (doesn't align its probe with the basket properly) so if the track isn't super long it can take them ages to complete a refuel; and if it is super long then the tanker will potentially be a very long way from the aircraft when it needs to refuel. Not sure if other aircraft have this problem. Boom refuellers seems okay even in turns.

 

There is a function unit:getFuel() which returns the percentage of fuel the unit has (0.0 to 1.0, or above 1.0 if they have external tanks). So you could potentially use that to determine if a flight is getting low on fuel, and then command it to follow a tanker (perhaps with afterburner use disabled) until its fuel level reaches (or is close to) 1.0 and then send it back to its normal tasking.

 

Would take some finagling to make it work reliably, but it might be kind of cool - having a few AI fighters trailing a tanker would add a bit of atmosphere for when players refuel.

 

I had a situation the other day where F-5E's were heading up the coast instead of out to targets, because there was an AWACS in the mission and the F-5E's wanted to kill it FIRST; after making the AWACS Invisible the problem was solved.

I pretty much never use the default tasks outside of very simple test missions specifically due to this. Search and engage in zone or the Search and engage enroute task with a range limit help to prevent the AI going all over the map.

Link to comment
Share on other sites

There is a function unit:getFuel() which returns the percentage of fuel the unit has (0.0 to 1.0, or above 1.0 if they have external tanks). So you could potentially use that to determine if a flight is getting low on fuel, and then command it to follow a tanker (perhaps with afterburner use disabled) until its fuel level reaches (or is close to) 1.0 and then send it back to its normal tasking.

So here is the logic I think would work...

 

SWITCHED CONDITION ->

 

CONDITION -> run script

 

unit:getFuel()

if getFuel < 0.15

condition = true

else

condition = false

 

ACTION -> AI Task Push (Refueling)

 

 

 

I'm not experienced at all with .lua scripting and I'm learning very slowly, so let me know if this would work or not.


Edited by IAS2424
Link to comment
Share on other sites

I pretty much never use the default tasks outside of very simple test missions specifically due to this. Search and engage in zone or the Search and engage enroute task with a range limit help to prevent the AI going all over the map.

 

That's good control, but in this case it will be Client a/c that the F-5Es are supposed to go after. I really did need something to get the F-5s to ignore the AWACS.

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

So here is the logic I think would work...

 

SWITCHED CONDITION ->

 

CONDITION -> run script

 

unit:getFuel()

if getFuel < 0.15

condition = true

else

condition = false

 

I think if you're using scripts in conditions they need return the value, so something like:

 

return Unit.getByName("name of aircraft"):getfuel() < 0.15

might do the trick.

 

ACTION -> AI Task Push (Refueling)

You can't actually tell the AI to refuel. The "Refuelling" enroute task if for tankers (to provide fuel). So, you have to wait until the AI itself decides it's low on fuel and needs more, but I don't know at what level they decide they're low. You'd have to experiment a bunch.

 

I think the best strategy would be to have your trigger push a "switch waypoint" task to a waypoint that's near the tanker, and possibly has a "follow unit (tanker)" task attached, so they'll stick close to the tanker. Then when the AI decides it needs fuel, it's already close by and should be able to rejoin and tank quickly and easily.

 

Then have another switch condition trigger with the fuel state > 0.99 or something, which switches them back to their mission waypoint.

 

Yep - tonnes of messing about with fragile systems to get something fairly basic to work properly, but that's par for the course with DCS. :)

Link to comment
Share on other sites

I think if you're using scripts in conditions they need return the value, so something like:

 

return Unit.getByName("name of aircraft"):getfuel() < 0.15

might do the trick.

 

 

You can't actually tell the AI to refuel. The "Refuelling" enroute task if for tankers (to provide fuel). So, you have to wait until the AI itself decides it's low on fuel and needs more, but I don't know at what level they decide they're low. You'd have to experiment a bunch.

Wait, then what is the 'Refuel' under Perform Task? I've told aircraft to refuel at a waypoint before using that command with no problem

Link to comment
Share on other sites

Wait, then what is the 'Refuel' under Perform Task? I've told aircraft to refuel at a waypoint before using that command with no problem

Oh actually, I believe you're right - they did add this. They still won't refuel in some cases though; I don't think they care about external fuel tanks and need to be less than a certain amount before they'll refuel.

 

So yeah, ignore that - perform task Refuel should be fine, especially if you're activating it after they're reasonably low.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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