Jump to content
  • 0

How to delete a road


ViktorReznov

Question

seriously, ive gone through hell to extract a classname on a road. Selecting the road as an object is done so theoretically, deleting it with deletevehicle should do it no? well it doesnt and im trying to figure out how to make it happen.

heres the (blown apart with diag_logs) code that will return the classname of road

updated to fix whitespaces in the name as well asf1_7 100 into MAP_asf1_7_100

  Reveal hidden contents

and this is the diagLogs produced, if you check _roads8 it indeed has produced a classname (intended for use elsewhere, the obj container _roads2 should still delete with deletevehicle no?)

  Reveal hidden contents

Now that road is a road that was generated by the map, if I attempt to use this on a road I created with script, im unable to (currently) track it down, ill get a postive on the isOnRoad function but cannot find the road as an object

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

@ViktorReznov

not sure if works with roads.. but try execute this one at bottom of init.sqf

execVM "remove_roads.sqf";

remove_roads.sqf

  Reveal hidden contents

 

also take a look here

https://community.bistudio.com/wiki/nearRoads

 

Link to comment
Share on other sites

  • 0
  On 10/2/2017 at 12:57 AM, juandayz said:

@ViktorReznov

not sure if works with roads.. but try execute this one at bottom of init.sqf

execVM "remove_roads.sqf";

remove_roads.sqf

  Reveal hidden contents

 

also take a look here

https://community.bistudio.com/wiki/nearRoads

 

Expand  

yes, one of my variables uses nearRoads, will try the function you suggest and get back to you!

Link to comment
Share on other sites

  • 0

my test script up there I wrote it to also remove the .p3d at the end of the string array, I havent been able to find too much information on what exactly that all means. Is it required in order to delete an object?

reference post I found with someone doing a similar function (a lot cleaner and nicer looking mind you) but seems to be old as dirt

http://www.ofpec.com/forum/index.php?topic=29713.0

Link to comment
Share on other sites

  • 0
  On 10/2/2017 at 11:09 PM, ViktorReznov said:

my test script up there I wrote it to also remove the .p3d at the end of the string array, I havent been able to find too much information on what exactly that all means. Is it required in order to delete an object?

reference post I found with someone doing a similar function (a lot cleaner and nicer looking mind you) but seems to be old as dirt

http://www.ofpec.com/forum/index.php?topic=29713.0

Expand  

i use this code in Z-IMS to get nearest forests-trees to make pee/poop see:


//////////////////////////////////FROM HERE
_findNearestTree = [];
{
	if (("" == typeOf _x) && {alive _x}) then {
		_objName = _x call fn_getModelName;
		// Exit since we found a tree
		if (_objName in dayz_trees) exitWith { _findNearestTree set [count _findNearestTree,_x]; };
	};
} count nearestObjects [getPosATL player, [], 20];


if (count _findNearestTree > 0) then {
	_tree = _findNearestTree select 0;
	_distance2d = [player, _tree] call BIS_fnc_distance2D;	
if (_distance2d < 5) exitWith {

//////////////////////TO HERE/////////////////////
                    
if (needpiss) then {
[player, "fillwater", 0, false, 5] call dayz_zombieSpeak;
player removeAction s_player_makepiss;
s_player_makepiss = -1;
needpiss = false;
};

if (needpoo) then {

 

Link to comment
Share on other sites

  • 0
  On 10/3/2017 at 7:30 PM, juandayz said:

DAm! i wanna see players working on new roads being whipped.


 
Expand  

ohh, dont you worry mate. This function has been added due to the possibiliteis of another mod already out and largely popular... im very close to being complete with these new set of scripts and am attempting to collaborate with the author. Bases with raods/airfileds/tracks are very near and upcoming feature!

Link to comment
Share on other sites

  • 0

The road deletion script is now complete. It will in fact only detect player spawned roads, not map spawned roads so this is good. Waiting on a response from some friends and will be released soon, one way or another. Road/runway/bridge construction is here. Also comes with ownership access so no random ppl removing your roads or vice versa

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
  • Advertisement
  • Discord

×
×
  • Create New...