Attaching sprites to models???


Glidias
04-30-2003, 10:41 AM
In the article by Whiskas, it said that the current Half-Life can have models that can have attached sprites to it. Is this true???? Can you attach sprites to models? Can you attach sprites to a model??? SHow me how!!!

BY Whiskas
One Final thing that I'm excited about is the possible ability to incorporate particle effects into models. In the current Half-Life engine, sprites are one of the few things that can be attached to a model, and only under limited circumstances. I won't make too many assumptions about particle effects and models since there is not enough information right now.


Maybe with HL's new particle system in the next patch, particle emitters could be put to models. Imagine a disabled vehicle with some smoke coming outta the exhaust pipe! But this can also be done manually...So, this is redundant.

HOwever, i do have a purpose of attaching sprites to models. Is this possible?

Doug the Head
04-30-2003, 10:57 AM
It involves editing of the .qc file in the model.

That's something that I don't really know how to do.

04-30-2003, 11:09 AM
you mean like *cough*muzzleflashes*cough* ? :D

04-30-2003, 03:21 PM
Just make an attachment point, and tell an animation to use a certain sprite at the certain attachment point at a certain frame. Muzzleflash sprites are just assigned to the shoot animations of the guns that that particular class uses.

Sgt.Sinister
04-30-2003, 03:46 PM
Uh..isn't this already possible since we have muzzleflashes already?

Also, does this mean we'll be able to have smoke come out of the barrel after the gun is fired?

Devin Kryss
04-30-2003, 04:40 PM
What do you want muzzleflashes on?

Glidias
04-30-2003, 09:51 PM
Originally posted by Bittles
Just make an attachment point, and tell an animation to use a certain sprite at the certain attachment point at a certain frame. Muzzleflash sprites are just assigned to the shoot animations of the guns that that particular class uses.

OH ok thanks. Time to prepare for SOldier of Fortune II style jungle maps! All Saint Lo country fields with tall grass everywhere!

....Sounds easy enough, an attachment bone....and the .qc file with that bone attachment listing to refer to some "grass.spr". I'll try it out!...including sprite based trees as well (not just poly masked ones...but sprites to add even more detail).

OH yea, i forgot, trees dropping some leaf sprites....Another possiiblity.

04-30-2003, 10:22 PM
Originally posted by Glidias
OH ok thanks. Time to prepare for SOldier of Fortune II style jungle maps! All Saint Lo country fields with tall grass everywhere!

....Sounds easy enough, an attachment bone....and the .qc file with that bone attachment listing to refer to some "grass.spr". I'll try it out!...including sprite based trees as well (not just poly masked ones...but sprites to add even more detail).

OH yea, i forgot, trees dropping some leaf sprites....Another possiiblity.

As far as I know though, you call upon certain numbers for the sprite files, and I don't know which numbers reference which sprites. Decompile a player model with muzzle flashes and look at the qc file to see what I'm talking about.

$sequence "sprint_shoot_thompson" "sprint_shoot_thompson_blend1" "sprint_shoot_thompson_blend2" blend XR -45 45 fps 36 {
{ event 5011 0 "23" }
{ event 5021 0 "13" }
{ event 5031 0 "11" }
{ event 5011 1 "23" }
{ event 5021 1 "13" }
{ event 5031 1 "11" }
{ event 5011 2 "23" }
{ event 5021 2 "13" }
{ event 5031 2 "11" }
}

Not sure what event numbers do what, but that second number is the frame for which the sprite is showing up and the third number is the sprite it's using.

As I said, though, I don't know which event numbers do what besides just one or two, and I've got no idea what number you would use for other sprite files. I've never been interested in that stuff to find out what they mean....yet. :D

Glidias
05-01-2003, 12:32 AM
There used to be a Tut on da old forum.

Is there a Tut somewhere else?

Glidias
05-01-2003, 04:03 AM
Originally posted by Bittles

$sequence "sprint_shoot_thompson" "sprint_shoot_thompson_blend1" "sprint_shoot_thompson_blend2" blend XR -45 45 fps 36 {
{ event 5011 0 "23" }
{ event 5021 0 "13" }
{ event 5031 0 "11" }
{ event 5011 1 "23" }
{ event 5021 1 "13" }
{ event 5031 1 "11" }
{ event 5011 2 "23" }
{ event 5021 2 "13" }
{ event 5031 2 "11" }
}


http://www.planethalflife.com/hlprogramming/tutorial.asp?i=110
Oh gosh, take a look at this. The switch(event->events) function! Ahahaha, all the cases for all the event->events are there. Here's it.

case 5011:
gEngfuncs.pEfxAPI->R_MuzzleFlash( (float *)&entity->attachment[1], atoi( event->options) ); break;
case 5021:
gEngfuncs.pEfxAPI->R_MuzzleFlash( (float *)&entity->attachment[2], atoi( event->options) ); break;
case 5031:
gEngfuncs.pEfxAPI->R_MuzzleFlash( (float *)&entity->attachment[3], atoi( event->options) ); break;

And do check out the other cases! Of course, those other cases i can't confirm whether they exist in default HL. When i checked entity.cpp in the HL SDK, apparently they only had a few events. Also, if you checked Modeling for Halflife.doc in the SDK, you would only notice a few of the default events that come with HL.

Actually events are very useful i realised. You can have a map model play its own distinctive sound on differnet instances, without the need for the mapper to add his own. It's like telling him , "Just put this model into the map and see it come ALLLIVE and hear it!!!".

(if i'm not wrong, the MuzzleFlash events the modellers made use of in beta 3.1 no longer can work in version 1.0 according to the dev team....so you can't play around with those events in Version 1.0 according to what i heard) ! Why is the HL code so darn restrictive??? This muzzle flash on models was merely a hack done on it by people exploiting an old event in HL, right? I guess so.

Alright, do you mean if i wanna do what i intend to do, i must hack the HLSDk and make my own mod??? I most certaintly hope not!

LOL, maybe i would try makign use of another event (eg. teleport, case 13024-case 13026). I doubt teleport sprites ever occured in DoD, so /me thinks of converting the teleport sprite to a grass sprite, and using that teleport event to generate what i want.

BUt the problem is, teleport event might have some pre-built "special" settings as to how the sprite is displayed. GASP! hopefully not.

Anyway, those are some events. FlickerParticles...hmmm..could use that event for some vehicle destroyed animation for a destroyed 88.

Glidias
05-01-2003, 06:02 AM
Anyone know of a tool that can convert the Bone coordinates of a ms3d file into a $attachment list? So, instead of manually typing the coordinates for every bone, can a list of attachment coordinates be automatically generated??

05-01-2003, 06:13 AM
Originally posted by Glidias
Anyone know of a tool that can convert the Bone coordinates of a ms3d file into a $attachment list? So, instead of manually typing the coordinates for every bone, can a list of attachment coordinates be automatically generated??

Just thought of this. You could try making a new bone, that's attached to the bone you're going to attach the attachment point to. Place this new bone where you want your attachment to be at. Export it as a reference SMD and open it up in notepad. Then do this:

(Coordinates of bone, that attachment is linked to) - (coordinates of new bone where attachment is going to be) = (coordinates you would use for the attachment)

I haven't tried that yet, but it seems like it would work, unless the coordinates SMD files use, are drastically different than the ones in a QC file.

Glidias
05-01-2003, 06:26 AM
I need 1000 attachments to display 1000 sprites in a mdl

Ah crap i wish there was a random fractual bone scatter algorithm!!!!!!@@#!#!##!

I can't afford to drum my stupid calculator 1000 times!

Neither can i afford to type 1000 lines!

I just want to casually click on my solid model work and scatter every individual attachment points everwhere like seeds! (kinda like scattering tons of point entities on your .rmf map brushwork)....kinda like scattering 1000 seeds on a field, and the entire list of
"$attachment 0 "plantseed" 49.000000 -14.500000 -3.000000
$attachment 0 "plantseed" 49.000000 -14.600000 -3.000000
$attachment 0 "plantseed" 49.000000 -14.700000 -3.000000
$attachment 0 "plantseed" 49.000000 -14.800000 -3.000000
.........................
....................
"
is generated!

Day of Defeat Forum Archive created by Neil Jedrzejewski.

This in an partial archive of the old Day of Defeat forums orignally hosted by Valve Software LLC.
Material has been archived for the purpose of creating a knowledge base from messages posted between 2003 and 2008.