Results 1 to 9 of 9

Thread: Classname for fence?

  1. #1

    Classname for fence?

    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!

  2. #2
    I shall not insult moderators
    Join Date
    Nov 25 2010
    Posts
    1,576
    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;
    };

  3. #3
    Staff Sergeant
    Join Date
    Nov 10 2009
    Location
    Denmark
    Posts
    307
    Author of the Thread
    Okay thank you very much. Ill have a go with this.

  4. #4
    I shall not insult moderators
    Join Date
    Nov 25 2010
    Posts
    1,576
    Quote Originally Posted by JacobJ View Post
    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.:

    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]);
    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.
    Last edited by PELHAM; Feb 24 2012 at 14:09. Reason: additional info

  5. #5
    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

  6. #6
    I shall not insult moderators
    Join Date
    Nov 25 2010
    Posts
    1,576
    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]);
    	};

  7. #7
    Staff Sergeant
    Join Date
    Nov 10 2009
    Location
    Denmark
    Posts
    307
    Author of the Thread
    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.

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

    Add this to "init.sqf":
    Code:
    player addAction ["Check object class (cursor)", "checkclass.sqf"];
    Create a "checkclass.sqf" with:
    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
    may get handy if the object is not reachable.

  9. #9
    I shall not insult moderators
    Join Date
    Nov 25 2010
    Posts
    1,576
    Quote Originally Posted by gammadust View Post
    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.

Similar Threads

  1. Arma fence generator
    By Leopotam in forum ARMA 2 & OA : TERRAIN - (Visitor)
    Replies: 6
    Last Post: Apr 25 2013, 00:13
  2. fence location
    By mozi in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 7
    Last Post: Apr 12 2007, 08:05
  3. Fence Linking
    By derfalpha in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 9
    Last Post: Mar 26 2007, 23:04
  4. Need the name of a fence??
    By D.murphy man in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 13
    Last Post: May 22 2005, 20:50
  5. Fence editing
    By Suma in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 8
    Last Post: Jun 26 2002, 12:53

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •