CougarFFW04 Posted August 23, 2018 Posted August 23, 2018 (edited) Hi everybody, I am interested in building the following mission which would be dedicated to dogfight training : basically there would be 2 flights (blue versus red) each containing one or more planes (including the player'one). Both flight plans consist of two WPTs (the second one being the meeting arena place) and would be assigned a "search and engage" task (concerning AI). I would like that : - If the player is shooted down - or if ALL planes of the AI flight are destructed, Then both flights would be re-spawned at their original places for a new dogfght run until a certain compter(defined by default) is reached. My question is NOT about the conditions ("Group dead" and "Unit dead" for the IA group and player respectively) but about the trigered actions : I do not see any action in the documentation that would allow to do what I want... I did find a "Group deactivate" action that would allow to suppress the AI flight in case the player is dead, but I cannot find the opposite (re-activation at the same place)... I have thinked about the following solution that would consist to duplicate n times the AI flight with a late activation and activate them sequentially each time the previous AI flight is dead. But I am looking for a smatter solution without having to duplicate the flights. And what about the player flight ? Thanks Edited August 23, 2018 by CougarFFW04
feefifofum Posted August 23, 2018 Posted August 23, 2018 (edited) You cannot force a player respawn, but you can destroy their aircraft. You also cannot natively respawn multiple instances of the same group. You should be able to use a combination of group.getbyName and the destroy function to remove all flights (including the player's old wingmen) when the player returns to spectactors on their own (switched condition UNIT OUTSIZE ZONE) You can use either MiST or MOOSE to respawn the AI flight, but I'd be inclined to go with MiST on this one for ease of using the destroy function as the group names for MOOSE will be more difficult to obtain (there may be an easier way in there, but I'm not very familiar with the framework.) This one-liner will respawn your bandit group when the player flight is detected back inside the zone (also a switched condition) mist.respawnGroup ('bandits', true) As for whether the player's AI wingmen will respawn when the player reslects the slot, I'm not sure...I have never tried to recycle AI wingmen. Edited August 23, 2018 by feefifofum THE GEORGIAN WAR - OFFICIAL F-15C DLC
CougarFFW04 Posted August 24, 2018 Author Posted August 24, 2018 Hi feefifofum, Never tryed yet MiST. I am going to have a look if there is something special to install for using MiST functions. You rock :thumbup: Thanks :smilewink:
CougarFFW04 Posted August 24, 2018 Author Posted August 24, 2018 Hello, Where should we put the mist_x.lua ? Doesn't matter ? Where is the best place ? Thanks
feefifofum Posted August 24, 2018 Posted August 24, 2018 (edited) Load the lua file via a DO SCRIPT FILE command and it will be embedded in the .miz :thumbup: One tricky bit, make sure you downloaded the file using the "raw" button on GitHub or it will have a bunch of nonsense .html in it that will generate errors. EDIT: Here's a direct link to the "raw" mist_4_3_74.lua from Grimes' github, right click and save as Edited August 24, 2018 by feefifofum THE GEORGIAN WAR - OFFICIAL F-15C DLC
CougarFFW04 Posted August 24, 2018 Author Posted August 24, 2018 Hi, It was a little bit tricky to have it working because unless I did something wrong, it seems that when a group is destroyed (from the ME native condition) and then respawned (with MiST), the ME engine still consider it is dead. After many trials and errors I was finally able to have it working using the Alive condition (>1%) rather than the group destroyed one. Actually it is working fine with AI only. Now I have to check if it still works as expected with a player. I will report. Thanks
feefifofum Posted August 24, 2018 Posted August 24, 2018 (edited) Correct, this is one of the areas where you have to start using scripting; the group respawned through MiST is not technically the original group, but rather a copy with identical properties and a unique ID within the SSE. This is where the getByName functions etc. start becoming a requirement when you want to access SSE functions such as destroy...since the ID for the group is dynamically generated, there is no way to create triggers for them within the ME GUI as their ID isn't accessible until they're born. Sounds like you've got yourself sorted though (and you're deep down the rabbit hole at this point :lol: ) Edited August 24, 2018 by feefifofum THE GEORGIAN WAR - OFFICIAL F-15C DLC
CougarFFW04 Posted August 24, 2018 Author Posted August 24, 2018 Hi, Working fine except that when my flight is respawned I cannot contact my wingman... He is there but I cannot give him orders... Any idea ? Thanks
feefifofum Posted August 25, 2018 Posted August 25, 2018 Sorry, that's where you lose me. I don't fly with the AI much these days. :dunno: THE GEORGIAN WAR - OFFICIAL F-15C DLC
CougarFFW04 Posted August 27, 2018 Author Posted August 27, 2018 Sorry, that's where you lose me. I don't fly with the AI much these days. :dunno: You helped a lot already. Thanks:smilewink:
Recommended Posts