Author Topic: Weapon_Bomb: Broked.  (Read 993 times)

forget I hate programming:
Code: [Select]
//Bomb.cs

//projectile
AddDamageType("BombDirect",   '<bitmap:add-ons/Weapon_Bombs/CI_Bomb> %1',       '%2 <bitmap:add-ons/Weapon_Bombs/CI_Bomb> %1',1,1);
AddDamageType("BombRadius",   '<bitmap:add-ons/Weapon_Bombs/CI_BombRadius> %1', '%2 <bitmap:add-ons/Weapon_Bombs/CI_BombRadius> %1',1,0);
datablock ProjectileData(BombProjectile)
{
   projectileShapeName = "./bomb.dts";
   directDamage        = 100;
   directDamageType   = $DamageType::BombDirect;
   radiusDamageType   = $DamageType::BombRadius;
   impactImpulse   = 20;
   verticalImpulse = 10;
   explosion           = rocketExplosion;
   particleEmitter     = RocketTrailEmitter;

   brickExplosionRadius = 10;
   brickExplosionImpact = true; //destroy a brick if we hit it directly?
   brickExplosionForce  = 50;
   brickExplosionMaxVolume = 200;
   brickExplosionMaxVolumeFloating = 200;

   muzzleVelocity      = 5;
   velInheritFactor    = 0.5;

   armingDelay         = 1;
   lifetime            = 20000;
   fadeDelay           = 19500;
   bounceElasticity    = 0;
   bounceFriction      = 0;
   isBallistic         = true;
   gravityMod = 1.0;

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

   uiName = "Bomb";
};


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

// Basic Item Properties
shapeFile = "./bomb.dts";
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;

//gui stuff
uiName = "Bomb";
iconName = "./icon_Bomb";
doColorShift = false;
colorShiftColor = "0.400 0.196 0 1.000";

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

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

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   offset = "0 0 -3";
   //eyeOffset = "0.1 0.2 -0.55";

   // 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 = BombItem;
   ammo = " ";
   projectile = BombProjectile;
   projectileType = Projectile;

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

   //casing = " ";
   doColorShift = true;
   colorShiftColor = "0.400 0.196 0 1.000";

   // 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.1;
stateTransitionOnTimeout[0] = "Ready";
stateSequence[0] = "ready";
stateSound[0] = weaponSwitchSound;

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

stateName[2] = "Fire";
stateTransitionOnTimeout[2] = "Ready";
stateTimeoutValue[2] = 0.9;
stateFire[2] = true;
stateSequence[2] = "fire";
stateScript[2] = "onFire";
stateWaitForTimeout[2] = true;
stateAllowImageChange[2] = false;
stateSound[2]         = SpearFireSound;

};

package Weapon_Bomb
{
function BombImage::onFire(%this,%obj,%slot)
{
if(!%obj.isMounted())
return;
Parent::onFire(%this,%obj,%slot);
}
};
activatePackage(Weapon_Bomb);
Essentially, it has decided to stop doing splash damage. Direct hits do damage, but not the actual explosion. You can find this weapon on RTB, but it's currently broken. I'm no programmer, I didn't write any of the script; I only conceived the idea, made the model, and collaborated to make the add-on. However, I'm currently in-charge of it, and I'd really like to fix it.
« Last Edit: December 03, 2009, 08:37:47 PM by yuki »

Maybe because it uses the explosion data of the rocketexplosion?
The radius of the radiusdamage is just 3 in that datablock.

Just suggesting something.
I don't know if it really is that.
I'm just a low level scripter, helping solve this would help me a lot. :P

But anyway, look at the rocketexplosion data, maybe that helps. :/

If the rocket isn't enabled it'll just direct damage, not radius damage. Try forcing the rocket launcher to be enabled if you havent' already.

If the rocket isn't enabled it'll just direct damage, not radius damage. Try forcing the rocket launcher to be enabled if you havent' already.

The Rocket L. and Spear are both forced in the server.cs of this add-on.

Also, why do you need to package the BombImage::onFire function? It is unnecessary. You only need to include Parent::onFire on it to work well.

Also, why do you need to package the BombImage::onFire function? It is unnecessary. You only need to include Parent::onFire on it to work well.
I didn't write the original script. It was collaboration, mostly aloshi.
forget I hate programming:
I'm no programmer, I didn't write any of the script; I only conceived the idea, made the model, and collaborated to make the add-on.
However, the problem is assumed to be exactly what lordician said.

I didn't write the original script. It was collaboration, mostly aloshi.However, the problem is assumed to be exactly what lordician said.
A good guess at the end.
Though, Destiny's sounds a bit more logical.
It sure is the radius?
Or is it because the rocket wasn't enabled?

It's probably the radius, fixing now.

It's probably the radius, fixing now.
I would like to hear the result when you fixed it.

I can't join a server with this add-on. I might as well download it, even if broken, so I get that .dts file.

I can't join a server with this add-on. I might as well download it, even if broken, so I get that .dts file.
Wrong thread. Post in the primary add-on thread.