Jump to content

Recommended Posts

Due to 3den enhanced editor allows to set fuel amount in liters (fuel cargo volume)in vehicle attributes and due to there is, for example, static wagon tanker (Land_wagon_tanker is classname) who operates as refueling point, I am searching for a way to refuel that somehow. 

-Situation on the field looks like:

There is transport base sector with those wagons installed and every of them have working refueling ACE system.

There are trucks who need to enter this base and transports fuel on the field to helicopters, boats and other vehicles involved in separate operations accros the map.

Once the truck cistern or wagon volume of fuel is depleted, is there a way to refuel that?

-Setups and tried solutions:

1. Trigger activated by radio Alpha  onAct: MyFuelTruck setFuelCargo 1  (don't work-it stays the number of liters what I put in editor 1000 and if I refuel some vehicle with, for example 100 litres there is 900 left in truck/wagon due to I set it to 1000) then I fire the mentioned trigger or in debug console put this setFuelCargo 1;  or MyFuelTruck setFuelCargo 1 ; while sitting it that vehicle - nothing happens. (not added fuel in cistern tank).

2. All trucks have correct variable names same as ones in the onAct field of trigger

3. I know that I can place 10000 liters in Fuel Cargo Volume field and be good with fuel for upcoming 10 years but I search for some realistic environment of that base and also set up some addAction things which moves wagons by line of rails from big fuel reservoars to station logistical points in the middle of the base to simulate logistical operations inside base so I need refueling system to set up somehow.

Thanks guys I hope I am writte this understandably.

 

  • Like 1

Share this post


Link to post
Share on other sites

Is Land_wagon_tanker an addon? You can use:

https://community.bistudio.com/wiki/setFuelCargo

Quote

Waffle SS.

(ArmA 3 1.44) setFuelCargo will have no effect if the vehicle doesn't support getFuelCargo.

https://community.bistudio.com/wiki/getFuelCargo

If it doesn't support it then you could set custom variable with whatever volume. Not sure about 3den Enhanced addon but say the volume is above 1. You can use Math commands to change to fraction.

https://community.bistudio.com/wiki/Operators

Or something lol, it is late here. :)

 

PS: You can't use "this" in debug, use cursorObject (must look at it) or object var name.

  • Like 1

Share this post


Link to post
Share on other sites

I saw somewhere today this Waffle SS guy when searching for answer lol. I use object var name in debug but in fast posting I make that mistake so yes sir I understand that. I don't know is this wagon vanila or addon I think it is vanila but if it is not I will replace that with some vanila reservoar to avoid changing Math so that will be supported by getFuelCargo command. Also, I tried with vanila trucks (typhoon fuel and HEMTT fuel trucks) and the same problem again-there is no refueling in tanks after simple command setFuelCargo. :(  

Yes it is late now, hoping that in the morning someone will show up with some answer I already asked two trustworthy members but without succes so I must create topic.

Share this post


Link to post
Share on other sites

Where do you use setFuelCargo command?

https://community.bistudio.com/wiki/setFuel

This one is to set the fuel of the vehicle itself. The other is for like, refuel trucks cargo of fuel as you say. I haven't found any issues with either. Can you provide an example mission? Vanilla if possible as I don't use ACE, unless ACE is the issue?

Share this post


Link to post
Share on other sites

While I get ready vanila mission for you I will answer: I use truckname setFuelCargo 1 in the onAct field of trigger who fires on radio Alpha command with also a hint "refueling tried again" just to be sure that trigger is fired if hint show up and it show up every time but number of liters I addad in editor to Fuel Cargo Volume field is no changed after command truckname setFuelCargo 1; or truckname setFuelCargo 0; . Trucks are vanila for sure and wagon is not important due to I don't use wagon anymore until I figured out this on basic vanila staff. And one more thing to add to questions- How to check is the vehicle supported by getFuelCargo command? What returns value will be if it works? I use this command to check if is truck supproted but nothing happens..

Share this post


Link to post
Share on other sites

Link to mission.sqm 

I simplied than as much as possible and relocate to Utes. Everything inside is vaniled now :) 

https://www.dropbox.com/s/iatfr9su05filnt/mission.sqm?dl=0

And I forget to answer- Yes, setFuel works normal but, like you said that refill tank for truck itself not reservoar for refueling other vehicles. 

Share this post


Link to post
Share on other sites

Maybe this will point some direction:

One member said that I need to call this from debug while I sitting inside the vehicle and I do that: 

_maxFuelCargoAmount = getNumber (configfile >> "CfgVehicles" >> typeOf vehicle player >> "transportFuel"); _getLitersInTank = _maxFuelCargoAmount * getFuelCargo vehicle player; hint format ["%1 has %2 liters of fuel in the tank",typeof vehicle player, _getLitersInTank];

Hint appeared in upper right corner: min_rf_truck_fuel has -1.#IND liters of fuel in the tank" text in upper right 

I don't have clue what this means.

In enchanced editor you can set -1 to desable refueling from truck or -10 to be infinite amount inside volume.

 

Share this post


Link to post
Share on other sites

Sorry for late reply, easier to tag me in @HazJ (@username) so I get notification or just quote me. Works fine here. Your issue might be related to ACE? Are you testing in MP? I only tested in Editor but should still work.

 

  • Thanks 1

Share this post


Link to post
Share on other sites
5 hours ago, Nemanjic said:

Maybe this will point some direction:

One member said that I need to call this from debug while I sitting inside the vehicle and I do that: 

_maxFuelCargoAmount = getNumber (configfile >> "CfgVehicles" >> typeOf vehicle player >> "transportFuel"); _getLitersInTank = _maxFuelCargoAmount * getFuelCargo vehicle player; hint format ["%1 has %2 liters of fuel in the tank",typeof vehicle player, _getLitersInTank];

Hint appeared in upper right corner: min_rf_truck_fuel has -1.#IND liters of fuel in the tank" text in upper right 

I don't have clue what this means.

In enchanced editor you can set -1 to desable refueling from truck or -10 to be infinite amount inside volume.

 

 

As already stated via PM and by @HazJ, try it in vanilla without any mods. And with vanilla I mean 0 mods, not even eden enhanced or CBA or whatever, plain arma without any modifications.

If it's working there then it's most likely one of the mods messing with transportFuel of the vehicles.

min_rf_truck_fuel is definitely not a vanilla vehicle.

 

The snippet I sent you evaluates if a vehicle has a certain amount of fuel in its fuelCargo storage. Seeing how it returns -1.#IND basically means this vehicle is not compatible with the setFuelCargo/getFuelCargo commands, which I also pointed out via PM.

 

So basically this vehicle won't work using vanilla functionality, your best bet would be to either use vanilla vehicles or vehicles that are properly configured to work with the vanilla commands, or write your own fuel logistics script which can be fun on its own.

 

In vanilla you can set a vehicles fuelCargo to a certain volume in liters the following way:

 

//set fuel amount in liters:
_yourFuelTruck = test;
_newAmount = 900;
_yourFuelTruck setfuelcargo (_newAmount / (getNumber (configfile >> "CfgVehicles" >> typeOf test >> "transportFuel")));

//retrieve fuel amount in liters:
_maxFuelCargoAmount = getNumber (configfile >> "CfgVehicles" >> typeOf _yourFuelTruck >> "transportFuel"); 
_getLitersInTank = _maxFuelCargoAmount * getFuelCargo _yourFuelTruck; 
hint format ["%1 has %2 liters of fuel in the tank",typeof _yourFuelTruck, _getLitersInTank];

 

This also works for those support vehicles that have 1*10^12 liters of fuel (yes, that's a trillion, a 1 with 12 zeros, or 1.000.000.000.000 liters...) due to BIs decision to rather apply a quick fix than using more authentic numbers.

Hope everything got cleared up, if not feel free to ask.

 

Cheers

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Here I am here I am. Was sleeping. Thank you guys for trying. 

5 hours ago, Grumpy Old Man said:

min_rf_truck_fuel is definitely not a vanilla vehicle.

Understand sir but after that I was try with real vanila like typhoon CSAT's truck just like in video the @HazJ post. (He just relocete .sqm to VR and kicked mods out,but it is practicly the same mission). Okay, so if I understand you guys well there is too ways to make this work: Using only vanila vehicles or vehicles who support getFuel command or just avoid ACE refueling system because ACE make troubles with config of vehicles.

To HazJ: No sir, I only test in singleplayer in editor and now I will try with totaly vanila game even without CBA and will report soon. I was planned to make mission for multiplayer for friends but stucked here. If I have luck will post this base on armaholic it is big but clean tactical base operations detailed and functional. It is in the Almyra region on Altis but you will not recognize the region after put base there :)  

Will report soon with vanila testing.

Share this post


Link to post
Share on other sites

Sorry I could not post earlier due to my gf was here playing sims and having problems to record desktop with fraps even when monitor aero desktop is checked to make better picture to you what I was doing with codes but I manage to make video only from game inside so I will writte what I was trying with codes.. Sory up here I am now with detailed finished testing about subject I hop we are still on same page here. So:

In part one of video I do the same as it shows with trigger commands and it look like it works (total vanila with no mods loaded) but in second part, where @Grumpy Old Man said to define volume of vanila truck I put in init.sqf : _yourFuelTruck = test; _newAmount = 900; _yourFuelTruck setfuelcargo (_newAmount / (getNumber (configfile >> "CfgVehicles" >> typeOf test >> "transportFuel")));   then go to game, preview and check from debug from inside the vehicle:   _maxFuelCargoAmount = getNumber (configfile >> "CfgVehicles" >> typeOf _yourFuelTruck >> "transportFuel"); _getLitersInTank = _maxFuelCargoAmount * getFuelCargo _yourFuelTruck; hint format ["%1 has %2 liters of fuel in the tank",typeof _yourFuelTruck, _getLitersInTank];

and you see output of that in video. I presume that I do something wrong in init.sqf to define trucks cargo volume or something like that?  

video: https://www.dropbox.com/s/fwcl9g4x8pfhh5i/a.mp4?dl=0

Share this post


Link to post
Share on other sites

When I change truck variable to "test", same as in the init.sqf it returns value of 900 liters normaly like 3000 liters when not set config manualy with code. So it works like you said @Grumpy Old Man  and thats more cleaner now then yesterday to me. Is there way to manipulate with volumes of non-vanila vehicles? Any way? Scripting? I will try it hard if it requires coding just need direction and little more help?

Share this post


Link to post
Share on other sites
14 minutes ago, Nemanjic said:

When I change truck variable to "test", same as in the init.sqf it returns value of 900 liters normaly like 3000 liters when not set config manualy with code. So it works like you said @Grumpy Old Man  and thats more cleaner now then yesterday to me. Is there way to manipulate with volumes of non-vanila vehicles? Any way? Scripting? I will try it hard if it requires coding just need direction and little more help?

 

As long as they're configured properly by the mod author you can use setFuelCargo/getFuelCargo, should work just fine.

If the vanilla commands don't work feel free to ask the mod author for a solution.

 

Cheers

Share this post


Link to post
Share on other sites
1 minute ago, Grumpy Old Man said:

As long as they're configured properly by the mod author you can use setFuelCargo/getFuelCargo, should work just fine.

If the vanilla commands don't work feel free to ask the mod author for a solution.

So there is unique way for every single vehicle? There is no universal way for config and read config of non-vanila staff? 

Share this post


Link to post
Share on other sites
7 minutes ago, Nemanjic said:

So there is unique way for every single vehicle? There is no universal way for config and read config of non-vanila staff? 

Well there's a guideline for configs when making a vehicle.

If a mod author doesn't keep to it there's only so much you can do.

 

Best bet is to always use vanilla assets where possible, or find mod vehicles that work with vanilla commands (which is a very specific case regarding getFuelCargo/setFuelCargo).

 

Cheers

 

  • Thanks 1

Share this post


Link to post
Share on other sites

One more thing maybe it will be useful to someone who looking for manipulate fuel volume in tanks.

It is not up to ACE or Enchanced 3den or any mod it is just to Cfg of vehicles like is decribed in upper Grumpy's posts.

Tested with moded vehicles like Sweden Tgb40 fuel truck and even MCC fuel container can be manipulated through this codes, so they are supported by getFuelCargo command.

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×