How about some sort of example code to define a certain raycast with an assigned name that is to be used in a certain function?
Notice here from the T+T2 pistol the lack of a name given to the raycast.
raycastWeaponRange = 200; //varies
raycastWeaponTargets =
$TypeMasks::PlayerObjectType | //AI/Players
$TypeMasks::StaticObjectType | //Static Shapes
$TypeMasks::TerrainObjectType | //Terrain
$TypeMasks::VehicleObjectType | //Terrain
$TypeMasks::FXBrickObjectType; //Bricks
raycastExplosionProjectile = GunProjectile;
raycastExplosionBrickSound = bulletHitSound;
raycastExplosionPlayerSound = bulletHitSound;
raycastDirectDamage = 12; //10
raycastDirectDamageType = $DamageType::L4Pistol;
raycastSpreadAmt = 0.0006; //varies
raycastSpreadCount = 1;
raycastTracerProjectile = pistolTracerProjectile;
raycastFromMuzzle = true;
function pistolImage::onFire(%this,%obj,%slot)
{
%obj.spawnExplosion(TTRecoilProjectile,"1 1 1");
if(%obj.getDamagePercent() >= 1.0)
return;
if(vectorLen(%obj.getVelocity()) > 0.1)
{
%this.raycastSpreadAmt = 0.0018;
%this.raycastWeaponRange = 85;
}
else
{
%this.raycastSpreadAmt = 0.0009;
%this.raycastWeaponRange = 200;
}
if(%obj.toolAmmo[%obj.currTool] > 0)
{
Parent::onFire(%this,%obj,%slot);
%obj.toolAmmo[%obj.currTool]--;
%obj.AmmoSpent[%obj.currTool]++;
commandToClient(%obj.client,'bottomPrint',"<just:right><font:impact:24><color:fff000>10x18mm <font:impact:34>\c6" @ %obj.toolAmmo[%obj.currTool] @ " / " @ %obj.client.quantity["9MMrounds"] @ "", 1, 2, 3, 4);
}
else if(%this.item.maxAmmo == 0)
{
Parent::onFire(%this,%obj,%slot);
}
%obj.playThread(2, shiftAway);
}