snkman 351 Posted January 26, 2007 Hi Guy's well on Sahrani Island there are some Object's i like to know their name's. How can i found out? For example there are some Radar's, named ( Telek 1 and Funk 2 ) I can destroy thouse Radars but i like to know their class names so i can make them a Object to destroy in my mission. Share this post Link to post Share on other sites
johnnyboy 3789 Posted January 26, 2007 The "typeof" command will get you the object type name you need to create your instances of that object using CreateVehicle command. So to find the name of an object you like, find the object on the map, then turn Show IDs on and get the ID. The first line of code below gets the object for the ID (change the ID to your desired object's ID). The second line will display the type name using the "typeof" command. The third line creates a new instance of that object at the players position. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _obj = (position player nearestobject 256237); player sidechat format ["object direction is: %1, type=%2", getdir _obj, typeof _obj]; _newObj = typeof _obj createVehicle (position player); Share this post Link to post Share on other sites
snkman 351 Posted January 27, 2007 Ah okay thank you JohnnyBoy i have the name now ( LAND_TELEK1) But it look's like i can't use the fixed Object's as Mission Object's.. Share this post Link to post Share on other sites
johnnyboy 3789 Posted January 27, 2007 What do you mean that you can't use "fixed objects as mission objects"? What are you trying to do? Share this post Link to post Share on other sites
Big Dawg KS 6 Posted January 27, 2007 The "typeof" command will get you the object type name you need to create your instances of that object using CreateVehicle command.So to find the name of an object you like, find the object on the map, then turn Show IDs on and get the ID. Â The first line of code below gets the object for the ID (change the ID to your desired object's ID). Â The second line will display the type name using the "typeof" command. Â The third line creates a new instance of that object at the players position. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _obj = (position player nearestobject 256237); player sidechat format ["object direction is: %1, type=%2", getdir _obj, typeof _obj]; _newObj = typeof _obj createVehicle (position player); Unless it's changed from OFP, typeof doesn't work on island objects. Share this post Link to post Share on other sites
deanosbeano 0 Posted January 27, 2007 the object wont have a name on sahrani. only a number and the name of its p3d. to make one of the buildings/ radars etc , you go in editor. click showid find the object you desire to make an objective and then use that in the code printed above to set the param for your objective. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_obj = (position player nearestobject 256237) where 256237 will be replaced by the id you have found on sahrani. for example the little shed on rhamadi id number is 4262 so in the init.sqs we put : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_obj = (position player nearestobject 4262) _obj addeventhandler ["Killed",{[] exec "radarblown.sqs"}] so when the shed is killed so to speak ,radarblown sqs will be executed. Share this post Link to post Share on other sites
iLL 0 Posted January 27, 2007 http://www.armaleague.com/buildingclasses/ Share this post Link to post Share on other sites
UNN 0 Posted January 27, 2007 Quote[/b] ]Unless it's changed from OFP, typeof doesn't work on island objects. As deanosbeano said, if you can get the object with the nearestobject commands. Then all the other commands will work the same way they did in OFP. I use this to get the control tower: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Tower=[9911,9997,0] NearestObject 1270; Hint TypeOf _Tower; Share this post Link to post Share on other sites
Big Dawg KS 6 Posted January 27, 2007 Quote[/b] ]Unless it's changed from OFP, typeof doesn't work on island objects. As deanosbeano said, if you can get the object with the nearestobject commands. Then all the other commands will work the same way they did in OFP. I use this to get the control tower: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Tower=[9911,9997,0] NearestObject 1270; Hint TypeOf _Tower; Well then it's changed from OFP. Share this post Link to post Share on other sites
UNN 0 Posted January 27, 2007 In OFP I think it was a case of some objects, like bushes and roads e.t.c not having a class name associated with them. But I was sure things like buildings did? Share this post Link to post Share on other sites
Big Dawg KS 6 Posted January 29, 2007 In OFP I think it was a case of some objects, like bushes and roads e.t.c not having a class name associated with them. But I was sure things like buildings did? Nope, even buildings with known classnames would return empty string when I used the typeof command on them. Share this post Link to post Share on other sites
Giova_BLH 0 Posted March 5, 2007 I confirm, if you type : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_obj = (position player nearestobject 64642); player sidechat format ["object type is: %1", typeof _obj]; it will returns "" instead of "Land_Hotel" that is a big problem, because we cannot make function that will checkk the type of the given parameter Do you think that's a bug, or is there an explain about this fact? any solution to stamp this problem? Share this post Link to post Share on other sites
fasad 1 Posted March 5, 2007 Many (roads, fences, vegetation, rocks, some buildings) wrp placed objects have no class (typeOf = ""), just an object number (ofp only?) and the p3d name. As we cannot manipulate strings, is it even possible to tell what an arbitrary classless object actually is (for a script condition etc)? Share this post Link to post Share on other sites