Well, took a bit of a more carefull approach and think the most 
important part is ready.
Now the harder part I don't really know if I'm doing it right.

Well first up my events look like this now:

        case EVENT_WEAPON_SEQUENCE_FINISHED:
            m_fDrawbackFinished = true;
            break;

        case EVENT_WEAPON_THROW:
            DecrementAmmo( pOwner );
            fThrewGrenade = true;
            break;

        case EVENT_WEAPON_THROW2:
            DecrementAmmo( pOwner );
            fThrewGrenade = true;
            break;

        case EVENT_WEAPON_THROW3:
            DecrementAmmo( pOwner );
            fThrewGrenade = true;
            break;

        case EVENT_WEAPON_PULLPIN:
            if ( m_AttackPaused == GRENADE_PAUSED_PRIMARY )
            {
                SetTimer( GRENADE_TIMER2 );
                ThrowGrenade( pOwner );
            }
            else if ( m_AttackPaused == GRENADE_PAUSED_SECONDARY )
            {
                SetTimer( GRENADE_TIMER2 );

                //See if we're ducking
                if ( pOwner->m_nButtons & IN_DUCK )
                {
                    RollGrenade( pOwner );
                }
                else
                {
                    LobGrenade( pOwner );
                }
            }

the bool fThrewGrenade is initialized in the constructor(I think it's 
the constructor.. it's CWeaponFrag::CWeaponFrag( void )      right? )

it's declared on the top of the file on the same place as the network 
vars though it;s not a networkvar atm(not sure if it should be?)

As can be seen in the events it checks if ur paused as primary or 
secondary and if crouching or not. Then calls the relevant functions for 
them

in the functions is something like this:

    CBaseGrenade *pGrenade = Fraggrenade_Create( vecSrc, vec3_angle, 
vecThrow, AngularImpulse(200,random->RandomInt(-600,600),0), pPlayer, 
GRENADE_TIMER, false, fThrewGrenade );

I added the , fThrewGrenade on the end as an argument but I'm not sure 
if that works.
I'm pretty much assuming since the function is called once the value is 
only sent once?
Any idea how I should have it sent the value again WITHOUT creating a 
second entity.
because if I do the same line again then it would create a second entity...

Yorg Kuijs wrote:
> Hmmm I'm a bit stuck, I tried something out and I think it can work but 
> I don't know if I'm doing it right.
>
> In the weapon file there's a bool in the area of the events used to 
> determine if the grenade was thrown, I moved it's declaration on top of 
> the file along with the rest of the variables and in the weaponfile in 
> the function for creating grenades I added bool fThrewGrenade
> so it became like this:
> CBaseGrenade *pGrenade = Fraggrenade_Create( vecSrc, orientation, 
> vecThrow, rotSpeed, pPlayer, GRENADE_TIMER, false, fThrewGrenade );
>
> then at the actual entity creation where it sets timer, damage, owner, 
> etc I have a check for whether the bool is true or not, if not true it 
> tells it to follow the entity(that works perfect) and if false it 
> supposed to stop following the player, set velocity, set the timer, etc 
> etc etc just like how it was before I started changing things.. that 
> part doesn't work though.
>
> the bool fThrewGrenade is set true or false in the events which is 
> currently rather messy.
> What I really need to know first if sending the value of the bool over 
> like this could even work.
> When I know it works then I can focus on making sure it properly knows 
> when it's thrown or not.
>
> so.. question in short: can I send the value of the bool fThrewGrenade 
> over  like this and if so do I need to do anything special, like making 
> it a networkvar like for example: m_bRedraw
>   

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

Reply via email to