Difference between revisions of "IsHostileToActor- Actor"
Jump to navigation
Jump to search
imported>Seorin |
imported>Rasikko |
||
Line 22: | Line 22: | ||
Debug.Trace("Dragon is hostile to the guard") | Debug.Trace("Dragon is hostile to the guard") | ||
endIf | endIf | ||
</source> | |||
To avoid the crash issue.. | |||
<source lang="papyrus"> | |||
Function isActorHostile(Actor akCallingActor, Actor akActorRef) | |||
if akActor == none | |||
return | |||
else | |||
if akCallingActor.isHostileToActor(akActorRef) | |||
; code here | |||
endif | |||
endif | |||
return | |||
EndFunction | |||
</source> | </source> | ||
Revision as of 09:29, 2 February 2018
Member of: Actor Script
Check if this actor is hostile to another actor
Syntax
bool Function IsHostileToActor(Actor akActor) native
Parameters
- akActor: The actor to check if we're hostile to
Return Value
True if we're hostile to the actor, false if we're not
Examples
; 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 akActor == none
return
else
if akCallingActor.isHostileToActor(akActorRef)
; code here
endif
endif
return
EndFunction
Notes
- If given a NONE value, this function will crash the game.