Punchangle for sshogun hits
Moderator: InsideQC Admins
2 posts
• Page 1 of 1
Punchangle for sshogun hits
Im experimenting with punchangle in regard to close attacks with the ssg, and in traceattack () at the veery bottom I have:
- Code: Select all
if (trace_ent.invincible_finished < time) // target has No pent
if (vlen (org - self.origin) < 200 && trace_ent.ishuman && self.weapon == 2) // range is under 200, for humans only attacker has ssg
{
if (trace_ent.origin_y + 5 < org_y) // +/- 5 unit buffer from targets center
trace_ent.punchangle_y = vlen(org - self.origin) /5; // a value of about 40 just for tests
if (trace_ent.origin_y - 5 > org_y)
trace_ent.punchangle_y = vlen(org - self.origin) / -5;
}
Is there a better way to do this and also include the _x and _z factors as well? Has any other mod tried this? Feel free to add code and colaborate.
-

Cobalt - Posts: 445
- Joined: Wed Jun 10, 2009 2:58 am
- Location: New England, USA
Re: Punchangle for sshogun hits
You can have fun with punchvector also. I had a small mini mod where you could punch players and I used something like this for when the player got hit...
Its pretty fun.
- Code: Select all
if (random() < .50)
self.punchangle_x = -5+ random()*-3;
else
self.punchangle_x = 5+ random()*3;
if (random() < .50)
self.punchangle_y = -10+ random()*-3;
else
self.punchangle_y = 10+ random()*3;
if (random() < .50)
self.punchangle_z = -4+ random()*-3;
else
self.punchangle_z = 4+ random()*3;
if (random() < .50)
self.punchvector_y = -5 + random()*-3;
else
self.punchvector_y = 5 + random()*3;
if (random() < .50)
self.punchvector_x = -4 + random()*-3;
else
self.punchvector_x = 4 + random()*3;
if (random() < .50)
self.punchvector_z = -10 + random()*-3;
else
self.punchvector_z = 10 + random()*3;
Its pretty fun.
- PrimalLove
- Posts: 14
- Joined: Sun Oct 19, 2014 2:37 am
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest