Custom Explosion Generators

Custom Explosion Generators

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Custom Explosion Generators

Post by PauloMorfeo »

I just don't get them... :(

From Nanoblobs:
Weapon tfd

Code: Select all

[ARCHERGUN]
	{
	explosiongenerator=custom:ARCHER_MISSILE_FX;
	}
That means that, when it hits, it activates that custom explosion, right?

Now comes all that i don't understand. The custom FX definition:

Code: Select all

[ARCHER_MISSILE_FX]
{
	[heatcloud_ARCHER_MISSILE_FX01]
   	{
		class=heatcloud;
      	[properties]
      	{
			texture=FragmentHeat;
      		...
      		pos = 0, 5, 0;
      	}
		air=1;
      	water=1;
      	ground=1;
      	count=5;
	}

	[heatcloud_ARCHER_MISSILE_FX02]
   	{
		...
	}

	[heatcloud_ARCHER_MISSILE_FX03]
   	{
		...
	}

	[heatcloud_ARCHER_MISSILE_FX04]
	{
		...
	}

	[smoke]
	{
		[properties]
		{
       		...
		}
		...
	}

	[groundflash]
	{
      	...
	}
}
That «class» is called "ARCHER_MISSILE_FX", suposedly the one that get's called by the weapon whenever it hits.

But it has lots of sub-categories, heatcloud_ARCHER_MISSILE_FX01, heatcloud_ARCHER_MISSILE_FX02, ..., smoke, groundflash. Whenever this custom explosion gets activated, is runs all those sub-categories (then why the need for so many?)? Or which? Randomly?

The 4 first categories have "class=heatcloud;" which, from the file of aliases, means it is calling "heatcloud=CHeatCloudProjectile;". Where do i find out what each of the classes does, behaves like, does? (CBeamLaserProjectile, CBubbleProjectile, etc, etc, etc)

Refering to this thread:
Flare effect using emit-sfx
It is refering to these same custom explosions, right? From the scripts, we can call these same custom explosions?
What got added was the ability for the unit to have, in the unit's definition, aliases to bind custom explosions weapon explosions, by number

Code: Select all

   [SFXTypes]
   {
      explosiongenerator0=custom:EXPLOSION1;
      explosiongenerator1=custom:EXPLOSION2;
   }
So those special numbered custom explosions can, ten, be called from the script, which are, actually, nothing more than aliases to weapons?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

No they have nothing to do with weapons. That stuff is in the unit definition and you can use your own explosion generator entries you defined in .\mods\..\gamedata\explosions\*.tdf
That «class» is called "ARCHER_MISSILE_FX", suposedly the one that get's called by the weapon whenever it hits.
It's just a name, nothing more. You can use the alias there instead, i.e. [dirt]. Using a custom name for particle types lets you have more than one of a type in an "explosion" (they're rather special effects). You can then "override" the class to be used by using either class=alias (not recommended) or class=CClassName. The latter is required when you are going to use it with emit-sfx.

Class names can be found in the explosion_alias.tdf.
But it has lots of sub-categories, heatcloud_ARCHER_MISSILE_FX01, heatcloud_ARCHER_MISSILE_FX02, ..., smoke, groundflash. Whenever this custom explosion gets activated, is runs all those sub-categories (then why the need for so many?)? Or which? Randomly?
All of them spawn at the same time when the weapon detonates (at an enemy, ground midair (flak) or under water (torpedos)), as long as it is in LOS or air LOS.
air=1;
water=1;
ground=1;
count=5
This is the condition and amount of how much particles to spawn. air=0 would mean the particle will never be visible if it's not at ground level (y = 0).

More information in the wiki. A list of projectiles which are exported to the explosion generator there.

Or just copy paste some stuff from nanoblobs and experiment around by changing one value at a time. It's really easy.
Post Reply

Return to “Game Development”