Jump to content
Sign in to follow this  
snkman

Object name's on Sahrani

Recommended Posts

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

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

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.. confused_o.gif

Share this post


Link to post
Share on other sites

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
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. confused_o.gif

Share this post


Link to post
Share on other sites

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
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
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. whistle.gif

Share this post


Link to post
Share on other sites

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

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 huh.gif

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×