Jump to content

[Release] Vehicle Service Point (Refuel, Repair, Rearm) [Script]


Axe Cop

Recommended Posts

Nope just learning yet and thought i had t working as I wanted to use those also.

 

So, I based it off the last change you made on the previous page

 

"to use fuel trucks as mobile service points, I use that on my server. Just change the config in the service_point.sqf like this:

_servicePointClasses = dayz_fuelpumparray + DZE_fueltruckarray;"

 

and it worked, although I learned you need to test stuff out a bit more than just trying it out once before you make a post about it. Since it worked to well as in always on when you get in a vehicle.

Link to comment
Share on other sites

Nope just learning yet and thought i had t working as I wanted to use those also.

 

So, I based it off the last change you made on the previous page

 

"to use fuel trucks as mobile service points, I use that on my server. Just change the config in the service_point.sqf like this:

_servicePointClasses = dayz_fuelpumparray + DZE_fueltruckarray;"

 

and it worked, although I learned you need to test stuff out a bit more than just trying it out once before you make a post about it. Since it worked to well as in always on when you get in a vehicle.

I am not sure what you are saying with your post? your changes worked? ALso i have no idea what you mean with the testing part, do you mean my script or the changes??

to clarify this dayz_fuelpumparray and DZE_fueltruckarray are already defined arrays in Epoch, that is why its working.. i am pretty sure I have posted that somewhere what is in that lists by default. :)

my script uses a single array with class names to define service points and they have to be in quotes for ArmA script to make use of it, e.g.: ["classA", "classB", "classC"]

Link to comment
Share on other sites

Yes mine worked also, but it works whenever I get in any vehicle anywhere. Only that wasn't my intent.

 

And i meant testing my stuff not yours.  You know what you're doing and I am just learning from you and others here. 

 

I got ahead of myself and thought I had worked something out ...but learned from it.

Link to comment
Share on other sites

You should check your log file for errors, or start the game with the option "-showScriptErrors".. but it is not always easy to debug ArmA script I tell you that :)

Maybe I will write my own simple developers tools because none of the existing ones do work with Epoch.. or I am to stupid to get them to work :D

Link to comment
Share on other sites

i have porblem when i join the server my screen is just black and then if i press esc im in debug zone im using 1.0.3.1

 

heres my init file ;)

 

/*
For DayZ Epoch
Addons Credits: Jetski Yanahui by Kol9yN, Zakat, Gerasimow9, YuraPetrov, zGuba, A.Karagod, IceBreakr, Sahbazz
*/
startLoadingScreen ["","RscDisplayLoadCustom"];
cutText ["","BLACK OUT"];
enableSaving [false, false];
 
//REALLY IMPORTANT VALUES
dayZ_instance = 3811; //The instance
dayzHiveRequest = [];
initialized = false;
dayz_previousID = 0;
 
// Enabling this option will disable the instant map features involving player healing and loadout changes
dayz_REsec = 0; // DayZ RE Security / 1 = enabled // 0 = disabled
 
//disable greeting menu 
player setVariable ["BIS_noCoreConversations", true];
//disable radio messages to be heard and shown in the left lower corner of the screen
enableRadio false;
// May prevent "how are you civillian?" messages from NPC
enableSentences false;
 
// DayZ Epoch config
spawnShoremode = 1; // Default = 1 (on shore)
spawnArea= 1500; // Default = 1500
MaxHeliCrashes= 5; // Default = 5
MaxVehicleLimit = 100; // Default = 50
MaxDynamicDebris = 100; // Default = 100
dayz_MapArea = 14000; // Default = 10000
dayz_maxLocalZombies = 30; // Default = 30 
 
dayz_paraSpawn = false;
 
dayz_minpos = -1; 
dayz_maxpos = 16000;
 
dayz_sellDistance_vehicle = 10;
dayz_sellDistance_boat = 30;
dayz_sellDistance_air = 40;
 
dayz_maxAnimals = 8; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0
DynamicVehicleDamageHigh = 85; // Default: 100
DynamicVehicleFuelLow = 0;
DynamicVehicleFuelHigh = 35;
 
DZE_vehicleAmmo = 1; //Default = 0, deletes ammo from vehicles with machine guns every restart if set to 0.
DZE_BackpackGuard = false; //Default = True, deletes backpack contents if logging out or losing connection beside another player if set to true.
DZE_BuildingLimit = 150; //Default = 150, decides how many objects can be built on the server before allowing any others to be built. Change value for more buildings.
DZE_TRADER_SPAWNMODE = false; //Vehicles bought with traders will parachute in instead of just spawning on the ground.
EpochEvents = [["any","any","any","any",30,"crash_spawner"],["any","any","any","any",0,"crash_spawner"],["any","any","any","any",15,"supply_drop"]];
dayz_fullMoonNights = true;
 
//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf"; //Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf"; //Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions
progressLoadingScreen 0.5;
call compile preprocessFileLineNumbers "server_traders.sqf"; //Compile trader configs
progressLoadingScreen 1.0;
 
"filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
 
if (isServer) then {
call compile preprocessFileLineNumbers "\z\addons\dayz_server\missions\DayZ_Epoch_11.Chernarus\dynamic_vehicle.sqf";
//Compile vehicle configs
 
// Add trader citys
_nil = [] execVM "\z\addons\dayz_server\missions\DayZ_Epoch_11.Chernarus\mission.sqf";
_serverMonitor = [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
};
 
if (!isDedicated) then {execVM "service_point\service_point.sqf"
//Conduct map operations
0 fadeSound 0;
waitUntil {!isNil "dayz_loadScreenMsg"};
dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
 
//Run the player monitor
_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
_playerMonitor = [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
 
// Anti Hack 
if (true) then {
 
//Lights
if (true) then {
//[0,0,true,true,true,58,280,600,[0.698, 0.556, 0.419],"Generator_DZ",0.1] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
};
};
 
if (dayz_REsec == 1) then {
#include "\z\addons\dayz_code\system\REsec.sqf"
};
 
//Start Dynamic Weather
if(true) then {
execVM "\z\addons\dayz_code\external\DynamicWeatherEffects.sqf";
};
 
#include "\z\addons\dayz_code\system\BIS_Effects\init.sqf"
Link to comment
Share on other sites

When I was testing this on my server after updating to 1.0.3 it worked, but then sometime afterwards I noticed it wasn't working. I'm updating to 1.0.3.1 now and I'm trying to get this work again. It's a very simple script and should be easy, but for some reason it's not working.

 

Here's the "is dedicated" section of my init.sqf:

if (!isDedicated) then {
//Conduct map operations
0 fadeSound 0;
waitUntil {!isNil "dayz_loadScreenMsg"};
dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
 
_nil = [] execVM "custom\remote_messages\remote_messages.sqf";
[] execVM "custom\loadout\loadout.sqf";
[] execVM "custom\markers\custommarkers.sqf";
[] execVM "debug\addmarkers.sqf";
[] execVM "debug\addmarkers75.sqf"; 
[] execVM "custom\service_point\service_point.sqf";
 
//Run the player monitor
_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
_playerMonitor =  [] execVM "\z\addons\dayz_code\system\player_monitor.sqf"; 
 
//anti Hack
[] execVM "\z\addons\dayz_code\system\antihack.sqf";
 
//Lights
//[0,0,true,true,true,58,280,600,[0.698, 0.556, 0.419],"Generator_DZ",0.1] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
 
};
 
The script and it's files are located in custom\service_point and I've set the "folder" line in service_point.sqf to this:
 
_folder = "custom\service_point\"; // folder where the service point scripts are saved, relative to the mission file
 
When I pull up to a gas station, no option to refuel/rearm/repair. What simple mistake am I making!? :)
Link to comment
Share on other sites

 

When I was testing this on my server after updating to 1.0.3 it worked, but then sometime afterwards I noticed it wasn't working. I'm updating to 1.0.3.1 now and I'm trying to get this work again. It's a very simple script and should be easy, but for some reason it's not working.

 

Here's the "is dedicated" section of my init.sqf:

if (!isDedicated) then {
//Conduct map operations
0 fadeSound 0;
waitUntil {!isNil "dayz_loadScreenMsg"};
dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
 
_nil = [] execVM "custom\remote_messages\remote_messages.sqf";
[] execVM "custom\loadout\loadout.sqf";
[] execVM "custom\markers\custommarkers.sqf";
[] execVM "debug\addmarkers.sqf";
[] execVM "debug\addmarkers75.sqf"; 
[] execVM "custom\service_point\service_point.sqf";
 
//Run the player monitor
_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
_playerMonitor =  [] execVM "\z\addons\dayz_code\system\player_monitor.sqf"; 
 
//anti Hack
[] execVM "\z\addons\dayz_code\system\antihack.sqf";
 
//Lights
//[0,0,true,true,true,58,280,600,[0.698, 0.556, 0.419],"Generator_DZ",0.1] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
 
};
 
The script and it's files are located in custom\service_point and I've set the "folder" line in service_point.sqf to this:
 
_folder = "custom\service_point\"; // folder where the service point scripts are saved, relative to the mission file
 
When I pull up to a gas station, no option to refuel/rearm/repair. What simple mistake am I making!? :)

 

worked fine for me just installed it how it came didn't change anything and it worked fine for me running Epoch 1.0.3.1 on panthera

if you have a custom variables.sqf try checking this line is there

dayz_fuelpumparray = ["FuelPump_DZ","Land_A_FuelStation_Feed","Land_Ind_FuelStation_Feed_EP1","Land_FuelStation_Feed_PMC","FuelStation","Land_ibr_FuelStation_Feed","Land_fuelstation_army","Land_fuelstation","land_fuelstation_w","Land_benzina_schnell"];

Link to comment
Share on other sites

I don't see any error in your init.sqf, should work like that. Did you check your report file? there should be a line like "AC_functions" in there when the service point gets executed (from the ac_functions.sqf file)?

the location of the client report file is usually "C:\Users\YOURNAME\AppData\Local\ArmA 2 OA\arma2oa.RPT"

Link to comment
Share on other sites

I don't have a custom variables.sqf. Do you have [] execVM "custom\service_point\service_point.sqf"; in the same place as me?

 

"Land_A_FuelStation_Feed" should allow you to refuel/rearm/repair and any fuel pump as long as it's not one put there by a player, right?

edit: could be a custom AH like infistars AH removing the addactions ?

my if (!isDedicated) code block looks like this

if (!isDedicated) then {
	//Conduct map operations
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
	"heliCrash" addPublicVariableEventHandler 
	{
		_list = nearestObjects [_this select 1, ["CraterLong"], 100];
		{deleteVehicle _x;} foreach _list;
	};
	//Run the player monitor
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	_playerMonitor = [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
	_nul = [] execVM "service_point\service_point.sqf";//Repair, Reammo, Refuel script
	_nul = [] execVM "Custom\cly_easyfly.sqf";//random script from Armaholic thats cool
	_nul = [] execVM "Custom\baseZeds.sqf";//remove zeds near plotpoles
};
Link to comment
Share on other sites

I don't see any error in your init.sqf, should work like that. Did you check your report file? there should be a line like "AC_functions" in there when the service point gets executed (from the ac_functions.sqf file)?

the location of the client report file is usually "C:\Users\YOURNAME\AppData\Local\ArmA 2 OA\arma2oa.RPT"

 

The RPT file doesn't have any reference to the ac_functions.sqf file.

 

 

edit: could be a custom AH like infistars AH removing the addactions ?

my if (!isDedicated) code block looks like this

if (!isDedicated) then {
	//Conduct map operations
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
	"heliCrash" addPublicVariableEventHandler 
	{
		_list = nearestObjects [_this select 1, ["CraterLong"], 100];
		{deleteVehicle _x;} foreach _list;
	};
	//Run the player monitor
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	_playerMonitor = [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
	_nul = [] execVM "service_point\service_point.sqf";//Repair, Reammo, Refuel script
	_nul = [] execVM "Custom\cly_easyfly.sqf";//random script from Armaholic thats cool
	_nul = [] execVM "Custom\baseZeds.sqf";//remove zeds near plotpoles
};

 

I don't use admin hacks (aka "antihack"). The difference between mine and your is that yours has _null = and my doesn't. What does that do? 

Link to comment
Share on other sites

The RPT file doesn't have any reference to the ac_functions.sqf file.

 

I don't use admin hacks (aka "antihack"). The difference between mine and your is that yours has _null = and my doesn't. What does that do? 

ok if there is nothing in the RPT there has to be a problem finding the script, weird, are you sure you use that init.sqf on your server (I better ask I know people who edited some files and never uploaded them lol).

the "_nul = .." means nothing, don't ask me why thas is used by so many scripts :D

what you can try is start at the beginning, put log messages in the service_point.sqf, first line above everything else, e.g.

diag_log "service point init";

that message should be printed to your RPT, if not the script is never executed nd not called correctly.

Link to comment
Share on other sites

Has anyone noticed an issue with accessing gear from the driver's seat since the 1.0.3.1 update?  I can access gear from the passenger seat of vehicles, but not from the driver's seat and I think it may be related to this mod.  Anyone reproduce the problem I'm seeing?

I think you could never access the gear from the driver seat? only over the map but that has been removed with one of the later epoch patches..

Link to comment
Share on other sites

ok if there is nothing in the RPT there has to be a problem finding the script, weird, are you sure you use that init.sqf on your server (I better ask I know people who edited some files and never uploaded them lol).

the "_nul = .." means nothing, don't ask me why thas is used by so many scripts :D

what you can try is start at the beginning, put log messages in the service_point.sqf, first line above everything else, e.g.

diag_log "service point init";

that message should be printed to your RPT, if not the script is never executed nd not called correctly.

 

Added that and waited a few restarts, nothing in the log.

Link to comment
Share on other sites

Added that and waited a few restarts, nothing in the log.

did you look at the correct log file? the service point is a client script so not running on the srever and therefore not logging to teh server RPT but your client RPT? http://community.bistudio.com/wiki/RPT#ARMA_2_OA

If the log messages really isn't showing you have to verify that you even call the script. I mean you posted your init.sqf and that looked right, but I don't know what else the problem might be usually this script is easy to use :/

Link to comment
Share on other sites

After checking my client rpt file, I found an error in line 19 of service_point.sqf:

 

File mpmissions\__CUR_MP.Chernarus\custom\service_point\service_point.sqf, line 19

 

Line 19:

 

_refuel_costs = ["AllVehicles",["ItemGoldBar",1]]; // free for all vehicles (equal to [["AllVehicles",[]]])

 

I changed it to this, and will test it after the next restart:

 

_refuel_costs = ["AllVehicles",["ItemGoldBar",1]] // free for all vehicles (equal to [["AllVehicles",[]]])

Link to comment
Share on other sites

you still missed the last ; should be like this:

_refuel_costs = [["AllVehicles",["ItemGoldBar",1]]]; // free for all vehicles (equal to [["AllVehicles",[]]])

sorry I didn't see that before, have to deal with 100 problems at the same time here it seems :D

Edit you also missed a [ ] around that, it has to be in a specific format the computer can't guess what you want to tell him

funny if you have my example right next to it and still make an error like that, thats why you should take a look at the logs :D

Link to comment
Share on other sites

you still missed the last ; should be like this:

_refuel_costs = [["AllVehicles",["ItemGoldBar",1]]]; // free for all vehicles (equal to [["AllVehicles",[]]])

sorry I didn't see that before, have to deal with 100 problems at the same time here it seems :D

Edit you also missed a [ ] around that, it has to be in a specific format the computer can't guess what you want to tell him :D

 

I'm a little confused. Are you sure the ; is supposed to be there? I ask because it's not there for the repair settings and rearm settings. ie:

 

["Air",["ItemGoldBar",5]], // 5 Gold for helicopters and planes
["AllVehicles",["ItemGoldBar",2]] // 2 Gold for all other vehicles
Link to comment
Share on other sites

 

I'm a little confused. Are you sure the ; is supposed to be there? I ask because it's not there for the repair settings and rearm settings. ie:

["Air",["ItemGoldBar",5]], // 5 Gold for helicopters and planes
["AllVehicles",["ItemGoldBar",2]] // 2 Gold for all other vehicles

take a look at the next line it should say "];" a line break is nothing for code.. only semicolons end the line not a line break! ;)

thats where all the [ ] come from, but they are necessary.. :P

 

for most programming languages whitespace is irrelevant, you could write everthing in 1 line but then no human can read the code anymore, for the computer it would be better and faster if everything was just in 1 line! :D

Link to comment
Share on other sites

What was confusing me was the ]; under the costs:

_repair_costs = [
["Air",["ItemGoldBar",5]], // 5 Gold for helicopters and planes
["AllVehicles",["ItemGoldBar",2]] // 2 Gold for all other vehicles
];

I've fixed it up. 

 

*edit* How come test under the "Code" brackets disappears sometimes when I post!?

Link to comment
Share on other sites

You should use a code editor like Notepad++ or something it will highlight at least the matching brackets and stuff so you'll see if you open 5 brackets you also close 5 and see where the matching bracket is! :)

and what text disappears? the code view on the forums isn't the best, might be a bug ^^

 

in case you are wondering when I edit code it looks like this with many colors haha (also different colors for build in ArmA commands and stuff so developers can see errors faster):

qCsfBgu.png

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
×
×
  • Create New...