Game Development Community

Lightning - What Am I Missing Here?

by Gibby · in Torque Game Engine · 02/01/2003 (6:11 pm) · 6 replies

Greets All:

I have gone through Desmond Fletcher's Lightning tutorial and 'though I think I followed it correctly, I can't seem to figure out why I don't see it. I can open and run the mission fine but don't see the effect, and when I open the editor creator I see Lightning under Mission Objects/environment but I don't see a block representing it.

Here's my lightning.cs:

//------------------ Sounds -------------------------------------------------
//
datablock AudioProfile(thunderCrash1)
{
filename = "~/data/sound/fx/environment/thunder1.wav";
description = AudioThunder3d;
};

datablock AudioProfile(thunderCrash2)
{
filename = "~/data/sound/fx/environment/thunder1.wav";
description = AudioThunder3d;
};

datablock AudioProfile(thunderCrash3)
{
filename = "~/data/sound/fx/environment/thunder1.wav";
description = AudioThunder3d;
};

datablock AudioProfile(thunderCrash4)
{
filename = "~/data/sound/fx/environment/thunder1.wav";
description = AudioThunder3d;
};

datablock AudioProfile(LightningHitSound)
{
filename = "~/data/sound/fx/misc/lightning_impact.wav";
description = AudioExplosion3d;
};

//----------------- Default storm -------------------------------------------
//
datablock LightningData(DefaultStorm)
{

strikeTextures[0] = "~/data/fx/lightning/lightning.dml";

// The following parameters reference the sound effects in the first section.

strikeSound = LightningHitSound;

// There are 8 slots for thunder sounds. Make sure all 8 slots are filled.
// If necessary, duplicate the sounds/textures into the extra slots.

thunderSounds[0] = thunderCrash1;
thunderSounds[1] = thunderCrash2;
thunderSounds[2] = thunderCrash3;
thunderSounds[3] = thunderCrash4;
thunderSounds[4] = thunderCrash1;
thunderSounds[5] = thunderCrash2;
thunderSounds[6] = thunderCrash3;
thunderSounds[7] = thunderCrash4;
};


Here's what I've added to the mission file, directly under 'WaterBlock' :

new Lightning() {
position = "0 0 200"; //move the lightning block with the world editor
rotation = "1 0 0 0";
scale = "624 688 500";
dataBlock = "DefaultStorm"; //this links to the lightning.cs datablock
strikesPerMinute = "5";
strikeWidth = "2.5";
chanceToHitTarget = "100";
strikeRadius = "50";
boltStartRadius = "20";
color = "1.000000 1.000000 1.000000 1.000000";
fadeColor = "0.100000 0.100000 1.000000 1.000000";
useFog = "1";
locked = "true";
};

#1
02/01/2003 (10:18 pm)
function createGame()
{
// Load up all datablocks, objects etc. This function is called when
// a server is constructed.
exec("./audioProfiles.cs");
exec("./camera.cs");
exec("./markers.cs");
exec("./inventory.cs");
exec("./shapeBase.cs");
exec("./item.cs");
exec("./health.cs");
exec("./weapon.cs");
exec("./radiusDamage.cs");
exec("./rifle.cs");
exec("./crossbow.cs");
exec("./lightning.cs"); //df: add for random lightning effects
exec("./player.cs");

Did you add the exec("/lightning.cs"); to your fps/server/scripts/game.cs file????
#2
02/03/2003 (3:05 pm)
Gibby turns beet red in embarrassment and then sez:

"Thanks Dude..."
#3
02/03/2003 (3:27 pm)
Don't worry Gibby I did the same thing :)
#4
02/03/2003 (5:18 pm)
I was thinking about adding lightning, but what i wanted to do was Have the lightning strike from the ground up. The map i would use it in is a desert map. So the sand and dust would cause static disharge, I got the idea from dune. The sandworms create a lightning effect as they move through the sand.
#5
02/04/2003 (9:33 am)
Actually, Tim, when you see the lightning go down, the electricity is actually flowing up :)
#6
02/04/2003 (1:12 pm)
'tis true. Slow motion photography shows lighting 'feelers' moving upwards towards the main discharge, looks pretty cool in slow mo'.

- Melv.