Chef98 Posted December 20, 2024 Posted December 20, 2024 (edited) Hello everybody. I build something. It comes to a point, where I wan't to add weapons with a radio trigger. With MIST it worked. With MOOSE I don't get it working. MIST: Worked fine local wareaddone = Airbase.getByName("Batumi"):getWarehouse() if (trigger.misc.getUserFlag(60) == 6) then wareaddone:addItem("weapons.missiles.AGM_65F",2) trigger.action.outText('[Logistic] AGM-65F x2 are unloaded at UK-Carrier', 50) end Now I tried it with MOOSE, triggered by a Radio function local storage=STORAGE:FindByName("Batumi") if (trigger.misc.getUserFlag(60) == 6) then storage:AddItem("weapons.missiles.AIM_120C", 10) end as well as the long version: local Batumi=AIRBASE:FindByName("Batumi") local storage=Batumi:GetStorage() if (trigger.misc.getUserFlag(60) == 6) then storage:AddItem("weapons.missiles.AIM_120C", 10) end Can someone tell me why it's not working? I don't get it. Syntax should be right. I checked the guide. I ask a friend how also is a programmer, we don't get it. With MIST it's working with MOOSE not. Edited December 20, 2024 by Chef98
Kanelbolle Posted December 23, 2024 Posted December 23, 2024 (edited) On 12/20/2024 at 1:52 AM, Chef98 said: Hello everybody. I build something. It comes to a point, where I wan't to add weapons with a radio trigger. With MIST it worked. With MOOSE I don't get it working. MIST: Worked fine local wareaddone = Airbase.getByName("Batumi"):getWarehouse() if (trigger.misc.getUserFlag(60) == 6) then wareaddone:addItem("weapons.missiles.AGM_65F",2) trigger.action.outText('[Logistic] AGM-65F x2 are unloaded at UK-Carrier', 50) end Now I tried it with MOOSE, triggered by a Radio function local storage=STORAGE:FindByName("Batumi") if (trigger.misc.getUserFlag(60) == 6) then storage:AddItem("weapons.missiles.AIM_120C", 10) end as well as the long version: local Batumi=AIRBASE:FindByName("Batumi") local storage=Batumi:GetStorage() if (trigger.misc.getUserFlag(60) == 6) then storage:AddItem("weapons.missiles.AIM_120C", 10) end Can someone tell me why it's not working? I don't get it. Syntax should be right. I checked the guide. I ask a friend how also is a programmer, we don't get it. With MIST it's working with MOOSE not. Never used moose. But i don't see why anyone would use mist or moose on this. It's just as easy with the regular code: local _afName = "Batumi" if (trigger.misc.getUserFlag(60) == 6) then local _wpn = "weapons.missiles.AIM_120C" local _wpnAmount = 10 Airbase.getByName(_afName):getWarehouse():addItem(_wpn , _wpnAmount) end Edited December 23, 2024 by Kanelbolle WARGAMES Servers: https://forum.dcs.world/topic/301046-wargames-server-pvp-and-pve-campaign-servers/ Scripts: RGC & SPGG https://github.com/AGluttonForPunishment/
Kanelbolle Posted January 1 Posted January 1 I did some testing with moose and the long version of the code you have works. But that said, if you are running Single player, the warehouse will not always show correct.. If i start SP and try and open Resources on Batumi it will not open the warehouse and if i try to spawn in the TF-51D in my test mission (se attachment) i will never be able to spawn even after the aircraft is added. If i go to spectate and wait for the script to run and then try to spawn it works. This works perfectly in multiplayer tho. Try starting a local server and see if it works. local Batumi=AIRBASE:FindByName("Batumi") local storage=Batumi:GetStorage() storage:AddItem("A-10C", 3) storage:AddItem("TF-51D", 3) storage:AddItem("weapons.missiles.AIM_120C", 10) test - moose warehouse add.miz WARGAMES Servers: https://forum.dcs.world/topic/301046-wargames-server-pvp-and-pve-campaign-servers/ Scripts: RGC & SPGG https://github.com/AGluttonForPunishment/
Recommended Posts