Saruman Posted August 17, 2023 Posted August 17, 2023 (edited) Does it work for carriers' warehouses, too? Edited August 17, 2023 by Saruman 1
antiload Posted August 17, 2023 Posted August 17, 2023 (edited) Can some kind soul do a little tutorial video on how this works for the lay person. The concept seems very interesting Edited August 17, 2023 by antiload 4
Mistermann Posted August 17, 2023 Posted August 17, 2023 1 hour ago, antiload said: Can some kind soul do a little tutorial video on how this works for the lay person. The concept seems very interesting I was thinking the exact same thing as I read through the thread. I think this would be fantastic and show the value to a broader audience. I big thanks in advance to whomever posts the showcase video. 2 System Specs: Spoiler Callsign:Kandy Processor:13th Gen Intel(R) Core(TM) i9-13900K - RAM: 64GB - Video Card: NVIDIA RTX 4090 - Display: Pimax 8kx VR Headset - Accessories: VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box Video Capture Software: Open Broadcaster Software (OBS), Video Editing Software: PowerDirector 365 Into The Jungle Apache Campaign - Griffins Kiowa Campaign - Assassins Thrustmaster TWCS Mod
MAXsenna Posted August 17, 2023 Posted August 17, 2023 43 minutes ago, Mistermann said: I was thinking the exact same thing as I read through the thread. I think this would be fantastic and show the value to a broader audience. I big thanks in advance to whomever posts the showcase video. Not a video, but have you guys seen this? 1
ElementLT Posted August 17, 2023 Posted August 17, 2023 Yes! so going to love this for some logistics missions!!! Thank you so much for this! 1 Coming Soon... The Fraternity Returns : https://thefraternitysim.com/
DD_Friar Posted August 17, 2023 Posted August 17, 2023 rEF THE VIDEO, gRIMREAPERS DID ONE ON THE wAREHOUSE CONCPET QUITE A WHILE BACK Visit the Dangerdogz at www.dangerdogz.com. We are a group based on having fun (no command structure, no expectations of attendance, no formal skills required, that is not to say we can not get serious for special events, of which we have many). We play DCS and IL2 GBS. We have two groups one based in North America / Canada and one UK / Europe. Come check us out.
edineygomes Posted August 17, 2023 Posted August 17, 2023 For example, a truck arrives at a certain base and delivers 10 aim-9m and 12 more mk-82. Where I see the correct name of weapons, planes etc... Could someone create a mission for demonstration? I'm not a programming expert.
phrogZ Posted August 17, 2023 Posted August 17, 2023 Thx ED !!! hope to see more API improvement like that in the future 1
eaglefirefly Posted August 18, 2023 Posted August 18, 2023 (edited) On 8/17/2023 at 11:26 AM, Saruman said: Does it work for carriers' warehouses, too? I believe so! I am testing it today for the Tarawa you basically use the name of what you want to access the resources of. That I presume includes ships. But I will edit this comment with my findings later. EDIT - The answer is yes all you need to do is enter the unit name of the warehouse you want to access. I will add the relevant part of the cope snippet I used below BASE:E("Fuel check running.....") local _tarawaairbase = Airbase.getByName('BLUE TARAWA') local _tarawawarehouse = _tarawaairbase:getWarehouse() local _tarawainventory = _tarawawarehouse:getInventory() local function dump(o) if type(o) == 'table' then local s = '{\n' for k,v in pairs(o) do if type(k) ~= 'number' then k = '"'..k..'"' end s = s .. '['..k..'] = ' .. dump(v) .. ',\n' end return s .. '}\n' else return tostring(o) end end if first_load == true then _deltawarehouse:setLiquidAmount(0,FuelArray[0]) local _romediesel = dump(_romeinventory['liquids'][3]) local _tarawajet = dump(_tarawainventory['liquids'][0]) BASE:E(_tarawajet) Result = BASE00000.function(100000) Edited August 18, 2023 by eaglefirefly adding result and code 2
eaglefirefly Posted August 18, 2023 Posted August 18, 2023 (edited) 18 hours ago, edineygomes said: For example, a truck arrives at a certain base and delivers 10 aim-9m and 12 more mk-82. Where I see the correct name of weapons, planes etc... Could someone create a mission for demonstration? I'm not a programming expert. Something like this would work, maybe have a look at MOOSE they have added the api to their codebase yesterday as a helper if truckenterzone == true then do the add fuel thing end Edited August 18, 2023 by eaglefirefly
shagrat Posted August 18, 2023 Posted August 18, 2023 Setting inventory - actually being able to fill storages and fuel tanks by script commands - is a huuuuge step! Finally we can create real "convoys" that directly impact available ressources. Thank you sooo much, for finally adding this feature. Total game changer! 1 Shagrat - Flying Sims since 1984 - Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)
Stonehouse Posted August 19, 2023 Posted August 19, 2023 (edited) That's probably the most exciting thing I've seen for DCS for a long time. Presumably first bit of the ongoing dynamic campaign work by ED to the users' hands. Getting logistics going is a big part of the skeleton of a dynamic campaign. Plus it finally makes physical units possible rather than relying on the virtual supply system. Edited August 19, 2023 by Stonehouse 1
Saruman Posted August 19, 2023 Posted August 19, 2023 What about ammos sharing same name? For example, looking at inventory, you have two distinct "Fuel Tank 300 gal": one is for F-16, the other one is certainly for F-14. How can you refer to one or the other, considering that the F-16's droptank seems not to have an unique typename (the F-14's one is weapons.droptanks.HB_F14_EXT_DROPTANK)?
funkyfranky Posted August 20, 2023 Posted August 20, 2023 Is a warehouse always associated with an airbase, FARP or ship? Asking, because we also have static objects such as warehouse, ammunition depo, tank 1, tank 2, tank 3, which act as warehouses, which do not belong to an airbase. Obviously for these, the warehouse cannot be retrieved with the airbase:getWarehouse(). According to hoggit , there should be a Warehouse.getByName() function https://wiki.hoggitworld.com/view/DCS_func_getByName. But that does not appear to work (not even for airbase warehouses). 2 A warrior's mission is to foster the success of others. i9-12900K | RTX 4090 | 128 GB Ram 3200 MHz DDR-4 | Quest 3 RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss
RogueRunner Posted August 22, 2023 Posted August 22, 2023 (edited) airbase:getWarehouse() local storage = airbase:getWarehouse("Goulet") --storage=STORAGE:FindByName("Goulet") storage:AddLiquid(STORAGE.Liquid.JETFUEL, 10000) Why does this give me a attempt to index global 'airbase' (a nil value) stack traceback: error? EDIT: was using the wromg version of moose. Edited August 22, 2023 by RogueRunner With the price of ammunition these days do not expect a warning shot.
Grimes Posted August 22, 2023 Posted August 22, 2023 1 hour ago, RogueRunner said: airbase:getWarehouse() local storage = airbase:getWarehouse("Goulet") --storage=STORAGE:FindByName("Goulet") storage:AddLiquid(STORAGE.Liquid.JETFUEL, 10000) Why does this give me a attempt to index global 'airbase' (a nil value) stack traceback: error? Ask a moose. Seem to be using their classes. 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
HC_Official Posted August 22, 2023 Posted August 22, 2023 @Grimes Just wanted to say thanks for all the hard work you put into documenting so much of this stuff , many thanks man 1 No more pre-orders Click here for tutorials for using Virpil Hardware and Software Click here for Virpil Flight equipment dimensions and pictures. .
Shrike88 Posted August 23, 2023 Posted August 23, 2023 Thank you @Grimes for all your work with this also. Also @Pikey for jumping onto some scripting. Would love to see this somewhat incorporated into Mist / Moose soon and make things a little easier to process for those of us like myself that is severely lacking in the coding / scripting department. 1 1
Pikey Posted August 23, 2023 Posted August 23, 2023 1 hour ago, Shrike88 said: Thank you @Grimes for all your work with this also. Also @Pikey for jumping onto some scripting. Would love to see this somewhat incorporated into Mist / Moose soon and make things a little easier to process for those of us like myself that is severely lacking in the coding / scripting department. So there is the STORAGE class in MOOSE that @funkyfranky wrote for Day 1 https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Storage.html but this is the start of what MOOSE might do with it to join things up. I did a warehouse persistance script, just saves your warehouse to file and reloads it: https://forum.dcs.world/topic/332310-script-release-simple-warehouse-saving-sws/ @chromium is writing things now for DSMC https://dsmcfordcs.wordpress.com/ I Chromui He's pinging right now for feedback as he rewrites parts. I presume for all these people there are others doing the same. It's going to take some time to make use of these because everyone is already established in workarounds and years of doing things a certain way. But in terms of using it, its some of the easiest things to use, you can make factories and supply chains that have physical presence. 4 ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
chromium Posted August 24, 2023 Posted August 24, 2023 (edited) 16 ore fa, Pikey ha scritto: @chromium is writing things now for DSMC https://dsmcfordcs.wordpress.com/ I Chromui He's pinging right now for feedback as he rewrites parts. I presume for all these people there are others doing the same. Thanks a lot for spreading the info here also . Given the possibility to track everything in the wh right now and more than one solution to make it persistent in the subsequent mission iteration, I believe that soon or later we're going to see much more RMS use in some servers. Mainly what I expect quite soon is some kind of CTLD version with resupply crates implemented. (PS: the version at the site link is the stable 1.3.4 that does not use the new system, while the openbeta 1.3.5 on github here https://github.com/Chromium18/DSMC does) 16 ore fa, Pikey ha scritto: But in terms of using it, its some of the easiest things to use, you can make factories and supply chains that have physical presence. And this is exactly what I'm expecting to be realized soon (and I'm also doing that with no rush, not a priority). But it's a very easy step to perform: you would only need to set as negligible the frequency/size/operating level of a warehouse, while coding a "spawn convoy from a to b" when the warehouse goes below a certain level for the desired item. About this, it might be good in a wishlist to have some events attached to the warehouse management, like "item below specific level", to avoid creating recursive loops to check quantity of each item all the time. Edited August 24, 2023 by chromium Author of DSMC, mod to enable scenario persistency and save updated miz file Stable version & site: https://dsmcfordcs.wordpress.com/ Openbeta: https://github.com/Chromium18/DSMC The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.
Pikey Posted August 24, 2023 Posted August 24, 2023 Yes, there is plenty to look forward to. This allows unlimited imagination to be used. From basic script snippets that anyone can use in a DO SCRIPT, to custom factory checks and complete supply chains, either virtual or real. But the best part will be when the C-130 and Chinook arrive to give the player agency for this entire thing and complement or remove the script requirements. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
tacts.zeagle Posted August 27, 2023 Posted August 27, 2023 (edited) Here is a listing of a typical inventory table for an airbase. I hope this helps someone. Notable is the indexing of liquids at [0], which, although normal for C, is not good Lua practice. Lua arrays typically start at index 1. Also of note is the inconsistent use of the underscore and the hyphen in the naming of weapons. The AIM-9 series is a good example. The AH-64 internal aux tank simply has no name other than "weapons.droptanks." Also, the inventory uses a plural for liquids and aircraft, and a singular for weapons. ( inventory = {liquids = {}, weapon = {}, aircraft = {}}... "weapon" needs an "s" at the end.) This is why we programmers have no hair. edit: this one includes the resource map as well. inventory.lua Edited August 28, 2023 by tacts.zeagle annotations 2
Saruman Posted August 28, 2023 Posted August 28, 2023 (edited) After testing a bit, I noticed that carriers do not always get updated after setting items, at least in my mission. Some times they get updated, some times (when restarting same mission) they do not. Here's a sample oversimplified code local friendlyAirbases = coalition.getAirbases(coalition.side.BLUE) for i = 1, #friendlyAirbases do local w = friendlyAirbases[i]:getWarehouse() local inventory = w:getInventory().weapon for wpn, _ in pairs(inventory) do w:setItem(wpn, 30) end end Common airbases always work fine instead. Edited August 28, 2023 by Saruman
tacts.zeagle Posted August 28, 2023 Posted August 28, 2023 First, I fail to grasp the reason for the above code. If you are just setting the values once and never changing them, then they are better set in the ME not in code. Second, this is a brute-force method of changing every weapon in every friendly base. Why? Why not just change the items you need to? Think efficiency. These kinds of things have the potential to really bog down performance. And lastly, if you are going to run this code, try using a time delay to allow everything to load up before you go and start iterating through all the airbases. Make sure your carriers are actually loaded before changing their internals. As far as readability goes, using a single letter for your warehouse is not good practice. Also naming a table "inventory" when it actually contains "weapon" is another pitfall.
Recommended Posts