View unanswered posts | View active topics It is currently Wed Jun 19, 2019 10:16 am

 Page 1 of 1 [ 2 posts ]
 Print view Previous topic | Next topic
how to create explodable units
Author Message

Joined: Fri Dec 14, 2012 5:44 am
Posts: 201
how to create explodable units
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

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:

^ 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:
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.

Tue May 14, 2013 7:03 am
Display posts from previous:  Sort by
 Page 1 of 1 [ 2 posts ]

#### Who is online

Users browsing this forum: No registered users

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ Cortex Command    Dev Log    Wiki    Game Discussion    Game and Licensing Support    Mod Making       Lua Scripting       Requests    Mod Releases       Older Mods    Scene Releases       Scene Making Planetoid Pioneers    Game Discussion    Pioneer Program Lounge Data Realms Off-Topic    Off Topic Chat       Gaming       Forum Games    Site Support & Feedback