Jump to content

Photo

getting SetOnCrippledLimbEventHandler to work on target

scripting jip plugin geck

  • Please log in to reply
13 replies to this topic

#11
dubiousintent

dubiousintent

    Resident poster

  • Premium Member
  • 8,128 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-



#12
LolzMan1325

LolzMan1325

    Old hand

  • Members
  • PipPipPip
  • 705 posts

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



#13
dubiousintent

dubiousintent

    Resident poster

  • Premium Member
  • 8,128 posts

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-



#14
UnvalidUserName

UnvalidUserName

    Enthusiast

  • Members
  • PipPip
  • 188 posts
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.





Also tagged with one or more of these keywords: scripting, jip plugin, geck

Page loaded in: 1.221 seconds