0414 Wee Neal Posted October 28, 2021 Posted October 28, 2021 Hi I am writing a simple mission to create a training area for the new Apache. I have installed MIST, CTLD and CSAR as normal, each with a small delayed load. I have set some armoured, unarmoured and infantry on the ground and set up a trigger:I have inserted the Do Script, on a repetitive trigger: if not Group.getByName('RespawnTest01') then mist.respawnGroup('RespawnTest01', true) end I have a Blue Force tank set to take this unit out, which it does, however nothing happens once destroyed. I am running MIST 4.4.90. Can anyone advise what I am doing wrong please? I will also be looking at respawn in a zone, which also does not work. Thanks Neal Desktop PC: Intel i7 14700K, MSI Z790 MAG Tomahawk MOBO, 64Gb RAM , GPU Nvidia RTX 3080ti Windows 11, VPC joystick, Crosswind rudder peddles, HP Reverb G2, VPC Collective, DOF Reality H2, Gametrix seat, WinWing panels.
toutenglisse Posted October 28, 2021 Posted October 28, 2021 4 hours ago, 0414 Wee Neal said: ...Can anyone advise what I am doing wrong please? ... Hi, it seems that Group.getByName('RespawnTest01') is still true for a dead group. Here is what I usually use, and is actually working, for checking if a group is totally definitely dead : if Group.getByName('RespawnTest01') and Group.getByName('RespawnTest01'):isExist() == true and #Group.getByName('RespawnTest01'):getUnits() > 0 then else mist.respawnGroup('RespawnTest01', true) end
0414 Wee Neal Posted October 30, 2021 Author Posted October 30, 2021 works well, thank you for your time. Neal Desktop PC: Intel i7 14700K, MSI Z790 MAG Tomahawk MOBO, 64Gb RAM , GPU Nvidia RTX 3080ti Windows 11, VPC joystick, Crosswind rudder peddles, HP Reverb G2, VPC Collective, DOF Reality H2, Gametrix seat, WinWing panels.
OzCougar Posted November 26, 2021 Posted November 26, 2021 (edited) Greetings, Have been following a number of threads regarding the use of Mist to respawn both Air and Ground units. Have picked up some great tips .... so thanks to all. I am getting the various groups to respawn after they have been destroyed .... however, I have run into .... what I hope .... is a small snag ....as I can't seem to get them to respawn with a delay so that it looks a little more realistic. Here is the DO SCRIPT I am using (with one of the three Convoy groups I have in my training mission): if (Group.getByName('Convoy3') and Group.getByName('Convoy3'):getSize() < 1) or not Group.getByName('Convoy3') then mist.respawnGroup('Convoy3', true) end Now this script as written works perfectly in that whichever 'groupname' I insert will be respawned as soon as the entire group has been destroyed. As I said, what I can't seem to get to work is a delay! I have tried the following actions with no success: 1. Replace true with a number value (i.e. 60) 2. Add a number value after true (i.e. true, 60) Neither seems to deliver the desired delay .... and action 1 is exactly as it is stated in the https://wiki.hoggitworld.com/view/MIST_respawnGroup I have also attached the Test mission if anyone wants to take a look to hopefully provide a solution . Thanks in Advance .... Test.miz Edited November 26, 2021 by OzCougar Corrections
toutenglisse Posted November 26, 2021 Posted November 26, 2021 4 hours ago, OzCougar said: ...I am getting the various groups to respawn after they have been destroyed .... however, I have run into .... what I hope .... is a small snag ....as I can't seem to get them to respawn with a delay so that it looks a little more realistic... Hi, the number value inside the function is for defining task delay, not respawn delay. You need respawn to be scheduled. Example : if (Group.getByName('Convoy3') and Group.getByName('Convoy3'):getSize() < 1) or not Group.getByName('Convoy3') then local addtime = mist.random(90, 180) mist.scheduleFunction(mist.respawnGroup,{'Convoy3', true}, timer.getTime() + addtime)--respawn will occure between 90/180 seconds end
OzCougar Posted November 26, 2021 Posted November 26, 2021 10 hours ago, toutenglisse said: Hi, the number value inside the function is for defining task delay, not respawn delay. You need respawn to be scheduled. Example : if (Group.getByName('Convoy3') and Group.getByName('Convoy3'):getSize() < 1) or not Group.getByName('Convoy3') then local addtime = mist.random(90, 180) mist.scheduleFunction(mist.respawnGroup,{'Convoy3', true}, timer.getTime() + addtime)--respawn will occure between 90/180 seconds end Hi toutenglisse, Thank you SOOOOO much .... I was actually reading my Mist manual and had started to think along these lines .... but you just helped me get to the result quicker . Greatly appreciate the assistance .... Cheers Oz Cougar
Grimes Posted November 26, 2021 Posted November 26, 2021 BTW I added a mist.groupIsDead function that is basically the if statement above. https://wiki.hoggitworld.com/view/MIST_groupIsDead 1 The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
OzCougar Posted November 27, 2021 Posted November 27, 2021 (edited) 33 minutes ago, Grimes said: BTW I added a mist.groupIsDead function that is basically the if statement above. https://wiki.hoggitworld.com/view/MIST_groupIsDead Hi Grimes .... WOW talk about great service .... Grimes is there a link to 4.5? Sorry but every search I try leads me to 4.4 .... unless I am missing something which could be highly likely . Cheers Oz Cougar Edited November 27, 2021 by OzCougar
Grimes Posted November 27, 2021 Posted November 27, 2021 https://github.com/mrSkortch/MissionScriptingTools/blob/development/mist_4_5_103.lua Development branch. I need to tidy a few things up and add documentation but I should be merging it to the main branch sooner or later. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Recommended Posts