Jump to content

Function to detect who an actor is currently fighting?


uhmattbravo

Recommended Posts

Hi, I'm making a mod that I don't want to divulge too much information about just yet, and I'm having trouble finding a script function that will detect whether the actor that the script is attached to is in combat with another semi specific reference. GetCombatTarget seems to return more what the actor is looking at than whether or not the two are fighting but still helps a little.

 

For example:

 

Short doOnce

Ref targetRef

 

Begin gamemode

 

If doOnce == 0

Set targetRef to getCombatTarget ; who the actor's looking at

 

If *targetRef is fighting with me*

;do something

Else

Set doOnce to 0 ;check another target

Endif

Endif

 

End

 

I basically just need a function to check if the two refs are in combat with each other to make a proper if statement to go between the *'s.

 

Thanks, any advice or help would be greatly appreciated.

Link to comment
Share on other sites

I guess some possibilities would depend on exactly who it was and what situation you are working on making happen. Without knowing specifics you could try giving said ref a token in their inventory and reference the token in the script instead of the ref of the actor. I guess it all depends on how specific this ref is in the game and how much leeway you have in adjusting the actor. You can always PM me more specifics you want.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...