Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - xxrumaroxx

Pages: 1 [2] 3
16
Help / making Gallery post? how to?
« on: November 23, 2011, 10:24:24 PM »
 i need to know how to make a gallery post that includes pictures. i dont know how to include pictures in my post can some one help me with that

17
Off Topic / Chronicles of Narnia funny??
« on: November 19, 2011, 11:39:37 PM »
a while ago there was a movie out based on the move "The Chronicles of Narnia" but it was a funny version. what was the name of the funny version?

18
Help / Bot events in minigame
« on: November 18, 2011, 08:34:43 AM »
Is there any way for me to make it where I can have much more bot events in a many game with out having to dealing with major lag

19
Help / looking for addon
« on: November 14, 2011, 03:54:48 PM »
I'm looking for the addon where it enables two players, on the same team, to share a kill when double teaming another player. I have already looked in rtb game modes but I just cant seem to find it and I have no idea what the name is. so if some one could leave a link I would greatly appreciate it.

20
Help / need help with blender software
« on: November 12, 2011, 06:55:32 PM »
I have had the software blender for a while now, but every time I install the disk in to my computer to give it a try I always give cuz I have no idea where to even begin. I have searched countless tutorials and nothing really helps. is there any one that could possibly help me out with the software or post a link to any decent tutorial videos.

No irrelevant or negative comments please

21
Help / Need help with VCE
« on: November 11, 2011, 12:47:13 PM »
I need help with VCE. To my understanding when using VCE to make it where a player must have a specific amount of points or more to be able to obtain an item you must set the event for the brick variable as (>=) , meaning greater than or equal to. For example this is the event that I put in:
---------------------------------------------------------------------------------onActivate>player>VCE_IfVariable>points>(>=)>30
onVariableTrue>Player>additem>Dual Handguns
onVariableFalse>Client>CenterPrint>cost: 30 points>3
---------------------------------------------------------------------------------
After putting this in I started a minigame and began to test my events. When I had 43 points I decided to test out the Dual handgun store brick, which was evented with the above event. When I clicked the brick, I got the client text that should only appear if my points are less than 30, but I had 43 points. Being that I had 43 points, which would be VariableTrue, on my activation of the brick I should have obtained the Dual handguns. From what I know this is what should have happened but its not working. Can some one let me know what the problem may be.

22
Modification Help / need more help scripting
« on: October 22, 2011, 11:20:43 PM »
The following script belongs to the stone add-on from the element spell pack. I want to know what will I have to change about this script to decrease the amount of time it takes to refire shots. plz post the number of the lines containing the part of the script needing be changed. Alos I will need to know what to do with it. (no irrelevant comments plz)

datablock audioProfile(StoneExplodeSound)
{
   fileName = "Add-Ons/Weapon_ElementalSpells/Sounds/StoneExplode.wav";
   description = AudioDefault3D;
   preload = true;
};
datablock audioProfile(StoneFireSound)
{
   fileName = "Add-Ons/Weapon_ElementalSpells/Sounds/StoneFire.wav";
   description = AudioClosest3D;
   preload = true;
};

datablock ParticleData(StoneAmbientParticle)
{
   dragCoefficient = 0;
   windCoefficient = 0;
   gravityCoefficient = 0.35;
   inheritedVelFactor = 0.25;
   constantAcceleration = 0;
   lifetimeMS = 1200;
   lifetimeVarianceMS = 500;
   spinSpeed = 0;
   spinRandomMin = -900;
   spinRandomMax = 900;
   useInvAlpha = true;
   framesPerSec = 1;
   textureName = "base/data/particles/cloud";

   colors[0] = "0.6 0.35 0 1";
   colors[1] = "0.5 0.25 0 1";
   colors[2] = "0.25 0.125 0 0";
   sizes[0] = 0.25;
   sizes[1] = 0.33;
   sizes[2] = 0.1;
   times[0] = 0;
   times[1] = 0.5;
   times[2] = 1;
};
datablock ParticleEmitterData(StoneAmbientEmitter)
{
   ejectionPeriodMS = 30;
   periodVarianceMS = 5;
   ejectionVelocity = 1;
   velocityVariance = 0;
   ejectionOffset = 0;
   thetaMin = 0;
   thetaMax = 180;
   phiReferenceVel = 0;
   phiVariance = 360;
   particles = StoneAmbientParticle;
   uiName = "Stone - Ambient";
};

datablock DebrisData(stoneShardDebris)
{
   emitters = StoneAmbientEmitter;

   shapeFile = "Add-Ons/Weapon_ElementalSpells/OtherShapes/StoneShard.dts";
   lifetime = 3;
   minSpinSpeed = -200;
   maxSpinSpeed = 200;
   elasticity = 0.5;
   friction = 0.2;
   numBounces = 1;
   staticOnMaxBounce = true;
   snapOnMaxBounce = false;
   fade = true;

   gravModifier = 1.5;
};

datablock ParticleData(StoneExplosionParticle)
{
   dragCoefficient = 1;
   windCoefficient = 0;
   gravityCoefficient = 1;
   inheritedVelFactor = 0;
   constantAcceleration = 0;
   lifetimeMS = 1100;
   lifetimeVarianceMS = 300;
   spinSpeed = 0;
   spinRandomMin = -900;
   spinRandomMax = 900;
   useInvAlpha = true;
   textureName = "base/data/particles/cloud";
   colors[0] = "0.8 0.65 0.30 1";
   colors[1] = "0.75 0.50 0 1";
   colors[2] = "0.50 0.25 0 0";
   sizes[0] = 0.8;
   sizes[1] = 0.7;
   sizes[2] = 0.6;
   times[0] = 0;
   times[1] = 0.5;
   times[2] = 1;
};
datablock ParticleEmitterData(StoneExplosionEmitter)
{
   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 25;
   velocityVariance = 0;
   ejectionOffset = 1;
   thetaMin = 0;
   thetaMax = 75;
   phiReferenceVel = 0;
   phiVariance = 360;
   particles = StoneExplosionParticle;
   lifetimeMS = 300;
};

datablock ExplosionData(StoneExplosion)
{
   soundProfile = StoneExplodeSound;

   lifeTimeMS = 200;

   particleEmitter = StoneExplosionEmitter;
   particleDensity = 100;
   particleRadius = 5;

   debris = stoneShardDebris;
   debrisNum = 5;
   debrisNumVariance = 1;
   debrisPhiMin = 0;
   debrisPhiMax = 360;
   debrisThetaMin = 15;
   debrisThetaMax = 60;
   debrisVelocity = 22;
   debrisVelocityVariance = 2;

   emitter[0] = StoneExplosionEmitter;

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

   shakeCamera = false;
   camShakeFreq = "10.0 11.0 10.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 0.5;
   camShakeRadius = 10.0;

   lightStartRadius = 10;
   lightEndRadius = 1;
   lightStartColor = "1 0.5 0";
   lightEndColor = "1 0.5 0";
};

AddDamageType("StoneSpike", '<bitmap:Add-Ons/Weapon_ElementalSpells/Icons/CI_Stone> %1', '%2 <bitmap:Add-Ons/Weapon_ElementalSpells/Icons/CI_Stone> %1', 1, 1);

datablock ProjectileData(StoneMProjectile)
{
   shapeFile = "base/data/shapes/empty.dts";
   directDamage = 0;
   directDamageType = $DamageType::StoneSpike;
   radiusDamageType = $DamageType::StoneSpike;

   brickExplosionRadius = 5;
   brickExplosionImpact = true;
   brickExplosionForce = 50;
   brickExplosionMaxVolume = 15;
   brickExplosionMaxVolumeFloati ng = 25;

   impactImpulse = 0;
   verticalImpulse = 0;
   explosion = StoneExplosion;
   particleEmitter = StoneAmbientEmitter;

   muzzleVelocity = 60;
   velInheritFactor = 1;

   armingDelay = 0;
   lifetime = 4000;
   fadeDelay = 3500;
   bounceElasticity = 0.5;
   bounceFriction = 0.20;
   isBallistic = true;
   gravityMod = 1;

   hasLight = true;
   lightRadius = 2;
   lightColor = "1 0.5 0";

   uiName = "Stone Spike";
};

datablock StaticShapeData(StoneSpikeData)
{
   category = "Statics";
   shapeFile = "Add-Ons/Weapon_ElementalSpells/OtherShapes/StoneSpike.dts";
   skinName = 'null';
};

function StoneMProjectile::onCollision(%this, %obj, %col, %fade, %pos, %normal)
{
   if(strPos(%col.getClassName(), "Player") != -1)
   {
      %start = %col.getPosition();
      %end = vectorAdd(%start, "0 0 " @ -2 * getWord(%col.getScale(), 2));
      %ray = containerRayCast(%start, %end, $TypeMasks::FxBrickObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType);
      if(!isObject(%col = firstWord(%ray)))
      {
         return;
      }
      %pos = posFromRaycast(%ray);
      %normal = normalFromRaycast(%ray);
   }
   if(%col.getType() & $TypeMasks::InteriorObjectType || %col.getType() & $TypeMasks::FxBrickObjectType || %col.getType() & $TypeMasks::TerrainObjectType)
   {
      %scale = %obj.getScale();
      %spike = new TSstatic()
      {
         datablock = StoneSpikeData;
         shapeName = "Add-Ons/Weapon_ElementalSpells/OtherShapes/StoneSpike.dts";
         position = %pos;
         rotation = "0 0 0 0";
         scale = %scale;
      };
      MissionCleanup.add(%spike);
      for(%i = 2; %i <= 24; %i++)
      {
         %spike.schedule(%i * 200, setScale, vectorScale(%scale, 1 / (%i / 2)));
      }
      StoneSpikeData.schedule(10, doDamage, %spike, %obj.sourceObject, %pos, %scale);
      %spike.schedule(5000, delete);
   }
}

function StoneSpikeData::doDamage(%data, %spike, %obj, %pos, %scale)
{
   %scale = getWord(%scale, 2);
   %typemasks = $Typemasks::PlayerObjectType | $Typemasks::VehicleObjectType;
   InitContainerRadiusSearch(%pos, 3 * %scale, %typemasks);
   while(isObject(%hit = ContainerSearchNext()))
   {
      if(minigameCanDamage(%obj, %hit) && getMinigameFromObject(%hit).weaponDamage)
      {
         %hit.damage(%obj, %pos, 10 * %scale, $DamageType::StoneSpike);
         %add = vectorScale(vectorAdd("0 0 10", getRandom(-2, 2) SPC getRandom(-2, 2) SPC getRandom(0, 5)), %scale);
         %hit.setVelocity(vectorAdd(%hit.getVelocity(), %add));
         %hit.lastPusher = %obj.sourceObject;
         %hit.lastPushTime = getSimTime();
      }
   }
   %boxpos = vectorAdd(%pos, "0 0 " @ %scale * 3);
   %boxsize = vectorScale("3 3 7", %scale);
   InitContainerBoxSearch(%boxpos, %boxsize, %typemasks);
   while(isObject(%hit = ContainerSearchNext()))
   {
      if(minigameCanDamage(%obj, %hit) && getMinigameFromObject(%hit).weaponDamage)
      {
         %hit.damage(%obj, %pos, 15 * %scale, $DamageType::StoneSpike);
         %hit.lastPusher = %obj.sourceObject;
         %hit.lastPushTime = getSimTime();
         %add = vectorScale(vectorAdd("0 0 10", getRandom(-5, 5) SPC getRandom(-5, 5) SPC getRandom(0, 5)), %scale);
         %hit.setVelocity(vectorAdd(%hit.getVelocity(), %add));
      }
   }
}

datablock ItemData(StoneMItem)
{
   category = "Weapon";
   className = "Weapon";

   shapeFile = "Add-Ons/Weapon_ElementalSpells/ItemShapes/Stone.dts";
   rotate = false;
   mass = 0.5;
   density = 0.7;
   elasticity = 0.6;
   friction = 0.6;
   emap = true;

   uiName = "Magic - Stone";
   iconName = "Add-Ons/Weapon_ElementalSpells/Icons/Icon_Stone";
   doColorShift = false;
   colorShiftColor = "1 1 1 1";

   image = StoneMImage;
   canDrop = true;
};

datablock ShapeBaseImageData(StoneMImage)
{
   shapeFile = "base/data/shapes/empty.dts";
   emap = true;

   mountPoint = 0;
   offset = "0 0 0";
   eyeOffset = 0;
   rotation = "0 0 0";

   correctMuzzleVector = true;

   className = "WeaponImage";

   item = StoneMItem;
   ammo = " ";
   MPused = 75;
   projectile = StoneMProjectile;
   projectileType = Projectile;

   melee = false;
   armReady = true;

   doColorShift = false;
   colorShiftColor = "1 1 1 1";

   NoAbsorb["FireM"] = 1; //Damage from type "FireM" is not reduced
   NoAbsorb["WindM"] = 1; //Damage from type "WindM" is not reduced

   stateName[0]                   = "Activate";
   stateTimeoutValue[0]           = 0.15;
   stateTransitionOnTimeout[0]    = "Ready";
   stateSound[0]                  = weaponSwitchSound;

   stateName[1]                   = "Ready";
   stateTransitionOnTriggerDown[1]= "Fire";
   stateAllowImageChange[1]       = true;
   stateEmitter[1]                = StoneAmbientEmitter;
   stateEmitterTime[1]            = 300;

   stateName[2]                   = "Fire";
   stateTransitionOnTimeout[2]    = "Reload";
   stateTimeoutValue[2]           = 1;
   stateFire[2]                   = true;
   stateAllowImageChange[2]       = false;
   stateSequence[2]               = "Fire";
   stateScript[2]                 = "onFire";
   stateWaitForTimeout[2]         = true;
   stateSound[2]                  = StoneFireSound;
   stateEjectShell[2]             = true;

   stateName[3]                   = "Reload";
   stateTransitionOnTriggerUp[3]  = "Ready";
};

function StoneMImage::onFire(%this, %obj, %slot)
{
   if(%obj.lst[%this] > getSimTime())
   {
      return;
   }
   %obj.lst[%this] = getSimTime() + 1000;
   if(%obj.getDatablock().isMage)
   {
      if(%obj.hasEnergy(%this.MPused))
      {
         parent::onFire(%this, %obj, %slot);
         %obj.setEnergyLevel(%obj.getEnergyLevel() - %this.MPused);
      }
      else if(isObject(%client = %obj.getControllingClient()))
      {
         %client.centerPrint("\c4Not enough MP!<br>\c3" @ %obj.getEnergyLevel() @ "/" @ %this.MPused, 3);
      }
   }
   else
   {
      parent::onFire(%this, %obj, %slot);
   }
}

package MagicStone
{
   function armor::damage(%this, %obj, %sourceObject, %pos, %amt, %type)
   {
      %img = %obj.getMountedImage(0);
      if(%img == StoneMImage.getID())
      {
         if(!%img.NoAbsorb[$DamageType_Array[%type]])
         {
            %amt*= 0.75;
         }
      }
      parent::damage(%this, %obj, %sourceObject, %pos, %amt, %type);
   }
};
activatePackage(MagicStone);

23
Modification Help / need help with scripting
« on: October 22, 2011, 07:51:42 PM »
The following script belongs to the stone add-on from the element spell pack. I want to know what will I have to change about this script to decrease the amount of time it takes to refire shots. plz post the number of the lines containing the part of the script needing be changed. Alos I will need to know what to do with it. (no irrelevant comments plz)

datablock audioProfile(StoneExplodeSound)
{
   fileName = "Add-Ons/Weapon_ElementalSpells/Sounds/StoneExplode.wav";
   description = AudioDefault3D;
   preload = true;
};
datablock audioProfile(StoneFireSound)
{
   fileName = "Add-Ons/Weapon_ElementalSpells/Sounds/StoneFire.wav";
   description = AudioClosest3D;
   preload = true;
};

datablock ParticleData(StoneAmbientParticle)
{
   dragCoefficient = 0;
   windCoefficient = 0;
   gravityCoefficient = 0.35;
   inheritedVelFactor = 0.25;
   constantAcceleration = 0;
   lifetimeMS = 1200;
   lifetimeVarianceMS = 500;
   spinSpeed = 0;
   spinRandomMin = -900;
   spinRandomMax = 900;
   useInvAlpha = true;
   framesPerSec = 1;
   textureName = "base/data/particles/cloud";

   colors[0] = "0.6 0.35 0 1";
   colors[1] = "0.5 0.25 0 1";
   colors[2] = "0.25 0.125 0 0";
   sizes[0] = 0.25;
   sizes[1] = 0.33;
   sizes[2] = 0.1;
   times[0] = 0;
   times[1] = 0.5;
   times[2] = 1;
};
datablock ParticleEmitterData(StoneAmbientEmitter)
{
   ejectionPeriodMS = 30;
   periodVarianceMS = 5;
   ejectionVelocity = 1;
   velocityVariance = 0;
   ejectionOffset = 0;
   thetaMin = 0;
   thetaMax = 180;
   phiReferenceVel = 0;
   phiVariance = 360;
   particles = StoneAmbientParticle;
   uiName = "Stone - Ambient";
};

datablock DebrisData(stoneShardDebris)
{
   emitters = StoneAmbientEmitter;

   shapeFile = "Add-Ons/Weapon_ElementalSpells/OtherShapes/StoneShard.dts";
   lifetime = 3;
   minSpinSpeed = -200;
   maxSpinSpeed = 200;
   elasticity = 0.5;
   friction = 0.2;
   numBounces = 1;
   staticOnMaxBounce = true;
   snapOnMaxBounce = false;
   fade = true;

   gravModifier = 1.5;
};

datablock ParticleData(StoneExplosionParticle)
{
   dragCoefficient = 1;
   windCoefficient = 0;
   gravityCoefficient = 1;
   inheritedVelFactor = 0;
   constantAcceleration = 0;
   lifetimeMS = 1100;
   lifetimeVarianceMS = 300;
   spinSpeed = 0;
   spinRandomMin = -900;
   spinRandomMax = 900;
   useInvAlpha = true;
   textureName = "base/data/particles/cloud";
   colors[0] = "0.8 0.65 0.30 1";
   colors[1] = "0.75 0.50 0 1";
   colors[2] = "0.50 0.25 0 0";
   sizes[0] = 0.8;
   sizes[1] = 0.7;
   sizes[2] = 0.6;
   times[0] = 0;
   times[1] = 0.5;
   times[2] = 1;
};
datablock ParticleEmitterData(StoneExplosionEmitter)
{
   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 25;
   velocityVariance = 0;
   ejectionOffset = 1;
   thetaMin = 0;
   thetaMax = 75;
   phiReferenceVel = 0;
   phiVariance = 360;
   particles = StoneExplosionParticle;
   lifetimeMS = 300;
};

datablock ExplosionData(StoneExplosion)
{
   soundProfile = StoneExplodeSound;

   lifeTimeMS = 200;

   particleEmitter = StoneExplosionEmitter;
   particleDensity = 100;
   particleRadius = 5;

   debris = stoneShardDebris;
   debrisNum = 5;
   debrisNumVariance = 1;
   debrisPhiMin = 0;
   debrisPhiMax = 360;
   debrisThetaMin = 15;
   debrisThetaMax = 60;
   debrisVelocity = 22;
   debrisVelocityVariance = 2;

   emitter[0] = StoneExplosionEmitter;

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

   shakeCamera = false;
   camShakeFreq = "10.0 11.0 10.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 0.5;
   camShakeRadius = 10.0;

   lightStartRadius = 10;
   lightEndRadius = 1;
   lightStartColor = "1 0.5 0";
   lightEndColor = "1 0.5 0";
};

AddDamageType("StoneSpike", '<bitmap:Add-Ons/Weapon_ElementalSpells/Icons/CI_Stone> %1', '%2 <bitmap:Add-Ons/Weapon_ElementalSpells/Icons/CI_Stone> %1', 1, 1);

datablock ProjectileData(StoneMProjectile)
{
   shapeFile = "base/data/shapes/empty.dts";
   directDamage = 0;
   directDamageType = $DamageType::StoneSpike;
   radiusDamageType = $DamageType::StoneSpike;

   brickExplosionRadius = 5;
   brickExplosionImpact = true;
   brickExplosionForce = 50;
   brickExplosionMaxVolume = 15;
   brickExplosionMaxVolumeFloati ng = 25;

   impactImpulse = 0;
   verticalImpulse = 0;
   explosion = StoneExplosion;
   particleEmitter = StoneAmbientEmitter;

   muzzleVelocity = 60;
   velInheritFactor = 1;

   armingDelay = 0;
   lifetime = 4000;
   fadeDelay = 3500;
   bounceElasticity = 0.5;
   bounceFriction = 0.20;
   isBallistic = true;
   gravityMod = 1;

   hasLight = true;
   lightRadius = 2;
   lightColor = "1 0.5 0";

   uiName = "Stone Spike";
};

datablock StaticShapeData(StoneSpikeData)
{
   category = "Statics";
   shapeFile = "Add-Ons/Weapon_ElementalSpells/OtherShapes/StoneSpike.dts";
   skinName = 'null';
};

function StoneMProjectile::onCollision(%this, %obj, %col, %fade, %pos, %normal)
{
   if(strPos(%col.getClassName(), "Player") != -1)
   {
      %start = %col.getPosition();
      %end = vectorAdd(%start, "0 0 " @ -2 * getWord(%col.getScale(), 2));
      %ray = containerRayCast(%start, %end, $TypeMasks::FxBrickObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType);
      if(!isObject(%col = firstWord(%ray)))
      {
         return;
      }
      %pos = posFromRaycast(%ray);
      %normal = normalFromRaycast(%ray);
   }
   if(%col.getType() & $TypeMasks::InteriorObjectType || %col.getType() & $TypeMasks::FxBrickObjectType || %col.getType() & $TypeMasks::TerrainObjectType)
   {
      %scale = %obj.getScale();
      %spike = new TSstatic()
      {
         datablock = StoneSpikeData;
         shapeName = "Add-Ons/Weapon_ElementalSpells/OtherShapes/StoneSpike.dts";
         position = %pos;
         rotation = "0 0 0 0";
         scale = %scale;
      };
      MissionCleanup.add(%spike);
      for(%i = 2; %i <= 24; %i++)
      {
         %spike.schedule(%i * 200, setScale, vectorScale(%scale, 1 / (%i / 2)));
      }
      StoneSpikeData.schedule(10, doDamage, %spike, %obj.sourceObject, %pos, %scale);
      %spike.schedule(5000, delete);
   }
}

function StoneSpikeData::doDamage(%data, %spike, %obj, %pos, %scale)
{
   %scale = getWord(%scale, 2);
   %typemasks = $Typemasks::PlayerObjectType | $Typemasks::VehicleObjectType;
   InitContainerRadiusSearch(%pos, 3 * %scale, %typemasks);
   while(isObject(%hit = ContainerSearchNext()))
   {
      if(minigameCanDamage(%obj, %hit) && getMinigameFromObject(%hit).weaponDamage)
      {
         %hit.damage(%obj, %pos, 10 * %scale, $DamageType::StoneSpike);
         %add = vectorScale(vectorAdd("0 0 10", getRandom(-2, 2) SPC getRandom(-2, 2) SPC getRandom(0, 5)), %scale);
         %hit.setVelocity(vectorAdd(%hit.getVelocity(), %add));
         %hit.lastPusher = %obj.sourceObject;
         %hit.lastPushTime = getSimTime();
      }
   }
   %boxpos = vectorAdd(%pos, "0 0 " @ %scale * 3);
   %boxsize = vectorScale("3 3 7", %scale);
   InitContainerBoxSearch(%boxpos, %boxsize, %typemasks);
   while(isObject(%hit = ContainerSearchNext()))
   {
      if(minigameCanDamage(%obj, %hit) && getMinigameFromObject(%hit).weaponDamage)
      {
         %hit.damage(%obj, %pos, 15 * %scale, $DamageType::StoneSpike);
         %hit.lastPusher = %obj.sourceObject;
         %hit.lastPushTime = getSimTime();
         %add = vectorScale(vectorAdd("0 0 10", getRandom(-5, 5) SPC getRandom(-5, 5) SPC getRandom(0, 5)), %scale);
         %hit.setVelocity(vectorAdd(%hit.getVelocity(), %add));
      }
   }
}

datablock ItemData(StoneMItem)
{
   category = "Weapon";
   className = "Weapon";

   shapeFile = "Add-Ons/Weapon_ElementalSpells/ItemShapes/Stone.dts";
   rotate = false;
   mass = 0.5;
   density = 0.7;
   elasticity = 0.6;
   friction = 0.6;
   emap = true;

   uiName = "Magic - Stone";
   iconName = "Add-Ons/Weapon_ElementalSpells/Icons/Icon_Stone";
   doColorShift = false;
   colorShiftColor = "1 1 1 1";

   image = StoneMImage;
   canDrop = true;
};

datablock ShapeBaseImageData(StoneMImage)
{
   shapeFile = "base/data/shapes/empty.dts";
   emap = true;

   mountPoint = 0;
   offset = "0 0 0";
   eyeOffset = 0;
   rotation = "0 0 0";

   correctMuzzleVector = true;

   className = "WeaponImage";

   item = StoneMItem;
   ammo = " ";
   MPused = 75;
   projectile = StoneMProjectile;
   projectileType = Projectile;

   melee = false;
   armReady = true;

   doColorShift = false;
   colorShiftColor = "1 1 1 1";

   NoAbsorb["FireM"] = 1; //Damage from type "FireM" is not reduced
   NoAbsorb["WindM"] = 1; //Damage from type "WindM" is not reduced

   stateName[0]                   = "Activate";
   stateTimeoutValue[0]           = 0.15;
   stateTransitionOnTimeout[0]    = "Ready";
   stateSound[0]                  = weaponSwitchSound;

   stateName[1]                   = "Ready";
   stateTransitionOnTriggerDown[1]= "Fire";
   stateAllowImageChange[1]       = true;
   stateEmitter[1]                = StoneAmbientEmitter;
   stateEmitterTime[1]            = 300;

   stateName[2]                   = "Fire";
   stateTransitionOnTimeout[2]    = "Reload";
   stateTimeoutValue[2]           = 1;
   stateFire[2]                   = true;
   stateAllowImageChange[2]       = false;
   stateSequence[2]               = "Fire";
   stateScript[2]                 = "onFire";
   stateWaitForTimeout[2]         = true;
   stateSound[2]                  = StoneFireSound;
   stateEjectShell[2]             = true;

   stateName[3]                   = "Reload";
   stateTransitionOnTriggerUp[3]  = "Ready";
};

function StoneMImage::onFire(%this, %obj, %slot)
{
   if(%obj.lst[%this] > getSimTime())
   {
      return;
   }
   %obj.lst[%this] = getSimTime() + 1000;
   if(%obj.getDatablock().isMage)
   {
      if(%obj.hasEnergy(%this.MPused))
      {
         parent::onFire(%this, %obj, %slot);
         %obj.setEnergyLevel(%obj.getEnergyLevel() - %this.MPused);
      }
      else if(isObject(%client = %obj.getControllingClient()))
      {
         %client.centerPrint("\c4Not enough MP!<br>\c3" @ %obj.getEnergyLevel() @ "/" @ %this.MPused, 3);
      }
   }
   else
   {
      parent::onFire(%this, %obj, %slot);
   }
}

package MagicStone
{
   function armor::damage(%this, %obj, %sourceObject, %pos, %amt, %type)
   {
      %img = %obj.getMountedImage(0);
      if(%img == StoneMImage.getID())
      {
         if(!%img.NoAbsorb[$DamageType_Array[%type]])
         {
            %amt*= 0.75;
         }
      }
      parent::damage(%this, %obj, %sourceObject, %pos, %amt, %type);
   }
};
activatePackage(MagicStone);

24
Help / scripting help needed
« on: October 22, 2011, 06:23:05 PM »
The following script belongs to the stone add-on from the element spell pack. I want to know what will I have to change about this script to ether decrease the amount of MP needed to use the attack with the magician player types or increase the amount of mp the player will have when equipped with the stone weapon. Ether or would be help full but if you know both plz post both and the number of the lines containing the part of the script needing be changed. Alos I will need to know what to do with it. (no irrelevant comments plz)



datablock audioProfile(StoneExplodeSound)
{
   fileName = "Add-Ons/Weapon_ElementalSpells/Sounds/StoneExplode.wav";
   description = AudioDefault3D;
   preload = true;
};
datablock audioProfile(StoneFireSound)
{
   fileName = "Add-Ons/Weapon_ElementalSpells/Sounds/StoneFire.wav";
   description = AudioClosest3D;
   preload = true;
};

datablock ParticleData(StoneAmbientParticle)
{
   dragCoefficient = 0;
   windCoefficient = 0;
   gravityCoefficient = 0.35;
   inheritedVelFactor = 0.25;
   constantAcceleration = 0;
   lifetimeMS = 1200;
   lifetimeVarianceMS = 500;
   spinSpeed = 0;
   spinRandomMin = -900;
   spinRandomMax = 900;
   useInvAlpha = true;
   framesPerSec = 1;
   textureName = "base/data/particles/cloud";

   colors[0] = "0.6 0.35 0 1";
   colors[1] = "0.5 0.25 0 1";
   colors[2] = "0.25 0.125 0 0";
   sizes[0] = 0.25;
   sizes[1] = 0.33;
   sizes[2] = 0.1;
   times[0] = 0;
   times[1] = 0.5;
   times[2] = 1;
};
datablock ParticleEmitterData(StoneAmbientEmitter)
{
   ejectionPeriodMS = 30;
   periodVarianceMS = 5;
   ejectionVelocity = 1;
   velocityVariance = 0;
   ejectionOffset = 0;
   thetaMin = 0;
   thetaMax = 180;
   phiReferenceVel = 0;
   phiVariance = 360;
   particles = StoneAmbientParticle;
   uiName = "Stone - Ambient";
};

datablock DebrisData(stoneShardDebris)
{
   emitters = StoneAmbientEmitter;

   shapeFile = "Add-Ons/Weapon_ElementalSpells/OtherShapes/StoneShard.dts";
   lifetime = 3;
   minSpinSpeed = -200;
   maxSpinSpeed = 200;
   elasticity = 0.5;
   friction = 0.2;
   numBounces = 1;
   staticOnMaxBounce = true;
   snapOnMaxBounce = false;
   fade = true;

   gravModifier = 1.5;
};

datablock ParticleData(StoneExplosionParticle)
{
   dragCoefficient = 1;
   windCoefficient = 0;
   gravityCoefficient = 1;
   inheritedVelFactor = 0;
   constantAcceleration = 0;
   lifetimeMS = 1100;
   lifetimeVarianceMS = 300;
   spinSpeed = 0;
   spinRandomMin = -900;
   spinRandomMax = 900;
   useInvAlpha = true;
   textureName = "base/data/particles/cloud";
   colors[0] = "0.8 0.65 0.30 1";
   colors[1] = "0.75 0.50 0 1";
   colors[2] = "0.50 0.25 0 0";
   sizes[0] = 0.8;
   sizes[1] = 0.7;
   sizes[2] = 0.6;
   times[0] = 0;
   times[1] = 0.5;
   times[2] = 1;
};
datablock ParticleEmitterData(StoneExplosionEmitter)
{
   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 25;
   velocityVariance = 0;
   ejectionOffset = 1;
   thetaMin = 0;
   thetaMax = 75;
   phiReferenceVel = 0;
   phiVariance = 360;
   particles = StoneExplosionParticle;
   lifetimeMS = 300;
};

datablock ExplosionData(StoneExplosion)
{
   soundProfile = StoneExplodeSound;

   lifeTimeMS = 200;

   particleEmitter = StoneExplosionEmitter;
   particleDensity = 100;
   particleRadius = 5;

   debris = stoneShardDebris;
   debrisNum = 5;
   debrisNumVariance = 1;
   debrisPhiMin = 0;
   debrisPhiMax = 360;
   debrisThetaMin = 15;
   debrisThetaMax = 60;
   debrisVelocity = 22;
   debrisVelocityVariance = 2;

   emitter[0] = StoneExplosionEmitter;

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

   shakeCamera = false;
   camShakeFreq = "10.0 11.0 10.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 0.5;
   camShakeRadius = 10.0;

   lightStartRadius = 10;
   lightEndRadius = 1;
   lightStartColor = "1 0.5 0";
   lightEndColor = "1 0.5 0";
};

AddDamageType("StoneSpike", '<bitmap:Add-Ons/Weapon_ElementalSpells/Icons/CI_Stone> %1', '%2 <bitmap:Add-Ons/Weapon_ElementalSpells/Icons/CI_Stone> %1', 1, 1);

datablock ProjectileData(StoneMProjectile)
{
   shapeFile = "base/data/shapes/empty.dts";
   directDamage = 0;
   directDamageType = $DamageType::StoneSpike;
   radiusDamageType = $DamageType::StoneSpike;

   brickExplosionRadius = 5;
   brickExplosionImpact = true;
   brickExplosionForce = 50;
   brickExplosionMaxVolume = 15;
   brickExplosionMaxVolumeFloati ng = 25;

   impactImpulse = 0;
   verticalImpulse = 0;
   explosion = StoneExplosion;
   particleEmitter = StoneAmbientEmitter;

   muzzleVelocity = 60;
   velInheritFactor = 1;

   armingDelay = 0;
   lifetime = 4000;
   fadeDelay = 3500;
   bounceElasticity = 0.5;
   bounceFriction = 0.20;
   isBallistic = true;
   gravityMod = 1;

   hasLight = true;
   lightRadius = 2;
   lightColor = "1 0.5 0";

   uiName = "Stone Spike";
};

datablock StaticShapeData(StoneSpikeData)
{
   category = "Statics";
   shapeFile = "Add-Ons/Weapon_ElementalSpells/OtherShapes/StoneSpike.dts";
   skinName = 'null';
};

function StoneMProjectile::onCollision(%this, %obj, %col, %fade, %pos, %normal)
{
   if(strPos(%col.getClassName(), "Player") != -1)
   {
      %start = %col.getPosition();
      %end = vectorAdd(%start, "0 0 " @ -2 * getWord(%col.getScale(), 2));
      %ray = containerRayCast(%start, %end, $TypeMasks::FxBrickObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType);
      if(!isObject(%col = firstWord(%ray)))
      {
         return;
      }
      %pos = posFromRaycast(%ray);
      %normal = normalFromRaycast(%ray);
   }
   if(%col.getType() & $TypeMasks::InteriorObjectType || %col.getType() & $TypeMasks::FxBrickObjectType || %col.getType() & $TypeMasks::TerrainObjectType)
   {
      %scale = %obj.getScale();
      %spike = new TSstatic()
      {
         datablock = StoneSpikeData;
         shapeName = "Add-Ons/Weapon_ElementalSpells/OtherShapes/StoneSpike.dts";
         position = %pos;
         rotation = "0 0 0 0";
         scale = %scale;
      };
      MissionCleanup.add(%spike);
      for(%i = 2; %i <= 24; %i++)
      {
         %spike.schedule(%i * 200, setScale, vectorScale(%scale, 1 / (%i / 2)));
      }
      StoneSpikeData.schedule(10, doDamage, %spike, %obj.sourceObject, %pos, %scale);
      %spike.schedule(5000, delete);
   }
}

function StoneSpikeData::doDamage(%data, %spike, %obj, %pos, %scale)
{
   %scale = getWord(%scale, 2);
   %typemasks = $Typemasks::PlayerObjectType | $Typemasks::VehicleObjectType;
   InitContainerRadiusSearch(%pos, 3 * %scale, %typemasks);
   while(isObject(%hit = ContainerSearchNext()))
   {
      if(minigameCanDamage(%obj, %hit) && getMinigameFromObject(%hit).weaponDamage)
      {
         %hit.damage(%obj, %pos, 10 * %scale, $DamageType::StoneSpike);
         %add = vectorScale(vectorAdd("0 0 10", getRandom(-2, 2) SPC getRandom(-2, 2) SPC getRandom(0, 5)), %scale);
         %hit.setVelocity(vectorAdd(%hit.getVelocity(), %add));
         %hit.lastPusher = %obj.sourceObject;
         %hit.lastPushTime = getSimTime();
      }
   }
   %boxpos = vectorAdd(%pos, "0 0 " @ %scale * 3);
   %boxsize = vectorScale("3 3 7", %scale);
   InitContainerBoxSearch(%boxpos, %boxsize, %typemasks);
   while(isObject(%hit = ContainerSearchNext()))
   {
      if(minigameCanDamage(%obj, %hit) && getMinigameFromObject(%hit).weaponDamage)
      {
         %hit.damage(%obj, %pos, 15 * %scale, $DamageType::StoneSpike);
         %hit.lastPusher = %obj.sourceObject;
         %hit.lastPushTime = getSimTime();
         %add = vectorScale(vectorAdd("0 0 10", getRandom(-5, 5) SPC getRandom(-5, 5) SPC getRandom(0, 5)), %scale);
         %hit.setVelocity(vectorAdd(%hit.getVelocity(), %add));
      }
   }
}

datablock ItemData(StoneMItem)
{
   category = "Weapon";
   className = "Weapon";

   shapeFile = "Add-Ons/Weapon_ElementalSpells/ItemShapes/Stone.dts";
   rotate = false;
   mass = 0.5;
   density = 0.7;
   elasticity = 0.6;
   friction = 0.6;
   emap = true;

   uiName = "Magic - Stone";
   iconName = "Add-Ons/Weapon_ElementalSpells/Icons/Icon_Stone";
   doColorShift = false;
   colorShiftColor = "1 1 1 1";

   image = StoneMImage;
   canDrop = true;
};

datablock ShapeBaseImageData(StoneMImage)
{
   shapeFile = "base/data/shapes/empty.dts";
   emap = true;

   mountPoint = 0;
   offset = "0 0 0";
   eyeOffset = 0;
   rotation = "0 0 0";

   correctMuzzleVector = true;

   className = "WeaponImage";

   item = StoneMItem;
   ammo = " ";
   MPused = 75;
   projectile = StoneMProjectile;
   projectileType = Projectile;

   melee = false;
   armReady = true;

   doColorShift = false;
   colorShiftColor = "1 1 1 1";

   NoAbsorb["FireM"] = 1; //Damage from type "FireM" is not reduced
   NoAbsorb["WindM"] = 1; //Damage from type "WindM" is not reduced

   stateName[0]                   = "Activate";
   stateTimeoutValue[0]           = 0.15;
   stateTransitionOnTimeout[0]    = "Ready";
   stateSound[0]                  = weaponSwitchSound;

   stateName[1]                   = "Ready";
   stateTransitionOnTriggerDown[1]= "Fire";
   stateAllowImageChange[1]       = true;
   stateEmitter[1]                = StoneAmbientEmitter;
   stateEmitterTime[1]            = 300;

   stateName[2]                   = "Fire";
   stateTransitionOnTimeout[2]    = "Reload";
   stateTimeoutValue[2]           = 1;
   stateFire[2]                   = true;
   stateAllowImageChange[2]       = false;
   stateSequence[2]               = "Fire";
   stateScript[2]                 = "onFire";
   stateWaitForTimeout[2]         = true;
   stateSound[2]                  = StoneFireSound;
   stateEjectShell[2]             = true;

   stateName[3]                   = "Reload";
   stateTransitionOnTriggerUp[3]  = "Ready";
};

function StoneMImage::onFire(%this, %obj, %slot)
{
   if(%obj.lst[%this] > getSimTime())
   {
      return;
   }
   %obj.lst[%this] = getSimTime() + 1000;
   if(%obj.getDatablock().isMage)
   {
      if(%obj.hasEnergy(%this.MPused))
      {
         parent::onFire(%this, %obj, %slot);
         %obj.setEnergyLevel(%obj.getEnergyLevel() - %this.MPused);
      }
      else if(isObject(%client = %obj.getControllingClient()))
      {
         %client.centerPrint("\c4Not enough MP!<br>\c3" @ %obj.getEnergyLevel() @ "/" @ %this.MPused, 3);
      }
   }
   else
   {
      parent::onFire(%this, %obj, %slot);
   }
}

package MagicStone
{
   function armor::damage(%this, %obj, %sourceObject, %pos, %amt, %type)
   {
      %img = %obj.getMountedImage(0);
      if(%img == StoneMImage.getID())
      {
         if(!%img.NoAbsorb[$DamageType_Array[%type]])
         {
            %amt*= 0.75;
         }
      }
      parent::damage(%this, %obj, %sourceObject, %pos, %amt, %type);
   }
};
activatePackage(MagicStone);

25
Suggestions & Requests / Spell pack continuation
« on: October 14, 2011, 12:03:37 PM »
red text= existing spells/addons


Darkness (abilities)- momentarily blind enemies, dark energy beam/ball
Fire (abilities)- momentarily set fire to target, melt ice blocks, meteor strike, fire steps(leaves behind fire momentarily in your footsteps that sets enemies on fire),  
Ice (abilities)- create ice blocks that freeze players, slippery feet beam, ice path,
Light (abilities)- fires light beam from sky,
Lighting (abilities)- lighting strike, momentary stun beam/ball, chain lighting(hits target and surrounding enemies,
Stone (abilities)- spike from ground lunches target, fissure(one hit kill), earthquake(shakes targets screen only,
Water (abilities)- water spout, cant be set on fire,
Wind (abilities)- knock back wind ball, double jump, tornado(reasonable size,2sec sucks up and tosses players doing damage to target while in tornado), wind tunnel(temporarily slows the target for about 3sec by pushing them back with wind), wind slash,
Poison (abilities)- poison sting(slowly kills player), infect(kills target and replaces with a zombie guard that attacks on command or when caster is attacked. Target can still respwan while zombie is guarding. On caster death zombie dies. Poison gass bomb,
Plant (abilities)- vine whip, vine restrict,
Animals (abilities)- sick’em(summons dog to attack target. dong only attacks target, dies on target death or caster death. Limit of 4 dogs per target), shift shape in to “air dragon.” to fly, summon “land dragon” bodyguard(s) with same Ai as poison-zombie, fury swipe(from a close distance teleports to target inflicting fast claw swipes), bee swarm(fires swarm of bees at target),


I suggest that the spells types are made as multiples to enable players to use all abilities of that spell type. For example: “stone1” makes spike come from ground, while “stone2” makes earthquake. This is all I have in mind at the moment. Any ideas?

26
Suggestions & Requests / To new tools
« on: October 13, 2011, 12:49:19 PM »
There should be a tool that allows you to phase bricks through bricks and also a comand mod that allow you to change your servers 3D graph, such as the mod that allows you to change your games speed. As for the phase brick tool it could really help when trying to put ramp bricks in a certant pattern. Plz leave only positive and relative comments

27
Suggestions & Requests / berserker predator
« on: October 12, 2011, 08:55:03 PM »
i was looking for the berserker predator player type but i cant find it any where if some one knows where i can find it plz post link.

28
Suggestions & Requests / A new element spell pack
« on: October 12, 2011, 01:56:26 PM »
Im requesting that some one make a new element spell pack with up grades of the old old ones and new elements such as plant, magma, animal etc

29
Modification Help / scripting help needed
« on: October 10, 2011, 11:11:57 PM »
the following script belongs to the wepon light, from the element pack addon. i would like to know which part of this i would have to change to increase/decrease the speed of the light strike, the range of dmg, and the strangth of dmg. let me know the exact line, and no nonhelpful coments plz





datablock AudioProfile(LightExplosionSound)
{
   fileName = "Add-Ons/Weapon_ElementalSpells/Sounds/LightExplosion.wav";
   description = AudioDefault3d;
   preload = true;
};

datablock ParticleData(LightAmbientParticle)
{
   dragCoefficient = 1;
   windCoefficient = 0;
   gravityCoefficient = 0;
   inheritedVelFactor = 0;
   constantAcceleration = 0;
   lifetimeMS = 400;
   lifetimeVarianceMS = 100;
   textureName = "base/data/particles/dot";
   spinSpeed = 0;
   spinRandomMin = -900;
   spinRandomMax = 900;
   useInvAlpha = false;

   colors[0] = "1 0.85 0 1";
   colors[1] = "1 0.95 0 0.8";
   colors[2] = "1 1 1 0";
   sizes[0] = 0.2;
   sizes[1] = 0.2;
   sizes[2] = 0.2;
   times[0] = 0;
   times[1] = 0.2;
   times[2] = 1;
};
datablock ParticleEmitterData(LightAmbientEmitter)
{
   ejectionPeriodMS = 5;
   periodVarianceMS = 0;
   ejectionVelocity = 1;
   velocityVariance = 0.5;
   ejectionOffset = 0.3;
   thetaMin = 0;
   thetaMax = 180;
   phiReferenceVel = 720;
   phiVariance = 1;
   overrideAdvance = false;
   particles = LightAmbientParticle;
   uiName = "Light - Ambient";
};

datablock ParticleData(LightTrailParticle)
{
   dragCoefficient = 1;
   windCoefficient = 0;
   gravityCoefficient = 0;
   inheritedVelFactor = 0.2;
   constantAcceleration = 0;
   lifetimeMS = 750;
   lifetimeVarianceMS = 100;
   textureName = "base/data/particles/dot";
   spinSpeed = 0;
   spinRandomMin = -900;
   spinRandomMax = 900;
   useInvAlpha = false;

   colors[0] = "1 1 0 0.8";
   colors[1] = "1 1 0 0.5";
   colors[2] = "1 1 1 0";
   sizes[0] = 3;
   sizes[1] = 2.5;
   sizes[2] = 2;
   times[0] = 0;
   times[1] = 0.5;
   times[2] = 1;
};
datablock ParticleEmitterData(LightTrailEmitter)
{
   ejectionPeriodMS = 5;
   periodVarianceMS = 0;
   ejectionVelocity = 0;
   velocityVariance = 0;
   ejectionOffset = 0;
   thetaMin = 0;
   thetaMax = 0;
   phiReferenceVel = 0;
   phiVariance = 0;
   overrideAdvance = false;
   particles = LightTrailParticle;
   uiName = "Light - Trail";
};

datablock ParticleData(LightExplosionParticle)
{
   dragCoefficient = 1;
   windCoefficient = 0.2;
   gravityCoefficient = -0.1;
   inheritedVelFactor = 0;
   constantAcceleration = 0;
   lifetimeMS = 5000;
   lifetimeVarianceMS = 3000;
   textureName = "base/data/particles/cloud";
   spinSpeed = 0;
   spinRandomMin = -100;
   spinRandomMax = 100;
   useInvAlpha = true;

   colors[0] = "1 1 0.5 0";
   colors[1] = "1 1 0.9 0.5";
   colors[2] = "1 1 1 0.3";
   colors[3] = "1 1 1 0";
   sizes[0] = 5;
   sizes[1] = 6;
   sizes[2] = 7;
   sizes[3] = 8;
   times[0] = 0;
   times[1] = 0.1;
   times[2] = 0.7;
   times[3] = 1;
};
datablock ParticleEmitterData(LightExplosionEmitter)
{
   ejectionPeriodMS = 1000;
   periodVarianceMS = 500;
   ejectionVelocity = 6;
   velocityVariance = 5;
   ejectionOffset = 1;
   thetaMin = 0;
   thetaMax = 90;
   phiReferenceVel = 0;
   phiVariance = 0;
   overrideAdvance = false;
   particles = LightExplosionParticle;
};

datablock ExplosionData(LightMExplosion)
{
   lifeTimeMS = 1000;

   particleEmitter = LightExplosionEmitter;
   particleDensity = 75;
   particleRadius = 3;
   soundProfile = LightExplosionSound;
   
   faceViewer = true;
   explosionScale = "1 1 1";

   emitter[0] = LightExplosionEmitter;
   
   shakeCamera = false;
   camShakeFreq = "1 1 1";
   camShakeAmp = "1 1 1";
   camShakeDuration = 0;
   camShakeRadius = 0;

   lightStartRadius = 20;
   lightEndRadius = 0;
   lightStartColor = "1 1 1";
   lightEndColor = "1 1 1";

   damageRadius = 10;
   radiusDamage = 50;
};

AddDamageType("LightM", '<bitmap:Add-Ons/Weapon_ElementalSpells/Icons/CI_Light> %1', '%2 <bitmap:Add-Ons/Weapon_ElementalSpells/Icons/CI_Light> %1', 0.5, 0);

datablock ProjectileData(LightMProjectile)
{
   shapeFile = "base/data/shapes/empty.dts";
   directDamage = 0;
   directDamageType = $DamageType::LightM;
   radiusDamageType = $DamageType::LightM;

   brickExplosionRadius = 0;
   brickExplosionImpact = true;
   brickExplosionForce = 0;
   brickExplosionMaxVolume = 1;
   brickExplosionMaxVolumeFloati ng = 2;

   impactImpulse = 0;
   verticalImpulse = 0;
   particleEmitter = LightTrailEmitter;
   explosion = LightMExplosion;

   muzzleVelocity = 90;
   velInheritFactor = 1;

   armingDelay = 0;
   lifetime = 4000;
   fadeDelay = 3500;
   bounceElasticity = 0.5;
   bounceFriction = 0.2;
   isBallistic = true;
   gravityMod = 0;

   hasLight = false;
   lightRadius = 10;
   lightColor = "1 1 1";

   uiName = "Light Ray";
};
datablock ItemData(LightMItem)
{
   category = "Weapon";
   className = "Weapon";

   shapeFile = "Add-Ons/Weapon_ElementalSpells/ItemShapes/Light.dts";
   rotate = false;
   mass = 0.5;
   density = 0.7;
   elasticity = 0.6;
   friction = 0.6;
   emap = true;

   uiName = "Magic - Light";
   iconName = "Add-Ons/Weapon_ElementalSpells/Icons/Icon_Light";
   doColorShift = false;
   colorShiftColor = "1 1 1 1";

   image = LightMImage;
   canDrop = true;
};

datablock ShapeBaseImageData(LightMImage)
{
   shapeFile = "base/data/shapes/empty.dts";
   emap = true;

   mountPoint = 0;
   offset = "0 0 0";
   eyeOffset = 0;
   rotation = "0 0 0";

   correctMuzzleVector = true;

   className = "WeaponImage";

   item = LightMItem;
   ammo = " ";
   MPused = 40;
   projectile = LightMProjectile;
   projectileType = Projectile;

   melee = false;
   armReady = true;

   doColorShift = false;
   colorShiftColor = "1 1 1 1";

   lightType = "ConstantLight";
   lightColor = "1 1 1";
   lightRadius = 5;

   stateName[0]                   = "Activate";
   stateTimeoutValue[0]           = 0.15;
   stateTransitionOnTimeout[0]    = "Ready";
   stateSound[0]                  = weaponSwitchSound;

   stateName[1]                   = "Ready";
   stateTransitionOnTriggerDown[1]= "Fire";
   stateAllowImageChange[1]       = true;
   stateEmitter[1]                = LightAmbientEmitter;
   stateEmitterTime[1]            = 300;

   stateName[2]                   = "Fire";
   stateTransitionOnTimeout[2]    = "Reload";
   stateTimeoutValue[2]           = 2;
   stateFire[2]                   = true;
   stateAllowImageChange[2]       = false;
   stateScript[2]                 = "onFire";
   stateWaitForTimeout[2]         = true;

   stateName[3]                   = "Reload";
   stateTransitionOnTriggerUp[3]  = "Ready";
};

function LightMImage::onFire(%this, %obj, %slot)
{
   if(%obj.lst[%this] > getSimTime())
   {
      return;
   }
   %obj.lst[%this] = getSimTime() + 2000;
   if(%obj.getDatablock().isMage)
   {
      if(%obj.hasEnergy(%this.MPused))
      {
         LightRay(%obj);
         %obj.setEnergyLevel(%obj.getEnergyLevel() - %this.MPused);
      }
      else if(isObject(%client = %obj.getControllingClient()))
      {
         %client.centerPrint("\c4Not enough MP!<br>\c3" @ %obj.getEnergyLevel() @ "/" @ %this.MPused, 3);
      }
   }
   else
   {
      LightRay(%obj);
   }
}

function LightRay(%obj)
{
   %start = %obj.getEyePoint();
   %end = vectorAdd(%start, vectorScale(%obj.getEyeVector(), 200));
   %typemasks = $TypeMasks::FxBrickObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType | $Typemasks::PlayerObjectType;
   %ray = containerRayCast(%start, %end, %typemasks, %obj);
   if(isObject(%col = firstWord(%ray)))
   {
      %proj = new projectile()
      {
         datablock = LightMProjectile;
         initialPosition = vectorAdd(posFromRaycast(%ray), vectorScale("0 0 50", getWord(%obj.getScale(), 2)));
         initialVelocity = "0 0 -50";
         scale = %obj.getScale();
         sourceObject = %obj;
         sourceSlot = 0;
         client = %obj.client;
      };
      MissionCleanup.add(%proj);
   }
}

function Player::LightHeal(%obj)
{
   if(isObject(%obj) && %obj.getState() !$= "Dead")
   {
      if(%obj.hasEnergy(2))
      {
         %obj.setEnergyLevel(%obj.getEnergyLevel() - 2);
         %scale = getWord(%obj.getScale(), 2);
         InitContainerRadiusSearch(%obj.getPosition(), 3 * %scale, $Typemasks::PlayerObjectType);
         while(isObject(%hit = ContainerSearchNext()))
         {
            if(minigameCanDamage(%obj, %hit))
            {
               %hit.addHealth(1);
               if(isObject(%client = %hit.getControllingClient()))
               {
                  %md = %hit.getDatablock().maxDamage;
                  %client.bottomPrint("\c2You are being healed. Health: \c3" @ %md - %hit.getDamageLevel() @ "/" @ %md, 3);
               }
            }
         }
         %obj.lightHealSched = %obj.schedule(100, lightHeal);
      }
      else if(isObject(%client = %obj.getControllingClient()) && %obj.getDatablock().isMage)
      {
         %client.centerPrint("\c4Not enough MP!<br>\c3" @ %obj.getEnergyLevel() @ "/2", 3);
      }
   }
}

package MagicLight
{
   function armor::onTrigger(%this, %obj, %slot, %val)
   {
      parent::onTrigger(%this, %obj, %slot, %val);
      if(%this.isMage && %slot == 4 && %obj.getMountedImage(0) == LightMImage.getID())
      {
         if(%val)
         {
            %obj.lightHeal();
         }
         else
         {
            cancel(%obj.lightHealSched);
         }
      }
   }
};
activatePackage(MagicLight);

30
Modification Help / scripting
« on: October 10, 2011, 04:14:06 PM »
the following script belongs to wind element from the element spell pack addon. with this addon on when it is equiped you can double jump, when fired it also pushes back the target. i would like to know what part of this script would i have to change to increase/decrease the height of jump, dmg, and distance of push. plz no nonhelpful coments






datablock AudioProfile(WindLoopSound)
{
   fileName = "Add-Ons/Weapon_ElementalSpells/Sounds/WindTravel.wav";
   description = AudioCloseLooping3d;
   preload = true;
};
datablock AudioProfile(WindExplosionSound)
{
   fileName = "Add-Ons/Weapon_ElementalSpells/Sounds/WindExplosion.wav";
   description = AudioClose3d;
   preload = true;
};

datablock ParticleData(WindAmbientParticle)
{
   dragCoefficient = 1;
   windCoefficient = 0.2;
   gravityCoefficient = 0;
   inheritedVelFactor = 0.2;
   constantAcceleration = 0;
   lifetimeMS = 400;
   lifetimeVarianceMS = 100;
   textureName = "base/data/particles/cloud";
   spinSpeed = 0;
   spinRandomMin = -900;
   spinRandomMax = 900;
   useInvAlpha = false;

   colors[0] = "0.33 0.33 0.33 1";
   colors[1] = "0.67 0.67 0.67 0.8";
   colors[2] = "1 1 1 0.2";
   sizes[0] = 0.4;
   sizes[1] = 0.3;
   sizes[2] = 0.2;
   times[0] = 0;
   times[1] = 0.2;
   times[2] = 1;
};
datablock ParticleEmitterData(WindAmbientEmitter)
{
   ejectionPeriodMS = 7;
   periodVarianceMS = 0;
   ejectionVelocity = 0.5;
   velocityVariance = 0;
   ejectionOffset = 0.2;
   thetaMin = 25;
   thetaMax = 155;
   phiReferenceVel = 360;
   phiVariance = 5;
   overrideAdvance = false;
   particles = "WindAmbientParticle";
   uiName = "Wind - Ambient";
};
datablock ParticleData(WindTrailParticle)
{
   dragCoefficient = 1;
   windCoefficient = 0.2;
   gravityCoefficient = 0;
   inheritedVelFactor = 0.2;
   constantAcceleration = 0;
   lifetimeMS = 400;
   lifetimeVarianceMS = 100;
   textureName = "base/data/particles/cloud";
   spinSpeed = 0;
   spinRandomMin = -900;
   spinRandomMax = 900;
   useInvAlpha = false;

   colors[0] = "0.33 0.33 0.33 1";
   colors[1] = "0.67 0.67 0.67 0.8";
   colors[2] = "1 1 1 0.2";
   sizes[0] = 0.4;
   sizes[1] = 0.25;
   sizes[2] = 0.1;
   times[0] = 0;
   times[1] = 0.2;
   times[2] = 1;
};
datablock ParticleEmitterData(WindTrailEmitter)
{
   ejectionPeriodMS = 5;
   periodVarianceMS = 0;
   ejectionVelocity = 0.0;
   velocityVariance = 0.0;
   ejectionOffset   = 1.0;
   thetaMin         = 0;
   thetaMax         = 40;
   phiReferenceVel  = 720;
   phiVariance      = 10;
   overrideAdvance = false;
   particles = "WindAmbientParticle";
   uiName = "Wind - Trail";
};

datablock ParticleData(WindExplosionParticle)
{
   dragCoefficient = 1;
   windCoefficient = 0;
   gravityCoefficient = 0;
   inheritedVelFactor = 0.2;
   constantAcceleration = 0;
   lifetimeMS = 750;
   lifetimeVarianceMS = 250;
   textureName = "base/data/particles/cloud";
   spinSpeed = 0;
   spinRandomMin = -1000;
   spinRandomMax = 1000;
   useInvAlpha = false;

   colors[0] = "0.33 0.33 0.33 1";
   colors[1] = "0.67 0.67 0.67 0.8";
   colors[2] = "1 1 1 0.2";
   sizes[0] = 2;
   sizes[1] = 1.8;
   sizes[2] = 1.6;
   times[0] = 0;
   times[1] = 0.2;
   times[2] = 1;
};
datablock ParticleEmitterData(WindExplosionEmitter)
{
   ejectionPeriodMS = 5;
   periodVarianceMS = 4;
   ejectionVelocity = 8;
   velocityVariance = 0.2;
   ejectionOffset = 1;
   thetaMin = 0;
   thetaMax = 180;
   phiReferenceVel = 720;
   phiVariance = 20;
   overrideAdvance = false;
   particles = "WindExplosionParticle";
};

datablock ExplosionData(WindMExplosion)
{
   lifeTimeMS = 600;

   particleEmitter = WindExplosionEmitter;
   particleDensity = 15;
   particleRadius = 0.5;

   soundProfile = WindExplosionSound;
   
   faceViewer = true;
   explosionScale = "1 1 1";
   
   shakeCamera = false;
   camShakeFreq = "1 1 1";
   camShakeAmp = "1 1 1";
   camShakeDuration = 0;
   camShakeRadius = 0;

   lightStartRadius = 0;
   lightEndRadius = 0;
   lightStartColor = "1 1 1";
   lightEndColor = "1 1 1";

   damageRadius = 3;
   radiusDamage = 20;
};

AddDamageType("WindM", '<bitmap:Add-Ons/Weapon_ElementalSpells/Icons/CI_Wind> %1', '%2 <bitmap:Add-Ons/Weapon_ElementalSpells/Icons/CI_Wind> %1', 0.5, 0);

datablock ProjectileData(WindMProjectile)
{
   shapeFile = "base/data/shapes/empty.dts";
   radiusDamageType = $DamageType::WindM;
   sound = WindLoopSound;

   brickExplosionRadius = 0;
   brickExplosionImpact = true;
   brickExplosionForce = 0;
   brickExplosionMaxVolume = 1;
   brickExplosionMaxVolumeFloati ng = 2;

   impactImpulse = 0;
   verticalImpulse = 0;
   explosion = WindMExplosion;
   particleEmitter = WindTrailEmitter;

   muzzleVelocity = 90;
   velInheritFactor = 1;

   armingDelay = 0;
   lifetime = 4000;
   fadeDelay = 3500;
   bounceElasticity = 0.5;
   bounceFriction = 0.20;
   isBallistic = true;
   gravityMod = 1;

   hasLight = false;
   lightRadius = 5;
   lightColor = "1 1 1";

   uiName = "Windblast";
};

function WindMProjectile::RadiusDamage(%this, %obj, %col, %dist, %pos, %amt)
{
   parent::RadiusDamage(%this, %obj, %col, %dist, %pos, %amt);
   if(isObject(%col) && %col.getType() & $Typemasks::PlayerObjectType)
   {
      %col.setVelocity(vectorAdd(%col.getVelocity(), vectorScale(setWord(vectorScale(%obj.getVelocity(), getWord(%obj.getScale(), 2)), 2, "10"), 0.2)));
   }
}

datablock ItemData(WindMItem)
{
   category = "Weapon";
   className = "Weapon";

   shapeFile = "Add-Ons/Weapon_ElementalSpells/ItemShapes/Wind.dts";
   rotate = false;
   mass = 0.5;
   density = 0.7;
   elasticity = 0.6;
   friction = 0.6;
   emap = true;

   uiName = "Magic - Wind";
   iconName = "Add-Ons/Weapon_ElementalSpells/Icons/Icon_Wind";
   doColorShift = false;
   colorShiftColor = "0.5 0.5 1 1";

   image = WindMImage;
   canDrop = true;
};

datablock ShapeBaseImageData(WindMImage)
{
   shapeFile = "base/data/shapes/empty.dts";
   emap = true;

   mountPoint = 0;
   offset = "0 0 0";
   eyeOffset = 0;
   rotation = "0 0 0";

   correctMuzzleVector = true;

   className = "WeaponImage";

   item = WindMItem;
   ammo = " ";
   MPused = 30;
   projectile = WindMProjectile;
   projectileType = Projectile;
   minShotTime = 500;

   melee = false;
   armReady = true;

   doColorShift = false;
   colorShiftColor = "1 1 1 1";

   stateName[0]                   = "Activate";
   stateTimeoutValue[0]           = 0.15;
   stateTransitionOnTimeout[0]    = "Ready";
   stateSound[0]                  = weaponSwitchSound;

   stateName[1]                   = "Ready";
   stateTransitionOnTriggerDown[1]= "Fire";
   stateAllowImageChange[1]       = true;
   stateEmitter[1]                = WindAmbientEmitter;
   stateEmitterTime[1]            = 300;

   stateName[2]                   = "Fire";
   stateTransitionOnTimeout[2]    = "Ready";
   stateTimeoutValue[2]           = 0.5;
   stateFire[2]                   = true;
   stateAllowImageChange[2]       = false;
   stateSequence[2]               = "Water";
   stateScript[2]                 = "onFire";
   stateWaitForTimeout[2]         = true;

   stateName[3]                   = "Reload";
   stateTransitionOnTriggerUp[3]  = "Ready";
};

function WindMImage::onFire(%this, %obj, %slot)
{
   if(%obj.lst[%this] > getSimTime())
   {
      return;
   }
   %obj.lst[%this] = getSimTime() + 500;
   if(%obj.getDatablock().isMage)
   {
      if(%obj.hasEnergy(%this.MPused))
      {
         parent::onFire(%this, %obj, %slot);
         %obj.setVelocity(vectorAdd(%obj.getVelocity(), vectorScale(%obj.getForwardVector(), -5)));
         %obj.setEnergyLevel(%obj.getEnergyLevel() - %this.MPused);
      }
      else if(isObject(%client = %obj.getControllingClient()))
      {
         %client.centerPrint("\c4Not enough MP!<br>\c3" @ %obj.getEnergyLevel() @ "/" @ %this.MPused, 3);
      }
   }
   else
   {
      parent::onFire(%this, %obj, %slot);
      %obj.setVelocity(vectorAdd(%obj.getVelocity(), vectorScale(%obj.getForwardVector(), -3)));
   }
}

package MagicWind
{
   function armor::onTrigger(%this, %obj, %slot, %val)
   {
      parent::onTrigger(%this, %obj, %slot, %val);
      if(%obj.getMountedImage(0) == WindMImage.getID() && %val)
      {
         if(%slot == 2 && !%obj.isOnGround() && ((%obj.lastDoubleJump + 2000) < getSimTime()))
         {
            %obj.lastDoubleJump = getSimTime();
            %scale = getWord(%obj.getScale(), 2) / 2;
            %vel = vectorScale("0 0 25", %scale);
            if(%this.isMage)
            {
               if(%obj.hasEnergy(10))
               {
                  %obj.addVelocity(%vel);
                  %obj.setEnergyLevel(%obj.getEnergyLevel() - 10);
                  %obj.spawnExplosion(WindMProjectile, %scale);
               }
               else if(isObject(%client = %obj.getControllingClient()))
               {
                  %client.centerPrint("\c4Not enough MP!<br>\c3" @ %obj.getEnergyLevel() @ "/10", 3);
               }
            }
            else
            {
               %obj.addVelocity(%vel);
               %obj.spawnExplosion(WindMProjectile, %scale);
            }
         }
         if(%slot == 4 && ((%obj.lastDownBlast + 2000) < getSimTime()))
         {
            if(%this.isMage)
            {
               if(%obj.hasEnergy(50))
               {
                  %obj.lastDownBlast = getSimTime();
                  %obj.setEnergyLevel(%obj.getEnergyLevel() - 50);
                  %scale = getWord(%obj.getScale(), 2);
                  InitContainerRadiusSearch(%obj.getPosition(), 10 * %scale, $Typemasks::PlayerObjectType);
                  while(isObject(%hit = ContainerSearchNext()))
                  {
                     if(minigameCanDamage(%obj, %hit) && getMinigameFromObject(%hit).weaponDamage && !%hit.isOnGround())
                     {
                        %hit.damage(%obj, %hit.getPosition(), 10 * %scale, $DamageType::WindM);
                        %hit.lastPusher = %obj.client;
                        %hit.lastPushTime = getSimTime();
                        %add = vectorScale("0 0 -30", %scale);
                        %hit.setVelocity(vectorAdd(%hit.getVelocity(), %add));
                     }
                  }
               }
               else if(isObject(%client = %obj.getControllingClient()))
               {
                  %client.centerPrint("\c4Not enough MP!<br>\c3" @ %obj.getEnergyLevel() @ "/50", 3);
               }
            }
         }
      }
   }
};
activatePackage(MagicWind);

Pages: 1 [2] 3