Jump to content
Halvhjearne

Repair & Rearming script

Recommended Posts

On 9/8/2019 at 6:33 PM, Grahame said:

I use it because I have never had time to add all the CUP vehicles into the configs tbh @He-Man :ph34r:

@Grahame
You can use this script to find all Vehicles on the map with weapons, but not currently in the default Epoch ServicePoint.
This Script will give you the needed config entries for cfgServicePoint.cfg but you have to sort it a bit and change the price from 999999 to what you want.
 

_allveh = allmissionobjects "landvehicle" + allmissionobjects "ship" + allmissionobjects "Air";
NewVehiclesAndAmmo = [];
_AlreadyFound = [];
_AmmoConfig = (missionconfigfile >> "CfgServicePoint" >> "VehiclesAndAmmo");
_VehiclesWithAmmo = ("true" configClasses _AmmoConfig) apply {configname _x};
_VehiclesWithAmmo = _VehiclesWithAmmo + ((getarray (missionconfigfile >> "CfgServicePoint" >> "VehiclesAndAmmo")) apply {_x select 0});
{
	_type = typeof _x;
	{
		if ((tolower _type) == (tolower _x)) exitwith {
			_AlreadyFound pushback _type;
		};
	} foreach _VehiclesWithAmmo;
	if !(_type in _AlreadyFound) then {
		_AlreadyFound pushback _type;
		_magsturrets = (magazinesAllTurrets _x);
		if !(_magsturrets isequalto []) then {
			_entry = [_type,[]];
			_tmp = [];
			_cnts = [];
			{
				_find = -1;
				_curmagturret = _x;
				{
					if (str _curmagturret isEqualTo str _x) exitwith {
						_find = _foreachindex;
					};
				} foreach _tmp;
				if (_find == -1) then {
					_tmp pushback _x;
					_cnts pushback 1;
				}
				else {
					_cnts set [_find, (_cnts select _find) + 1];
				};
			} foreach _magsturrets;
			{
				(_entry select 1) pushback [];
				(_entry select 1 select _foreachindex) pushback (_x select 0);
				(_entry select 1 select _foreachindex) pushback (_x select 1);
				(_entry select 1 select _foreachindex) pushback (_cnts select _foreachindex);
				(_entry select 1 select _foreachindex) pushback 999999;
				(_entry select 1 select _foreachindex) pushback (_x select 2);
			} foreach _tmp;
			NewVehiclesAndAmmo pushback _entry;
		};
	};
} foreach _allveh;

 

Edit: I have changed the Script, so it is compatible to Epoch 1.3.1 and also the upcoming Epoch 1.3.2.

 

The Output is an Array like this:

[["B_G_Offroad_01_armed_EPOCH",[["100Rnd_127x99_mag_Tracer_Yellow",[0],4,999999,100]]],["B_HMG_01_high_F",[["FakeWeapon",[-1],1,999999,1],["100Rnd_127x99_mag_Tracer_Red",[0],4,999999,100]]],["O_UAV_01_F",[["Laserbatteries",[0],1,999999,1]]]]

 

Add some linebreaks and tabs for a better overview like this:

[
	[
		"B_G_Offroad_01_armed_EPOCH",
		[
			["100Rnd_127x99_mag_Tracer_Yellow",[0],4,999999,100]
		]
	],
	[
		"B_HMG_01_high_F",
		[
			["FakeWeapon",[-1],1,999999,1],
			["100Rnd_127x99_mag_Tracer_Red",[0],4,999999,100]
		]
	],
	[
		"O_UAV_01_F",
		[
			["Laserbatteries",[0],1,999999,1]
		]
	]
]

 

Replace the 999999 by the price for this kind of magazine, like you want.

Then you should be able to add the Vehicles to the cfgServicePoint. Do not copy / paste it, but add new entries with the same syntax like others already in the cfg

Share this post


Link to post
Share on other sites
2 hours ago, Sneer said:

Where would I put this script? and what does "you have to replace the [] by {} " mean?

@Sneer
I have changed the script, so it can also be used in Editor.
- Run you Epoch Mission file in Editor
- Place all Vehicles you want to configure for the ServicePoint
- Run this Script in console
- Read out the Variable "NewVehiclesAndAmmo"
- Paste the array you get from the variable into an empty file
- Replace all [ by {
- Replace all ] by }
- Replace all 999999 by the price you want for the Ammo
- Add it to cfgservicepoint

 

Sure, you have to add some line breaks, to make it a bit easier to get an overview. But in general, you get a final config (with the above changes)

Share this post


Link to post
Share on other sites
11 minutes ago, He-Man said:

@Sneer
I have changed the script, so it can also be used in Editor.
- Run you Epoch Mission file in Editor
- Place all Vehicles you want to configure for the ServicePoint
- Run this Script in console
- Read out the Variable "NewVehiclesAndAmmo"
- Paste the array you get from the variable into an empty file
- Replace all [ by {
- Replace all ] by }
- Replace all 999999 by the price you want for the Ammo
- Add it to cfgservicepoint

 

Sure, you have to add some line breaks, to make it a bit easier to get an overview. But in general, you get a final config (with the above changes)

 

Thank you! I'll try it out tonight.

 

Share this post


Link to post
Share on other sites

@Sneer
I had to rework the script again and added some more infos.
The "old" variant has added turrets with more than 1 count of mags multiple. So I have added a merge for it.
Now it also works with the stable and experimental branch (I had to change the config for cfgServicePoint).
If there are questions, we can also discuss it in Discord. Would be a bit easier and faster than in a forum.

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 webbie
      Hey all, trying to track down the code that determines what the multigun Vehicle attachment will fix. Here is why. A player of mine noticed that the vtols can not be repaired. After some testing on both the epoch and vanilla variant I couldn't get either to work and actually found I couldn't do much with repair on them at all, I'm wondering if this is the same as the Hitpoint issue???
      As always thx in advance for any help or suggestions, always appreciated :)
    • By harcosgoogle
      Hi!
       
      Repair and Salvage Script 1.0.6.1?
       
       
    • By salival
      Hi,
       
      With Axe Cops permission I am releasing my updated version of his amazing Service Points script. 
      This includes support for original briefcases, gems (from epoch 1.0.6.1) and coins.
          (original github url: https://github.com/vos/dayz/tree/master/service_point)
          (original install/discussion url: https://epochmod.com/forum/topic/3935-release-vehicle-service-point-refuel-repair-rearm-script/)
          
      **** *REQUIRES DAYZ EPOCH 1.0.6.1* ****
          
      Major Changes:
          This version adds support for both single currency and gems (from the epoch 1.0.6 update) as well as the original epoch briefcase currency system. 
          Instead of pricing things like the original way, prices are now done on a "worth" similar to how coins are done. The price value of items are below.
          If you are using coins, I would recommend using the _currencyModifier variable since coins typically are 10x the value of briefcase based currency (1 brief == 100,000 coins)
          (You can either set this _currencyModifier variable to 1 then set the proper value or use the modifier, the modifier is mainly for dual currency servers)
          1 silver = 1 worth
          1 10oz silver = 10 worth
          1 gold = 100 worth
          1 10oz gold = 1,000 worth
          1 briefcase = 10,000 worth
          Please see dayz_code\configVariables.sqf for the value of gems (DZE_GemWorthArray) and their relevant worth if they are enabled.
          Example config settings for _refuel_costs, _repair_costs and _rearm_costs:
          All 3 sections can either be made free, disabled or a specifc price with the following examples:
          ["Air","free"] will make the vehicle config class of "Air" free for the specific action.
          ["Air","disabled"] will make the vehicle config class of "Air" disabled for the specific action.
          ["Air",2000] will make the vehicle config class of "Air" have a worth of 2000 for the specific action.
          ["Armored_SUV_PMC",2000] will make the specific vehicle have a worth of 2000 for the specific action.
          ["Armored_SUV_PMC","free"] will make the specific vehicle be free for the specific action.
          ["Armored_SUV_PMC","disabled"] will make the specific vehicle be disabled for the specific action.
          Valid vehicle config classes as an example: "Air", "AllVehicles", "All", "APC", "Bicycle", "Car", "Helicopter", "Land", "Motorcycle", "Plane", "Ship", "Tank"
      Visit my Github page to download and read the README.MD : https://github.com/oiad/service_points
    • By Halvhjearne
      so i realized that some server owners has been checking out my github and noticed the Taru pods mod/script i made.
       
      however, unfortunatly not as many has had the courtesy of actually reporting back to me about functionality/bugs, so i decided to just release it here for everyone to enjoy and i can see what everyone has to say about it.
       
      What is this?
       
      this script was inspired by this mod:
      http://www.armaholic.com/page.php?id=27532
       
      one of my players asked me to add this mod, but i feelt that this could be done without having to add an extra mod to every client, so i created this:
       
      this is a script that will allow players to attach the taru pods to the base taru that does not have a pod attached by default, if the pod is dropped above 25m height, the pod will be dropped in a parachute, else the pod is just dropped.
       

      (more pics soon)
       
      i also made possibility to sell pods at the traders without getting in as driver (claim action) that i will be uploading to my github soon.
       
      to attach a pod:
      Land "on" the pod with a wheel on each side as close as possible make sure wheels are touching ground scroll and use the attach scroll action to attach a pod scroll to detach/para drop it again.
       
      to make sure the pod saves new position after being moved, then either enter the pod or change inventory in it.
      pods should now save when dropped.
       
      so here goes:
      https://github.com/Halvhjearne/taru-pods
       
      to install this, add to the bottom of your init.sqf:
      execVM "addons\taru_pods\taru_init.sqf"; (or wherever you decide to install it, folder is not important)
       
      if you have antihack, you will need to disable attach and scroll actions checks (more info on this will come soon).
       
      you will also need to add the pods to traders / epochconfog.hpp
      the pod classnames are:
      "Land_Pod_Heli_Transport_04_bench_F" "Land_Pod_Heli_Transport_04_covered_F" "Land_Pod_Heli_Transport_04_medevac_F" "Land_Pod_Heli_Transport_04_box_F" "Land_Pod_Heli_Transport_04_fuel_F" "Land_Pod_Heli_Transport_04_repair_F" "Land_Pod_Heli_Transport_04_ammo_F"
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...