Forum

Adding Flies over dead bodys like in QRACK 1.9?(Darkplaces)

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Adding Flies over dead bodys like in QRACK 1.9?(Darkplaces)

Postby skite2001 » Wed Nov 19, 2008 4:59 pm

Hello,
i would like to ask, if it would possibe to add flies over killed (dead) bodys, as seen on the actual QRACK 1.9 or sure, Quake 2.
Using Drakplaces Engine and want to add these "feature" to my effects-mod...if possible to do so.
User avatar
skite2001
 
Posts: 17
Joined: Mon Nov 17, 2008 5:40 pm

Postby scar3crow » Wed Nov 19, 2008 5:08 pm

The only difficult part really is getting the media for the flies, be it via a particle effect (such as in Q2), or models (such as in Unreal) or a just a looping sprite animation. Then you need a fly buzzing sound. The only thing that is left is to associate these assets with any corpse over a period of time (delays are nice, longer delays with natural variation are better). You'll probably want to position the assets a little bit above the corpse, to help circumvent awkwardness of corpses on thin surfaces and such.

I also have no clue how Qrack does it as I don't really use the engine, so I'm going off of Q2/Unreal style.
User avatar
scar3crow
InsideQC Staff
 
Posts: 1054
Joined: Tue Jan 18, 2005 8:54 pm
Location: Alabama

Postby skite2001 » Wed Nov 19, 2008 6:08 pm

qrack does it via png particle.
the resources are no problem, i already got the fly pngs and sound
look here:
http://www.mediafire.com/download.php?yiyk1mtnnhm

...but how to get it working ingame???
User avatar
skite2001
 
Posts: 17
Joined: Mon Nov 17, 2008 5:40 pm

Postby scar3crow » Wed Nov 19, 2008 6:59 pm

Despite my label of Inside3d Staff, I'm not exactly a coder, so take what I say with a grain of salt (and hope someone else responds to this thread).

Basically what you need to do is create a non-solid entity with no velocity that has a null model, citing the fly png particles as the self.effects (how easy this is I do not know, I've never mucked about in anything regarding new effects), and looping the fly buzzing sound. This entity should be created by a monster when they are verified as dead (self.health < 1, movetype = movetype_none etc) and created say 32 units above their origin. For a bit of flourish you can keep track of the time since the monster died and add a random value so it feels less automated, more natural.

I'd suggest digging around in whatever code you can find for behavior that happens once a monster is dead, and for behavior where one entity creates another and how to offset location.
User avatar
scar3crow
InsideQC Staff
 
Posts: 1054
Joined: Tue Jan 18, 2005 8:54 pm
Location: Alabama

Postby Electro » Thu Nov 20, 2008 1:04 am

A non-particle way to do it would be to put that png into a spr (sprite). Then create an entity like scar3crow said and set it's .model to be the .spr file.
Making it move is a little bit more code than that, but not a great deal.
Benjamin Darling
http://www.bendarling.net/

Reflex - In development competitive arena fps combining modern tech with the speed, precision and freedom of 90's shooters.
http://www.reflexfps.net/
Electro
 
Posts: 312
Joined: Wed Dec 29, 2004 11:25 pm
Location: Brisbane, Australia


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest