hardnick Posted September 23, 2018 Share Posted September 23, 2018 I finally learned to use the mist.respawnGroup successfully. But there have been some problem if not Group.getByName(v.ID) then mist.respawnGroup(v.ID, true) end The original unit(Group) works properly! after that... any respawned unit it can Follow the route But just sits idle. What am I doing wrong? I can even formation with it :pilotfly: Thank You. My DCS version 2.5.3.21708 MIST version mist_4_3_74 Link to comment Share on other sites More sharing options...
hardnick Posted September 24, 2018 Author Share Posted September 24, 2018 (edited) I made a file to test the problem I said. Please use the F10 menu to activate a su27 Then when you shoot down the first one, please use F10 to respawn a su27. Then it began to show a idle(sluggish?) situation.ReSpawn Test.miz Edited September 24, 2018 by hardnick Link to comment Share on other sites More sharing options...
Grimes Posted September 24, 2018 Share Posted September 24, 2018 Appears to be related to having late activation checked. The group will attack normally with a normal spawn. 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 Link to comment Share on other sites More sharing options...
hardnick Posted September 24, 2018 Author Share Posted September 24, 2018 Confirm that the late activation if canceled respawn can work Very well!!! Is there a better solution to this problem? (except uncheckedlate activation) Thank you~~~ Grimes Link to comment Share on other sites More sharing options...
Zayets Posted September 25, 2018 Share Posted September 25, 2018 Group.getByName('MyGroupName'):activate() once the group is spawned. [sIGPIC]OK[/sIGPIC] Link to comment Share on other sites More sharing options...
hardnick Posted September 26, 2018 Author Share Posted September 26, 2018 Thank you! Zayets, I will try it. ^^ Link to comment Share on other sites More sharing options...
hardnick Posted September 26, 2018 Author Share Posted September 26, 2018 I tested. if the group is activated() then the mist.respawnGroup won't work. Link to comment Share on other sites More sharing options...
hardnick Posted September 26, 2018 Author Share Posted September 26, 2018 I think of a way. If I destroy All those groups at the beginning of the mission Group.getByName(SomeGroup):destroy() I don't need to use the "later activation". Although this is not the perfect solution But at least it can solve the problem :) Thank you all. Link to comment Share on other sites More sharing options...
Zayets Posted September 27, 2018 Share Posted September 27, 2018 You have to call activate after you call the respawn function. [sIGPIC]OK[/sIGPIC] Link to comment Share on other sites More sharing options...
hardnick Posted September 27, 2018 Author Share Posted September 27, 2018 Thank you, Zayets, but I have tried it, it still doesn't work. local function B_SpawnAI(v) local TextSpawn_A = "RED "..v.AIGroup_BGF.." activated" local TextSpawn_B = "RED "..v.AIGroup_BGF.." ReSpawn" local TextSpawn_C = "RED "..v.AIGroup_BGF.." Already performing a task" if not Group.getByName(v.ID) then mist.respawnGroup(v.ID, true) Group.getByName(v.ID):activate() trigger.action.outTextForCoalition(coalition.side.BLUE, TextSpawn_B, 30) elseif Unit.getByName(v.UnitName):isActive() then trigger.action.outTextForCoalition(coalition.side.BLUE, TextSpawn_C, 30) else local myGroup = Group.getByName(v.ID) Group.activate(myGroup) trigger.action.outTextForCoalition(coalition.side.BLUE, TextSpawn_A, 30) end end local Menu_BlueItem = {"ReSpawn Test"} local SubMenu_BlueItem_1 = {"su27"} local Blue_Menu1 = missionCommands.addSubMenuForCoalition(coalition.side.BLUE, Menu_BlueItem[1], B_SpawnAI) missionCommands.addCommandForCoalition(coalition.side.BLUE, SubMenu_BlueItem_1[1], Blue_Menu1, B_SpawnAI, {AIGroup_BGF = SubMenu_BlueItem_1[1], ID = "su27", UnitName = "U_su27"})ReSpawn Test.miz Link to comment Share on other sites More sharing options...
Zayets Posted September 27, 2018 Share Posted September 27, 2018 Question, can you output the value of v.ID ? By the looks of it it returns the group ID and not the name of the group. I haven't checked the mission yet [sIGPIC]OK[/sIGPIC] Link to comment Share on other sites More sharing options...
hardnick Posted September 28, 2018 Author Share Posted September 28, 2018 Yes v.ID output is the group name (su27) Link to comment Share on other sites More sharing options...
Zayets Posted September 29, 2018 Share Posted September 29, 2018 There you go, mate. I took your script and loaded it after mist was loading. It should work now.ReSpawn Test.miz [sIGPIC]OK[/sIGPIC] Link to comment Share on other sites More sharing options...
hardnick Posted September 29, 2018 Author Share Posted September 29, 2018 Thank you so much! But I can't see the respawn.lua file you edited. Link to comment Share on other sites More sharing options...
Zayets Posted September 29, 2018 Share Posted September 29, 2018 I just took your script from the DO SCRIPT trigger action and created a new file which I loaded 5 seconds after mission starts with DO SCRIPT FILE. So basically it is exactly as you wrote it. If you want to see the file you will have to unzip ReSpawn Yes.miz and then simply look into the folder for it. [sIGPIC]OK[/sIGPIC] Link to comment Share on other sites More sharing options...
hardnick Posted September 29, 2018 Author Share Posted September 29, 2018 Oh, "DO SCRIPT FILE" Now I get it! but the second Su27(respawn su27) is still very peaceful and not aggressive. But thank you very much, Zayets. Link to comment Share on other sites More sharing options...
Zayets Posted September 29, 2018 Share Posted September 29, 2018 Yeah, tasking on the respawned units sometimes sub par. They do what's expected quite often for me. One thing I do myself is to use dynAdd instead of respawn. It is the same approach, have a late activated group and then use dynAdd. This function is more to my liking as I can modify the route on the fly. It does take more coding but it (almost) never fails. [sIGPIC]OK[/sIGPIC] Link to comment Share on other sites More sharing options...
hardnick Posted September 30, 2018 Author Share Posted September 30, 2018 Ok~Thank you! I still have a lot to learn about Lua ^^ Link to comment Share on other sites More sharing options...
Recommended Posts