Page 1 of 1

Coding question: Exploding

Posted: Sat Apr 19, 2014 7:18 pm
by Not-Dorsidarf
Looking for some advice here: How exactly would I go about making a mob explode. Not just gib, but actually cause a explosion at its own location. If this is an easy question, I apologise, as I'm fairly new to the SS13 code.

Re: Coding question: Exploding

Posted: Sat Apr 19, 2014 7:48 pm
by Remie Richards
Not-Dorsidarf wrote:Looking for some advice here: How exactly would I go about making a mob explode. Not just gib, but actually cause a explosion at its own location. If this is an easy question, I apologise, as I'm fairly new to the SS13 code.

Code: Select all

proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, ignorecap = 0, flame_range = 0)
Arguments:
1: Where the explosion "happens" - must be a turf
2,3,4 are the explosion values you'd use when making a bomb in game, they're how big the explosion is
5: The range at which people get flashed
6: Whether to log it for admins
7: Whether to ignore the bomb camp (Best to keep this at 0)
8: How far out fire can appear from the explosion center

This is a global proc so it doesn't run like "mob.explosion(arguments)" it just runs as explosion(arguments)
Setting the epicentre to get_turf(mob) (Where mob is the mob you want to explode) *Should* kill the mob as well.

Re: Coding question: Exploding

Posted: Fri Apr 25, 2014 11:49 pm
by Rolan7
And if not you can always just call gib() on the mob. Probably want to store the turf, gib the mob, then do the explosion. Don't want to call gib() on a mob that's already been deleted...