Strip vehicles for parts

Manatee hunter, follow this tutorial and it will work perfectly:

1. Using the PBO tool of your choice (cPBO, PBOView, PBOManager etc.) extract the "dayz_code.pbo" from the "@dayz" folder.
2. Copy the "compiles.sqf" from "dayz_code\init" into your mission.pbo.
3. In the init.sqf in the mission.pbo edit:

Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";

to

Code:
call compile preprocessFileLineNumbers "compiles.sqf";

You can use the compiles.sqf to override majority of the files in "dayz_code\compile" folder. We are going to use it to override the function "fn_selfAction.sqf" so:

4. Copy the "fn_selfAction.sqf" in "dayz_code\compile" to your mission.pbo

5. Open the compiles.sqf and find:

Code:
    fnc_usec_selfActions =        compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf";        //Checks which actions for self

(Should be on line 17)

and edit it so it looks like this

Code:
    fnc_usec_selfActions =        compile preprocessFileLineNumbers "fn_selfActions.sqf";        //Checks which actions for self

Now we can edit the fn_selfActions.sqf and the changes will work in our server!

6. Now open the "fn_SelfActions" in the mission.pbo and find
Code:
//Sleep
if(cursorTarget isKindOf "TentStorage" and _canDo and _ownerID == dayz_characterID) then {
if ((s_player_sleep < 0) and (player distance cursorTarget < 3)) then {
s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_sleep;
s_player_sleep = -1;
};

And right underneath it, we add

Code:
// Remove Parts from Vehicles - By SilverShot.
if( !_isMan and _canDo and _hasToolbox and (silver_myCursorTarget != cursorTarget) and cursorTarget isKindOf "AllVehicles" and (getDammage cursorTarget < 0.95) ) then {
_vehicle = cursorTarget;
_invalidVehicle = (_vehicle isKindOf "Motorcycle") or (_vehicle isKindOf "Tractor"); //or (_vehicle isKindOf "ATV_US_EP1") or (_vehicle isKindOf "ATV_CZ_EP1");
if( !_invalidVehicle ) then {
{silver_myCursorTarget removeAction _x} forEach s_player_removeActions;
s_player_removeActions = [];
silver_myCursorTarget = _vehicle;
 
_hitpoints = _vehicle call vehicle_getHitpoints;
 
{
_damage = [_vehicle,_x] call object_getHit;
 
if( _damage < 0.15 ) then {
 
//change "HitPart" to " - Part" rather than complicated string replace
_cmpt = toArray (_x);
_cmpt set [0,20];
_cmpt set [1,toArray ("-") select 0];
_cmpt set [2,20];
_cmpt = toString _cmpt;
 
_skip = true;
if( _skip and _x == "HitFuel" ) then { _skip = false; _part = "PartFueltank"; _cmpt = _cmpt + "tank"};
if( _skip and _x == "HitEngine" ) then { _skip = false; _part = "PartEngine"; };
if( _skip and _x == "HitLFWheel" ) then { _skip = false; _part = "PartWheel"; };
if( _skip and _x == "HitRFWheel" ) then { _skip = false; _part = "PartWheel"; };
if( _skip and _x == "HitLBWheel" ) then { _skip = false; _part = "PartWheel"; };
if( _skip and _x == "HitRBWheel" ) then { _skip = false; _part = "PartWheel"; };
if( _skip and _x == "HitGlass1" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass2" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass3" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass4" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass5" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass6" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitHRotor" ) then { _skip = false; _part = "PartVRotor"; };
 
if (!_skip ) then {
_string = format["<t color='#0096ff'>Remove%1</t>",_cmpt,_color]; //Remove - Part
_handle = silver_myCursorTarget addAction [_string, "ss_remove.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
s_player_removeActions set [count s_player_removeActions,_handle];
};
};
 
} forEach _hitpoints;
};
};

This gives us the options on the scroll wheel menu when looking at vehicles!

7. Now find

Code:
 //Engineering
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
dayz_myCursorTarget = objNull;
//Others
player removeAction s_player_forceSave;
s_player_forceSave = -1;
player removeAction s_player_flipveh;
s_player_flipveh = -1;
player removeAction s_player_sleep;
s_player_sleep = -1;
player removeAction s_player_deleteBuild;
s_player_deleteBuild = -1;
player removeAction s_player_butcher;
s_player_butcher = -1;
player removeAction s_player_cook;
s_player_cook = -1;
player removeAction s_player_boil;
s_player_boil = -1;
player removeAction s_player_fireout;
s_player_fireout = -1;
player removeAction s_player_packtent;
s_player_packtent = -1;
player removeAction s_player_fillfuel;
s_player_fillfuel = -1;
player removeAction s_player_studybody;
s_player_studybody = -1;
//Dog
player removeAction s_player_tamedog;
s_player_tamedog = -1;
player removeAction s_player_feeddog;
s_player_feeddog = -1;
player removeAction s_player_waterdog;
s_player_waterdog = -1;
player removeAction s_player_staydog;
s_player_staydog = -1;
player removeAction s_player_trackdog;
s_player_trackdog = -1;
player removeAction s_player_barkdog;
s_player_barkdog = -1;
player removeAction s_player_warndog;
s_player_warndog = -1;
player removeAction s_player_followdog;
s_player_followdog = -1;
};

And right above it add
Code:
//Extras
//Remove Parts
{silver_myCursorTarget removeAction _x} forEach s_player_removeActions;s_player_removeActions = [];
silver_myCursorTarget = objNull;

This makes sure we don't have the option unless we are looking at vehicles!

8. Last but CERTAINLY not least, download the attached ss_remove.sqf and place it into your mission!

Job done!!!
 

Attachments

  • ss_remove.sqf
    2.1 KB · Views: 623
Another question - will this remove parts that are damaged, or only undamaged?

I'd prefer it only removed parts that are max 10% dmgd.
 
Well I'd assume so: Right here

Code:
if( _hitpoint == "HitEngine" or _hitpoint == "HitFuel" ) then {
dayzSetFix = [_vehicle,_selection,0.89];
} else {
dayzSetFix = [_vehicle,_selection,1];

And then further down there is an outcome for parts that are too broken

Code:
cutText [format["Cannot remove %1 from %2, the part has been damaged.",_namePart,_nameType], "PLAIN DOWN"];
 
Manatee hunter, follow this tutorial and it will work perfectly:

1. Using the PBO tool of your choice (cPBO, PBOView, PBOManager etc.) extract the "dayz_code.pbo" from the "@dayz" folder.
2. Copy the "compiles.sqf" from "dayz_code\init" into your mission.pbo.
3. In the init.sqf in the mission.pbo edit:

Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";

to

Code:
call compile preprocessFileLineNumbers "compiles.sqf";

You can use the compiles.sqf to override majority of the files in "dayz_code\compile" folder. We are going to use it to override the function "fn_selfAction.sqf" so:

4. Copy the "fn_selfAction.sqf" in "dayz_code\compile" to your mission.pbo

5. Open the compiles.sqf and find:

Code:
    fnc_usec_selfActions =        compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf";        //Checks which actions for self

(Should be on line 17)

and edit it so it looks like this

Code:
    fnc_usec_selfActions =        compile preprocessFileLineNumbers "fn_selfActions.sqf";        //Checks which actions for self

Now we can edit the fn_selfActions.sqf and the changes will work in our server!

6. Now open the "fn_SelfActions" in the mission.pbo and find
Code:
//Sleep
if(cursorTarget isKindOf "TentStorage" and _canDo and _ownerID == dayz_characterID) then {
if ((s_player_sleep < 0) and (player distance cursorTarget < 3)) then {
s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_sleep;
s_player_sleep = -1;
};

And right underneath it, we add

Code:
// Remove Parts from Vehicles - By SilverShot.
if( !_isMan and _canDo and _hasToolbox and (silver_myCursorTarget != cursorTarget) and cursorTarget isKindOf "AllVehicles" and (getDammage cursorTarget < 0.95) ) then {
_vehicle = cursorTarget;
_invalidVehicle = (_vehicle isKindOf "Motorcycle") or (_vehicle isKindOf "Tractor"); //or (_vehicle isKindOf "ATV_US_EP1") or (_vehicle isKindOf "ATV_CZ_EP1");
if( !_invalidVehicle ) then {
{silver_myCursorTarget removeAction _x} forEach s_player_removeActions;
s_player_removeActions = [];
silver_myCursorTarget = _vehicle;
 
_hitpoints = _vehicle call vehicle_getHitpoints;
 
{
_damage = [_vehicle,_x] call object_getHit;
 
if( _damage < 0.15 ) then {
 
//change "HitPart" to " - Part" rather than complicated string replace
_cmpt = toArray (_x);
_cmpt set [0,20];
_cmpt set [1,toArray ("-") select 0];
_cmpt set [2,20];
_cmpt = toString _cmpt;
 
_skip = true;
if( _skip and _x == "HitFuel" ) then { _skip = false; _part = "PartFueltank"; _cmpt = _cmpt + "tank"};
if( _skip and _x == "HitEngine" ) then { _skip = false; _part = "PartEngine"; };
if( _skip and _x == "HitLFWheel" ) then { _skip = false; _part = "PartWheel"; };
if( _skip and _x == "HitRFWheel" ) then { _skip = false; _part = "PartWheel"; };
if( _skip and _x == "HitLBWheel" ) then { _skip = false; _part = "PartWheel"; };
if( _skip and _x == "HitRBWheel" ) then { _skip = false; _part = "PartWheel"; };
if( _skip and _x == "HitGlass1" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass2" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass3" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass4" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass5" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass6" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitHRotor" ) then { _skip = false; _part = "PartVRotor"; };
 
if (!_skip ) then {
_string = format["<t color='#0096ff'>Remove%1</t>",_cmpt,_color]; //Remove - Part
_handle = silver_myCursorTarget addAction [_string, "ss_remove.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
s_player_removeActions set [count s_player_removeActions,_handle];
};
};
 
} forEach _hitpoints;
};
};

This gives us the options on the scroll wheel menu when looking at vehicles!

7. Now find

Code:
 //Engineering
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
dayz_myCursorTarget = objNull;
//Others
player removeAction s_player_forceSave;
s_player_forceSave = -1;
player removeAction s_player_flipveh;
s_player_flipveh = -1;
player removeAction s_player_sleep;
s_player_sleep = -1;
player removeAction s_player_deleteBuild;
s_player_deleteBuild = -1;
player removeAction s_player_butcher;
s_player_butcher = -1;
player removeAction s_player_cook;
s_player_cook = -1;
player removeAction s_player_boil;
s_player_boil = -1;
player removeAction s_player_fireout;
s_player_fireout = -1;
player removeAction s_player_packtent;
s_player_packtent = -1;
player removeAction s_player_fillfuel;
s_player_fillfuel = -1;
player removeAction s_player_studybody;
s_player_studybody = -1;
//Dog
player removeAction s_player_tamedog;
s_player_tamedog = -1;
player removeAction s_player_feeddog;
s_player_feeddog = -1;
player removeAction s_player_waterdog;
s_player_waterdog = -1;
player removeAction s_player_staydog;
s_player_staydog = -1;
player removeAction s_player_trackdog;
s_player_trackdog = -1;
player removeAction s_player_barkdog;
s_player_barkdog = -1;
player removeAction s_player_warndog;
s_player_warndog = -1;
player removeAction s_player_followdog;
s_player_followdog = -1;
};

And right above it add
Code:
//Extras
//Remove Parts
{silver_myCursorTarget removeAction _x} forEach s_player_removeActions;s_player_removeActions = [];
silver_myCursorTarget = objNull;

This makes sure we don't have the option unless we are looking at vehicles!

8. Last but CERTAINLY not least, download the attached ss_remove.txt, rename it to a .sqf file and place it into your mission!

Job done!!!

Not seeing a ss_remove.txt. Are you refering to the one in the original post or did you forget to attach one?
 
I, alike a previous poster, would love to see a "harvest parts" version for Taviana! I know theres one out there as i have seen it in another server. I attempted to use this one in my Taviana and ended up stuck on the "wait for host" screen. I looked for and world indicator to change from Cherno to Tavi but didnt notice any. Any help would be great!
 
here is a version for Taviana not sure if it works not tested
so if some on wanne test it for me and tell me the errors what you get in the log so i can try to fix it

the mission file i add here is only for Taviana
 

Attachments

  • dayz_mission.pbo
    91.9 KB · Views: 58
I will test it right now and let you know! Thank you for the prompt reply!! is this download just the parts harvest, or does it have other stuff?
 
I tested it as you sent it over and it almost completely loaded in when I got "something went wrong" error message
 
I attempted several times again and to sum it up, once at the loading screen "loading" takes a very very long time, and then the screen goes to the volcano as the error message then comes up.
 
I dont think Tavi can handle some of the other changes IE: weather, food, tents, Zeds, etc. What do you think about rewritting the script with just the Parts Harvest aspects. Im not experienced with this but can give it a try.......Let me know what you think?
 
yes it works with Reality 1.7.6
and GaryG im gonna look at it

Terrific, im experimenting myself as well.....(<- scary,lol). I will gladly test what ever you come up with on my server. All replys are set to go to my email so I should be able to do so fairly quickly. ;)
 
Terrific, im experimenting myself as well.....(<- scary,lol). I will gladly test what ever you come up with on my server. All replys are set to go to my email so I should be able to do so fairly quickly. ;)
here you go try this
if you get errors let me know
or if it works
 

Attachments

  • dayz_mission.pbo
    95.9 KB · Views: 49
May someone can use it :)
Credits goes to DayzEpoch
 

Attachments

  • salvage.sqf
    2.3 KB · Views: 103
  • salvage_vehicle.sqf
    2.2 KB · Views: 96
Still the same glowpowner :(
Have you looked a Xmoondockx's files?

Again...THANK YOU FOR ALL THE HELP!!!!!

i will take a look at it

can you try this 1
and can you check in your server startup log for me and copy the error message
 

Attachments

  • dayz_mission.pbo
    94.7 KB · Views: 29
i will take a look at it

can you try this 1
and can you check in your server startup log for me and copy the error message

The last two didnt give an error, just froze on the loading screen. Where do i pull the startup logs from?
 
Thank you all for the replies. Do I just upload the dayz_mission.pbo above onto my server and it is good to go?
 
Back
Top