Skip to content

GetIsLocationValid()

Does anyone know of a clever way of determining if a given target location, such as from spell or Unique Power targets, is valid and walkable mesh? Such as preventing an effect from firing if the targetted location is inside a wall or black space outside the painted terrain.


I've tried LineOfSightVector(GetPosition(locPlayerLocation), GetPosition(locTargetLocation)) to check if the location is visible to the player, but for some reason it's returning false at all locations and even those blatantly visible.

Comments

  • PhantasmaPhantasma Member Posts: 79
    I am only speculating, but GetFirstObjectInShape has a bLineOfSight parameter which says :-

    bLineOfSight

    This can be used to ensure that spell effects do not go through walls. (Default: FALSE)

    ... so maybe that will help with what you're trying to do?
  • ShadowMShadowM Member Posts: 573
    Use the new function they added GetSurfaceMaterial
  • WhitegraveWhitegrave Member Posts: 37
    ShadowM said:

    Use the new function they added GetSurfaceMaterial

    Fantastic thank you
  • ProlericProleric Member Posts: 1,269
    An old dodge was to create an invisible creature at the target location, then get its actual location. If they're different, the target location isn't valid / walkable.
    pscythe
Sign In or Register to comment.