Jump to content
Sign in to follow this  
tracy_t

Rtti in ofp?

Recommended Posts

In config.cpp, we all know that Soldier inherits from Land (or is it man? Feck, I forget.)

It there any way to find the nearest object that inherits from a specified BASE CLASS?

Does

NearestObject[player, "Man"]

return the nearest object that derives from class Man? I haven't tried it - I'm at work. Which is why I am asking you lot, so I don't have to try it later on myself smile_o.gif

I certainly don't like using

_obj = NearestObject[player, "SoldierEB"]

_obj2 = NearestObject[player, "SoldierEMG"]

_obj3 = NearestObject[player, "Civilian1"]

etc. etc. because it's slow as feck!

Am I lazy or what? ;)

But I think this is a valid question!!!

Share this post


Link to post
Share on other sites

You still need to use NearestObject but with just a position passed to it. Then use CoutType to find it's descendants.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Object=NearestObject [X,Y,Z]

If ("Man" CountType [_Object]==1) Then ....................

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  

×