I love the smell of UnrealEd crashing in the morning. – tarquin

Legacy:ExplosionChain

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
Actor >> Effects (UT) >> ExplosionChain (custom)

...a description of what it actually does is required here...

When triggered, this actor spawns an explosion sprite (class SpriteBallExplosion) and hurts things nearby. Because of the way it is scripted, it cannot be retriggered. See below for a fix.

Properties[edit]

MomentumTransfer 
is passed to the HurtRadius function – presumably the momentum applied to actors affected by the explosion.
Damage 
the amount of damage to inflict on surrounding actors. The radius affected is this value + 100.
Size 
scaling of the explosion sprite
Delaytime 
the explosion is delayed by a random amount, between 1 and 3 times this value.

Comments[edit]

For some reason I could only add this to a map in an orthogonal viewport, not in 3D. Could someone confirm this?

Mychaeel: UnrealEd frequently says "Actor doesn't fit here" when you try to place an ExplosionChain in 3D view even though its collision size is zero. It occasionally works though even in 3D view.

This has been scripted so it's triggered... yet setting bOnlyTriggerable to true will make it ignore triggers... weird.

Mychaeel: Hard to believe from the code. bOnlyTriggerable should indeed make the ExplosionChain only triggerable (otherwise it could also be set off by inflicting damage on it).

Tarquin: It was probably me that wrote that, and it looks like I read the code wrong... oops. Trigger calls TakeDamage, which is short-circuited if bOnlyTriggerable && DamageType!='Detonated').

Which part of the script actually makes a noise?

What does the 'detonated' damage type do?

RFairey: The part of the code that makes a noise is in the class SpriteBallExplosion, which is spawned in the Explosion Chain code. In turn, SpriteBallExplosion spawns the class SpriteBallChild, and some smoke effects too. I think the detonated damage type is for the death message if you are caught in the blast, "Player1 was detonated" or something.

Examples[edit]

Tutorials which use this actor:

Extending[edit]

This actor destroys itself once it has been triggered and exploded, so the explosions can only be triggered once. To make it repeatable, subclass it with the following code. This class has been tested, a demo map is available from Tarquin and will probably be posted here at some point. See Create A Subclass and Embedding Code for how to use this script.

//=============================================================================
// RepeatExplosionChain.
//=============================================================================
class RepeatExplosionChain extends ExplosionChain;
 
state Exploding
{
	function Timer()
	{
		local SpriteBallExplosion f;
 
		bExploding = true;
 		HurtRadius(damage, Damage+100, 'Detonated', MomentumTransfer, Location);
 		f = Spawn(class'SpriteBallExplosion',,,Location + vect(0,0,1)*16,rot(16384,0,0)); 
 		f.DrawScale = (Damage/100+0.4+FRand()*0.5)*Size;
		GotoState('');
	}
}

If there's an easier way to make it repeatable, please add it to this page.

Setting Advanced.bNoDelete won't work because once triggered it's put into Exploding state, which ignores the listening function.

Related Topics[edit]


Dark Pulse: Is there any way to STOP the explosion once it's started? I figured this would just allow a repeatedly triggerable explosion, not one that goes on forever...

Foxpaw: You can stop the explosions by stopping the timer. I believe you can stop the timer by setting it to 0. I'm not sure if you can set the state to a blank like that, maybe you can, or you might need to make a dummy state for that purpose.