I'm currently writing a melee weapon system for the mod I'm working on.
 It's going to work rather differently to way say the HL2 crowbar works
in that instead of just whacking buttons to make your character do
different attacks the movements of your mouse will determine how you
attack.  I've setup a system whereby the mouse is tracked client side
and when an attack is made the information about what kind of attack it
is is sent over to the server via a client-command (i.e. if it was a
slash attack for a sword it'd send over a number identifying the attack
and two other numbers giving the direction the mouse was moved in).  I
then use pose parameters to control the attack animation (so for example
you can slash a sword in any direction you want).

The difficulty I'm having is in actually creating the weapon that will
sit in the players hand and collide with things / effect physics objects
etc.  Currently I've coded a base melee weapon class (inherited from
CBaseEntity not CBaseCombatWeapon) and I'm using bone followers to get a
physics shadow which follows the weapon model.  The weapon model follows
the player's hand movement using the same method weapons inherited from
CBaseCombatWeapon do (i.e. using the CBaseEntity::FollowEntity function
which sets up a bone merge).  Thus when the player makes an attack, the
player model animation moves the weapon model and if it hits stuff the
appropiate action can occur (i.e. if it hits a player damage
calculations can be done, if it hits a physics object it could knock it
over etc).  However when I use a bone follower to create a physics
shadow which follows round the weapon model I'm told the server is stuck
on the sword model the player is carrying and hence the player model
can't really move anywhere.  If I stand next to a physics object and
equip the sword I can knock over the object so it works in one respect.

Does anyone know what would be cause the server to be getting stuck on
the sword model and how I could fix this?  Also is this the best way to
do what I want (namely I'm using a bone follower which creates a physics
shadow, to follow round a model bone merged to a players hand so the
model can interact with physics objects etc)?  I'm not particular
familiar with Source's physics system yet so I could be going completely
the wrong way about this.

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Reply via email to