headshot101588 10 Posted February 24, 2019 I'm trying to find a building object on a certain map that I want to copy for my mission, this is the script that I'm trying to use and it isn't working. appreciate the help. _objects = nearestObject [player, [] , 5]; { hint _x; sleep 5; } forEach _objects; Share this post Link to post Share on other sites
gc8 981 Posted February 24, 2019 Change nearestObject to nearestObjects then you probably need typeof command to get the object type Share this post Link to post Share on other sites
headshot101588 10 Posted February 24, 2019 So? _objects = nearestObjects [player, [] , 5]; { hint _x; sleep 5; } forEach typeof _objects; Share this post Link to post Share on other sites
gc8 981 Posted February 24, 2019 9 minutes ago, headshot101588 said: So? If I understand right what you want: _objects = nearestObjects [player, [] , 5]; _objTypes = []; { _objTypes pushback (typeof _x); } forEach _objects; copytoclipboard (str _objTypes); That copies to clipboard. press ctrl + V to paste it to somewhere 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 24, 2019 Hello there headshot101588 ! If you want to get all the map houses all the map : GF_Building_Replacement_centerPosition = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition"); GF_Building_Replacement_array = nearestTerrainObjects [GF_Building_Replacement_centerPosition, ["house"], worldsize]; copyToClipboard str GF_Building_Replacement_array; this is from my : 2 Share this post Link to post Share on other sites
Grumpy Old Man 3548 Posted February 24, 2019 You're not really giving much information about what you want to do exactly. Do you need to get all nearby building types into the clipboard or is the hint sufficient? onEachFrame { _stuff = (nearestObjects [player, [] , 5]) apply {typeOf _x}; copyToClipboard str _stuff; hintSilent str _stuff }; Cheers 1 Share this post Link to post Share on other sites
headshot101588 10 Posted February 24, 2019 for some reason it says its missing a semicolon and I have no idea why Share this post Link to post Share on other sites
headshot101588 10 Posted February 24, 2019 19 minutes ago, Grumpy Old Man said: You're not really giving much information about what you want to do exactly. Do you need to get all nearby building types into the clipboard or is the hint sufficient? onEachFrame { _stuff = (nearestObjects [player, [] , 5]) apply {typeOf _x}; copyToClipboard str _stuff; hintSilent str _stuff }; Cheers I'm trying to find a specific house model, I put a unit(which is the player) next to that house, and on load, I'm hoping to find the class name so that later I could find it in Eden or something. Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 24, 2019 onEachFrame {hintSilent str [typeOf cursorObject, cursorObject]}; 1 Share this post Link to post Share on other sites
headshot101588 10 Posted February 24, 2019 It gave me an error but after I took a look at the documentation I found that changing it to "onEachFrame {hintSilent str [getModelInfo cursorObject, typeOf cursorObject]};" did the trick I'm pretty sure. Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 24, 2019 18 minutes ago, headshot101588 said: onEachFrame {hintSilent str [getModelInfo cursorObject, typeOf cursorObject]}; This will give you the .p3d model and not the classname , how it didn't work ? did you added the code above in the init.sqf or the player's init ? 1 Share this post Link to post Share on other sites
headshot101588 10 Posted February 25, 2019 21 hours ago, GEORGE FLOROS GR said: This will give you the .p3d model and not the classname , how it didn't work ? did you added the code above in the init.sqf or the player's init ? was I supposed to put this command in the init.sqf or some other .sqf file? Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 25, 2019 you can place it also in an sqf and as i posted above , i think also on the debug console. What exacly you did and what was the error ? Share this post Link to post Share on other sites
gc8 981 Posted February 25, 2019 On 2/24/2019 at 6:51 PM, headshot101588 said: I'm hoping to find the class name so that later I could find it in Eden With this script you get the name of the object you are currently pointing, you can then type that name in the eden object search: addMissionEventHandler ["EachFrame", { hintSilent (getText (configfile >> "cfgVehicles" >> (typeOf cursorObject) >> "displayName")); }]; Run it in debug console or in init.sqf for example 1 Share this post Link to post Share on other sites
headshot101588 10 Posted February 25, 2019 3 hours ago, GEORGE FLOROS GR said: you can place it also in an sqf and as i posted above , i think also on the debug console. What exacly you did and what was the error ? Error invalid number in expression Share this post Link to post Share on other sites
headshot101588 10 Posted February 25, 2019 Just now, headshot101588 said: Error invalid number in expression 2 hours ago, gc8 said: With this script you get the name of the object you are currently pointing, you can then type that name in the eden object search: addMissionEventHandler ["EachFrame", { hintSilent (getText (configfile >> "cfgVehicles" >> (typeOf cursorObject) >> "displayName")); }]; Run it in debug console or in init.sqf for example the same with this script Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 25, 2019 Just now, headshot101588 said: Error invalid number in expression and how did you use it ? Did you tried this again as the examples above ? Share this post Link to post Share on other sites
headshot101588 10 Posted February 25, 2019 I wrote this: onEachFrame { hintSilent (typeOf cursorObject) }; and it seems to work, or is it returning something else? Share this post Link to post Share on other sites
headshot101588 10 Posted February 25, 2019 4 minutes ago, headshot101588 said: I wrote this: onEachFrame { hintSilent (typeOf cursorObject) }; and it seems to work, or is it returning something else? I checked and it this did work. Thank you @GREGOR_FLOROS, the script you posted on my other thread combined with the thing I wrote above worked Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted February 25, 2019 34 minutes ago, headshot101588 said: the script you posted on my other thread combined with the thing I wrote above worked Your 're welcome , have fun ! Share this post Link to post Share on other sites