Coding question: Exploding

How, what and why to code in BYOND.
Locked
User avatar
Not-Dorsidarf
Joined: Fri Apr 18, 2014 4:14 pm
Byond Username: Dorsidwarf
Location: We're all going on an, admin holiday

Coding question: Exploding

Post by Not-Dorsidarf » #611

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.
Image
Image
There is a lot of very bizarre nonsense being talked on this forum. I shall now remain silent and logoff until my points are vindicated.
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Coding question: Exploding

Post by Remie Richards » #617

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.
私は完璧
User avatar
Rolan7
Rarely plays
Joined: Wed Apr 23, 2014 6:51 pm
Byond Username: Rolan7

Re: Coding question: Exploding

Post by Rolan7 » #1947

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...
The EMPEROR OF MANKIND wants YOU to squash bugs. They are symptoms of CHAOS.
Locked

Who is online

Users browsing this forum: No registered users