Automatic fuel filling

ProtossMaster

New Member
On lingor island you can have your vehicle automatically refilled at gas tanks. Is it possible to implement this into chernarus?
 
There is a workaround, not the most elegant but it works. There is an item you plop down in the editor - I think it is an ammo box - that automatically refuels a vehicle. The ammo boxes don't function in any way for storage or have any weapons in them but they serve a purpose to refuel. I could imagine you put them down at the refuel points you want, maybe the gas stations auto refuel, but the rural tanks require gas cans.
 
I think it is done in the mission file but not sure. Might want to look through the lingor mission file and see if you can copy over.
yeah ill take a look
There is a workaround, not the most elegant but it works. There is an item you plop down in the editor - I think it is an ammo box - that automatically refuels a vehicle. The ammo boxes don't function in any way for storage or have any weapons in them but they serve a purpose to refuel. I could imagine you put them down at the refuel points you want, maybe the gas stations auto refuel, but the rural tanks require gas cans.
makes sense why you dont place them at rural tanks. Ill explore this option aswell.
 
I suppose the tanks don't have a pump like a gas station would have, and thus necessitate the cans. Just a nod to a sense of realism / needing the cans for something. Risk vs Reward mechanic. Fueling at a gas station is quicker, but riskier because they may be in a more populated place while rural tanks don't have a pump, are removed from population but may require a bit of time / effort to refuel.
 
There is no electricity, fuel pumps don't work without it. ;)

I'd add generators via building spawns near any place you wanted to auto-fuel so it makes sense and gives some indication of which ones will, and which ones won't.
 
Create a trigger (blufor present)

Condition:
this and ((getpos (thislist select 0)) select 2 < 1)
OnAct:
_xhandle= [(thislist select 0)] execVM "scripts\x_reload.sqf";

I had a look at it, what do you think?

// by Xeno Edited by MattzFiber for DayZ
private ["_config","_count","_i","_magazines","_object","_type","_type_name"];

_object = _this select 0;

_type = typeof _object;

if (_object isKindOf "ParachuteBase") exitWith {};

if (isNil "x_reload_time_factor") then {x_reload_time_factor = 1;};

if (!alive _object) exitWith {};
_object setFuel 0;

_type_name = typeOf _object;

_object vehicleChat format ["Filling %1... Please wait...", _type];

// _magazines = getArray(configFile >> "CfgVehicles" >> _type >> "magazines");

sleep x_reload_time_factor;
if (!alive _object) exitWith {};
_object vehicleChat "Repairing...";
_object setDamage 0;
sleep x_reload_time_factor;
if (!alive _object) exitWith {};
_object vehicleChat "Refueling...";
while {fuel _object < 0.99} do {
//_object setFuel ((fuel _vehicle + 0.1) min 1);
_object setFuel 1;
sleep 0.01;
};
sleep x_reload_time_factor;
if (!alive _object) exitWith {};
_object vehicleChat format ["%1 is ready...", _type_name];

if (true) exitWith {};

I am new to this, tell me if it will not work at all :p
Then add a trigger in the mission editor for all of the gas stations, and put it into the DayZ mission file?
Correct me if I am wrong :)
 
I worked on this all night and have got it into DayZ and have it working without script restrictions or errors...
It is done!!!
The player drives up to the pumps, the engine turns off, a message pops up, car refuels (levels move realistically) and then a message saying its done pops up once again, it also works when in a helli...

Please post if you would like to know more XD
Now to get some well earned sleep!
 
I would like to get this working on my chernarus map as well, only difference is i would like it to be initiated by using the scroll wheel, and not have the vehicle turn off.

Im running the latest dayzbliss(if that matters), and so far ive gotten all of the triggers placed, just not sure how to edit the sqf to get the function i want

edit: from what i gather from searching around to add the scroll menu i need to use addAction just not sure where to put it in the code
 
Back
Top