AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Additional hitzones? (https://forums.alliedmods.net/showthread.php?t=9237)

TotalNoobScripter 01-10-2005 18:01

Additional hitzones?
 
Would it be possible to add a hitzone to a player? Say a hitzone for a model the player is holding? In example, if i were to make a player weaponmodel test.mdl, could I make an if statement if a player model is test.mdl, then make test.mdl also have its own hitzone? So you can shoot a players test.mdl and after it takes how much damage you want it to, it would run a function?

TotalNoobScripter 01-10-2005 20:41

geuss not.

Ronkkrop 01-10-2005 21:37

Quote:

Originally Posted by TotalNoobScripter
geuss not.

well, theres no easy way to do it. However, you could use some vector math to determine where it hit. This would require finding out which hitbox they hit into, and then doing your vector math based on the "vector" from which the player is pointing.

If you have any more questions, msg me privately via msn.

Da Bishop 01-10-2005 22:24

Just one question tho... Isn't the true hitbox made when the model is made. I Beleive that is how its "officially" done. But Ronkkrop's idea would also work. Gotta love math ;).

Ronkkrop 01-10-2005 22:38

Quote:

Originally Posted by Da Bishop
Just one question tho... Isn't the true hitbox made when the model is made. I Beleive that is how its "officially" done. But Ronkkrop's idea would also work. Gotta love math ;).


yes but the hitzones are mod dependant im quite sure, you cant just add a new hitzone to the model and expect hl/cs/whatever to "understand" it.

Geesu 01-11-2005 09:04

Just catch traceline and see what entity the player is looking at and check curweapon to see if they fired :P

Ronkkrop 01-11-2005 17:30

Quote:

Originally Posted by Geesu
Just catch traceline and see what entity the player is looking at and check curweapon to see if they fired :P

yes but he's talking about entirely new hitboxes. traceline wont tell you where in the body it hit, you still need to do vector math to get a coordinate on the body that the hit took place.

XxAvalanchexX 01-11-2005 18:26

When you user get_user_aiming, it returns the part of the body (hitbox) that you are looking at on a player, if you are looking at one. How does AMX, or therefore HL, decide which hitbox is which? Can you name the hitboxes within the model and HL interprets that?

Da Bishop 01-11-2005 21:23

Yes i have found it. The hitboxes are made within the model. So when you make the model you must make a hitbox for you. I beleive you give that hitbox an id of some sort. Then you must write something that calculates the dmg for the hitbox.

Ronkkrop 01-11-2005 22:22

Quote:

Originally Posted by Da Bishop
Yes i have found it. The hitboxes are made within the model. So when you make the model you must make a hitbox for you. I beleive you give that hitbox an id of some sort. Then you must write something that calculates the dmg for the hitbox.


You cant assign it an id... as i said earlier, its mod specific. So unless you can change the code for the mod, your hooped.


All times are GMT -4. The time now is 19:23.

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