Author Topic: Editing the Horse Ray  (Read 1657 times)

I just wanted to try a quick personal edit if the Horse Ray, and make it a Wall-e Ray. I took a quick look at the script, and, since I had to go, didn't edit at all. I was just wondering what name to put in instead of "Horsearmor". I know how to do all of the renaming jazz. Also, how do I change a weapon's color? I once tried changing it, it didn't work. Do I have to rename the color file (I.e. DARKERBLUE from the OSR) or something, because just changing the color itself doesn't work, and I stays blue.

You would change "horseArmor" to whatever the name of the Wall-E playertype's name is. Open the script file for that one, search for "PlayerData" and get the bit in brackets.

To change the colour, search for the colorShiftColor parts in your weapon's script file. There should be two, the item (on the brick) and the weapon that goes in your hand. Edit these to change the weapon's colour.

The weapon's color is in R G B (Red Green Blue) Values.

In order to get a color you want, find your desired color on here:
http://www.tayloredmktg.com/rgb/

Then divide.. <value> by 255 to get a number from 0-1. Which is what blockland uses for it's RGB values.
For instance, if you wanted (255 155 0) you would put (1 .6 0)

255 being solid color of each value.

Thanks a lot for the help, guys! Locking.

Alright, now I have a problem. I tried to make Mechlight and MechHeavy rays after having a successful wall-e, airboat, and mech attempt, but they don't show up in the Wrench Gui. Any help will be appreciated, I'll be on at 9:00 tonight.

Alright, now I have a problem. I tried to make Mechlight and MechHeavy rays after having a successful wall-e, airboat, and mech attempt, but they don't show up in the Wrench Gui. Any help will be appreciated, I'll be on at 9:00 tonight.
You also need to change the datablock of the ray and the UI name

Here's the script. I had already replaced everything I could find to the other name:
Code: [Select]
//MechLightRay - shoot someone, they turn into a MechLight

//audio
//datablock AudioProfile(MechLightRayFireSound)
//{
//   filename    = "base/data/sound/printFire.wav";
//   description = AudioClose3d;
//   preload = true;
//};
//datablock AudioProfile(MechLightRayHitSound)
//{
//   filename    = "./MechLightRayHit.wav";
//   description = AudioClose3d;
//   preload = true;
//};


//explosion
datablock ParticleData(MechLightRayExplosionParticle)
{
   dragCoefficient      = 10;
   gravityCoefficient   = 0.0;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 300;
   lifetimeVarianceMS   = 290;
   spinSpeed = 0.0;
spinRandomMin = -150.0;
spinRandomMax = 150.0;
   textureName          = "base/data/particles/star1";
   colors[0]     = "0.4 0.9 0.4 0.9";
   colors[1]     = "0.0 1.0 0.0 0.9";
   colors[2]     = "0.0 1.0 0.6 1.0";

   sizes[0]      = 0.0;
   sizes[1]      = 0.7;
   sizes[2]      = 2.0;

   times[0] = 0.0;
   times[1] = 0.9;
   times[2] = 1.0;
};

datablock ParticleEmitterData(MechLightRayExplosionEmitter)
{
lifeTimeMS = 50;

   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 15;
   velocityVariance = 4.0;
   ejectionOffset   = 1.25;
   thetaMin         = 0;
   thetaMax         = 180;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "MechLightRayExplosionParticle";

   uiName = "MechLight Ray Explosion";
};
datablock ExplosionData(MechLightRayExplosion)
{
   //explosionShape = "";
   lifeTimeMS = 500;

   emitter[0] = MechLightRayExplosionEmitter;

   //soundProfile = MechLightRayHitSound;

   faceViewer     = true;
   explosionScale = "1 1 1";

   shakeCamera = true;
   camShakeFreq = "2.0 2.0 2.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 0.5;
   camShakeRadius = 10.0;

   // Dynamic light
   lightStartRadius = 3;
   lightEndRadius = 1;
   lightStartColor = "00.0 0.6 0.9";
   lightEndColor = "0 0 0";
};



//muzzle flash effects
datablock ParticleData(MechLightRayFlashParticle)
{
dragCoefficient      = 3;
gravityCoefficient   = -0.5;
inheritedVelFactor   = 0.2;
constantAcceleration = 0.0;
lifetimeMS           = 25;
lifetimeVarianceMS   = 15;
textureName          = "base/data/particles/star1";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0]     = "1.0 0.9 0.0 0.9";
colors[1]     = "0.0 0.5 0.0 0.0";
sizes[0]      = 1.5;
sizes[1]      = 2.50;

useInvAlpha = false;
};
datablock ParticleEmitterData(MechLightRayFlashEmitter)
{
   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 1.0;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "MechLightRayFlashParticle";

   uiName = "MechLight Ray Flash";
};

datablock ParticleData(MechLightRaySmokeParticle)
{
dragCoefficient      = 1;
gravityCoefficient   = 0.0;
inheritedVelFactor   = 1.0;
constantAcceleration = 0.0;
lifetimeMS           = 525;
lifetimeVarianceMS   = 55;
textureName          = "base/data/particles/star1";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0]     = "0.1 0.9 0.1 0.2";
colors[1]     = "0.1 0.9 0.1 0.0";
sizes[0]      = 0.25;
sizes[1]      = 0.1;

useInvAlpha = false;
};
datablock ParticleEmitterData(MechLightRaySmokeEmitter)
{
   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = -3.0;
   velocityVariance = 0.0;
   ejectionOffset   = 0.50;
   thetaMin         = 0;
   thetaMax         = 180;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "MechLightRaySmokeParticle";

   uiName = "MechLight Ray Charge";
};


//bullet trail effects
datablock ParticleData(MechLightRayTrailParticle)
{
dragCoefficient      = 3;
gravityCoefficient   = -0.0;
inheritedVelFactor   = 0.0;
constantAcceleration = 0.0;
lifetimeMS           = 300;
lifetimeVarianceMS   = 55;
textureName          = "base/data/particles/thinRing";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0]     = "0.0 0.9 0.1 0.4";
colors[1]     = "0.1 0.9 0.0 0.4";
   colors[2]     = "0.1 0.9 0.0 0.0";
   sizes[0]      = 0.0;
sizes[1]      = 1.0;
sizes[2]      = 0.0;

   times[0] = 0;
   times[1] = 0.3;
   times[2] = 1;

useInvAlpha = false;
};
datablock ParticleEmitterData(MechLightRayTrailEmitter)
{
   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 0.0;
   velocityVariance = 0.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "MechLightRayTrailParticle";

   uiName = "MechLight Ray Trail";
};


datablock ProjectileData(MechLightRayProjectile)
{
   projectileShapeName = "base/data/shapes/empty.dts";
   directDamage        = 30;
   directDamageType    = $DamageType::Default;
   radiusDamageType    = $DamageType::Default;

   brickExplosionRadius = 0;
   brickExplosionImpact = true;          //destroy a brick if we hit it directly?
   brickExplosionForce  = 10;
   brickExplosionMaxVolume = 1;          //max volume of bricks that we can destroy
   brickExplosionMaxVolumeFloating = 2;  //max volume of bricks that we can destroy if they aren't connected to the ground

   impactImpulse      = 000;
   verticalImpulse   = 100;
   //explosion           = MechLightRayExplosion;
   bloodExplosion        = MechLightRayExplosion;
   particleEmitter       = MechLightRayTrailEmitter;
   explodeOnPlayerImpact = true;
   explodeOnDeath        = false;

   muzzleVelocity      = 90;
   velInheritFactor    = 1;

   armingDelay         = 3000;
   lifetime            = 3000;
   fadeDelay           = 3500;
   bounceElasticity    = 0.99;
   bounceFriction      = 0.20;
   isBallistic         = true;
   gravityMod = 0.0;

   hasLight    = false;
   lightRadius = 3.0;
   lightColor  = "0 0 0.5";
   
   uiName = "MechLight Ray";
};

//////////
// item //
//////////
datablock ItemData(MechLightRayItem)
{
category = "Weapon";  // Mission editor category
className = "Weapon"; // For inventory system

// Basic Item Properties
shapeFile = "base/data/shapes/printGun.dts";
rotate = false;
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;

//gui stuff
uiName = "MechLight Ray";
iconName = "base/client/ui/itemIcons/Printer";
doColorShift = true;
colorShiftColor = "0.0 0.7 0.0 1.000";

// Dynamic properties defined by the scripts
image = MechLightRayImage;
canDrop = true;
};

////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(MechLightRayImage)
{
   // Basic Item properties
   shapeFile = "base/data/shapes/printGun.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   offset = "0 0 0";
   eyeOffset = 0; //"0.7 1.2 -0.5";
   rotation = eulerToMatrix( "0 0 0" );

   // When firing from a point offset from the eye, muzzle correction
   // will adjust the muzzle vector to point to the eye LOS point.
   // Since this weapon doesn't actually fire from the muzzle point,
   // we need to turn this off. 
   correctMuzzleVector = true;

   // Add the WeaponImage namespace as a parent, WeaponImage namespace
   // provides some hooks into the inventory system.
   className = "WeaponImage";

   // Projectile && Ammo.
   item = BowItem;
   ammo = " ";
   projectile = MechLightRayProjectile;
   projectileType = Projectile;

//casing = MechLightRayShellDebris;
//shellExitDir        = "1.0 -1.3 1.0";
//shellExitOffset     = "0 0 0";
//shellExitVariance   = 15.0;
//shellVelocity       = 7.0;

   //melee particles shoot from eye node for consistancy
   melee = false;
   //raise your arm up or not
   armReady = true;

   doColorShift = true;
   colorShiftColor = MechLightRayItem.colorShiftColor;//"0.400 0.196 0 1.000";

   //casing = " ";

   // Images have a state system which controls how the animations
   // are run, which sounds are played, script callbacks, etc. This
   // state system is downloaded to the client so that clients can
   // predict state changes and animate accordingly.  The following
   // system supports basic ready->fire->reload transitions as
   // well as a no-ammo->dryfire idle state.

   // Initial start up state
stateName[0]                     = "Activate";
stateTimeoutValue[0]             = 0.15;
stateTransitionOnTimeout[0]       = "Ready";
stateSound[0] = weaponSwitchSound;

stateName[1]                     = "Ready";
stateTransitionOnTriggerDown[1]  = "Fire";
stateAllowImageChange[1]         = true;
stateSequence[1] = "Ready";

stateName[2]                    = "Fire";
stateTransitionOnTimeout[2]     = "Smoke";
stateTimeoutValue[2]            = 0.14;
stateFire[2]                    = true;
stateAllowImageChange[2]        = false;
stateSequence[2]                = "Fire";
stateScript[2]                  = "onFire";
stateWaitForTimeout[2] = true;
stateEmitter[2] = MechLightRayFlashEmitter;
stateEmitterTime[2] = 0.05;
stateEmitterNode[2] = "muzzleNode";
stateSound[2] = printFireSound;
stateEjectShell[2]       = true;

stateName[3] = "Smoke";
stateEmitter[3] = MechLightRaySmokeEmitter;
stateEmitterTime[3] = 0.4;
stateEmitterNode[3] = "muzzleNode";
stateTimeoutValue[3]            = 0.5;
stateTransitionOnTimeout[3]     = "Reload";

stateName[4] = "Reload";
stateSequence[4]                = "Reload";
stateTransitionOnTriggerUp[4]     = "Ready";
stateSequence[4] = "Ready";

};

function MechLightRayImage::onFire(%this,%obj,%slot)
{
if(%obj.getDamagePercent() < 1.0)
%obj.playThread(2, shiftAway);
Parent::onFire(%this,%obj,%slot);
}

function MechLightRayProjectile::Damage(%this,%obj,%col,%fade,%pos,%normal)
{
   if(%col.getType() & $TypeMasks::PlayerObjectType)
   {
      %col.setDataBlock(MechLightArmor);

      if(isObject(%col.client))
         %col.client.applyBodyColors();

      if(%col.getObjectMount())
         %col.getDataBlock().doDismount(%col);
   }
}





Here's the server.cs:
Code: [Select]
//we need the horse add-on for this, so force it to load
%error = ForceRequiredAddOn("Vehicle_MechLight");

if(%error == $Error::AddOn_Disabled)
{
   //A bit of a hack:
   //  we just forced the Mech Light to load, but the user had it disabled
   //  so lets make it so they can't select it
   MechLightArmor.uiName = "";
}

if(%error == $Error::AddOn_NotFound)
{
   //we don't have the Mech Light, so we're screwed
   error("ERROR: Weapon_MechLight_Ray - required add-on Vehicle_MechLight not found");
}
else
{
   exec("./Weapon_MechLight_Ray.cs");
}



Also, I renamed the file to Weapon_MechLight_Ray, and the file inside to Weapon_MechLight_Ray.cs
Sorry for the ton of code, just wanted to get it out beforehand. Also, they show up in the add-on list and are checked off.
« Last Edit: August 27, 2009, 09:08:23 PM by Dapizzanator »

Also, it now won't work for any new rays I try to make... Please help!


You have Mech Light enabled, true?

And you have the playertype right, true?

Yea, I checked, Mech Heavy and Light are indeed on. Also, it wouldn't work when I tried to do a zombie one, maybe I'm running out of datablocks? Or would Blockland just not start.

I also tried with a Minigun edit, using the ShockWave projectile. Again, failed. Here's a code:
Code: [Select]
datablock ParticleData(ShockwaveMinigunSmokeParticle)
{
dragCoefficient      = 4;
gravityCoefficient   = -1.0;
inheritedVelFactor   = 0.2;
constantAcceleration = 0.0;
lifetimeMS           = 425;
lifetimeVarianceMS   = 55;
textureName          = "base/data/particles/cloud";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0]     = "0.5 0.5 0.5 0.7";
colors[1]     = "0.5 0.5 0.5 0.0";
sizes[0]      = 0.05;
sizes[1]      = 0.25;

useInvAlpha = false;
};
datablock ParticleEmitterData(ShockwaveMinigunSmokeEmitter)
{
   ejectionPeriodMS = 10;
   periodVarianceMS = 0;
   ejectionVelocity = 1.0;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "ShockwaveMinigunSmokeParticle";
};


//bullet trail effects
datablock ParticleData(ShockwaveMinigunbulletTrailParticle)
{
dragCoefficient      = 3;
gravityCoefficient   = -0.0;
inheritedVelFactor   = 1.0;
constantAcceleration = 0.0;
lifetimeMS           = 525;
lifetimeVarianceMS   = 55;
textureName          = "base/data/particles/dot";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0]     = "0.9 0.0 0.0 0.8";
colors[1]     = "0.9 0.3 0.0 0.6";
colors[2]     = "0.9 0.3 0.0 0.0";
sizes[0]      = 0.06;
sizes[1]      = 0.06;
sizes[2]   = 0.01;
times[0]      = 0.0;
times[1]   = 0.9;
times[2]      = 1.0;

useInvAlpha = false;
};
datablock ParticleEmitterData(ShockwaveMinigunbulletTrailEmitter)
{
   ejectionPeriodMS = 8;
   periodVarianceMS = 0;
   ejectionVelocity = 0.0;
   velocityVariance = 0.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "ShockwaveMinigunbulletTrailParticle";
};

AddDamageType("ShockwaveMinigun",   '<bitmap:add-ons/Weapon_ShockwaveMinigun/CI_ShockwaveMinigun> %1',    '%2 <bitmap:add-ons/Weapon_ShockwaveMinigun/CI_ShockwaveShockwaveMinigun> %1',0.5,1);
datablock ProjectileData(MaverickProjectile)
{
   projectileShapeName = "./empty.dts";
   directDamage        = 15;
   directDamageType    = $DamageType::ShockwaveMinigun;
   radiusDamageType    = $DamageType::ShockwaveMinigun;

   brickExplosionRadius = 0;
   brickExplosionImpact = true;          //destroy a brick if we hit it directly?
   brickExplosionForce  = 10;
   brickExplosionMaxVolume = 15;          //max volume of bricks that we can destroy
   brickExplosionMaxVolumeFloating = 20;  //max volume of bricks that we can destroy if they aren't connected to the ground

   impactImpulse      = 400;
   verticalImpulse   = 300;
   explosion           = GunExplosion;
   particleEmitter     = ShockwaveMinigunbulletTrailEmitter;

   muzzleVelocity      = 180;
   velInheritFactor    = 1;

   armingDelay         = 00;
   lifetime            = 4000;
   fadeDelay           = 3500;
   bounceElasticity    = 0.5;
   bounceFriction      = 0.20;
   isBallistic         = false;
   gravityMod = 0.0;

   hasLight    = false;
   lightRadius = 3.0;
   lightColor  = "0 0 0.5";
};

//////////
// item //
//////////
datablock ItemData(ShockwaveMinigunItem)
{
category = "Weapon";  // Mission editor category
className = "Weapon"; // For inventory system

// Basic Item Properties
shapeFile = "Add-ons/Weapon_ShockwaveMinigun/ShockwaveMinigun.dts";
rotate = false;
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;

//gui stuff
uiName = "ShockwaveMinigun";
iconName = "Add-ons/Weapon_ShockwaveMinigun/icon_ShockwaveMinigun";
doColorShift = true;
colorShiftColor = (180/255) SPC (180/255) SPC (180/255) SPC (255/255);

// Dynamic properties defined by the scripts
image = ShockwaveMinigunImage;
canDrop = true;
};


////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(ShockwaveMinigunImage)
{
   // Basic Item properties
   shapeFile = "Add-ons/Weapon_ShockwaveMinigun/ShockwaveMinigun.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   offset = "0 0 0";
   eyeOffset = "0.0 1.0 -0.85";
   rotation = eulerToMatrix( "0 0 0" );

   // When firing from a point offset from the eye, muzzle correction
   // will adjust the muzzle vector to point to the eye LOS point.
   // Since this weapon doesn't actually fire from the muzzle point,
   // we need to turn this off. 
   correctMuzzleVector = true;

   // Add the WeaponImage namespace as a parent, WeaponImage namespace
   // provides some hooks into the inventory system.
   className = "WeaponImage";

   // Projectile && Ammo.
   item = BowItem;
   ammo = " ";
   projectile = Shockwaveprojectile;
   projectileType = Projectile;

casing = GunShellDebris;
shellExitDir        = "1.0 -1.3 1.0";
shellExitOffset     = "0 0 0";
shellExitVariance   = 15.0;
shellVelocity       = 7.0;

   //melee particles shoot from eye node for consistancy
   melee = false;
   //raise your arm up or not
   armReady = true;
   LarmReady = true;

   doColorShift = true;
   colorShiftColor = ShockwaveMinigunItem.colorShiftColor;//"0.400 0.196 0 1.000";

   //casing = " ";

   // Images have a state system which controls how the animations
   // are run, which sounds are played, script callbacks, etc. This
   // state system is downloaded to the client so that clients can
   // predict state changes and animate accordingly.  The following
   // system supports basic ready->fire->reload transitions as
   // well as a no-ammo->dryfire idle state.

   // Initial start up state
stateName[0]                    = "Activate";
stateTimeoutValue[0]            = 0.15;
stateTransitionOnTimeout[0]     = "Ready";
stateSound[0] = weaponSwitchSound;

stateName[1]                    = "Ready";
stateTransitionOnTriggerDown[1] = "Spinup";
stateAllowImageChange[1]        = true;
stateSequence[1] = "ready";

stateName[2]                    = "Spinup";
stateAllowImageChange[2]        = false;
stateTransitionOnTimeout[2]     = "Fire";
stateTimeoutValue[2]            = 1.00;
stateWaitForTimeout[2] = true;
//stateSound[2] = ShockwaveMinigunShot1Sound;
stateSequence[2] = "Spin";
stateTransitionOnTriggerUp[2]   = "Ready";
//stateSequenceOnTimeout[2] = "Spin";

stateName[3]                    = "Fire";
stateTransitionOnTimeout[3]     = "Smoke";
stateTimeoutValue[3]            = 0.01;
stateFire[3]                    = true;
stateAllowImageChange[3]        = false;
//stateSequence[3]                = "Fire";
stateScript[3]                  = "onFire";
stateWaitForTimeout[3] = true;
stateEmitter[3] = gunFlashEmitter;
stateEmitterTime[3] = 0.01;
stateEmitterNode[3] = "muzzleNode";
stateSound[3] = gunShot1Sound;
stateEjectShell[3]        = true;

stateName[4] = "Smoke";
stateEmitter[4] = ShockwaveMinigunSmokeEmitter;
stateEmitterTime[4] = 0.05;
stateEmitterNode[4] = "muzzleNode";
stateTimeoutValue[4]            = 0.01;
stateTransitionOnTimeout[4]     = "Check";

stateName[5] = "Check";
stateTransitionOnTriggerUp[5]   = "Slow";
stateTransitionOnTriggerDown[5] = "Fire";

stateName[6] = "Slow";
stateTransitionOnTriggerDown[6] = "Fire";
//stateSequence[6]                = "ready";
stateEmitter[6] = ShockwaveMinigunSmokeEmitter;
stateEmitterTime[6] = 1.00;
stateEmitterNode[6] = "muzzleNode";
stateAllowImageChange[6]        = false;
stateTransitionOnTimeout[6]     = "Ready";
stateTimeoutValue[6]            = 1.00;
stateWaitForTimeout[6] = true;

};

function ShockwaveMinigunImage::onMount(%this,%obj,%slot)
{
Parent::onMount(%this,%obj,%slot);
%obj.playThread(0, armreadyboth);
}

function ShockwaveMinigunImage::onUnMount(%this,%obj,%slot)
{
Parent::onMount(%this,%obj,%slot);
%obj.playThread(0, root);
}

function ShockwaveMinigunImage::onFire(%this,%obj,%slot)
{
%obj.setVelocity(VectorAdd(%obj.getVelocity(),VectorScale(%obj.client.player.getEyeVector(),"-1")));

%projectile = %this.projectile;
%spread = 0.00185;
%shellcount = 1;

for(%shell=0; %shell<%shellcount; %shell++)
{
%vector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
%vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
%velocity = VectorAdd(%vector1,%vector2);
%x = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%y = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%z = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%velocity = MatrixMulVector(%mat, %velocity);

%p = new (%this.projectileType)()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
}
return %p;
}

And the server.cs:
Code: [Select]
//we need the gun add-on for this, so force it to load
%error = ForceRequiredAddOn("Weapon_Shockwave");

if(%error == $Error::AddOn_Disabled)
{
   //A bit of a hack:
   //  we just forced the gun to load, but the user had it disabled
   //  so lets make it so they can't select it
   GunItem.uiName = "";
}

if(%error == $Error::AddOn_NotFound)
{
   //we don't have the gun, so we're screwed
   error("ERROR: Weapon_ShockwaveMinigun - required add-on Weapon_Shockwave not found");
}
else
{
   exec("./Weapon_ShockwaveMinigun.cs");
}
Also, I renamed everything back to Shockwaveminigun, because this was a copy of my Nerfminigun. It doesn't show up in the Gui! Nothing I have made from the mech light ray on has! <frustration>

Hmmm, ignore that up there, it's now working... But the ray's aren't... That was weird, but I'm a bit more happy. Guys! I still need help with the other rays! C'mon!

Honestly, I don't do weapon editing.

datablock ProjectileData(MaverickProjectile)

a little late but still.