you could also try to send its info with your health in a way similar to the
bit flags.  for instance, say health goes from 0 - 100.  that will use the
first 8 bits.  you can use the next 8 for your mana.  you'd have to handle
this anytime you use health or mana on both client and server.  tweak the
numbers to fit your particular design.

barret

----- Original Message -----
From: "Daniel Koppes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 04, 2003 10:16 AM
Subject: Re: [hlcoders] Adding new attributes


> You cannot add new things to entvars_t (pev), because it is shared between
> the DLL and the engine, and i think the network code expects it to be a
set
> size...
>
> I'm surprised its not crashing.
>
> Just add it to CBasePlayer and send it in each client update instead (make
> sure you update your delta.lst)
>
> At 22:07 4/01/2003, you wrote:
> >Alright if i want to give players a new attribute Like mana what
structure
> >would I modify ? Im having trouble with my
> >new statistic, Client side, its jumping up and down everytime i use a
> >command that wastes the "mana" but server side
> >it's apparently keeping track because it eventually lets me stop using
it,
> >but in my client hud it says i got damn near max left.  I currently
hopped
> >around peeked and proded and decided to add it to the entvars_t struct
since
> >it contains health  to keep track that way as well as an addition to
> >cbaseplayer.  *I pretty much did a quick hack of all the player used
health
> >pieces* so I send the message out with the entvars_t contained value, and
> >set the cbaseplayers value with that value like it does in health, and
> >during the communication it must get trashed.  Any Ideas ? I decrement it
> >like this in the code serverside
> >
> >--KiAttacks.cpp--
> >...
> >         if ( m_pPlayer->pev->fKi > 200.0 )
> >{//To check to make sure the player has enough to use the attack in
> >primaryattack
> >...
> >m_pPlayer->pev->fKi -= 100.0; //Decrement it
> >...
> >--End of KiAttacks.cpp--
> >
> >So in reality that addition to cbaseplayer is useless as far as i can
tell,
> >because on the client side, i recieve the
> >message in my healthhud and save it their(like health does).. and I only
> >check and decrement the entvars_t structure (pev right ??) sorry it's
late
> >and i stopped working on this for about a month now and tried to
ressurrect
> >and look at it again and find some help.
> >
> >
> >_______________________________________________
> >To unsubscribe, edit your list preferences, or view the list archives,
> >please visit:
> >http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
> ----------
> Programmer and Modeller for <http://pokemod.fragoff.net/>The
> <http://pokemod.fragoff.net/>Pokemod
>
> ----------
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders

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

Reply via email to