Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 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.
- Then add to both the player actor and the projectile actor */
- var int user_blood_x;
- var int user_blood_y;
- var int user_blood_z;
- var int user_blood_angle;
- var int user_blood_pitch;
- /* Then in the first frame of the projectile, in a 0 tic frame, call the following script */
- Script 1 void
- {
- int vel_x, vel_y, vel_z, angle, pitch;
- vel_x = GetActorVelX(0);
- vel_y = GetActorVelY(0);
- vel_z = GetActorVelZ(0);
- angle = GetActorAngle(0);
- pitch = VectorAngle( VectorLength(vel_x, vel_y), vel_z ); /* calculate pitch, because monsters projectiles don't have pitch */
- SetUserVariable (0, "user_blood_x", vel_x);
- SetUserVariable (0, "user_blood_y", vel_y);
- SetUserVariable (0, "user_blood_z", vel_z);
- SetUserVariable (0, "user_blood_angle", angle);
- SetUserVariable (0, "user_blood_pitch", pitch);
- }
- /* Then in the xdeath/death of the projectile call the following script */
- Script 2 void
- {
- int vel_x, vel_y, vel_z, angle, pitch;
- vel_x = GetUserVariable (0, "user_blood_x");
- vel_y = GetUserVariable (0, "user_blood_y");
- vel_z = GetUserVariable (0, "user_blood_z");
- angle = GetUserVariable (0, "user_blood_angle");
- pitch = GetUserVariable (0, "user_blood_pitch");
- SetActivator(0, AAPTR_TRACER); /* set activator to tracer of projectile, which is target of monster that fired it */
- SetUserVariable (0, "user_blood_x", vel_x);
- SetUserVariable (0, "user_blood_y", vel_y);
- SetUserVariable (0, "user_blood_z", vel_z);
- SetUserVariable (0, "user_blood_angle", angle);
- SetUserVariable (0, "user_blood_pitch", pitch);
- }
- /* 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.
- Remember to divide all vars by 65536 in the decorate because they are fixed number values.
- Remember that the "user_blood_angle" and "user_blood_pitch" vars are in fixed point angle, so 0 to 1.0 (or 0 to 65536). */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement