Difference between revisions of "IsHostileToActor- Actor"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Rhavlovick
m (1 revision: Clobber re-import by Henning)
 
imported>Rasikko
 
(2 intermediate revisions by 2 users not shown)
Line 23: Line 23:
endIf
endIf
</source>
</source>
To avoid the crash issue..
<source lang="papyrus">
Function isActorHostile(Actor akCallingActor, Actor akActorRef)
    if akActorRef == none
        return
    else
        if akCallingActor.isHostileToActor(akActorRef)
            ; code here
        endif
    endif
   
    return
EndFunction
</source>
== Notes ==
*If given a NONE value, this function will crash the game.


== See Also ==
== See Also ==
*[[Actor Script]]
*[[Actor Script]]

Latest revision as of 09:29, 2 February 2018

Member of: Actor Script

Check if this actor is hostile to another actor

Syntax[edit | edit source]

bool Function IsHostileToActor(Actor akActor) native

Parameters[edit | edit source]

  • akActor: The actor to check if we're hostile to

Return Value[edit | edit source]

True if we're hostile to the actor, false if we're not

Examples[edit | edit source]

; Is the dragon hostile to the guard?
if Dragon.IsHostileToActor(Guard)
  Debug.Trace("Dragon is hostile to the guard")
endIf

To avoid the crash issue..

Function isActorHostile(Actor akCallingActor, Actor akActorRef)
    if akActorRef == none
        return 
    else
        if akCallingActor.isHostileToActor(akActorRef)
            ; code here
        endif
    endif
    
    return
EndFunction

Notes[edit | edit source]

  • If given a NONE value, this function will crash the game.

See Also[edit | edit source]