Jump to content

getting SetOnCrippledLimbEventHandler to work on target


Bunslinger

Recommended Posts

How about placing a "token" (an unplayable, and therefor invisible, item) into the Actor's inventory when you first detect they are crippled? Then you can add that check to your script and "return" if found. You will need to remove that token when they get healed.

 

Just a minor tip to improve processing: testing for a single condition (like "<") is faster than for a combination of conditions like "<=". Change your "<=0" tests into "<1", or whatever level of precision is the equivalent for the variable type.

 

-Dubious-

Link to comment
Share on other sites

at that point i feel like it's more trouble than it's worth, i might either just wait for JIP to change the handler (i asked about it) or just stick with what i have.

 

also i don't know if it helps, but i use <=0 for health values in-case the damage subtracts to 0 exactly, which while rare i'd still like to prevent stuff from not working if it does

Link to comment
Share on other sites

Stats (including "derived stats" such as "health") are "integers", so GetAV "<1" is functionally equivalent to "<=0". Even if it were returning "real numbers" less than 1 (e.g. "0.9999"), when saved into a variable of type "integer" the value would be truncated instead of rounded, so a value less than 1 would be treated as zero as well. It's one of the reasons why knowing the declared "type" of a variable is important.

 

-Dubious-

Link to comment
Share on other sites

You can still use the event handler from within an event handler. You could use the UDF that you are currently using for the OnHit handler to declare the crippled limb thingy whenever the target reference changes and clear previous event handlers for efficiency. That way you only need to check whether the limb got crippled on the first shot and then skip that part of the routine if the handler is already set.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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