Seeking disk projectile

I wanted to try a example script by -Defender for a seeking disk launcher. But the example script does not work at all. Causes only that the disk launcher is not possible to get on player hand (the disk is available like normally on the inventory).

The changed code is this and everything on top of that (sounds, effects etc) are on original state. Does someone find the specific problem or is the script on these days impossible to get working?
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock SeekerProjectileData(SeekerDiscProjectile)
{
   projectileShapeName = "disc.dts";
   hasDamageRadius     = true;
   indirectDamage      = 0.50;
   damageRadius        = 15.0;
   radiusDamageType    = $DamageType::Disc;
   kickBackStrength    = 2000;

   explosion           = "DiscExplosion";
   underwaterExplosion = "UnderwaterDiscExplosion";
   splash              = DiscSplash;

   velInheritFactor    = 1.0;    // to compensate for slow starting velocity, this value
                                 // is cranked up to full so the missile doesn't start
                                 // out behind the player when the player is moving
                                 // very quickly - bramage
   baseEmitter         = ChaingunFireEmitter;

   lifetimeMS          = 6000;
   muzzleVelocity      = 10.0;
   maxVelocity         = 110.0;
   turningSpeed        = 20.0;
   acceleration        = 200.0;

   proximityRadius     = 9;

   terrainAvoidanceSpeed         = 180;
   terrainScanAhead              = 25;
   terrainHeightFail             = 12;
   terrainAvoidanceRadius        = 100;

   flareDistance = 0;
   flareAngle    = 0;

   sound = discProjectileSound;

   hasLight    = true;
   lightRadius = 2.0;
   lightColor  = "0.175 0.175 0.5";

   explodeOnWaterImpact = true;
};

//--------------------------------------------------------------------------
// Ammo
//--------------------------------------

datablock ItemData(SeekerDiscAmmo)
{
   className = Ammo;
   catagory = "Ammo";
   shapeFile = "ammo_disc.dts";
   mass = 1;
   elasticity = 0.2;
   friction = 0.6;
   pickupRadius = 2;
	pickUpName = "some spinfusor discs";
};

//--------------------------------------------------------------------------
// Weapon
//--------------------------------------

datablock ShapeBaseImageData(SeekerDiscImage)
{
   className = WeaponImage;
   shapeFile = "weapon_disc.dts";
   item = SeekerDisc;
   ammo = SeekerDiscAmmo;
   offset = "0 0 0";
   emap = true;

   projectile = SeekerDiscProjectile;
   projectileType = SeekerProjectile;

   isSeeker     = true;
   seekRadius   = 170;
   maxSeekAngle = 2;
   seekTime     = 1.50;
   minSeekHeat  = 0.1;

   // only target objects outside this range
   minTargetingDistance             = 50;
   
   // State Data
   stateName[0]                     = "Activate";
   stateTransitionOnTimeout[0]      = "ActivateReady";
   stateTimeoutValue[0]             = 0.5;
   stateSequence[0]                 = "Activate";
   stateSound[0]                    = DiscSwitchSound;

   stateName[1]                     = "ActivateReady";
   stateTransitionOnLoaded[1]       = "Ready";
   stateTransitionOnNoAmmo[1]       = "NoAmmo";

   stateName[2]                     = "Ready";
   stateTransitionOnNoAmmo[2]       = "NoAmmo";
   stateSequence[2]                 = "DiscSpin";
   stateSound[2]                    = DiscLoopSound;
   stateTransitionOnTriggerDown[2]  = "CheckWet";

   stateName[3]                     = "Fire";
   stateTransitionOnTimeout[3]      = "Reload";
   stateTimeoutValue[3]             = 0.4;
   stateFire[3]                     = true;
   stateRecoil[3]                   = LightRecoil;
   stateAllowImageChange[3]         = false;
   stateSequence[3]                 = "Fire";
   stateScript[3]                   = "onFire";
   stateSound[3]                    = DiscFireSound;

   stateName[4]                     = "Reload";
   stateTransitionOnNoAmmo[4]       = "NoAmmo";
   stateTransitionOnTimeout[4]      = "Ready";
   stateTimeoutValue[4]             = 1.0;
   stateAllowImageChange[4]         = false;
   stateSequence[4]                 = "Reload";
   stateSound[4]                    = DiscReloadSound;

   stateName[5]                     = "NoAmmo";
   stateTransitionOnAmmo[5]         = "Reload";
   stateSequence[5]                 = "NoAmmo";
   stateTransitionOnTriggerDown[5]  = "DryFire";

   stateName[6]                     = "DryFire";
   stateSound[6]                    = DiscDryFireSound;
   stateTimeoutValue[6]             = 1.0;
   stateTransitionOnTimeout[6]      = "ActivateReady";
   
   stateName[7]                     = "CheckTarget";
   stateTransitionOnNoTarget[7]     = "DryFire";
   stateTransitionOnTarget[7]       = "Fire";
   
   stateName[8]                     = "CheckWet";
   stateTransitionOnWet[8]          = "WetFire";
   stateTransitionOnNotWet[8]       = "CheckTarget";
   
   stateName[9]                     = "WetFire";
   stateTransitionOnNoAmmo[9]       = "NoAmmo";
   stateTransitionOnTimeout[9]      = "Reload";
   stateSound[9]                    = DiscFireSound;
   stateRecoil[3]                   = LightRecoil;
   stateTimeoutValue[9]             = 0.4;
   stateSequence[3]                 = "Fire";
   stateScript[9]                   = "onWetFire";
   stateAllowImageChange[9]         = false;
};

function SeekerDiscImage::onFire(%data,%obj,%slot)
{
   %p = Parent::onFire(%data, %obj, %slot);
   MissileSet.add(%p);

   %target = %obj.getLockedTarget();
   if(%target)
      %p.setObjectTarget(%target);
   else if(%obj.isLocked())
      %p.setPositionTarget(%obj.getLockedPosition());
   else
      %p.setNoTarget();
}

function SeekerDiscImage::onWetFire(%data, %obj, %slot)
{
   %p = Parent::onFire(%data, %obj, %slot);
   MissileSet.add(%p);

   %p.setObjectTarget(0);
}

datablock ItemData(SeekerDisc)
{
   className = Weapon;
   catagory = "Spawn Items";
   shapeFile = "weapon_disc.dts";
   image = SeekerDiscImage;
   mass = 1;
   elasticity = 0.2;
   friction = 0.6;
   pickupRadius = 2;
	pickUpName = "a seeker disc launcher";

   computeCRC = true;
   emap = true;
};

Comments

Sign In or Register to comment.