Cypher1o1 Posted October 21, 2018 Share Posted October 21, 2018 is there a way to despawn and spawn static objects mid-mission to rearrange the carrier deck for T.O. beggining of the mission and landing at the end of the mission? Link to comment Share on other sites More sharing options...
ScopeDope Posted January 20, 2019 Share Posted January 20, 2019 is there a way to despawn and spawn static objects mid-mission to rearrange the carrier deck for T.O. beggining of the mission and landing at the end of the mission? Sorry to necro this thread, but I came here wondering this same thing. Anyone? Link to comment Share on other sites More sharing options...
Hardcard Posted January 20, 2019 Share Posted January 20, 2019 @ScopeDope Hold my beer! [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
Darcaem Posted January 20, 2019 Share Posted January 20, 2019 I did that to block some parking spots on a Stennis. I put the static objets in the ME, and a trigger on mission start removes them with the following: StaticObject.getByName('REMOVE1'):destroy()8h.miz Link to comment Share on other sites More sharing options...
Hardcard Posted January 21, 2019 Share Posted January 21, 2019 (edited) @ScopeDope I don't know of a way to spawn static objects once the mission has started, but you can use late activated AI units to "replace" the statics you remove. For instance, the attached MOOSE demo mission has 2 static hornets and 1 static sea stallion (on the Stennis' deck) at mission start. All these statics will be removed 10 seconds after mission start, then, 2x late activated hornets and a late activated sea stallion will spawn at a different location (starting from ramp). Basically, removing any number of statics from the Stennis' deck is easy to do, "replacing" them, however, not so much :cry:Stennis static spawn_despawn.mizStatic Spawn Carrier.lua Edited January 21, 2019 by Hardcard [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
TonyG Posted January 23, 2019 Share Posted January 23, 2019 Thanks Hardcard. Too bad we're still limited to having 4 parking spots... Is there anyway to remove some of the static, or is it an all or nothing switch in the script? Link to comment Share on other sites More sharing options...
Habu_69 Posted January 23, 2019 Share Posted January 23, 2019 We have 4 spots on the cats and 4 additional. I simulate more by either late-activating groups airborne near the CVN or having them orbit until triggered. Add a triggered message "Wheels up." Once human pilots are launched they can't see the flight deck anyway. Link to comment Share on other sites More sharing options...
Hardcard Posted January 23, 2019 Share Posted January 23, 2019 (edited) Thanks Hardcard. Too bad we're still limited to having 4 parking spots... Yup, that's not ideal Is there anyway to remove some of the static, or is it an all or nothing switch in the script? The script I provided uses a set of statics, which includes all statics in that mission. The "removal" function is applied to all the statics within the set. I wrote it that way because it makes things simpler, but, sure, the script can be modified to target specific statics: local StaticSet = SET_STATIC:New() :FilterPrefixes("Static_") -- This is the key. It'll look for all statics that use "Static_" as prefix in their ME name. These will be included in the set :FilterStart() StaticSet:ForEachStatic( -- This iterator will run the following function for each static in the set function(StaticUnit) Stuff you want to do with the statics in StaticSet end ) -- Now, imagine I had several static hornets and several static sea stallions on the Stennis' deck. I could create two separate sets instead, one for each type local HornetSet = SET_STATIC:New() :FilterPrefixes("Hornet_") -- This will look for all statics that use "Hornet_" as prefix in their ME name. Needless to say that you need to modify the name of the static hornets in ME, so they use this prefix :FilterStart() HornetSet:ForEachStatic( -- We can use the same kind of iterator as before, this time it'll apply to the static hornet set only function(HornetUnit) Stuff you want to do with the statics in HornetSet end ) -- Then we do the same thing with the static sea stallions local StallionSet = SET_STATIC:New() :FilterPrefixes("Stallion_") -- This will look for all statics that use "Stallion_" as prefix in their ME name. Needless to say that you need to modify the name of the static stallions in ME, so they use this prefix :FilterStart() StallionSet:ForEachStatic( -- We can use the same kind of iterator as before, this time it'll apply to the static stallion set only function(StallionUnit) Stuff you want to do with the statics in StallionSet end ) -- So far, I've only used sets to target statics, since that's the easiest way to handle several groups at once (each static can be considered a separate group), -- However, if you want to target individual statics instead, you can use: STATIC:FindByName("Name of the static in ME") -- Let's say I want to target the first static hornet only: local Static_Hornet_1 = STATIC:FindByName("Name of the first static hornet in ME") -- Then, I can remove it from the map whenever I choose, by using Static_Hornet_1:Destroy() Edited January 23, 2019 by Hardcard [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
TonyG Posted January 23, 2019 Share Posted January 23, 2019 Fantastic stuff, thank you so much! Link to comment Share on other sites More sharing options...
Teriander Posted January 30, 2019 Share Posted January 30, 2019 Hardcore, First. Thanks for this script. Very awesome! But I'm having an issue where the "Static Respawn Test" only seems to work if the Trigger "MOOSE Load" exist. But I do not see the Moose.lua. Is it imbedded into the mission file you provided? As a result, using the "Static Respawn Test" doesn't work on my mission despite having the correct naming. I'm I missing something to get this to work on my mission? Also, launching your mission file and removing the "Moose Load" reference breaks the "Static Respawn Test". Link to comment Share on other sites More sharing options...
Hardcard Posted January 31, 2019 Share Posted January 31, 2019 (edited) I do not see the Moose.lua. Is it imbedded into the mission file you provided? Yes, it's in there. Open the mission file with winzip/winrar/7zip/etc. and navigate to Stennis static spawn_despawn.miz\l10n\DEFAULT , you'll find it there. Alternatively, you can download it here As a result, using the "Static Respawn Test" doesn't work on my mission despite having the correct naming. I'm I missing something to get this to work on my mission? Also, launching your mission file and removing the "Moose Load" reference breaks the "Static Respawn Test". As you've probably deduced, the script won't work without Moose.lua being loaded first, since it's a MOOSE script. You need to create that "MOOSE load" trigger at mission start, with a "DO SCRIPT FILE" action that runs Moose.lua Edited April 27, 2020 by Hardcard [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
Teriander Posted January 31, 2019 Share Posted January 31, 2019 Awesome! Thanks again. On a side note, the Moose.lua seems a bit heavy. Is it possible for me to strip what I don't need and keep the functions that allow the "Static Spawn" lua to work, or is the whole script pretty much necessary? Just trying to reduce the number of functions on my mission as possible. But if I need it all, I'll use it! Link to comment Share on other sites More sharing options...
pimp Posted January 31, 2019 Share Posted January 31, 2019 Awesome! Thanks again. On a side note, the Moose.lua seems a bit heavy. Is it possible for me to strip what I don't need and keep the functions that allow the "Static Spawn" lua to work, or is the whole script pretty much necessary? Just trying to reduce the number of functions on my mission as possible. But if I need it all, I'll use it! Not sure which one you have, but looks like there's a smaller file located on the MOOSE thread: https://forums.eagle.ru/showthread.php?t=138043 i9 9900k @5.1GHz NZXT Kraken |Asus ROG Strix Z390 E-Gaming | Samsung NVMe m.2 970 Evo 1TB | LPX 64GB DDR4 3200MHz EVGA RTX 3090 FTW3 Ultra | Reverb G1 | HOTAS Warthog | Saitek Flight Pedals Link to comment Share on other sites More sharing options...
Teriander Posted January 31, 2019 Share Posted January 31, 2019 Not sure which one you have, but looks like there's a smaller file located on the MOOSE thread: https://forums.eagle.ru/showthread.php?t=138043 Thanks Pimp! Link to comment Share on other sites More sharing options...
Hardcard Posted January 31, 2019 Share Posted January 31, 2019 (edited) @pimp That's an older MOOSE release @Teriander Modify Moose.lua at your own risk, I don't recommend it, but you are free to try, ofc. As for performance, Moose.lua by itself shouldn't affect it. Think of it as a "scripting dictionary/translator", it shouldn't do anything by itself. It'll simply "translate" your MOOSE scripts so the DCS scripting engine "understands" them. Anyway, you can always use DCS scripting methods instead, no Moose.lua required for those. Edited January 31, 2019 by Hardcard [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
Teriander Posted February 2, 2019 Share Posted February 2, 2019 @pimp That's an older MOOSE release @Teriander Modify Moose.lua at your own risk, I don't recommend it, but you are free to try, ofc. As for performance, Moose.lua by itself shouldn't affect it. Think of it as a "scripting dictionary/translator", it shouldn't do anything by itself. It'll simply "translate" your MOOSE scripts so the DCS scripting engine "understands" them. Anyway, you can always use DCS scripting methods instead, no Moose.lua required for those. Where could I get the latest Moose release? Link to comment Share on other sites More sharing options...
Hardcard Posted February 2, 2019 Share Posted February 2, 2019 (edited) Where could I get the latest Moose release? Scroll up to post #11 The link I provided directs you to the download link of the latest Moose.lua (include version). However, if you want to know the location where MOOSE releases can be found, that would be the Github release branch Edited February 2, 2019 by Hardcard [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
Exocet Posted March 9, 2020 Share Posted March 9, 2020 Hello guys, can i ask you something?.. I'm trying to use your scrypt for spawn statics with 10s delay. Do you see an error? My static name objects is : FpostB1_Fuel1 FpostB1_Fuel2 FpostB1_Fuel3 FpostB1_Fuel4 local StaticSet = SET_STATIC:New() :FilterPrefixes("FpostB1_") :FilterStart() local FpostB1Fuel = SPAWN:New("Fuel") local SpawnFlag = USERFLAG:New("Spawn Flag") local function StaticDestroy(StaticUnit) StaticUnit:Destroy() if SpawnFlag:Get() ~= 1 then Fuel:Spawn() SpawnFlag:Set(1) end end StaticSet:ForEachStatic( function(StaticUnit) timer.scheduleFunction(StaticDestroy, StaticUnit, timer.getTime() + 10 ) end ) Link to comment Share on other sites More sharing options...
SpikeGondorff Posted March 9, 2020 Share Posted March 9, 2020 My understanding is that you can't spawn static objects after mission start. Someone please correct me if I'm wrong, because I would love that option. Link to comment Share on other sites More sharing options...
Ozone1 Posted April 25, 2020 Share Posted April 25, 2020 Have any of you guys managed to despawn effects? (fire/smoke) I tried as if it was a static, but no joy... Link to comment Share on other sites More sharing options...
Hardcard Posted April 27, 2020 Share Posted April 27, 2020 (edited) @Ozone1 I don't think it's possible @SpikeGondorff Static objects can be spawned after mission start (not on ships, though). To do so, you need to define a static group template, then use coalition.addStaticObject() Keep in mind that some static units/buildings are broken, they won't work properly. Edited April 27, 2020 by Hardcard [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
Lineaxe Posted July 19, 2020 Share Posted July 19, 2020 (edited) Late answer may help future readers of this post. Moose.lua is to be loaded separately , ahead of the your lua script in the mission .miz file. It's very likely that you need to download it and keep it in your missions directory as is done in this example. Take a look at the triggers. Edited July 29, 2020 by Lineaxe Link to comment Share on other sites More sharing options...
Spearzone Posted July 29, 2020 Share Posted July 29, 2020 Redkite has made a tutorial on how to remove and spawn statics on the carrier: 1 Link to comment Share on other sites More sharing options...
gmangnall Posted February 23, 2022 Share Posted February 23, 2022 I have an updated tool which allows static ground units whereas RedKites is aircraft only Link to comment Share on other sites More sharing options...
Recommended Posts