Results 1 to 2 of 2

Thread: Rtti in ofp?

  1. #1
    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

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



    Scott \"Tracy\" T
    Scotland\'s silver tongued cavalier ?

    Author of the original zombie addon!!
    And other shite

    I play online as [TM]Spetsnaz[MAJOR] - don\'t shoot me!!

  2. #2
    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 &#91;X,Y,Z&#93;

    If &#40;&#34;Man&#34; CountType &#91;_Object&#93;==1&#41; Then ....................[/QUOTE]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •