im trying to make a zombies 2013 mod, but i want some of my zombies to explode on death, how do i do dis?
Sun May 12, 2013 4:02 pm
uberhen
Joined: Wed Jan 24, 2007 11:53 pm Posts: 589 Location: Silicon Valley, California
Re: how to create explodable units
I'm guessing you want the torso of the actor to explode once it's received enough damage? At the end of an actor's .ini file (the one with AddActor = AHuman), there should be a bunch of gibs defined like so:
Code:
AddGib = Gib GibParticle = MOSRotating CopyOf = Soldier Rib Cage Gib A Offset = Vector X = 0 Y = -4 Count = 1 Spread = 0 AddGib = Gib GibParticle = MOSRotating CopyOf = Soldier Misc Gib A Offset = Vector X = 1 Y = -6 Count = 1 Spread = 0 AddGib = Gib GibParticle = MOSParticle CopyOf = Gib Panel White Micro A Offset = Vector X = 1 Y = -2.5 Count = 1 Spread = 0 AddGib = Gib GibParticle = MOSParticle CopyOf = Gib Panel White Micro A Offset = Vector X = -2 Y = -6.5 Count = 1 Spread = 0 AddGib = Gib GibParticle = MOSParticle CopyOf = Gib Panel White Tiny A Offset = Vector X = -0.5 Y = -6 Count = 1 Spread = 0 AddGib = Gib GibParticle = MOSRotating CopyOf = Soldier Misc Gib B Offset = Vector X = 4 Y = -1 Count = 1 Spread = 0 AddGib = Gib GibParticle = MOSRotating CopyOf = Soldier Misc Gib C Offset = Vector X = -4 Y = -6 Count = 1 Spread = 0 AddGib = Gib GibParticle = MOSRotating CopyOf = Gib Bone Small D Offset = Vector X = -2.5 Y = -1 Count = 1 Spread = 0 AddGib = Gib GibParticle = MOSParticle CopyOf = Gib Flesh Micro A Offset = Vector X = -3.5 Y = 1 Count = 1 Spread = 0 AddGib = Gib GibParticle = MOSParticle CopyOf = Gib Flesh Micro A Offset = Vector X = -4.5 Y = -4 Count = 1 Spread = 0 AddGib = Gib GibParticle = MOSParticle CopyOf = Gib Flesh Micro A Offset = Vector X = -4.5 Y = -10 Count = 1 Spread = 0 AddGib = Gib GibParticle = MOSRotating CopyOf = Soldier Misc Gib D Offset = Vector X = 1 Y = 2 Count = 1 Spread = 0 GibImpulseLimit = 4100 GibWoundLimit = 20 GibSound = Sound CopyOf = Flesh Body Blunt Hit
^ This is for the coalition soldier. As far as I know, his torso doesn't explode when it gibs, since there aren't any velocity variables on the gibs. Now, let's take a look at the old blue clone:
^ For each MOPixel (single pixels, like blood, zombie green stuff, whatever), MOSParticle (sprites only collide using a single pixel defined at their spriteoffset, I think), and MOSRotating (sprites collide along their whole length, spriteoffset sets center of mass), there is a MaxVelocity and MinVelocity. They're relatively slow right now, all you would need to do in your code is bump these up to, say, 80 and 60 respectively. The "Count =" defines how many of each is created when the actor gibs, and the "Spread =" determines the degrees the multiple gibs will spread out once the actor is gibbed (IIRC, it's radians, so 2.25 = ~129 degrees. Google "x degrees to radians" to determine your value). "GibImpulseLimit" defines the amount of force, like a long drop or a craft crashing into the actor, before he will gib. "GibWoundLimit" determines how many wounds (from bullets, shrapnel, etc) the actor can have before he gibs.
For example, if you want zombie blood to go splattering in all directions, use this:
Code:
AddGib = Gib GibParticle = MOPixel CopyOf = Zombie Blood <---- your blood's presetname here Count = 100 <---- how many pixels you want Spread = 6.28 <---- 360 degrees, they'll hit the ground too, so you may want to bump up the count value MaxVelocity = 80 <---- the maximum speed of the blood will be 80, uh... I forget what the unit is for CC MinVelocity = 60 <---- the minimum speed of the blood
And if you want to have a sound play when the actor explodes, use the "GibSound =" lines from the coalition code I posted, and make the sound point to one you've already defined elsewhere.
I'm still a little fuzzy, though. Check out this old post, lots of useful info there. Specifically section IVb, the Variables.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum