Jump to content
Sign in to follow this  
JacobJ

Classname for fence?

Recommended Posts

Hey all

I am trying to find a classname for fence or walls. I already know "building" and "house", but can't seem to find anything coming close to fence or walls. Is there such a classname?

/Jacob

Share this post


Link to post
Share on other sites

This might help you. It spits out class names for objects not in the editor too (Not written by me, found it somewhere):

//Identify closest object
while {true} do
{	
//get all objects within a 5 metre radius
_all_objects = [];
_all_objects = nearestObjects [player, ["All"], 5]; 

if ((count _all_objects) > 1) then
{	
	//identify the closest object to player
	_closest_object = _all_objects select 1; 

	//find out its type 
	_object_type = typeOf _closest_object;

	//hint type
	hint format ["%1", _object_type];
};
sleep 2;
};

Share this post


Link to post
Share on other sites

Okay thank you very much. Ill have a go with this.

Share this post


Link to post
Share on other sites
Okay thank you very much. Ill have a go with this.

That first script is for objects, this will work for buildings and some associated walls.:

house = nearestBuilding player;
m=0;
while { format ["%1", (house) buildingPos m] != "[0,0,0]" } do {m=m+1}; 
m=m-1; 
player globalchat format["%1 \npositions: %2", typeof house, m+1];
sleep 2;
copytoclipboard str([typeof house, m+1]);

You call it from a radio trigger.

This will give you some wall class names but NOT fences. Fences do not have a config entry as it's something you can only place when editing islands. I thought it might work as it returns walls but tested some fences and then worked out why I it returned nothing. The object script in post 2 will give you class names for fences placed in editor.

Edited by PELHAM
additional info

Share this post


Link to post
Share on other sites

How I do it:

1. Start editor.

2. Create a new mission from scratch.

3. Insert unit with the unknown class name.

4. Save mission.

5. Open the mission file (mission.sqm) in Notepad and read the class name.

Share this post


Link to post
Share on other sites

Had a go with the object script on editor placed things and got these with editor placed objects:

"Fence_corrugated_plate"

"Fence_Ind_long"

"Fence_Ind"

"Fort_RazorWire"

"Land_BagFenceLong"

"Concrete_Wall_EP1"

"Fort_StoneWall_EP1"

"Base_WarfareBBarrier10xTall"

"Base_WarfareBBarrier10x"

Changed the script to make it more user friendly - if you run this from a 'radio alpha' trigger, repeatedly, on act: nul = [] execVM "objfinder.sqf"; keys 0-0-1

It will copy the nearest object to the clipboard, just Alt-Tab and paste it into notepad.

//Identify closest object

private ["_closest_object","_object_type","_all_objects"];

//get all objects within a 5 metre radius
_all_objects = [];
_all_objects = nearestObjects [player, ["All"], 5]; 

if ((count _all_objects) > 1) then
{	
	//identify the closest object to player
	_closest_object = _all_objects select 1; 

	//find out its type 
	_object_type = typeOf _closest_object;

	//hint type
	player sidechat format ["%1", _object_type];
	copytoclipboard str([_object_type]);
};

Share this post


Link to post
Share on other sites

Okay thank you all very much, this is some very easy ways to do it. I will give them a go and check out how they work.

Share this post


Link to post
Share on other sites

Yet another alternative: pointing to object to get class instead of nearest objects.

Add this to "init.sqf":

player addAction ["Check object class (cursor)", "checkclass.sqf"];

Create a "checkclass.sqf" with:

_object_type = typeOf cursorTarget;
hintSilent format ["%1", _object_type];
copytoclipboard str(_object_type); // also copies to clipboard but as a simple string you won't get a list of objects with this method

may get handy if the object is not reachable.

Share this post


Link to post
Share on other sites
Yet another alternative: pointing to object to get class instead of nearest objects.

Add this to "init.sqf":

That's a good one, saves HALOing onto things lol.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×