SHARE
TWEET

Blood direction stuff

skroton May 8th, 2016 (edited) 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. So, add the +SEEKERMISSILE flag to the projectile that is hitting the player. It won't actually seek unless you call the specific function that does the seeking.
  3.  
  4. Then add to the player actor */
  5.  
  6. var int user_blood_x;
  7. var int user_blood_y;
  8. var int user_blood_z;
  9. var int user_blood_angle;
  10.  
  11. /* Then in the xdeath/death of the projectile call the following script */
  12.  
  13. Script 1 void
  14. {
  15.   int vel_x, vel_y, vel_z, angle;
  16.   vel_x = GetActorVelX(0);
  17.   vel_y = GetActorVelY(0);
  18.   vel_z = GetActorVelZ(0);
  19.   angle = VectorAngle (vel_x, vel_y);
  20.   SetActivator(0, AAPTR_TRACER); /* set activator to tracer of projectile, which is target of monster that fired it */
  21.   SetUserVariable (0, "user_blood_x", vel_x);
  22.   SetUserVariable (0, "user_blood_y", vel_y);
  23.   SetUserVariable (0, "user_blood_z", vel_z);
  24.   SetUserVariable (0, "user_blood_angle", angle);
  25. }
  26.  
  27. /* You now have access to all of the above user_vars in the decorate of the player actor, and it will always use the var of the projectile that most recently hit them.
  28.  
  29. Remember to divide all vars by 65536 in the decorate because they are fixed number values.
  30.  
  31. Remember that the "user_blood_angle" var is in fixed point angle, so 0 to 1.0 (or 0 to 65536). */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top