Jump to content

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


Axe Cop

Recommended Posts

Just made a new script for proper vehicle service points where you are able to refuel, repair and rearm your vehicles! (I could not find a good one, so I did it myself)

"Proper" meaning everything is done like it should be in Epoch and saved to the database, e.g. the script is really repairing all vehicle parts and not just setting the damage to 0, so it's the same as if you would repair every damaged part yourself.

 

Main Features:

  • dynamic service points where you are able to select the options (default at every fuel station, if you want it's easy to add the epoch fuel pumps so you can build a service point in your base, you can also add vehicles or units if you want, like a NPC trader)
  • you can refuel and repair any vehicle by just sitting inside and get close to a service station (default 10m), then you get the actions menu attached to the vehicle, with rearm you have to be in the gunner seat because only that turret will be rearmed (for all cases the vehicle has to be local to your PC, so your have to be the driver/pilot or are alone in the vehicle)
  • the services don't have to be for free, you can add a price to every option like the traders (e.g. refuel is free but repair would cost 2 gold and rearm 3 10oz gold)
  • dynamic costs based on vehicle type
  • you can also disable any option if you don't want or need it, like disabling the rearm option completely
  • anything important is configurable in one place with config variables (there are comments in the config block, just take a look at the file service_point.sqf)

 

The Installation is pretty simple, it's just a client side script.

Add this to your init.sqf in the "if (!isDedicated) then { PUT HERE SOMEWHERE (at the end is ok) }" block (so it will only be started on your client and not the server):

if (!isDedicated) then {
    // ... some other stuff ...
    // add the next line somewhere in this block
    execVM "service_point\service_point.sqf";
};

Download all files from here into a folder "service_point" inside your mission folder: https://github.com/vos/dayz/tree/master/service_point

If you want to change the path, there is one config variable in the file service_point.sqf called "_folder", you have to change that so it can access the other files needed for the script.

 

Here a screenshot how it looks like (click on the preview to show a full screenshot with the UAZ DShKM):

3IQOiUL.png

 

Feel free to add features and tell me your ideas. :)

Edited by Axe Cop
Link to comment
Share on other sites

_servicePointClasses = ["Land_A_FuelStation_Feed"]; // service point classes (add "FuelPump_DZ" to use the dynamic Epoch fuel pumps)

Whats the format to add more fuel points m8?

["Land_A_FuelStation_Feed","FuelPump_DZ"]

or just add another class underneath ?

_servicePointClasses = ["FuelPump_DZ"];

yeah like the first one:

_servicePointClasses = ["Land_A_FuelStation_Feed", "FuelPump_DZ"];

You can add as many object classes as you like, but I found out yesterday that it might not be a good idea to add the fuel pump to that list, because if a player just holds it in his hand it will recognize it and you can refuel and whatever while he is placing it.. that's more a "problem" with epoch because the fuel pump has no preview object like walls etc do, so it is the same object no matter if placed or just "holding" to build it. I could add a fix for that in my script just for that class but thats kinda stupid.. I think you still have to be near a fuel tank to build a fuel pump anyway, so maybe not that big of a deal.

Link to comment
Share on other sites

_servicePointClasses = ["Land_A_FuelStation_Feed", "Land_A_FuelStation_Feed", "Land_Ind_TankSmall", "Land_Ind_TankSmall2", "Land_Ind_TankSmall2_EP1", "Land_fuel_tank_stairs"]; // service point classes (add "FuelPump_DZ" to use the dynamic Epoch fuel pumps) 

Cheers.

 

Just so that I can add most of the fuel tanks that are on the map.

 

Link to comment
Share on other sites

Rather than having every fuel point act as a refuel/repair/rearm point I assume that I change _servicePointClasses = ["Land_A_FuelStation_Feed"];  to something that I want? Would allow to move this function to the traders or maybe a "new" trader which only has this.

 

 

 

It was obvious and I see that you pretty much answered it already. Thanks. I have been meaning to do this since I saw Epoch came out and thought it weird that there would be no refueling at the traders.

Edited by mintypie007
Link to comment
Share on other sites

Just wondering after you pay to rearm a vehicle does the ammo stay after a server restart or will the ammo be gone?

Vehicle ammo won't be saved in Epoch, there is no place in the database to save it.. so nothing I could do with a script like this. :(

there is only one config variable you can let vehicles spawn with ammo or not, it was never saved :/

Anyway one could do a script to get unused ammo back from the vehicles to save it in your gear/safe, that is all I can think of.

Link to comment
Share on other sites

Just tested the script in a vehicle if you have a driver and a gunner its not letting the gunner rearm, but when the driver switches to the gunner it lets him rearm. Only when the gunner moves to driver seat then back to gunner it lets him rearm.

Link to comment
Share on other sites

Just tested the script in a vehicle if you have a driver and a gunner its not letting the gunner rearm, but when the driver switches to the gunner it lets him rearm. Only when the gunner moves to driver seat then back to gunner it lets him rearm.

Thats is a intended feature I would say (or a restriction of the ArmA engine whatever you like). :P

 

You need to get in the driver seat at least once and then change to the gunner to get the rearm option!

This is necessary because the server owns the vehicle (or the last player who was the driver), if you get in the driver seat you will become the owner (the commands for changing fuel, repair and ammo only works if you are the owner of the vehicle), just some background knowledge of the arma engine ^^
 
There are some acticles about "locality in the ArmA engine" and how it works, if you are interested in those, I guess not :D
Link to comment
Share on other sites

Yeah there is no easy way around it, in the first version of my script I rearmed all weapons from the driver/pilot seat, sometimes it worked and others not, you had to switch to all seats before you do that and it was still buggy then, so I changed it so you have to be in the gunner seat to ream only that turret. If you know a better solution change the script, I think it's not that bad this way, shouldn't be to easy and it's working! :p

Link to comment
Share on other sites

Could you add a setting in for a delay for re-arming and re-reparing that we can config?

 

Would something simple like sleep 30 work? Though people could still drive off and it would then continue the script so would require some proximity and perhaps a timer, to prevent quick re-arming/quick repairing?

Link to comment
Share on other sites

Maybe I have missed an battleye update or something, but is anybody else getting a Battleye Script restriction #0 when they rearm?  I know that I can change a file in the setpos.txt, but I believe that opens up the server to hackers??? Thoughts?

The reamt script uses this 3 commands: magazinesTurret, removeMagazineTurret and addMagazineTurret, look in your BattlEye scripts.txt to see if anyone of those is blacklisted (5 in front, it can also be blacklisted with a part of the name like 5 "turret").

 

 

Could you add a setting in for a delay for re-arming and re-reparing that we can config?

 

Would something simple like sleep 30 work? Though people could still drive off and it would then continue the script so would require some proximity and perhaps a timer, to prevent quick re-arming/quick repairing?

It's possible but you can't simply put a "sleep" in there because then the script will just run after the sleep-time, it's not checking if you are still near the service points in the script.

 

For the repair script I could do something like this: repair 1 damaged part at a time, lets say 1 part every second, so if you have 5 damages parts the repair will take 5 seconds. But then I have to add an abort option if you drive way or leave the serive point range and you won't get the money back if you do that.. :/

 

For rearming it's not that easy, I could simply add a sleep or something but the script has to be changed for the reasons I told you before.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...