.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Half-Life 1 SDK (http://forums.bots-united.com/forumdisplay.php?f=33)
-   -   Making a blowtorch. Drawing the flame? (http://forums.bots-united.com/showthread.php?t=835)

Lazer 21-02-2004 22:13

Making a blowtorch. Drawing the flame?
 
I'm trying to make a blowtorch similar to the Condition-Zero one. Basically it draws a few sprites coming off of what I think might be an attachment point on the model. I dunno how to make it draw the sprites though.

gEngfuncs.pEfxAPI->R_TempSprite( vecSrc, origin, 0.1, m_iBalls, kRenderGlow, kRenderFxNoDissipation, 255.0, 1.0, FTENT_FADEOUT );

I use that to create one of the sprites, but it creates it right at my origin and I don't know how to create it at the attachment point.

Any idea how to make this work?

Austin 22-02-2004 02:41

Re: Making a blowtorch. Drawing the flame?
 
Try looking up particle effects?

Pierre-Marie Baty 22-02-2004 03:59

Re: Making a blowtorch. Drawing the flame?
 
What if you use pfnGetBonePosition() to get the exact location of the attachment point and then display the sprite there ?

Also you might want to look at temporary entities. Some of them are TE_PLAYERATTACHMENT, which mean they're "stuck" to an entity's origin and track it as long as the entity is not destroyed. That's what I use to display the HLVoice speaker icons over my bots' heads.

Lazy 22-02-2004 04:06

Re: Making a blowtorch. Drawing the flame?
 
I do not think that GetBonePosition is client side which is what his code looks like. Though, there is lots of missing information here. All you posted was one line and thats really hard to diagnose. Try posting the function you are using so some of the variables that were referenced in that line make more sense.

botman 22-02-2004 16:08

Re: Making a blowtorch. Drawing the flame?
 
See cl_dll\entity.cpp in the HUD_StudioEvent() function where muzzle flashes are drawn based on the attachment point of a weapon.

botman

Lazer 22-02-2004 18:09

Re: Making a blowtorch. Drawing the flame?
 
Thanks botman, I'll look into that. What I'm trying to do is a muzzleflash type of thing that constantly glows at the attachmentpoint for this sprite. I will have a few of them all lined up actually. This will give the blowtorch look to it.

Lazer 22-02-2004 19:08

Re: Making a blowtorch. Drawing the flame?
 
Problem...

Code:

case 5001:
        int m_iBalls;
        m_iBalls = gEngfuncs.pEventAPI->EV_FindModelIndex( "sprites/rhotglow.spr" );
        gEngfuncs.pEfxAPI->R_TempSprite( (float *)&entity->attachment[0], (float *)&entity->attachment[1], 0.1, m_iBalls, kRenderGlow, kRenderFxNoDissipation, 255.0, 1.0, FTENT_FADEOUT );
break;

I want to make the sprite move from my attachment[0] to attachment[1]. I guess I'm not doing this right because whenever I shoot now it makes the sprite somewhere flying up into the sky. I can't even figure out a deffinate patter as to where the ball spawns and where it flies to. Any idea what I should use for the first two parameters to make it go from one point to the other?


All times are GMT +2. The time now is 13:13.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.