[Working] Repair and Refueling Stations

Gorsy

Valued Member!
Repair and Refueling Stations help and discussion may take place here...

Any problems, feel free to ask.

But dont ask me to find out the building names for you, I dont have the time for that. You will have to look through the editor, or use google for that
 
Just tried this out, great little script and easy to put in. 2 questions though;

1. to add more buildings is it as simple as adding them in (see example):
Code:
countFuel = (count ((position _currentVehicle) nearObjects ["[COLOR=#339966]land_nav_pier_c_big[/COLOR]","Land_Barn_Metal", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["[COLOR=#339966]land_nav_pier_c_big[/COLOR]","Land_Barn_Metal", _distance]));
etc
etc

2. does this run alongside the other fuel script by seven, with added fuel tanks, so that only certain buildings could be used for repairs but all fuel tanks/fuel stations can be used for refueling? (or could it be incorporated in some way?)
 
If you see where they are all the same name, just change some of the others to the other building names. And I cant see any reason why it wouldnt run with the other script (thats why i changed the file names). If you have any problems tho, let me know. I probably could make it all one script with if statements and such, but I dont have the time right now, and I dont use the refuel script on my server, I created this solely for peoples bases we have on the server :p

countFuel = (count ((position _currentVehicle) nearObjects ["land_nav_pier_c_big", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["land_nav_pier_c_big", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["land_nav_pier_c_big", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Randomcrap", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["House", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Hospital", _distance]));

*Names above arnt real building names, just examples
 
If i'd paid attention I would've noticed that all those lines were the same :D I'll give it a try with the other refuel scripts and see if i can break it what happens. Thanks :)

*edit* Yeah they both work alongside eachother :)
 
I've noticed that when a vehicle is repaired and you jump out, using the mousewheel will show the damage as still being there (with the 'repair - Engine' or whatever still being in the damaged state) yet inside the vehicle it is all greens.
I had one report of a vehicle resetting to it's damaged state after a server restart.

Any ideas on how to fix this, if it can be fixed of course?
 
Im pretty busy for awhile, but i have not noticed this on my servers nor had any reports of it, I will look into it when i get chance, just bought a dedi so pretty busy and the new dayz code is out monday so have to rewrite my scripts, Basically all the script is doing is decreasing the damage from 1 to 0 slowly 1 being dead, 0 being all green, So with the server saving the stuff every 10 minutes I cant see why it isnt saving, I suppose I could write a server sync into to it, so it saves once it reaches green or sleeps for 40 seconds then saves. But you could be right :p I never pretend to be all knowing, like i say ill check it out, and ask my players to check it out

Anyways I plan to edit this script with a more optimised version once I get my eat and drink stations working. As an all in one script with a customisations page, to switch stuff on or off, or link it to certain buildings only

then maybe eventually if i can be bothered, have a reloading script. Just need to try and get those freaking hydras off the venoms, first. They just dont want to switch off, even replaced the machine guns with PKM's lol


Edit - Done the repair and ur right it is still showing it requiring parts even tho its all green and working, just waiting to check if the database sync sorts it out if not, after the vehicle has turned green
I'll have it attatch all the parts in the coding for the next update release where i also plan to set the damage of the vehicle to nearly destroyed before doing the repair script to stablise the time players have to wait
 
Hey guys, I installed these scripts to the building : "
Land_repair_center".
The auto refuel works, but the auto repairs do not work. Is this only for vehicles or should helicopters work as well? Thanks!
 
Do you reckon if I replace the green lines with 'small_can' and add a small can using the map editor to zelengorsk fuel station I will have auto refuel at zelengorsk fuel station only?

Many Thanks
Robbie
 
Lol, it does work, dont use 'small can' though !!!! anyone with a can of coke in thier inventory and it works also!! gonna try a bucket or a laptop or something small!!

thx

robbie
 
Sorry for the spam but I like this script!!!

"Red_Light_Blinking_EP1" works fine just in case anyone was wondering!!

Just add one in through the arma editor (under vehicles/small objects), put one at the pumps and change it in the repairactions.sqf I set the radius to 15m.

thx for this

Robbie
 
Has anyone gotten this to work with auto reful script installed and the 1.7.7.1 patch? I have auto-refuel working on the building I want but no auto repairs. Any Ideas?
 
I'll have it attach all the parts in the coding for the next update release where i also plan to set the damage of the vehicle to nearly destroyed before doing the repair script to stablize the time players have to wait

Are you still working on that?
It would be very nice, because that would probably be the only repair script able to do that...
I went through a lot of them and all just set damage value to "0", leaving the parts's values in the databases "hitpoints" column still untouched...

Any fix for that would be greatly appreciated :)
 
Ok guys after having alot of issues with the other repair station script on here, I decided to go about it in a different approach

Credit where its due to Seven, and Muddr. For their original refueling script
and thanks to Zombz.net, Player2, Ghost

What this script does is, lets you choose the building types to turn into a repair station, define the range you need to be within, to use it and also gives you the option via mousewheel.


Installation Details

Step 1

Open your Init.sqf located in your mission.pbo

add the following line... to the isdedicated section

[] execVM "Scripts\repairactions.sqf";

Step 2

Create a folder called Scripts if you dont already have one

Visit the links below and paste the code into two new files and save them in the scripts folder

repair.sqf

repairactions.sqf


Thats it, Pretty simple.

See below to set this up once you have it installed. You WILL need to find out the building names (editor does help with this, or your database if you have added buildings that way)
This link helps with building names too
-----------------------------------------------------------------------------------------------------------------




Changing Settings

Choose your building type to be the repair station

Open your repairactions.sqf

Find the lines below and change the green text to the building names (line 17 to 22)
countFuel = (count ((position _currentVehicle) nearObjects ["land_nav_pier_c_big", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["land_nav_pier_c_big", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["land_nav_pier_c_big", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["land_nav_pier_c_big", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["land_nav_pier_c_big", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["land_nav_pier_c_big", _distance]));

Note: You can have more than the one type if you want to vary it, Im using a pier only that I have on custom bases. To have multiple buildings, just simply change some of the others shown above

Changing the time need to refuel/repair and the distance

Open your repairactions.sqf
Simply adjust the timers below shown in green (lines 9 to 11)
_distance = 50; // Distance from object to display Refuel Message
_amount= 0.02; // Refuel rate
_amount2= 0.01; // Repair Rate


Changing the custom messages

Open your repairs.sqf located in the scripts folder

Edit the green text shown in the lines below (lines 16,26,29)
titleText ["Refueling and Repairing", "PLAIN DOWN", 3];
titleText ["Refueling and Repairs Finished", "PLAIN DOWN", 3];
titleText ["Refueling and Repairs Stopped", "PLAIN DOWN", 3];


Enjoy!


please look this http://opendayz.net/threads/new-idea-for-repair-center-for-vehicles.11836/
 
As far as I could see the situation is as follows:

In the table Object_DATA we have two columns dealing with damage:


1. A column called "damage".

Here we have a value ranging from 0.00000 to 1.00000, which means no damage at all to completely wrecked.


2. A column called "Hitpoints"

Here we have an entry for each single damaged part, which, for example, looks like that:

[["wheel_1_1_steering",0.809],["wheel_1_2_steering",1],["wheel_2_1_steering",1],["wheel_2_2_steering",0.926],["motor",1],["sklo predni P",1],["sklo predni L",0.669],["karoserie",1],["palivo",1],["wheel_1_4_steering",1],["wheel_2_4_steering",1],["wheel_1_3_steering",1],["wheel_2_3_steering",1],["glass1",0.721],["glass2",0.347],["glass3",0.958],["glass4",0.541]]

There seem to be the following parts:

8 wheels

=======

["wheel_1_1_steering",0.0],

["wheel_1_2_steering",0.0],

["wheel_1_3_steering",0.0],

["wheel_1_4_steering",0.0],

["wheel_2_1_steering",0.0],

["wheel_2_2_steering",0.0],

["wheel_2_3_steering",0.0],

["wheel_2_4_steering",0.0],

Up to 8 glasses

============

["glass1",0.0],

["glass2",0.0],

["glass3",0.0],

["glass4",0.0],

["glass5",0.0],

["glass6",0.0],

["sklo predni P",0.0], Front glass right

["sklo predni L",0.0], Front glass left

11 possible other parts

===================

["motor",0.0], Engine (all vehicles)

["karoserie",0.0], Hull (wheeled vehicles)

["palivo",0.0], Fueltank (wheeled vehicles)

["NEmotor",0.0], Engine (some wheeled military vehicles... ?)

["NEpalivo",0.0], Fueltank (some wheeled military vehicles... ?)

["NEtrup",0.0], Hull (Helis)

["elektronika",0.0], Avionics (Helis)

["mala vrtule",0.0], Back Rotor (Helis)

["velka vrtule",0.0], Main Rotor (Helis)

["munice",0.0], Missiles (Helis)

["telo",0.0], Hull (airplanes)

With nothing damaged the field can be empty as well... []

(The parts listed above refer to DayZ Epoch, other mods may have additional parts, for instance there were no tracked vehicles for me to look at...)


At the moment the script adresses only the column "Damage" and sets that value to zero. The "Hhitpoints" column remains untouched.

So, in addition to ehat it does now, we need the script to:

a) check for each possible part (not every vehicle does use the same combination of parts) and

b) repair/ replace that respective part or, put in other words, set the damage value for that part to zero, or even completely delete that part from the database.

Unfortunately I have no idea about scripting, so I have no idea how the code would have to look like....

Edit: I found this: http://community.bistudio.com/wiki/setHit
Thats probably the command to repair the parts...
 
Tested, and working on Fallujah. I use the
Code:
Land_Mil_Repair_center_EP1
and it works great.

Thank you for this script.
 
Odd, it doesn't want to work for me...I've set it to common buildings on my server but it seems to not work, I set it to the barracks. .RPT isn't showing anything wrong with it so idk whats effed

Code:
if (!isNull player) then {
        private ["_currentVehicle", "_isNearFeed", "_countFuel"];
                _currentVehicle = vehicle player;
                _countFuel = (count ((position _currentVehicle) nearObjects ["Land_Mil_Barracks_i", _distance]));
                _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_Mil_Barracks_i", _distance]));
                _isNearFeed = _countFuel > 0;
 
Don't you need to trigger a hive write and a public variable trigger so that repair and refuel data is synced to all clients and the database?
 
I keep getting an error saying "Script Scripts/repairactions.sqf not found". I am not entirely sure where the mission.pbo is. I am running an Epoch server. Any help?
 
Back
Top