Alpenwolf Posted February 18, 2017 Posted February 18, 2017 How can I have a unit/group being reactivated multiple times? For example: If a team captures an airfield by destroying the enemy's garrison his garrison now will be activated. But what if the other team recaptures the airfield? Can that unit/group be reactivated even after it was destroyed by the enemy that first captured it? HACA DYCA Discord Cold War 1947 - 1991 You can help me with keeping up the server via PayPal donations: hokumyounis@yahoo.com
Grimes Posted February 19, 2017 Posted February 19, 2017 Using triggers you can only activate a group once. Once it is destroyed it can't be reactivated. If desired you can do it with multiple groups, but eventually you will "run out" of groups to activate. The better solution is with scripting and using the coalition.addGroup() scripting function. Basically you can spawn in however many groups you want. There are a few different scripting libraries people have put together to simplify things. Using mist you could use the functionmist.respawnGroup() and it respawns the original group in its entirety. 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
Pikey Posted February 19, 2017 Posted February 19, 2017 Alpenwolf, there is a number of ways to do this, I'm not saying my way is best, but I used Mist Clone in zone from Grimes. I place a "template" group way out of the action and a normal trigger Zone. Then a switched trigger with a 'do script' that clones that group and places it where you want it. Net result, your airbase flips, you clone in a group of defense units. Airbase flips back, clone in the other group of units. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
Alpenwolf Posted February 19, 2017 Author Posted February 19, 2017 Using triggers you can only activate a group once. Once it is destroyed it can't be reactivated. If desired you can do it with multiple groups, but eventually you will "run out" of groups to activate. The better solution is with scripting and using the coalition.addGroup() scripting function. Basically you can spawn in however many groups you want. There are a few different scripting libraries people have put together to simplify things. Using mist you could use the functionmist.respawnGroup() and it respawns the original group in its entirety. Alpenwolf, there is a number of ways to do this, I'm not saying my way is best, but I used Mist Clone in zone from Grimes. I place a "template" group way out of the action and a normal trigger Zone. Then a switched trigger with a 'do script' that clones that group and places it where you want it. Net result, your airbase flips, you clone in a group of defense units. Airbase flips back, clone in the other group of units. Many thanks to you both! I got it working now with your help :thumbup: HACA DYCA Discord Cold War 1947 - 1991 You can help me with keeping up the server via PayPal donations: hokumyounis@yahoo.com
exil Posted February 20, 2017 Posted February 20, 2017 Sorry to hijack the threat, but i guess my problem is very similar: I wan't to create a practise range on the NTTR map, where several enemys are spawed using the radio commands. Therefore i scripted an F10 Radio Menu script. So far i'm able to let (for example) spawn a two-ship of Mig-29 which you can fly against. Now, what i plan to do is to find some triggers/script so that the Migs can be spawed after they are killed as often as i want to. I plan to use a radio command like "ACTIVATE MIG". The purpose is that you can train the same scenario as often as you want to. The tricky thing is, that either mist.respawnGroup and mist.cloneGroup won't work properly since units will respawn immediatelly and not when using a trigger. Since the migs are not the only enemy (i plan to do it with ground troops, SAMs, Tanks and so on...) a triggered action, where you just copy and past enemy units and let them spawn in a FLAG 1, spawn Group 1; FLAG 2, spawn Group 2 manner would cause enormous triggering action. So basically what i'm looking for is a loop which looks something like this: F10 Activate Group 1 > Group 1 is Activated > i destroy Group 1 > Push F10 Activate Group 1 > Group 1 is activated again and so on... Does anyone see a more simplified way to achieve this? I'm really a bit lost right now. Cheers! GeForce RTX 4090 Founders Edition - AMD Ryzen 7 5800X3D - 64Gb RAM - Win11 - HP Reverb G1 - Thrustmaster Warthog HOTAS (40cm extension) - VKB Sim T-Rudder MKIV Pedals
Alpenwolf Posted February 21, 2017 Author Posted February 21, 2017 Sorry to hijack the threat, but i guess my problem is very similar: I wan't to create a practise range on the NTTR map, where several enemys are spawed using the radio commands. Therefore i scripted an F10 Radio Menu script. So far i'm able to let (for example) spawn a two-ship of Mig-29 which you can fly against. Now, what i plan to do is to find some triggers/script so that the Migs can be spawed after they are killed as often as i want to. I plan to use a radio command like "ACTIVATE MIG". The purpose is that you can train the same scenario as often as you want to. The tricky thing is, that either mist.respawnGroup and mist.cloneGroup won't work properly since units will respawn immediatelly and not when using a trigger. Since the migs are not the only enemy (i plan to do it with ground troops, SAMs, Tanks and so on...) a triggered action, where you just copy and past enemy units and let them spawn in a FLAG 1, spawn Group 1; FLAG 2, spawn Group 2 manner would cause enormous triggering action. So basically what i'm looking for is a loop which looks something like this: F10 Activate Group 1 > Group 1 is Activated > i destroy Group 1 > Push F10 Activate Group 1 > Group 1 is activated again and so on... Does anyone see a more simplified way to achieve this? I'm really a bit lost right now. Cheers! Don't use "Activate MiG's". They're dead so they can't be activated. Use what Grimes had posted above this post - mist.respawnGroup() HACA DYCA Discord Cold War 1947 - 1991 You can help me with keeping up the server via PayPal donations: hokumyounis@yahoo.com
FlightControl Posted February 21, 2017 Posted February 21, 2017 Don't use "Activate MiG's". They're dead so they can't be activated. Use what Grimes had posted above this post - mist.respawnGroup() An other option that allows you to reactivate units, is to use an object oriented framework. The framework is a collection of "classes" = objects that you can use to enhance your mission with simple additional commands or methods. Suggest you have a look at the mechanism behind the SPAWN class, that allows you to reactivate groups in various forms (in zones, at points, scheduled, limited, using random templates, uncontrolled, ...) A lot is documented around that capability, and I am not going to write all down here. Maybe have a look at the following youtube videos that illustrate the usage of the SPAWN class: For a more comprehensive setup guide of the MOOSE framework, look here: There are test missions that you can try out and look at the code how it is done: https://github.com/FlightControl-Master/MOOSE/tree/master/Moose%20Test%20Missions/SPA%20-%20Spawning (Just don't try SPA-010, because that one has a problem i still need to fix). Just check below in my signature for more info if you find this useful. Sven [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
exil Posted February 21, 2017 Posted February 21, 2017 Don't use "Activate MiG's". They're dead so they can't be activated. Use what Grimes had posted above this post - mist.respawnGroup() Thanks for your reply! Yes, i thought about that too. But the problem is with mist.respawnGroup they'll respawn immediatelly and not when i want (when i push the trigger again). GeForce RTX 4090 Founders Edition - AMD Ryzen 7 5800X3D - 64Gb RAM - Win11 - HP Reverb G1 - Thrustmaster Warthog HOTAS (40cm extension) - VKB Sim T-Rudder MKIV Pedals
exil Posted February 21, 2017 Posted February 21, 2017 An other option that allows you to reactivate units, is to use an object oriented framework. The framework is a collection of "classes" = objects that you can use to enhance your mission with simple additional commands or methods. Suggest you have a look at the mechanism behind the SPAWN class, that allows you to reactivate groups in various forms (in zones, at points, scheduled, limited, using random templates, uncontrolled, ...) A lot is documented around that capability, and I am not going to write all down here. Maybe have a look at the following youtube videos that illustrate the usage of the SPAWN class: For a more comprehensive setup guide of the MOOSE framework, look here: There are test missions that you can try out and look at the code how it is done: https://github.com/FlightControl-Master/MOOSE/tree/master/Moose%20Test%20Missions/SPA%20-%20Spawning (Just don't try SPA-010, because that one has a problem i still need to fix). Just check below in my signature for more info if you find this useful. Sven Sven, i'm watching the developtment of MOOSE for a long time now. The tool gets more powerful every day! This is really awesome and i can really see me using it. Thank you also for the great documentation which makes scripting (for a lua noob like me) a lot easier to understand. For the moment i'm still on MIST. But due to my job i don't have much time right now to learn new things. But MOOSE looks so promising, that i will try to learn (at least some basics) in the next couple of weeks. And as far as i understand, MOOSE works perfectly alongside MIST. Thanks for this great contribution! GeForce RTX 4090 Founders Edition - AMD Ryzen 7 5800X3D - 64Gb RAM - Win11 - HP Reverb G1 - Thrustmaster Warthog HOTAS (40cm extension) - VKB Sim T-Rudder MKIV Pedals
Alpenwolf Posted February 22, 2017 Author Posted February 22, 2017 An other option that allows you to reactivate units, is to use an object oriented framework. The framework is a collection of "classes" = objects that you can use to enhance your mission with simple additional commands or methods. Suggest you have a look at the mechanism behind the SPAWN class, that allows you to reactivate groups in various forms (in zones, at points, scheduled, limited, using random templates, uncontrolled, ...) A lot is documented around that capability, and I am not going to write all down here. Maybe have a look at the following youtube videos that illustrate the usage of the SPAWN class: For a more comprehensive setup guide of the MOOSE framework, look here: There are test missions that you can try out and look at the code how it is done: https://github.com/FlightControl-Master/MOOSE/tree/master/Moose%20Test%20Missions/SPA%20-%20Spawning (Just don't try SPA-010, because that one has a problem i still need to fix). Just check below in my signature for more info if you find this useful. Sven Thank you so much! I'm checking out the videos :thumbup: HACA DYCA Discord Cold War 1947 - 1991 You can help me with keeping up the server via PayPal donations: hokumyounis@yahoo.com
Recommended Posts