Jump to content
Sign in to follow this  
nullsystems

nearestObjects, question.

Recommended Posts

Hi,

I have a simple array, eg:

_array = nearestObjects [player, ["SoldierGB"], 200]

Now, if I have created my own class of soldiers, using the SolderGB as a base, would they also be returned ?

Also, would SoldierGMedic be returned also, since its under the tree of SolderGB?

Thanks, just need it clearing up at this stage smile_o.gif

If it doesnt, and I have used something like:

Mysoldier : SoldierGB {

..stuff

};

In a config file, how could I return that in an array, without having to list all of MySoldier1, MySoldier2 etc?

Share this post


Link to post
Share on other sites
I have a simple array, eg:

_array = nearestObjects [player, ["SoldierGB"], 200]

Now, if I have created my own class of soldiers, using the SolderGB as a base, would they also be returned ?

Also, would SoldierGMedic be returned also, since its under the tree of SolderGB?

Definitely!

nearestObjects considers all sub-members of the specified class, so you only need to look for the highest class relevant to your situation.

But you probably figured that out already by now... ;)

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  

×