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
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
21vb.dk ftw!
This might help you. It spits out class names for objects not in the editor too (Not written by me, found it somewhere):
Code://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; };
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.:
You call it from a radio trigger.Code: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]);
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.
Last edited by PELHAM; Feb 24 2012 at 13:09. Reason: additional info
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.
Engima spells E-n-G-I-m-a
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.
Code://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]); };
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.
Yet another alternative: pointing to object to get class instead of nearest objects.
Add this to "init.sqf":
Create a "checkclass.sqf" with:Code:player addAction ["Check object class (cursor)", "checkclass.sqf"];
may get handy if the object is not reachable.Code:_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
Spoiler: