hey List,
me again.
Got the grenade timer started on event and also have it forcing you to
throw at detonate time.
Timer continues on in the entity so that works now to.
One problem left: Sometimes if I hold a grenade for a short time, then
throw it, then press throw button again at exactly the
. This is inheritance.
-Tony
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Yorg Kuijs
Sent: September-26-08 9:19 AM
To: Discussion of Half-Life Programming
Subject: Re: [hlcoders] grenade code
alright I think I fixed the previous problems
but can't really
alright I think I fixed the previous problems
but can't really test it yet.
Right now in weapon_superfrag it does SetTimer bla bla bla and what is
actually that timer is named m_flThrowTime
in grenade_superfrag.cpp it uses m_flDetonateTime now what I need to
make is m_flDetonateTime =
Of Yorg Kuijs
Sent: September-26-08 9:19 AM
To: Discussion of Half-Life Programming
Subject: Re: [hlcoders] grenade code
alright I think I fixed the previous problems
but can't really test it yet.
Right now in weapon_superfrag it does SetTimer bla bla bla and what is
actually that timer is named
it is defined and none of that even works
would be better if I could mail the files to someone?
___
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
hey List,
back again with another problem
now trying to start off the detonation off grenades when the pull is
pinned through events, I first tested it by starting the countdown sound
in the event and that worked, doing the timer proves more troublesome.
I'm currently working in
If you are declaring SetTimer in the class def, are you actually
providing a body for that method?
Yorg Kuijs wrote:
hey List,
back again with another problem
now trying to start off the detonation off grenades when the pull is
pinned through events, I first tested it by starting the
Body as in a function?
in that case no
if not I don't know what you mean
___
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
Message -
From: Yorg Kuijs [EMAIL PROTECTED]
To: Discussion of Half-Life Programming hlcoders@list.valvesoftware.com
Sent: Sunday, September 21, 2008 6:48 PM
Subject: Re: [hlcoders] grenade code
Body as in a function?
in that case no
if not I don't know what you mean
ah wait it wasn't loading the SetTimer from GrenadeSuperFrag but from
WeaponSuperFrag so hence it indeed didn't have a body,
grenade_superfrag.h is included, anyway I can use the SetTimer from
GrenadeSuperFrag in WeaponSuperFrag? I tried CGrenadeSuperFrag::SetTimer
but says its not a class or
ok back again and found out a bit more
I'm thinking I was initially wrong when I thought only NPC's use Events
but I think its actually so that Activities are linked to Events and in
the events the coder can then specifiy specific code stuff that a
modeller can't do with it.
so I think I have
I haven't followed the discussion from the beginning, so I don't know
where you are in the code, but you seem to be talking about grenades, so
typically if you want to wait until the end of an animation you do sth
like:
SetWeaponIdleTime( gpGlobals-curtime + SequenceDuration() );
or
well been mucking around with the example you gave
have this now:
case EVENT_WEAPON_SEQUENCE_FINISHED:
if ( gpGlobals-curtime m_flTimeWeaponIdle )
{
m_fDrawbackFinished = true;
}
break;
and in PrimaryAttack():
{ event 3900 4 }
The number after the event number is the frame when the event should
be fired. It looks like the last frame in your animation is 35 so write:
{ event 3900 35 }
-- Tim Baker
--
ok back again and found out a bit more
I'm
ohhh
me and my modeller were already wondering what 4 ment! we'll give it a
shot! thanks!
___
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
well he tried it and it worked so thanks!
spent several days on this and now it turns out his fault :P
I believe its time to give him a spanking.. nah kidding
many thanks though :)
___
To unsubscribe, edit your list preferences, or view the list
updating this
found where I could probably do what I wanna do, but inexperienced as I
am and without examples I have no idea how to do it
let's take a look
if( m_fDrawbackFinished )
{
CBasePlayer *pOwner = ToBasePlayer( GetOwner() );
if (pOwner)
{
so moved on and now trying to prevent people from throwing the grenade
DURING the ready animation, for standard hl2 grenades the pin is pulled
when you draw the grenade and you can throw it without even fully
raising your arm.
In my mod the pins gonna be pulled at the actual animation when you
ok been trying out more stuff and found the culprit:
it's:
bool CGrenadeMelon::CreateVPhysics()
{
// Create the object in the physics system
VPhysicsInitNormal( SOLID_BBOX, 0, false );
return true;
}
if I would remove this then melon explodes when it touches something BUT
it just
Add this line. It will get vphysics to generate touch functions for the
grenade.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Yorg Kuijs
Sent: Sunday, August 24, 2008 9:09 AM
To: Discussion of Half-Life Programming
Subject: Re: [hlcoders
GREAT, that did it :) thank you very much!
seems to work fine now gonna test it to more extent tommorow!
again many thanks :D
Jay Stelly schreef:
Add this line. It will get vphysics to generate touch functions for the
grenade.
___
To
still haven't got it working
the base projectile grenade was useless, it wasnt even included in the
project and seems part of the sdk code? or whatever..
more usefull seems all the code I can gather from bugbait, rpg and
basegrenade_shared
together like that I have the following code in my
probably cause you're using a hl2 mod or something, I have a from scratch
mod ( ep1 based ), and my code uses base projectile grenades :)
still haven't got it working
the base projectile grenade was useless, it wasnt even included in the
project and seems part of the sdk code? or whatever..
yeah EP1 half life 2 multiplayer mod:)
anyway anything you see wrong with the code? I know the touch function
and all works, but only seem to get it to work for players, npcs and
physic props, so anything else thats also solid isnt counted somehow..
which is strange, im thinking something else
Alright back with a new problem,
been working on a grenade that explodes on impact and used so far
molotov or rpg code(tried both) but haven't been able to get it work
yet, all I got to work is that it explodes on physic entities, npcs and
players but other then that it just bounces off
http://www.mail-archive.com/hlcoders@list.valvesoftware.com/
but impact grenades should be peanuts. Check out
void CBaseGrenadeProjectile::ResolveFlyCollisionCustom( trace_t trace,
Vector vecVelocity )
hth
Alright back with a new problem,
been working on a grenade that explodes on impact
Maarten De Meyer schreef:
but impact grenades should be peanuts. Check out
void CBaseGrenadeProjectile::ResolveFlyCollisionCustom( trace_t trace,
Vector vecVelocity )
hth
didnt notice there was a basegrenadeprojecile yet! gonna check that out
for sure tommorow! thanks :)
Yeah the impact grenade base is what the SMG grenade launcher uses if
that's of any help.
I used it as a base for a artillery shell projectile I made for a
cannon once. I think the only thing I had to change in the touch code
was to make it discreetly vanish rather than explode when it hit the
just mailing this so you know: I fixed the bleeping and the sound is now
properly playing, turns out I needed to change npc_grenade_frag to
npc_supergrenade_frag, most likely that was still trying to somehow load
the sound from grenade_frag.cpp causing a conflict but changing it to be
I think I'm just gonna leave explosion as is for a while, changed my
focus on the bleeping of the grenade before it explodes
I found already how to change it but my sound cant play correctly
because its about 5 seconds long and it tries to bleep after less then a
second again so the soundfile
Здраствуйте товарищ Yorg!
File grenade_frag.cpp
void CGrenadeFrag::Spawn( void )
{
Precache( );
SetModel( GRENADE_MODEL );
if( GetOwnerEntity() GetOwnerEntity()-IsPlayer() )
{
m_flDamage = sk_plr_dmg_fraggrenade.GetFloat();
hey BEaST,
that sounds like it but the thing is that's the sound I set to null.wav
and it doesn't play the bleeps anymore except the first bleep so isn't
it strange that it's still emitting that first bleep, that's why I think
the first bleep is created somewhere else.. yet this does sound
ok so another solution I thought of would be to remove all the lines of
code for next bleeptime and bleep frequence as I don't want that(this code:)
m_flNextBlipTime = gpGlobals-curtime + FRAG_GRENADE_BLIP_FREQUENCY;
funny thing now is that it seems stuck in between wanting to play the default
Well I've been it at for a few more hours and still no luck, I was
thinking however how it may eventually prove to be faster and easier to
do it in the script file(game_sounds_weapons.txt) and somehow decide
sounds by checking what weapon_name.txt script is loaded.
Ehm here an example of what I
] wrote:
From: Yorg Kuijs [EMAIL PROTECTED]
Subject: Re: [hlcoders] grenade code
To: Discussion of Half-Life Programming hlcoders@list.valvesoftware.com
Date: Friday, August 1, 2008, 12:31 AM
Well I've been it at for a few more hours and still no
luck, I was
thinking however how it may
I'm pretty sure that if is not supported by weapon scripts as they
aren't really scripts but rather data definition formats.
Could you give us the code you have so far, the SuperFrag/HolyGrenade .cpp
and .h?
On Fri, Aug 1, 2008 at 12:31 AM, Yorg Kuijs [EMAIL PROTECTED] wrote:
Well I've been it
You are going to have to edit the explosion effect itself which is client
side. Ill give you the location but actually getting your own sound to play
is going to require some skill on your part, that being, you will need to
create a new variable in that explosion FX so you can if statement your
Alright another question:
I started on adding a new grenade, all went well, it's in game though
its still using the same ammo as the regular grenade, however it will
have a unique sound replacing the regular bleeps and explosion but I
can't find out how to change sounds of it individually.
I
I think you'll find it's defined in the weapons script file.
i.e. weapon_mygrenade.txt
Theres a section that defines weapon sounds and these refer to sounds
defined in weapon_sounds.txt.
Hope that helps.
- Jed
2008/7/30 Yorg Kuijs [EMAIL PROTECTED]:
Alright another question:
I started on
nah there's only a few sounds defined there
but I found what I was looking for in the code, but again if I change
this it will count that for all the grenades so I want to make something
like:
if weapon_frag.cpp
{
playsound1
}
if weapon_superfrag.cpp
{
playsound2
]
I have no idea how to do
Been messing around for about 2 hours now and I think I almost got it
currently using this code:
if ( weapon_superfrag )
{
EmitSound( HolyGrenade.Explode );
}
else if ( weapon_frag )
{
EmitSound( BaseGrenade.Explode );
}
the problem I have is though that
Thats not going to work because your not actually testing anything.
if ( weapon_superfrag ). if weapon_superfrag WHAT? exactly?
I can't remember the exact code off my head but you need something like:
if ( strcmp( this.weapon_name, weapon_superfrag) != 0)
{
...
}
So you'd be comparing the
Yorg Kuijs wrote:
Been messing around for about 2 hours now and I think I almost got it
currently using this code:
if ( weapon_superfrag )
{
I hope that's not the actual code, since...
if ( pointer_to_some_text_string_here )
...will always be true since the pointer will always
Jed schreef:
I still think you'd be better off just overriding the function that
plays the sound in each weapons own class.
and how do I do that? There isn't a function that plays the sound in its
own class, the function that plays the sound is EmitSound which is
location in a function
Override explode?
On Wed, Jul 30, 2008 at 12:26 PM, Yorg Kuijs [EMAIL PROTECTED] wrote:
Jed schreef:
I still think you'd be better off just overriding the function that
plays the sound in each weapons own class.
and how do I do that? There isn't a function that plays the sound in its
Or make an actual function inside the base grenade class like so:
virtual void PlayExplosionSound() {};
then inside Explode()
replace the lines that play the sound with PlayExplosionSound();
and then derive it in your subclasses to actually play the sounds.
On Wed, Jul 30, 2008 at 12:33 PM,
Tony omega Sergi schreef:
and then derive it in your subclasses to actually play the sounds.
think I followed most of what you said except this. What does it mean?
Also base grenade class is basegrenade_shared.cpp ? sounds like that
wouldn't fix it?
Nice answers, think that'll be quite helpfull thanks :)
___
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
1.
/game/shared/hl2mp/weapon_frag.cpp is the weapon (viewmodel) for the HL2DM
frag grenade
/game/server/hl2/grenade_frag.cpp is the grenade entity itself (not the
weapon)
2. There are some prototype grenades, satchels, tripmines, SMG grenades,
etc. There are two versions for weapons because the
49 matches
Mail list logo