GG Guys need your help :)
by Justin DuJardin · in Torque Game Engine · 04/03/2002 (1:40 pm) · 1 replies
Ok, i was looking through weapon projectiles in the T2 scripts, noticed that the laser rifle's beam was hardcoded into the engine.. I was wondering if you could give me some incite as to how it was accomplished, i'm trying to duplicate it for our legends project. Thanks a bunch in advance guys :)
Below is a bit of the T2 script for the beam to refresh your memories :)
datablock SniperProjectileData(BasicSniperShot)
{
directDamage = 0.4;
hasDamageRadius = false;
indirectDamage = 0.0;
damageRadius = 0.0;
velInheritFactor = 1.0;
sound = SniperRifleProjectileSound;
explosion = "SniperExplosion";
splash = SniperSplash;
directDamageType = $DamageType::Laser;
maxRifleRange = 1000;
rifleHeadMultiplier = 1.3;
beamColor = "1 0.1 0.1";
fadeTime = 1.0;
startBeamWidth = 0.145;
endBeamWidth = 0.25;
pulseBeamWidth = 0.5;
beamFlareAngle = 3.0;
minFlareSize = 0.0;
maxFlareSize = 400.0;
pulseSpeed = 6.0;
pulseLength = 0.150;
lightRadius = 1.0;
lightColor = "0.3 0.0 0.0";
textureName[0] = "special/flare";
textureName[1] = "special/nonlingradient";
textureName[2] = "special/laserrip01";
textureName[3] = "special/laserrip02";
textureName[4] = "special/laserrip03";
textureName[5] = "special/laserrip04";
textureName[6] = "special/laserrip05";
textureName[7] = "special/laserrip06";
textureName[8] = "special/laserrip07";
textureName[9] = "special/laserrip08";
textureName[10] = "special/laserrip09";
textureName[11] = "special/sniper00";
};
Below is a bit of the T2 script for the beam to refresh your memories :)
datablock SniperProjectileData(BasicSniperShot)
{
directDamage = 0.4;
hasDamageRadius = false;
indirectDamage = 0.0;
damageRadius = 0.0;
velInheritFactor = 1.0;
sound = SniperRifleProjectileSound;
explosion = "SniperExplosion";
splash = SniperSplash;
directDamageType = $DamageType::Laser;
maxRifleRange = 1000;
rifleHeadMultiplier = 1.3;
beamColor = "1 0.1 0.1";
fadeTime = 1.0;
startBeamWidth = 0.145;
endBeamWidth = 0.25;
pulseBeamWidth = 0.5;
beamFlareAngle = 3.0;
minFlareSize = 0.0;
maxFlareSize = 400.0;
pulseSpeed = 6.0;
pulseLength = 0.150;
lightRadius = 1.0;
lightColor = "0.3 0.0 0.0";
textureName[0] = "special/flare";
textureName[1] = "special/nonlingradient";
textureName[2] = "special/laserrip01";
textureName[3] = "special/laserrip02";
textureName[4] = "special/laserrip03";
textureName[5] = "special/laserrip04";
textureName[6] = "special/laserrip05";
textureName[7] = "special/laserrip06";
textureName[8] = "special/laserrip07";
textureName[9] = "special/laserrip08";
textureName[10] = "special/laserrip09";
textureName[11] = "special/sniper00";
};
Torque Owner Tim Gift
Another way of doing it would be to generate events instead of ghosting a projectile... In this case the beam projectile is not ghosted, but simply blasts out events to all "visible" clients. The event contructs an the beam projectile image on the clients which delete's itself after a few seconds.