• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • GameObject.IsVisible

    Discussion in 'Community Developer Forum' started by RahlRB, Jul 11, 2016.

    1. RahlRB

      RahlRB New Member

      Joined:
      Sep 24, 2015
      Messages:
      20
      Likes Received:
      2
      Trophy Points:
      0
      Mastahg,

      Can you give a little more detail on exactly what GameObject.IsVisible is supposed to tell us?

      Specific questions that come to mind:
      • Does this check Line of Sight?
      • Does this check for things that are actually able to be seen within the game?
        • For example, would this return true on a mob that was locked behind a door?

      For a little more context of what I'm looking for:

      I'm looking at putting together a nice way of finding an enemy to target around me.

      This is the code I have for searching for suitable targets:
      Code:
      var enemies = GameObjectManager.GetObjectsOfType<BattleCharacter>().Where(x => x.IsValid && x.IsVisible && x.IsAlive && x.IsTargetable && x.CanAttack);
      
      I'm trying to determine if there are other filters I should add or if there are filters I should remove.

      Thanks!
       
    2. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,319
      Likes Received:
      376
      Trophy Points:
      83
      IsVisible checks if the object is invisible.
       
    3. ZeeZee

      ZeeZee Member

      Joined:
      Nov 6, 2014
      Messages:
      61
      Likes Received:
      3
      Trophy Points:
      8
      It's pretty useful for checking for timed nodes / ephemeral nodes
      e.g. I use something like this as my conditional:

      "Condition.IsTimeBetween(&NodeTime;) and GameObjectManager.GetObjectByObjectId(&NodeId;) and GameObjectManager.GetObjectByObjectId(&NodeId;).IsVisible"
       
    4. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,319
      Likes Received:
      376
      Trophy Points:
      83
      You should be using npcid. Objectids will change on zone.,restart, death, out ranging it, etc.
       

    Share This Page