[Q] How does the ECX RC2 attack charge work?

New Member
Joined
Oct 8, 2011
Messages
21
Best answers
0
I've made this code to actually spawn the charge into the player's attachment origins which are coded in the model but the entities or entity doesn't spawn into the exact origin they should.So how does the ecx rc2 charge works? Was trigonometry used a lot or is it even needed?

Code:
new Float:Origin[3], Float:Angles[3];
engfunc( EngFunc_GetAttachment, Client, 0, Origin, Angles );
set_pev( KameEnt[ Client ], pev_origin, Origin );
set_pev( KameEnt[ Client ], pev_angles, Angles );
 
Freelance Mappzor
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Nov 21, 2003
Messages
17,065
Best answers
0
Location
Stairing at the Abyss
As far as i know you need to bind the sprite to a bone of the model skeliton.

Usually its the right hand bone. No idea what the name for it is though.
 
Last edited:
New Member
Joined
Oct 8, 2011
Messages
21
Best answers
0
Bind to a bone? How can I bind it? I've tried setting it's origin but it didn't work well also.

edit: you mean like keep updating it's origin maybe? Still didn't put into the right place tho.
 
Last edited:
Freelance Mappzor
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Nov 21, 2003
Messages
17,065
Best answers
0
Location
Stairing at the Abyss
Half Life models are animated with the help of a skeleton.

The skeleton is composed of bones and joints and the verts move relative to the way the skeleton moves.

You can see the skeleton in HLMV if i recall correctly. Basically you need to set the effect origin to be pointing at the correct bone (i beleive usually its the right hand) and then the effect will play at the position of that bone. Thats how we get attacks to stick to the hands of characters.
 
Freelance Mappzor
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Nov 21, 2003
Messages
17,065
Best answers
0
Location
Stairing at the Abyss
Yea its spawned out of the wrist bone.

And to be honest it can be both left or right. In the last post i just remembered the Spiritbomb, and that one is in the right hand. Besides i can use hangover as an excuse for mixing up directions ^^;
 
New Member
Joined
Oct 8, 2011
Messages
21
Best answers
0
The correct bone I checked in HLMV of my model was 12
Code:
engfunc( EngFunc_GetBonePosition, Client, 12, Origin, Angles );
set_pev( KameEnt[ Client ], pev_origin, Origin );
set_pev( KameEnt[ Client ], pev_angles, Angles );
And it still doesn't spawn there.
 
Freelance Mappzor
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Nov 21, 2003
Messages
17,065
Best answers
0
Location
Stairing at the Abyss
Its not a number. You need its name from the QC file.

Best to wait for a coder to tell you exactly what name you need though. I lack that experience.
 
New Member
Joined
Oct 8, 2011
Messages
21
Best answers
0
Wait what? How come it is not a number, last time I checked this function parameters which was a minute ago it's a number

engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])
 
Freelance Mappzor
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Nov 21, 2003
Messages
17,065
Best answers
0
Location
Stairing at the Abyss
Wait what? How come it is not a number, last time I checked this function parameters which was a minute ago it's a number

engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])
Oh i was sure you needed a name. In any case again im not a coder. I can only make vague answers. So youll have to wait for a proper answer.
 
Project Manager
🌠 Staff
✔️ HL Verified
💻 Oldtimer
Joined
Nov 25, 2001
Messages
1,729
Best answers
0
Well I was asked to take a look at this thread. So I didn't read through everything but I think you are trying to attach an entity to a specific bone. This might be difficult for several reasons.
If you don't do it client-side which you can't with amxx it will always "lag" except if the model stays in place "frozen".
If you even have a single chance of spawing "effects" at bones then manually. Or you can try relying on existing attachments.
Or.. use a few effect messages that 1.2.3 offers, like the "EETrail"
 
New Member
Joined
Oct 8, 2011
Messages
21
Best answers
0
I don't really care about the lag, I just want my sprite to actually spawn into the character's hands. I've tried many ways I could think of, searched whole alliedmods forums for help but nothing.The EETrail message changes the existing weapon sprites and all that. I tried setting sprite origin the same as attachments, there's code in my first post, but it doesn't put it there where it should. Your special xtension spirit sword plugin I think has this thing to spawn in hands, that's why I asked a friend to ask you for your help.
 

Users who are viewing this thread

Top Bottom