Jump to content

script options to respawn a group upon RTB?


Recommended Posts

I have a hunch that MIST might offer this functionality but I'm unclear on how to apply it.

 

I have a randomizing trigger spawning an unknown set of AI Cap flights. I would like to use MIST (i think) to recognize when one of these CAP flights has RTB and clone the group at its original start location after a reasonable time has passed to represent the return flight time.

 

I know how to trigger a respawn on death ... but I want them to stay dead if they have been defeated for this mission... its only if they survive and RTB that I'd like to respawn/clone them.

 

Any ideas how to apply some trigger logic here?? I'm struggling with this one.

 

 

thanks!!

""This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL

Link to comment
Share on other sites

Probably going to end up here:

 

http://wiki.hoggit.us/view/TeleportToPoint

 

http://wiki.hoggit.us/view/TeleportGroup

 

There are some specifics in there that fit what you require as well as some use examples. That wiki hoggit is a fantastic resource... don't be afraid to look around at some of the other examples. It's been a godsend for me.

 

You might need to define an RTB zone on a switched condition trigger that monitors for that unit returning before setting the teleport / respawn action. If it doesn't RTB (ie because it's dead) then it won't respawn.

 

Something to that effect anyway.

"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

Interesting - does the teleport move the group "as is" or refuel/ rearm / repair them too? It would be tough luck for jerry if he's landing out of fuel and "zap" runs into a infinite loop of teleporting ... :)

 

The other thing I struggle with is that I don't know which af the ai will attempt their rtb to... Do I have to flag each one?


Edited by dooom

""This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL

Link to comment
Share on other sites

I wonder if the tanker respawn script can be modified for cap flights.... Didn't it use some sort of lua predicate argument?

""This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL

Link to comment
Share on other sites

There's also a few different scripts that do random CAPs / GCIs... might be worth checking out.

 

I thought about the tanker respawn as well but I wasn't too sure about the work involved in converting it to fighters...

 

I'll keep my eyes open.

"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

Respawn Script examples

 

I wonder if the tanker respawn script can be modified for cap flights.... Didn't it use some sort of lua predicate argument?

 

Might be the respawn script I have been fiddling with (someone elses work).

 

I have attached:

my test mission - has a the tanker and F-15's respawning, when the old group, lands, runs out of fuel or is killed. (might be helpfull for you to see it in action.

 

The Dam mission - has an AI flight group for the A10 and Ka-50 which will fly the mission if no human players playing (great for testing that it works as intended), etc. It uses the same script for respawning both flight groups if they are all killed, or when they RTB to base. This miz file has the scripts in lua files inside it, and is work in progress for me.

 

Hope it helps,

 

Cheers, Ian

DRAGONs_TheDam_v73.128.17.miz

Test - Tanker and F-15c Respawn with MIST.miz


Edited by MadDog-IC
added files
  • Like 1

Asus p877v-pro, Intel I7 3770k 4.2ghz, 32gb Ripjaw X ram, Nvidia RTX-2070 Super, Samsung 32" TV, Saitek x52 pro Joystick and Combat rudder pedals, TrackIR 5, Win8.1 x64 with SSD and SSHD protected by (Avast AV).

 

DCS Tech Support.

Link to comment
Share on other sites

very cool Ian - +1!

 

I'll have a peek and see how it works . can i have it ignore respown on death though? I'd prefer that dead units reward players by staying dead

""This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL

Link to comment
Share on other sites

  • 5 months later...
very cool Ian - +1!

 

I'll have a peek and see how it works . can i have it ignore respown on death though? I'd prefer that dead units reward players by staying dead

 

Sorry for very late reply, must have missed this some time back

 

It is a reasonably simple script, that is why I can understand it ;-):thumbup:

 

More work would be required on script to give it the capabliites you require, past my pay grade I am afraid.:cry:

 

I would also prefer:

 

  • Respawn Flight Group - When all planes have landed back at a base and have powered down, simulate a reload and go again, or simulate re-enforcements for a tired flight crew. (Looking for a way I might get that done with out using a trigger zone and to much code).

I have started to look at LUA coding a bit more, have added a little bit to the script since, only very minor, but works better.

 

Mission setup:

 

  • AI Flight Groups - (Set Options - RTB on out of Ammo, RTB on Low Fuel)
  • AI Flight Groups - Advanced waypoint commands (flag 999 to true) as a STOP condition on all CAP, CAS, Orbit commands and return to base.
  • Mission Complete Trigger - (Flag 999 set true)

 

 

Script:

 

 

  • SCRIPT - Respawns AI Flight Group when they are all dead
  • SCRIPT - Respawns AI Flight if Leader is NOT IN THE AIR - CRASHED, KILLED or has LANDED. (To be Disabled when I figure out how to check all flight members have landed)
  • SCRIPT - Respawns AI Flight only when All of group have landed and powered down. (WIP)
  • Disabled - RESPAWN on LOW FUEL
  • SCRIPT - Will not RESPAWN any GROUPS once Flag 999 = 1

 

 

New LUA Predicate code for DRAGONS the DAM

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

 

-- Condition --> LUA PREDICATE:

local groupName = 'A-10C #1.1 AI' -- MISSON EDITOR: FLIGHT GROUP NAME

local lowFuelThreshold = 0.08 -- RTB when less then this amount of fuel (10%)

env.setErrorMessageBoxEnabled(false) -- Message Box on error: FALSE=No Box, TRUE=Show Box

 

 

-- ***********

-- Add 1 to Group Name for new Flight Group when it respawns

if barons_respawn_script and barons_respawn_script[groupName] then

groupName = groupName .. barons_respawn_script[groupName]

end

 

-- Set Flag 999 to true in Mission when Mission is Completed and No more waves of AI Aircraft are needed

flag_999 = trigger.misc.getUserFlag('999')

 

-- If the Whole Flight Group is DEAD respawn replacements until Flag 999=1

local group = Group.getByName(groupName)

if (not group and flag_999 == 0) then

return true

end

 

-- If Flight Groups LEADER is DEAD or LANDED respawn replacements until Flag 999=1

group = group:getUnits()[1]

if (not group and flag_999 == 0) or (Unit.inAir(group) == false and flag_999 == 0) then

return true

end

 

--[[

-- If Groups Fuel is below Threshold send out a replacement Flight Group until Flag 999=1

if (group:getFuel() < lowFuelThreshold and flag_999 == 0) then

return true

end

]]

 

Cheers, Ian.

Asus p877v-pro, Intel I7 3770k 4.2ghz, 32gb Ripjaw X ram, Nvidia RTX-2070 Super, Samsung 32" TV, Saitek x52 pro Joystick and Combat rudder pedals, TrackIR 5, Win8.1 x64 with SSD and SSHD protected by (Avast AV).

 

DCS Tech Support.

Link to comment
Share on other sites

 

Checking it out, might get some ideas on how to do things

 

Thank you for bringing it to my attention

 

Regards, Ian

Asus p877v-pro, Intel I7 3770k 4.2ghz, 32gb Ripjaw X ram, Nvidia RTX-2070 Super, Samsung 32" TV, Saitek x52 pro Joystick and Combat rudder pedals, TrackIR 5, Win8.1 x64 with SSD and SSHD protected by (Avast AV).

 

DCS Tech Support.

Link to comment
Share on other sites

  • 3 years later...
Might be the respawn script I have been fiddling with (someone elses work).

 

I have attached:

my test mission - has a the tanker and F-15's respawning, when the old group, lands, runs out of fuel or is killed. (might be helpfull for you to see it in action.

 

The Dam mission - has an AI flight group for the A10 and Ka-50 which will fly the mission if no human players playing (great for testing that it works as intended), etc. It uses the same script for respawning both flight groups if they are all killed, or when they RTB to base. This miz file has the scripts in lua files inside it, and is work in progress for me.

 

Hope it helps,

 

Cheers, Ian

 

Maddog

 

Thanks for this it works great. Question? As each aircraft lands after it RTB's, how long does it stay in the mission before it is removed?

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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