What my goal is, is to create a vehicle using the "fighter" as the base, and replace the normal rocket launchers on it with the stinger missile functionality.
Looking through the code of the stinger.cs file, I think I've located the bit of code I would need, but I'm not sure. Basically I'm trying to find the section that locks on to the target
Code: Select all
function StingerImage::onFire(%player,%slot)
{
if($debug)
echo("?? EVENT fire "@Player::getMountedItem(%player,0)@ " player "@ %player @" cl# "@ Player::getclient(%player));
%AmmoCount = Player::getItemCount(%player, $WeaponAmmo[Stinger]);
if(%AmmoCount)
{
%client = GameBase::getOwnerClient(%player);
%clientName = Player::getClient(%player);
%clientId = Client::getName(%client);
%trans = GameBase::getMuzzleTransform(%player);
%vel = Item::getVelocity(%player);
if(GameBase::getLOSInfo(%player,1500))
{
%object = getObjectType($los::object);
%targeted = GameBase::getOwnerClient($los::object);
if(%object == "Player" || %object == "Flier")
{
%targetP = Client::getName(%targeted);
Client::sendMessage(%client,0,"Stinger lock acquired "@ %targetP @ "~wmine_act.wav");
Client::sendMessage(%targeted,0,"Stinger lock detected - " @ %clientId @ "~wono.wav");
Projectile::spawnProjectile("StingerMissile",%trans,%player,%vel,$los::object);
Annihilation::decItemCount(%player,$WeaponAmmo[Stinger],1);
}
else
{
Projectile::spawnProjectile("StingerRocket",%trans,%player,%vel,%player);
Annihilation::decItemCount(%player,$WeaponAmmo[Stinger],1);
}
}
else
{
Projectile::spawnProjectile("StingerRocket",%trans,%player,%vel,$los::object);
Annihilation::decItemCount(%player,$WeaponAmmo[Stinger],1);
}
}
else
Client::sendMessage(Player::getClient(%player),0,"Stinger out of ammo.~waccess_denied.wav");
}
Code: Select all
if(%object == "Player" || %object == "Flier")
Code: Select all
if(%object == "Flier")
If that is the case, would I simply have to change line 36:
Code: Select all
projectileType = ScoutMissile;
Code: Select all
projectileType = StingerAmmo