Jump to content
Axe Cop

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

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

Share this post


Link to post
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"];

Share this post


Link to post
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.

Share this post


Link to post
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.

 

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Im just thinking if your in a chopper and you have people in each gun you will need to land the chopper and the pilot will have to rearm all the guns. All good though script is working fine and is great, thanks

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By vbawol
      Open world survival mod set just two years after the mass extinction of billions of people. Those that remain are left with remnants of a once technological society. Try to survive, build, or explore your way through the harsh dynamic environment.
      Features
      Powerful persistence framework for Arma 3 with native Windows and Linux dedicated server support. Fully configurable script based security checks. Base Building re-envisioned for Arma 3 PhysX. Persistent secure and insecure storage devices. Upgradeable locking doors. Barter based economy and trading systems backed a single currency ¤ called "Krypto". Hostile Environment with several different types of antagonists, Air and Water temperature extremes, and Earthquakes. Hunting, Fishing, Tame Dogs, Explore & Loot: Wrecked ships, Abandoned vehicles and buildings, Perform task based missions and more! Open source APL-SA Epoch Survival MP gamemode. Open source APL-SA Modders resource configs and Class List. Assets can be used as a mod dependency on Steam workshop.
    • By xtrmsnpr
      Hello to all.

      So, the old company from {grof communty} is back,this time away from that clan.We are operating by ourselves and we have opened a new dayz mod epoch server!
      https://steamcommunity.com/groups/kirterpos

      And we want you to join us and have fun!
      It runs 24/7

      Server IP:
      144.76.99.158:2600

      Name:
      Kir Terpos Playground Epoch|DAY/NIGHT|Startkit|Custom events

      Map: Chernarus

      Slots:
      30

      Location:
      Germany


      --------

      In order to join the server, you need to download through DZlauncher these files:

      dayz Epoch 1.0.6.2

      and of course ARMA 2OA beta patch (obsolete) through STEAM.
      and arma2oa beta version from steam options!

      ---------------

      Server will restart every 6hours (no notification yet).
      Server will backup database every 8hours.

      Server has custom random events.
      Server has day/night circle (UTC+6)
      You start with custom gear,ready for PVP with a shiny m9SD and some surprises as well.

      @Sandbird is an extra feature to this server
      ---
      Discord for you:
      https://discord.gg/684KQH

      Welcome all,and we hope you like it.

      kir terpos aka kir menios aka xtrmsnpr
    • By thegdog
      2:08:04 Error Type Any, expected String 2:08:04 File z\addons\dayz_server\compile\server_playerSync.sqf, line 41 2:08:12 Server: Object 3:54 not found (message 70) 2:08:12 "Server_PublishVehicle2 error: Wrong parameter format" 2:08:12 "Trader Menu: jeffdog (76561198147272349) purchased 1x BAF_Merlin_DZE into gear at Aircraft Trader for 1 ItemObsidian" 2:08:12 Error in expression <ceFoot = 0; trying to buy aircraft from the default aircraft trader.  never touched any of it and it giving this error.  no vehicle spawns.  it shows the arrow.  EDIT:  i tried other traders, all vehicles dont spawn when bought.
    • By tyrant50187
      Im looking for the ability to add Script allowing Eyescan (retina scan) For Safe's and lockboxes, ether or, its something i havent found any script for but have found mentions and seen, any suggestions, links, or scripts are welcome, please Let me know!
    • By Bloodthirsty
      Hey I just need some files for this server, any and all you guys can come up with and think it deserve post that shit in chat rn. I want to see some crazy ideas and additions if you got em :) Lets see what you guys can come up with

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...