Jump to content

Recommended Posts

Posted
Just now, BIGNEWY said:

please make a new post include the script and a small mission example and tag me, I will show the team to be sure it isnt missed

i will try after my work, if nobody make it before

thanks

Posted
On 7/14/2024 at 6:41 PM, Zyll said:

interested in how you generated that list of gunpods and equipment? The Apache FCR is missing, and I'd like to be able to determine the codes for other equipment as they arise.

code is {4,15,44,2114}

  • Like 1
Posted (edited)
10 hours ago, BIGNEWY said:

please make a new post include the script and a small mission example and tag me, I will show the team to be sure it isnt missed

for information, i try a script to spawn invisible farp => farp spawn but stock is empty.

so i add script to add item on warehouse getWarehouse():addItem()) , and i confirm that now i can refuel/rearm....

post here :

 

Edited by bal2o
  • Thanks 1
Posted

I create a class to spawn FARP with F10 mark (write #addFOB)

- FARP spawn with all possible inventary stuff

- and 3 other static are add : fuel, ammo and PC

Just add script in mission (no MOOSE or other need)

It's also possible to use in your own script :

1/ remove last line (FARPSPAWN:New():Init()),

2/ add in your file something like :

local farpClass = FARPSPAWN:New()
farpClass:AddFOBStatic(vec3, options)

- with vec3 is position of FARP 
- options : not necessary, but it's an array where first value is FARP callsign (London by default)


example : farpClass:AddFOBStatic({x = 328226.953125, y = 631214.2618276, z = 10.010028839111}, {"Madrid"})

PS : ATC of FARP will be at 126.5 MHZ + 1 MHz for each FARP (first FARP => 127.6MHz, second => 128.6MHz)

Best,

DebugFarp.lua

  • Thanks 1
Posted
On 7/14/2024 at 2:13 AM, Dangerzone said:

Actually, it seems DCS does scan new dynamic FARPS to see if they should be on the list. The problem is that there’s a function it calls (dynamicSpawnAvailable) to see if the FARP has DynSpawn enabled and as it doesn’t (no way at present to set it via lua code and its false by default) it bypasses those FARPS. 

I’ve managed to get this to work by modifying one of the lua files in the DCS install directory, but it is a hack.

It works when running a local MP mission on the client, but I have not yet tested at a dedicated server side level. 

But it does provide proof of concept. DCS does include new FARPs in its scan, so DCS can handle it, if they gave us the option to set the variable that we set in the mission editor for DynSpawn via LUA. Maybe there is already an option but they’re not telling us what the function is called yet. 

We also would need the option to set the stores. I’ve used a script that dynamically created FARPS previous for rearming and refueling that’s worked fine up until this release that is now broken since this patch.  For some reason they’ve changed new FARP creations from unlimited to empty by default.

If you want to know how to get a slot to show up on dynamically created FARPS, here’s how. 

I haven’t persisted with going further than that for now.  TBH, I’m quite discouraged at the moment from mission design in DCS.

When it finally seemed like what I’ve been dreaming of achieving for years is almost within reach, not only is it not, but it’s one step forward, 2 back with more things that used to work are broken (and talking to some others, it seems this change for default FARP parameters is intentional). So, just like the event_dead on cows that was working and has been removed for 2 years, (and I’m now told “it’s intentional to not have it anymore on cows”), the impression I’m getting lately is that nothing is safe. What other work I’ve done is next on the chopping block to be permanently removed at some stage in the future, by intentional design, with no plans to give it back- or at the least take a long time before those features are made available again?

Bugs are one thing, but removals of previous functionality of change of design, while leaving no simple options for us to have backwards compatibility to still maintain existing functionality is another. (Why would they change FARP from defaulting to unlimited to not without giving us an option to switch it back to unlimited via lua?) 😢

Maybe it’s my fault, wanting to design a complex dynamic MP mission/server campaign that ‘s up there with the big ones. I see the potential DCS has and want to get there. I keep finding ways to overcome DCSs limitations which gives me hope, but then see intentional changes made in newer releases that breaks themis disheartening. So is having no feedback on whether ED has any intention of allowing us DynSpawn on DynFarps.

I sometimes think that the CB team get more info on the direction things are going, so they have time to prepare their missions and servers in advance before release, which is why they can maintain their missions easier and prepare for things that break, and the only way to succeed in having a complex 24/7 MP server is to be in the inner circle. But then seeing Enigma’s video of why he left and identifying with his struggles, has me realising while it’s probably somewhat helpful and would solve some of the issues, there is still a lot to deal with even then.

I’m not sure if I’m being rational with my thinking, or I just had some bad nights sleep, but I do feel like I need a lifeline atm to restore my enthusiasm in mission design. Has me wondering how other designers are going, and if it’s just me that’s struggling. 

FARPs were spawning with nukes and unlimited contents which made both spawning farps risky in muliplayer for abuse and breaks the point of a warehouse which needs to be limited as a pre requisite to dynamic spawns which had to be controlled by server owners.

The API was given to us to set the numbers easily, its simple to use and we've requested the ability for dynamic spawns to come from it and limited/unlimited switches.

We all get tired, trust me this month, im pretty burned with all the change, take it easy.

🙂

  • Like 1

___________________________________________________________________________

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

Posted (edited)
4 hours ago, Pikey said:

FARPs were spawning with nukes and unlimited contents which made both spawning farps risky in muliplayer for abuse and breaks the point of a warehouse which needs to be limited as a pre requisite to dynamic spawns which had to be controlled by server owners.

The API was given to us to set the numbers easily, its simple to use and we've requested the ability for dynamic spawns to come from it and limited/unlimited switches.

We all get tired, trust me this month, im pretty burned with all the change, take it easy.

🙂

Hi Pikey,

So it's your fault - and this was a feature request!?!  What were you thinking?  😉 

Nah - the amount that you and the other guys put in to make scripting available to us - I trust that the change then is in the wider communities best interest. I'm constantly grateful for all the resources and support that you guys do, so I'll defer to your better judgement. 🙂 

But thank you for requesting the ability for dynamic spawns to have limited/unlimited switches to cater for us who think... 'differently'.. This will be perfect, to allow for backwards compatibility and give everyone what they need. Hopefully this will be in the next DCS patch so I don't have to wait too long for my older missions/scripts to work again. Is there any chance that including dynamic spawn as a switch/option to turn on and off in the API was also requested?  

If I feel burned out, I can only imagine how much more challenging it must be for you - especially with so many more people relying on you than me! Once again, thank you very much for the work you do and for taking the time to explain the bigger picture behind these changes, and for requesting a limited/unlimited switch! 

Take care, and have a great weekend!

DZ

Edited by Dangerzone
  • Like 1
  • 2 weeks later...
Posted

Hi all..

Not sure if I test correctly.  it seems that the SETITEM function and ADDITEM only works for players that are online at the moment that was executed.   

Posted
On 7/13/2024 at 5:11 PM, NeedzWD40 said:

So there is a way, but it's incredibly inconvenient and has its own limitations, but it does work (at least, for the server side):

The warehouses file is where our dynamic spawn locations are listed, which unfortunately we can't change (yet) via scripting. However, we can fool the game into working with this by creating fake entries linked to IDs assigned by us. We can then create a FARP object with the ID as defined in the warehouse file anywhere we wish, with the caveat we can only do so once. This means that we can only have a limited number of dynamically created FARPs with spawn points that, once set, cannot be moved after they've been set. If it were possible to delete FARPs after creation, we could probably circumvent this rule, but as it stands, once a FARP object has been created, it's there forever.

You could have a list of 10-20 or however many FARPs you wanted with reserved IDs manually added to the warehouses file, then use and discard this reserved ID list until depleted, at which point it would be set in stone. I'm including an example mission where a F10 command is utilized to generate a FARP with dynamic slots with this method. I cannot say if this mechanism will work for all clients, only that it works on the server side.

dyn_spawn_tester.miz 52.12 kB · 7 downloads

I finally was able to check this on my server and your solution worked excellent. thanks a lot for that.. 

Posted
On 7/19/2024 at 5:27 AM, Pikey said:

The API was given to us to set the numbers easily, its simple to use and we've requested the ability for dynamic spawns to come from it and limited/unlimited switches.

Hi Pikey,

Do you know if anything was implemented in this latest update that would allow us to use Dynamic Spawn from Dynamically created FARPS?

Cheers

DZ

  • 2 weeks later...
Posted (edited)

Some more storage items as added to Moose.lua
 

-- Gazelle

ENUMS.Storage.weapons.Gazelle.HMP400_100RDS = {4,15,46,1771}

ENUMS.Storage.weapons.Gazelle.HMP400_200RDS = {4,15,46,1770}

ENUMS.Storage.weapons.Gazelle.HMP400_400RDS = {4,15,46,1769}

ENUMS.Storage.weapons.Gazelle.GIAT_M261_AP = {4,15,46,1768}

ENUMS.Storage.weapons.Gazelle.GIAT_M261_SAPHEI = {4,15,46,1767}

ENUMS.Storage.weapons.Gazelle.GIAT_M261_HE = {4,15,46,1766}

ENUMS.Storage.weapons.Gazelle.GIAT_M261_HEAP = {4,15,46,1765}

ENUMS.Storage.weapons.Gazelle.GIAT_M261_APHE = {4,15,46,1764}

ENUMS.Storage.weapons.Gazelle.GAZELLE_IR_DEFLECTOR = {4,15,47,680}

ENUMS.Storage.weapons.Gazelle.GAZELLE_FAS_SANDFILTER = {4,15,47,679}

-- Chinook

ENUMS.Storage.weapons.CH47.CH47_PORT_M60D = {4,15,46,2476}

ENUMS.Storage.weapons.CH47.CH47_STBD_M60D = {4,15,46,2477}

ENUMS.Storage.weapons.CH47.CH47_AFT_M60D = {4,15,46,2478}

ENUMS.Storage.weapons.CH47.CH47_PORT_M134D = {4,15,46,2482}

ENUMS.Storage.weapons.CH47.CH47_STBD_M134D = {4,15,46,2483}

ENUMS.Storage.weapons.CH47.CH47_AFT_M3M = {4,15,46,2484}

ENUMS.Storage.weapons.CH47.CH47_PORT_M240H = {4,15,46,2479}

ENUMS.Storage.weapons.CH47.CH47_STBD_M240H = {4,15,46,2480}

ENUMS.Storage.weapons.CH47.CH47_AFT_M240H = {4,15,46,2481}
-- Huey

ENUMS.Storage.weapons.UH1H.M134_MiniGun_Right = {4,15,46,161}

ENUMS.Storage.weapons.UH1H.M134_MiniGun_Left = {4,15,46,160}

ENUMS.Storage.weapons.UH1H.M134_MiniGun_Right_Door = {4,15,46,175}

ENUMS.Storage.weapons.UH1H.M60_MG_Right_Door = {4,15,46,177}

ENUMS.Storage.weapons.UH1H.M134_MiniGun_Left_Door = {4,15,46,174}

ENUMS.Storage.weapons.UH1H.M60_MG_Left_Door = {4,15,46,176}

-- Kiowa

ENUMS.Storage.weapons.OH58.FIM92 = {4,4,7,446}

ENUMS.Storage.weapons.OH58.MG_M3P100 = {4,15,46,2578}

ENUMS.Storage.weapons.OH58.MG_M3P200 = {4,15,46,2577}

ENUMS.Storage.weapons.OH58.MG_M3P300 = {4,15,46,2576}

ENUMS.Storage.weapons.OH58.MG_M3P400 = {4,15,46,2575}

ENUMS.Storage.weapons.OH58.MG_M3P500 = {4,15,46,2574}

ENUMS.Storage.weapons.OH58.Smk_Grenade_Blue = {4,5,9,484}

ENUMS.Storage.weapons.OH58.Smk_Grenade_Green = {4,5,9,485}

ENUMS.Storage.weapons.OH58.Smk_Grenade_Red = {4,5,9,483}

ENUMS.Storage.weapons.OH58.Smk_Grenade_Violet = {4,5,9,486}

ENUMS.Storage.weapons.OH58.Smk_Grenade_White = {4,5,9,488}

ENUMS.Storage.weapons.OH58.Smk_Grenade_Yellow = {4,5,9,487}

 

Edited by Apple
  • Like 3
  • 1 month later...
Posted

I need help. I've been trying to get the getInventory script to work, and so far have been unable. I simply don't know enough about scripting to know why it won't work. I thought the script posted at the beginning of this thread was a working example, and that by changing the name of the airbase, it would give a readout of the warehouse inventory. I'm replacing the airbase name in the script with Kandahar. It doesn't work for me. Don't even get an error message. Is there any way that someone could post a working example of the getInventory script? I'd sure appreciate it. Thanks in advance. 

Posted (edited)
6 hours ago, Magic_Jim said:

I need help. I've been trying to get the getInventory script to work, and so far have been unable. I simply don't know enough about scripting to know why it won't work. I thought the script posted at the beginning of this thread was a working example, and that by changing the name of the airbase, it would give a readout of the warehouse inventory. I'm replacing the airbase name in the script with Kandahar. It doesn't work for me. Don't even get an error message. Is there any way that someone could post a working example of the getInventory script? I'd sure appreciate it. Thanks in advance. 

Have not tried this code, but would think it works. Might be as simple as the name being case sensitive. I my self use the airbase ID when working with airbases.

 

You can get out a list of the names by using this code:

https://wiki.hoggitworld.com/view/DCS_func_getAirbases

 

You just need to add :

env.info(info.callsign)

This will list all airbase call sign to the DCS.log

or

trigger.action.outText(info.callsign , 10)
 

To get it in the message box up in the right corner in-game.

Edited by Kanelbolle
  • Like 1
Posted

@Kanelbolle

Thanks, Kanelbolle. Still haven't figured it out, but I appreciate the reply. I know so little about scripting that it's laughable, but I'm trying to learn. Wanting to build a logistics mission where FARPS have to be resupplied by helicopter, and trying to have an easy way of checking the FARPs inventory so pilots will know what to deliver to it.  

Posted
11 hours ago, Magic_Jim said:

@Kanelbolle

Thanks, Kanelbolle. Still haven't figured it out, but I appreciate the reply. I know so little about scripting that it's laughable, but I'm trying to learn. Wanting to build a logistics mission where FARPS have to be resupplied by helicopter, and trying to have an easy way of checking the FARPs inventory so pilots will know what to deliver to it.  

@Magic_Jim

To be honest, if you are a beginner to scripting lua i would not recommend starting with warehouse control. It's not the easiest part to learn from.

The things you want to accomplish is better to just simulate with triggers in the ME until you are further in to your lua learning phase.

 

Here is an example you can use a trigger to check if the cargo is in the zone and lower then an altitude.

cargo-delivered-trigger.jpg

  • Like 1
Posted

Thanks, Kanelbolle. Appreciate the input. However, if this was something that I could do with triggers in the mission editor, I would not be looking at doing it with a script. 

Posted (edited)
15 hours ago, Magic_Jim said:

Thanks, Kanelbolle. Appreciate the input. However, if this was something that I could do with triggers in the mission editor, I would not be looking at doing it with a script. 

At the moment you actually can move ammo without scripts with dynamic cargo and the Ch-47, but you can't count how much you moved.

 

Anyway, if you are determined on trying to script it, I would look at this example:

https://forum.dcs.world/topic/332300-warehouse-control-functions/?do=findComment&comment=5282893

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

And look at the get command:

https://wiki.hoggitworld.com/view/DCS_func_getItemCount

 

You can also take a look at this script that saves Warehouse inventory for clues:

https://forum.dcs.world/topic/332310-script-release-simple-warehouse-saving-sws/#comment-5276682

 

But as i pointed out earlier, it's going to be hard building anything without the Lua experience. You should go through some Lua tutorials and learn the basic first

🙂

 

 

Edited by Kanelbolle
  • 5 weeks later...
Posted
On 9/14/2023 at 11:41 PM, Grimes said:

AFAIK they are unlimited for now. The warehouse info isn't saved in the mission file, its in the warehouse file within the miz. Thus there aren't any input parameters right now to define the warehouse functionality. 

Or so they were...

On 7/12/2024 at 4:38 AM, MarcosR said:

I think is relevant again... now the dynamic farps have nothing..  do we know if we will have a way to make dynamic faprs work again? 

I noted this, on our servers, with the dynamic missions we run (using our VEAF Mission Creation Tools).

The FARP that we spawn (via Mist) are now empty.

As a workaround, I used the API calls described in this post and setup the warehouse to full each time a FARP is spawned in my scripts.

Unfortunately, it seems that it works only randomly: I've got reports of people on multiplayer servers (BFR to name it) who looked at the same time, at the warehouse content for the same FARP, and they got a different result.

The only difference that I can find is that one of them (the one who'd got a full warehouse) spawned in the mission earlier than the second one.

This leads me to thinking that, maybe, the warehouse content is not synced with new pilots when they spawn; could that be the case?

@BIGNEWY please, could you ask the team to have a look into it? Ideally we'd love the option to spawn the FARPs already unlimited, as was the case before July 2024, but I can live with a correction to the server code, if my assumption was right.

Thank you!

Full warehouse from one point of view:

image.png?ex=67321cb9&is=6730cb39&hm=508

Empty warehouse from another (same time, same FARP):

image.png?ex=67321cec&is=6730cb6c&hm=113

 

Zip - VEAF :pilotfly:

 

If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum

If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !

Posted

Well, it's even worse than I thought.

To work around this network sync problem, I've scheduled the resupply code to run each time a human spawns in the mission (using the S_EVENT_BIRTH event).

Even with this ugly hack, it gives weird results.

I set all the liquids in the warehouses to 5000kg + a random value between 1 and 100, and all the items to 50000 + a random value between 1 and 100. This is because if I don't use a random number, sometimes the warehouse does not get filled.

Even there, I've got problems with people connecting and seeing weird things.

Correct inventory, after logging in:

image.png?ex=67372895&is=6735d715&hm=40e

Wrong inventory, after logging out and in again:

image.png?ex=673728ed&is=6735d76d&hm=b36

This is so weird...

Can someone help me please, this is a critical problem for BFR, their dynamic missions rely on spawning FARPs to unlock areas of the map.

@BIGNEWY I don't know what to do, I could attach a trk but it's not going to be very useful.

Zip - VEAF :pilotfly:

 

If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum

If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !

Posted (edited)

Thank you @BIGNEWY!

Just to give you some additional info, I added logging to my mission and, when running on a dedicated MP server, it goes like that:

image.png

Edited by davidp57

Zip - VEAF :pilotfly:

 

If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum

If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !

Posted
44 minutes ago, davidp57 said:

Thank you @BIGNEWY!

Just to give you some additional info, I added logging to my mission and, when running on a dedicated MP server, it goes like that:

image.png

 

I'm also experiencing this (the warehouse not reflecting the correct fuel levels).
It works correctly when running with the local server (from the mission editor -> Launch Multiplayer Mission).

Posted (edited)

I was trying to use SWS.lua to extract some weapon codes but im unable to find what is the code for the OH-58D APKWS guided rockets.

Could someone help me out find it?

I´ve tried with 4,7,33,147 but it seems incorrect. Thanks for any help

An updated file with all codes would be welcomed also.

Edited by Esac_mirmidon
  • Like 1

" You must think in russian.."

[sIGPIC][/sIGPIC]

 

Windows 7 Home Premium-Intel 2500K OC 4.6-SSD Samsung EVO 860- MSI GTX 1080 - 16G RAM - 1920x1080 27´

 

Hotas Rhino X-55-MFG Crosswind Rudder Pedals -Track IR 4

  • Recently Browsing   0 members

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