Jump to content

Recommended Posts

Posted

This code doesn't seem to be working. I've got the script attached to a new type of Bighorner. Pretty much a duplicate of the standard Bighorner, nothing special, just needed something to test it on. I presume I'm using the correct functions, I can't seem to find any others that would apply to this situation. Any help guys?

 

scn HealthDetectBighorner

ref BighornerREF
short doOnce

begin onHit
set BighornerREF to GetOwnerLastTarget
if ( doOnce == 0 )
	if ( BighornerREF.GetHealthPercentage < 0.80 )
		showmessage HealthLow
		set doOnce to 1
	endif
endif
end

Posted

GetOwnerLastTarget runs on a weapon script to get the ref of it's last target that was hit. http://geck.bethsoft.com/index.php/OnHit

 

If this script is running on your Bighorner, all you should need it this:

 

scn HealthDetectBighorner

short doOnce

begin onHit
if ( doOnce == 0 )
	if (GetHealthPercentage < 0.80 )
		showmessage HealthLow
		set doOnce to 1
	endif
endif
end

 

The GetHealthPercentage function in this case is performed on the actor that the script is running on, so you don't need the actor's reference.

  • Recently Browsing   0 members

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