Jump to content
Sign in to follow this  
stinkypinky

Auto refuel not working

Recommended Posts

Hello,

 

I am administrating a DayZ Chernarus Private Hive server 1.7.7.1 through HFB and I am having some difficulty editing PBO's. In particular, the dayz_1.chernarus mission file pbo.

 

For whatever reason, I am not able to refuel anywhere on my server. I am hoping that an auto refuel script might solve the problem, so I downloaded this https://github.com/MattzFiber/DayZ-Fuel-Script from GitHub and followed instructions provided. This was my process:

 

I downloaded my mission file, dayz_1.chernarus, from the MPMission files directory on my server to my desktop.

 

HMuIYyD.jpg

 

I then extracted it's contents onto my desktop using PBO Manager.

 

2JtIrlK.jpg

 

So, I now had a folder on my desktop of the pbo contents called dayz_1.chernarus. Following the instructions that accompanied the "DayZ-Fuel-Script-master" file I got from GitHub, I place the "scriptsMZ" folder into my new dayz_1.chernarus pbo folder.

 

LYr7VLt.jpg

 

After that, I edited the mission.sqm (according to author's instruction) in this fashion:

 

ssTxeip.jpg

 

I used BinPBO to pack the new dayz_1.chernarus pbo:

 

3zpnqyp.jpg

 

And then reopened with PBOManager to check the contents and then locked it.

 

KGNFRY1.jpg?1

 

 

Share this post


Link to post
Share on other sites

Finally, I uploaded the modified dayz_1.chernarus pbo to the proper directory on my server. MPMissions/dayz_1.chernarus

 

When I start my server and after waiting for 2 minutes, I try to join and get this:

 

IT F**KING WORKS!!! HOLY F**KING CHRIST IT WORKS!!!

 

Sorry, guys. I swear, I tried this 42 times and got the "Wait for Host" error every time and now it works!

Share this post


Link to post
Share on other sites

another way...

 

inside your mission folder edit your init.sqf

 

After

 

if (!isDedicated) then {

 

add

 

[] execVM "Scripts\kh_actions.sqf";

 

so it looks like this..

if (!isDedicated) then {[] execVM "Scripts\kh_actions.sqf";

 

Next create a folder inside your mission root called "Scripts" and place the file "kh_actions.sqf" and "kh_vehicle_refuel.sqf"

 

and your done.

 

kh_actions.sqf

private ["_vehicle", "_vehicle_refuel_id"];//Awesomely Edited by Seven, Then modified by Muddr_vehicle = objNull;diag_log "Running ""kh_actions""."; _distance = 15; // Distance from object to display Refuel Message_amount= 0.02; // Amount of fuel to add per loop. Default was 0.005 while {true} do{    if (!isNull player) then {        private ["_currentVehicle", "_isNearFeed", "_countFuel"];                _currentVehicle = vehicle player;                _countFuel = (count ((position _currentVehicle) nearObjects ["Land_Fuel_tank_big", _distance]));                _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_A_FuelStation_Feed", _distance]));                _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_Ind_TankSmall", _distance]));                _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_Ind_TankSmall2", _distance]));                _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_Ind_TankSmall2_EP1", _distance]));                _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_fuel_tank_stairs", _distance]));                _isNearFeed = _countFuel > 0;         if (_vehicle != _currentVehicle) then {            if (!isNull _vehicle) then {                _vehicle removeAction _vehicle_refuel_id;                _vehicle = objNull;            };             if (_currentVehicle != player && _isNearFeed && !(_currentVehicle isKindof "Bicycle")) then {  //change "Bicycle" to "Land" to allow only air vehicles to aut-refuel                _vehicle = _currentVehicle;                 _vehicle_refuel_id = _vehicle addAction ["Refuel", "Scripts\kh_vehicle_refuel.sqf", [_amount], -1, false, true, "", "vehicle _this == _target && local _target"];            };        };         if (!_isNearFeed) then {            _vehicle removeAction _vehicle_refuel_id;            _vehicle = objNull;        };    };    sleep 2;}

 

kh_vehicle_refuel.sqf

 

private ["_target", "_caller", "_id"]; _target = _this select 0;_caller = _this select 1;_id = _this select 2;_args = _this select 3;_amount = _args select 0; if (isNil "ib_refueling_in_progress") then { ib_refueling_in_progress = false; }; if (!ib_refueling_in_progress) then {         ib_refueling_in_progress = true;         titleText ["Refueling", "PLAIN DOWN", 3];         while {(vehicle _caller == _target) and (local _target)} do {                private ["_velocity", "_cfcust"];                 _velocity = velocity _target;                _cfcust = fuel _target;                 if ((_velocity select 0 > 1) or (_velocity select 1 > 1) or (_velocity select 2 > 1)) exitWith {                        titleText ["Refueling Stopped", "PLAIN DOWN", 3];                };                if (_cfcust >= 1.0) exitWith {                        titleText ["Done Refueling", "PLAIN DOWN", 3];                };                 sleep 0.5;                 _cfcust = _cfcust + _amount;                 if (_cfcust >= 1.0) then { _cfcust = 1.0; };                 _target setFuel _cfcust;        };         titleFadeOut 1;         ib_refueling_in_progress = false;};
  • Like 1

Share this post


Link to post
Share on other sites

Ok, I've narrowed the previous error in my process down too tool settings. When using BinPBO to pack the edited pbo folder, I needed to manually include some file extensions to be directly written to the pbo file it will create. It turns out that .ext and .sqm files were not enabled in the default of BinPBO's settings. So when I tried to pack my pbo folder/files, the .ext and .sqm files were being excluded. I know this is a funky way of providing a Noob-Level Tutorial, however maybe this thread can help other folks who are just getting started with mod additions.

 

Thanks for watching and good evening.

 

Joe

Share this post


Link to post
Share on other sites

use PBOmanager I find it much better than all the rest of the other pbo applications.

Share this post


Link to post
Share on other sites

Right on. The problem I am having with PBO Manager is that I don't get the option to pack pbo files with it. I believe I'm supposed to be able to right-click on a pbo folder and get an option to pack it using PBO Manager, however the option is not there. Maybe I'm not using it correctly.

Edited by stinkypinky

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
Sign in to follow this  

×