Re: [hlcoders] Help with externs

2008-11-16 Thread Yorg Kuijs
Got it working now, in a eh rather weird way, but it works fine at least 
the check for grenade being thrown or not

I basically looked at how IsTeamplay works
and basically added WasThrown and SetThrown to hl2mp_gamerules
the SetThrown is then set in the weapon file and gets it in the grenade 
file, have it in the delay think function cause otherwise it only checks 
once, and that doesn't really help:P

buuut, in the code is then: StopFollowingEntity();
but it keeps folowing the player anyway.
So I assume it either doesn't realize what it's following and thus it 
doesn't do anything orrr the velocity needs to be set again.

Also effects are created after thrown but the grenade trail has turned 
very fat for some reason, while otherwise it was normal. could have to 
do with it being stuck of trying to throw but wanting to keep following 
at the same time?

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



Re: [hlcoders] Help with externs

2008-11-15 Thread Yorg Kuijs
Sorry I didn't answer for a while, got an reply elsewhere and tried that 
and have been playing l4d demo.
Since I didn't get any further I took a look again at the replies I got 
from the list and got me thinking.

Tom, you say make a bool into grenade_frag, but then there's know to set 
the bool to true, cause there's nothing that indicates it was thrown in 
the grenade_frag file.

So I went thinking again, why can't I use the bool simply on the 
throwgrenade functions in the weapon file, answer: cause it's only 
called once.
But think functions keep doing whatever is in the code right?

so if I'm carefull to make sure it wont endlessly spawn grenades, could 
I make it a think function that keeps checking if the grenade was thrown 
yet(in similar ways that the detonate timer works?)
Tom Leighton wrote:
 I assume thats a member variable of the weapon_frag class, so you would 
 need an instance of that to access the variable.

 You could simply put another bool fThrewGrenade into grenade_frag and 
 then set that when you throw the grenade?
   

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



Re: [hlcoders] Help with externs

2008-11-15 Thread Tom Leighton
When you throw the grenade from the weapon file, and you create the 
grenade entity, you will get a pointer to that entity.

If you make a couple of Set/Get functions for that, when it gets thrown 
you can set the boolean through those functions.

You can read up about pointers/classes/polymorphism/inheritance/etc on 
google if you don't understand any of them.

Any more questions feel free to reply ;)


Yorg Kuijs wrote:
 Sorry I didn't answer for a while, got an reply elsewhere and tried that 
 and have been playing l4d demo.
 Since I didn't get any further I took a look again at the replies I got 
 from the list and got me thinking.

 Tom, you say make a bool into grenade_frag, but then there's know to set 
 the bool to true, cause there's nothing that indicates it was thrown in 
 the grenade_frag file.

 So I went thinking again, why can't I use the bool simply on the 
 throwgrenade functions in the weapon file, answer: cause it's only 
 called once.
 But think functions keep doing whatever is in the code right?

 so if I'm carefull to make sure it wont endlessly spawn grenades, could 
 I make it a think function that keeps checking if the grenade was thrown 
 yet(in similar ways that the detonate timer works?)
 Tom Leighton wrote:
   
 I assume thats a member variable of the weapon_frag class, so you would 
 need an instance of that to access the variable.

 You could simply put another bool fThrewGrenade into grenade_frag and 
 then set that when you throw the grenade?
   
 

 ___
 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



Re: [hlcoders] Help with externs

2008-11-11 Thread Garry Newman
extern is a generic c++ thing.. it just means the variable is defined
somewhere else.

garry

On Tue, Nov 11, 2008 at 12:45 PM, Yorg Kuijs [EMAIL PROTECTED] wrote:
 Hey list,

 have been fiddling with trying to get the bool fThrewGrenade from
 weapon_frag to grenade_frag using extern bool
 but whatever I try I can't seem to get it to work, can't find anything
 about externs and searched through the code for examples and it seems it
 can be done in a ton of ways but what I'm trying just doesn't work
 either I get unresolved external error, or I include weapon_frag.h and
 then I get 4 errors in weapon_ar2.h which are rather weird...

 so anybody know where to find more information about external variables?

 ___
 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



Re: [hlcoders] Help with externs

2008-11-11 Thread Tom Leighton
I assume thats a member variable of the weapon_frag class, so you would 
need an instance of that to access the variable.

You could simply put another bool fThrewGrenade into grenade_frag and 
then set that when you throw the grenade?

Garry Newman wrote:
 extern is a generic c++ thing.. it just means the variable is defined
 somewhere else.

 garry

 On Tue, Nov 11, 2008 at 12:45 PM, Yorg Kuijs [EMAIL PROTECTED] wrote:
   
 Hey list,

 have been fiddling with trying to get the bool fThrewGrenade from
 weapon_frag to grenade_frag using extern bool
 but whatever I try I can't seem to get it to work, can't find anything
 about externs and searched through the code for examples and it seems it
 can be done in a ton of ways but what I'm trying just doesn't work
 either I get unresolved external error, or I include weapon_frag.h and
 then I get 4 errors in weapon_ar2.h which are rather weird...

 so anybody know where to find more information about external variables?

 ___
 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


   

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



[hlcoders] Help with externs

2008-11-11 Thread Yorg Kuijs
Hey list,

have been fiddling with trying to get the bool fThrewGrenade from 
weapon_frag to grenade_frag using extern bool
but whatever I try I can't seem to get it to work, can't find anything 
about externs and searched through the code for examples and it seems it 
can be done in a ton of ways but what I'm trying just doesn't work
either I get unresolved external error, or I include weapon_frag.h and 
then I get 4 errors in weapon_ar2.h which are rather weird...

so anybody know where to find more information about external variables?

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