Jump to content

Warehouse control functions


Recommended Posts

34 minutes ago, Pikey said:

the string is
weapons.missiles.AIM_9

for the 9M. It's an anomaly for sure. Once you have a look at the print out from the warehouse it should be easy to use. hth.

Yes, if you go through all 700+ entries in the table returned by the warehouse, and cross reference them to all potential loadouts for AI, you can figure out which names do not match the ones returned by getAmmo(). 

Also you ignore pods and fuel tanks and racks, because although they are warehouse items, getAmmo will never return them. 

If you do all this, you can then track spawns and despawns of AI aircraft, to compensate for any weapons they remove or add, checking if weapon names are part of a list of names that should be corrected.

Or, ED could add a checkbox to groups, call it 'ignore warehouses', and make them behave exactly like when they start from air, or from ground, outside the range of a warehouse.

Link to comment
Share on other sites

Very aware of the limitations of getAmmo(), thanks. It was reported on these forums several years ago, I don't have any info I can give you about that - its been discussed in Moose discord and these forums many times over the years. I'd suggest creating your own thread for your idea on the checkbox so that it doesn't get lost in this warehouse thread, thanks!

15 minutes ago, Dzsekeb said:

Yes, if you go through all 700+ entries in the table returned by the warehouse, and cross reference them to all potential loadouts for AI, you can figure out which names do not match the ones returned by getAmmo(). 

Also you ignore pods and fuel tanks and racks, because although they are warehouse items, getAmmo will never return them. 

If you do all this, you can then track spawns and despawns of AI aircraft, to compensate for any weapons they remove or add, checking if weapon names are part of a list of names that should be corrected.

Or, ED could add a checkbox to groups, call it 'ignore warehouses', and make them behave exactly like when they start from air, or from ground, outside the range of a warehouse.

et


Edited by Pikey

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to comment
Share on other sites

Thanks a lot! 

DSMC will be ready tomorrow to update it's warehouse tracking up to the new features , finally getting rid of the getAmmo() limitations about pods, fuel tanks and RMS real time resupplies 🙂

  • Like 2

ChromiumDis.png

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.

Link to comment
Share on other sites

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.  

  • Like 2

System Specs:

Spoiler

 💻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, Thrustmaster TWCS (modified), Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box 

Thrustmaster TWCS Mod

 

Link to comment
Share on other sites

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? 

 

  • Like 1
Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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 by eaglefirefly
adding result and code
  • Like 2
Link to comment
Share on other sites

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 by eaglefirefly
Link to comment
Share on other sites

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! 🥰

  • Like 1

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

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)

Link to comment
Share on other sites

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 by Stonehouse
  • Like 1
Link to comment
Share on other sites

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)?

Link to comment
Share on other sites

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).

  • Like 1

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

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 by RogueRunner

With the price of ammunition these days do not expect a warning shot.

Link to comment
Share on other sites

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. 

  • Like 1

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting 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

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. 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

 

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.

 
  • Like 3

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...