Jump to content

Recommended Posts

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

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

So?

_objects = nearestObjects [player, [] , 5];

{
    hint _x;
    sleep 5;

} forEach typeof _objects;

Share this post


Link to post
Share on other sites
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

  • Like 1

Share this post


Link to post
Share on other sites

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 :

 

 

  • Like 2

Share this post


Link to post
Share on other sites

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

  • Like 1

Share this post


Link to post
Share on other sites
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

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
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 ?

  • Like 1

Share this post


Link to post
Share on other sites
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

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
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

  • Like 1

Share this post


Link to post
Share on other sites
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
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
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

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

 

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
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 !  :thumb:

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

×