Raised This Month: $51 Target: $400
 12% 

punchangle problems


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 09-15-2008 , 16:05   punchangle problems
Reply With Quote #1

hello ,
when I do recoil effect , like this

PHP Code:
pev(idpev_punchanglerecoil)
recoil[0] += random_float(recoilForce*-10.0)    // up - down
recoil[1] += random_float(recoilForce*-10.0)    // right - left
recoil[2] = 0.0    // Screen rotation
set_pev(idpev_punchanglerecoil
and after , I get user entity aiming and user aim origin,
like this
PHP Code:
new aimOrigin[3], targetbody
get_user_origin
(attackeraimOrigin3)
get_user_aiming(attackertargetbody
it s returning the origin and the user aim without count the punchangle ...
I think need to do something like a trace_line but I don't know :s
some one can help me ?
(if need a "custom" module like memoryx say it also it s ok )

in advance thank you

Last edited by kossolax; 09-15-2008 at 16:24.
kossolax is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 09-16-2008 , 12:45   Re: punchangle problems
Reply With Quote #2

Well, first of all, punchangle does not change the users origin.
The player does not move at all from just that. In Half-Life, if
e.g. a Gargantua hits you, the game code adds a bunch of velocity
to the player, on top of the punchangle effect.

The second problem is, that punchangle does not change the
angles directly. It is some tricky engine workaround. Try to fire
different guns in HL1 and look at the angles by doing so. Use this.
You will notice that on most guns the screen shakes when firing,
but the angles only are affected by a few guns. Reason is the game
code is set to use punchangle for guns that fire fast (like 9mmAR)
where you won't see a change in the angle values, and a manual
workaround for guns with a slow firerate, (like RPG and Crossbow)
where you will notice a change in the angles. Whyever that is...

You might be able to do the same workaround as the game does.
I am not sure about trace_line, though, since I never used it.

Hope this helps at all.
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 09-16-2008 at 12:48.
Silencer123 is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 09-16-2008 , 13:42   Re: punchangle problems
Reply With Quote #3

get_user_origin(attacker, aimOrigin, 3) aim user origin

but here nothing change
is there anyway to do the aim origin with the recoil , please?

like

PHP Code:
new origin[3],Float:origin_2[3]
get_user_origin(attackeraimOrigin3)
pev(idpev_punchangleorigin_2)
origin[0] += origin_2[0]
origin[1] += origin_2[1
but I need also the get_user_aiming(attacker, target, body);

that the problems ....

or maybe find origin and after find hitbox
or maybe add the native inside amxx core like get_user_origin(6) to calcule aim origin with the recoil :p
same with get_user_aim ... I dont know
kossolax is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 09-16-2008 , 13:52   Re: punchangle problems
Reply With Quote #4

I dunno about recoil, but this is how to get aim origin (credited to VEN - fakemeta_util.inc):
PHP Code:
stock fm_get_aimorigin(indexFloat:origin[3])
{
    new 
Float:start[3], Float:view_ofs[3];
    
pev(indexpev_originstart);
    
pev(indexpev_view_ofsview_ofs);
    
xs_vec_add(startview_ofsstart);
    
    new 
Float:dest[3];
    
pev(indexpev_v_angledest);
    
engfunc(EngFunc_MakeVectorsdest);
    
global_get(glb_v_forwarddest);
    
xs_vec_mul_scalar(dest9999.0dest);
    
xs_vec_add(startdestdest);
    
    
engfunc(EngFunc_TraceLinestartdest0index0);
    
get_tr2(0TR_vecEndPosorigin);
    
    return 
1;

Note: If you notice, you need to include xs.inc

P.S: I understand none of it, so I won't have answers to questions...
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 09-16-2008 at 14:47.
Dores is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 09-16-2008 , 14:08   Re: punchangle problems
Reply With Quote #5

thank you
but i need
get_user_aiming(attacker, target, body);

to find the entity and hitbox if it s possible if not,
if it s possible to calcule it like if it s at the top at the player model
to find the head with min/max in the player model




anyway someone can help for this one : get_user_aim ? please
kossolax is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-16-2008 , 14:15   Re: punchangle problems
Reply With Quote #6

Quote:
credited to anakin_cstrike
( To VEN ; stock from fakemeta_util. )
__________________
Arkshine is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 09-16-2008 , 14:45   Re: punchangle problems
Reply With Quote #7

From the method I gave you, instead of returning 1, return the aiming origin (i think you need to return the 'origin' variable), and check if the aiming origin is the same as the head origin (there's somewhere in the TraceLine guide by Nomexous on how to get head origin using EngFunc).

Quote:
Originally Posted by arkshine
( To VEN ; stock from fakemeta_util. )
Fixed.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 09-16-2008 at 14:53.
Dores is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 09-16-2008 , 16:09   Re: punchangle problems
Reply With Quote #8

oh there http://forums.alliedmods.net/showthread.php?t=66076
thank you

but does it work with the recoil ?


well so
PHP Code:
new Float:attacker_origin[3], Float:attacker_aim_origin[3]
pev(attackerpev_originattacker_origin)
fm_get_aimorigin(attackerFloat:attacker_aim_origin[3]) // get aim origin 

new trace 0
new hit
new Float:head_origin[3]
engfunc(EngFunc_TraceLineattacker_originattacker_aim_originDONT_IGNORE_MONSTERSattackertrace)
hit get_tr2(traceTR_pHit// get hitbox 
but I think my trace_line is bad

for my plugin I need :
aim origin , entity in target , and hitbox
....


helps please

Last edited by kossolax; 09-17-2008 at 09:56. Reason: code update
kossolax is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 09-17-2008 , 09:36   Re: punchangle problems
Reply With Quote #9

Well, for hitbox you need to do the following using TraceLine:
PHP Code:
new hitgroup;
hitgroup get_tr2(traceTR_iHitgroup); 
As you can see at the TraceLine tut, variable 'hitgroup' will contain either HIT_CHEST, HIT_RIGHTLEG, HIT_HEAD... etc.

About your TraceLine method (using EngFunc), the two first parameters for getting a trace is where the trace begins (assumably the attacker's origin), and where it ends (where the bullet will hit). I'm not sure finding the aim origin will help getting the right end of the trace. Try asking Nomexous or something.

P.S: I know nothing about recoil...
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 09-17-2008 at 09:38.
Dores is offline
kossolax
AlliedModders Donor
Join Date: Jan 2008
Location: Belgium
Old 09-17-2008 , 10:00   Re: punchangle problems
Reply With Quote #10

kk well thank you for your helping I will PM him.
kossolax is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode