[T1] Seeking Missiles

Ryo-Wolf
08-15-2004, 10:21 PM
Is it possible to make a gun that uses seeking missiles in Tribes 1? I know the turrets use them, but everytime I try to canibalize the turret code to make a gun version, the game crashes when I pull the trigger.

Reverend Zero
08-15-2004, 10:31 PM
Some mods had lock on missiles that would track you if the player got a lock on you. HaVoC comes to mind.

Ryo-Wolf
08-15-2004, 10:43 PM
yeah, I've looked at the havoc code. And from what I can tell, it was designed to keep people from borrowing from it. It is so cluttered and disorganized, I'd be hard pressed to find the lock-on codes. Are there any other mods that use it?

Reverend Zero
08-15-2004, 10:51 PM
HavoC was the only mod I ever played so I really don't know. I'm sure Insomniax and Renegades have something like it.

Hilikus
08-15-2004, 11:00 PM
ultra renegades..... it uses bounding box.....and heat signatures...

Hilikus
08-15-2004, 11:02 PM
//========================= ========================= ==============
// Rocket launcher
//========================= ========================= ==============



ItemImageData RocketLauncherImage
{
shapeFile = "grenadel";
mountPoint = 0;
mountoffset = { 0, 0, -0.2 };
mountrotation = { 0, 3, 0 };

weaponType = 0; // Single Shot
//projectileType = LiLFFBShell;
accuFire = false;
reloadTime = 0.07;
fireTime = 0;
minEnergy = 1;
maxEnergy = 0.1;

//lightType = 3; // Weapon Fire
//lightRadius = 2;
//lightTime = 1;
//lightColor = { 1, 0, 0 };

sfxFire = SoundEMPfire;
sfxActivate = SoundPickUpWeapon;
};

ItemData RocketLauncher
{
description = "Star Burster";
className = "Weapon";
shapeFile = "grenadel";
hudIcon = "plasma";
heading = "bWeapons";
shadowDetailMask = 4;
imageType = RocketLauncherImage;
price = 50;
//showWeaponBar = true;
showinventory = true;
//validateShape = true;
validateMaterials = true;
};

function RocketLauncherImage::onFi re(%player, %slot)
{
%client = GameBase::getOwnerClient( %player);
%trans = GameBase::getMuzzleTransf orm(%player);
%vel = Item::getVelocity(%player );
if(GameBase::getLOSInfo(% player,350))
{
%object = getObjectType($los::objec t);
if(%object == "Player" || %object == "Flier")

{
RocketLockWarning(%client , $los::object, %object);
Projectile::spawnProjecti le("StripperONE",%trans,%player,%vel,$los ::object);
Projectile::spawnProjecti le("StripperTWO",%trans,%player,%vel,$los ::object);
} else
Projectile::spawnProjecti le("Stripperalt",%trans,%player,%vel);
} else
Projectile::spawnProjecti le("Stripperalt",%trans,%player,%vel);
}

i think theres another part too it for the los info... i forget its been so long:( i can't create code but i can modify it... i think ill stick with my designing:) ~ultraraptor

Ryo-Wolf
08-16-2004, 01:01 AM
thanks, that helps.

Plasmatic
08-16-2004, 01:23 AM
Forgot to define the projectiles. StripperONE and StripperTWO are seeking missles, StripperALT is a simple rocket.

The fire function checks up to 350m in the players line of sight, and if there's a player or flier there, it fires a seeker at that object. if not, it fires the non seeker. Increase the 350 in the line:
if(GameBase::getLOSInfo(% player,350))
if you want more range.

Unless you write a seek function for StripperOne and two, they will behave like the rocket turret seeker missle. No lock when not jetting.
The default is:
function SeekingMissile::updateTar getPercentage(%target)
{
return GameBase::virtual(%target , "getHeatFactor");
}
add:
function StripperONE::updateTarget Percentage(%target)
{
return true;
}
function StripperTWO::updateTarget Percentage(%target)
{
return true;
}
so they will always seek...

There are other ways to determine the targets object ID, but getlos is the simplest.

Take a look at Annihilation 2.1, everything is in its own file, and easy to read.