Blockland Forums > Modification Help
Weapon doesn't do any radius damage
<< < (2/4) > >>
Brixmon:

--- Quote from: Masterlegodude on November 02, 2017, 08:35:06 AM ----cut-

--- End quote ---
Didn't work. The wand still does no radius damage.
Edit: Even making it refer to the Rocket Launcher doesn't work. Somehow, something about it is ruining its radius damage.
Could it be the small value on the radius damage, or the short lifetime? Do explosions need to last a certain time for radius damage to be detected?

Edit 2: Here's the COMPLETE code for the weapon.

--- Code: ---//########## Demonflame Wand

//### Sound
datablock AudioProfile(DemonWandHitSound)
{
   filename    = "./demonWandHit.wav";
   description = AudioClose3d;
   preload = true;
};

datablock AudioProfile(DemonWandFireSound)
{
   filename    = "./demonWandFire.wav";
   description = AudioClose3d;
   preload = true;
};

//### Effects

datablock ParticleData(DemonWandAmbParticle)
{
  textureName = "base/data/particles/cloud";
  dragCoefficient = 0;
gravityCoefficient = -0.5;
inheritedVelFactor = 0;
windCoefficient = 0;
constantAcceleration = 0;
lifetimeMS = 600;
lifetimeVarianceMS = 100;
spinSpeed = 0;
spinRandomMin = -90.0;
spinRandomMax = 90;
useInvAlpha = 0;
colors[0] = "0.66 0.19 1 1.0";
colors[1] = "0.5 0.07 1 0.5";
colors[2] = "0.29 0 1 0";
sizes[0] = 0.3;
sizes[1] = 0.2;
sizes[2] = 0.1;
times[0] = 0;
times[1] = 0.1;
times[2] = 1;
useInvAlpha = false;
};

datablock ParticleEmitterData(DemonWandAmbEmitter)
{
  ejectionPeriodMS = 4;
periodVarianceMS = 2;
ejectionVelocity = 0;
ejectionOffset = 0.1;
velocityVariance = 0;
thetaMin = 0;
thetaMax = 180;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = 0;
  particles = "DemonWandAmbParticle";
  uiName = "Demonflame Wand Ambient";
};

datablock ParticleData(DemonWandAtkParticle : DemonWandAmbParticle)
{
colors[0] = "0.66 0.19 1 1.0";
colors[1] = "0.66 0.19 1 0.5";
colors[2] = "0.5 0.07 1 0";
};

datablock ParticleEmitterData(DemonWandAtkEmitter : DemonWandAmbEmitter)
{
  particles = "DemonWandAtkParticle";
  uiName = "Demonflame Wand Attack";
};

datablock ParticleData(DemonFireballWandParticle)
{
  dragCoefficient = 0;
  inheritedVelFactor = 0;
  lifetimeMS = 500;
  textureName = "base/data/particles/cloud";
  spinSpeed = 0;
  colors[0] = "0.66 0.19 1 1";
  colors[1] = "0.5 0.07 1 0.5";
  colors[2] = "0.29 0 1 0";
  sizes[0] = 1.25;
  sizes[1] = 0.7;
  sizes[2] = 0.4;
  times[0] = 0;
  times[1] = 0.25;
  times[2] = 1;
  useInvAlpha = false;
};

datablock ParticleEmitterData(DemonFireballWandEmitter)
{
  ejectionPeriodMS = 5;
  ejectionVelocity = 1;
  velocityVariance = 1;
  thetaMin = 0;
  thetaMax = 180;
  phiReferenceVel = 0;
  phiVariance = 360;
  particles = "DemonFireballWandParticle";
  uiName = "Demonflame Fireball";
};

datablock ParticleData(DemonFireballWandExplosionParticle)
{
  dragCoefficient = 3;
  gravityCoefficient = -0.2;
  inheritedVelFactor   = 0;
constantAcceleration = 0.0;
lifetimeMS           = 500;
lifetimeVarianceMS   = 250;
  textureName = "base/data/particles/cloud";
  spinSpeed = 10.0;
spinRandomMin = -50.0;
spinRandomMax = 50.0;
  colors[0] = "0.66 0.19 1 1";
  colors[1] = "0.5 0.07 1 1";
  colors[2] = "0.29 0 1 0";
  sizes[0] = 4;
  sizes[1] = 0.75;
  sizes[2] = 0.4;
  times[0] = 0;
  times[1] = 0.04;
  times[2] = 1;
  useInvAlpha = false;
};

datablock ParticleEmitterData(DemonFireballWandExplosionEmitter)
{
  ejectionPeriodMS = 5;
   periodVarianceMS = 0;
   ejectionVelocity = 8;
   velocityVariance = 4;
   ejectionOffset   = 0.1;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
  particles = "DemonFireballWandExplosionParticle";
  uiName = "Demonflame Fireball Hit";
};

datablock ExplosionData(DemonFireballWandExplosion : rocketExplosion)
{
  uiName = "Demonflame Fireball Explosion";
  emitter[0] = DemonFireballWandExplosionEmitter;
  lifetimeMS = 350;
 
  particleEmitter = "";
 
  explosionShape = "base/data/shapes/empty.dts";
  soundProfile = DemonWandHitSound;
 
  shakeCamera = false;
 
  faceViewer     = true;
  explosionScale = "1 1 1";
 
  damageRadius = 3;
  radiusDamage = 25;
 
  impulseRadius = 2;
  impulseForce = 100;
 
  // Dynamic light
  lightStartRadius = 4;
  lightEndRadius = 0;
  lightStartColor = "0.66 0.19 1";
  lightEndColor = "0.29 0 1";
};

//### Projectile

datablock ProjectileData(DemonFireballWandProjectile)
{
  uiName = "Demonflame Fireball";
  projectileShapeName = "";
  directDamage = 25;
  directDamageType = $DamageType::MagicWand;
  radiusDamageType = $DamageType::MagicWand;
  impactImpulse = 100;
  verticalImpulse = 0;
  particleEmitter = DemonFireballWandEmitter;
  explosion = DemonFireballWandExplosion;
  bounceExplosion = DemonFireballWandExplosion;
  muzzleVelocity = 40;
  verInheritFactor = 0;
 
  armingDelay         = 4500;
   lifetime            = 5000;
   fadeDelay           = 5000;
   bounceElasticity    = 1;
   bounceFriction      = 0;
   isBallistic         = true;
   gravityMod = 20;
};

datablock ItemData(DemonFireballWandItem : WandItem)
{
uiName = "Demonflame Wand";
doColorShift = true;
colorShiftColor = "0.5 0.07 1 1";

image = DemonFireballWandImage;
};

datablock ShapeBaseImageData(DemonFireballWandImage : AdminWandImage)
{
  projectile = DemonFireballWandProjectile;
  projectileType = Projectile;
  doColorShift = true;
  colorShiftColor = "0.5 0.07 1 1";

  stateName[0] = "Initial";
stateTimeoutValue[0] = 0.2;
stateTransitionOnTimeout[0] = "Ready";
//stateSound[0] = weaponSwitchSound;

stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "preFire";
stateAllowImageChange[1] = true;
stateEmitter[1] = DemonWandAmbEmitter;
stateScript[1]                  = "onFireReload";

stateName[3]                    = "Fire";
stateTransitionOnTimeout[3]     = "CheckFire";
stateTimeoutValue[3]            = 0.4;
stateFire[3]                    = true;
stateAllowImageChange[3]        = false;
stateSequence[3]                = "Fire";
stateScript[3]                  = "onFire";
stateWaitForTimeout[3] = true;
stateEjectShell[3]        = false;
stateEmitter[3] = DemonWandAtkEmitter;
stateEmitterTime[3] = 0.4;
stateEmitterNode[3] = "muzzlePoint";
stateSound[3] = DemonWandFireSound;

stateName[4] = "CheckFire";
stateTransitionOnTriggerUp[4] = "StopFire";
stateTransitionOnTriggerDown[4] = "Fire";
stateTransitionOnNoAmmo[4]       = "Recharge";

stateName[5]                    = "StopFire";
stateAllowImageChange[5]        = true;
stateTransitionOnTimeout[5]     = "Ready";
stateTimeoutValue[5]            = 0.01; //3.00
stateScript[5] = "onStopFire";
stateSequence[5] = "StopFire";
stateWaitForTimeout[5] = true;

stateName[6] = "PreFire";
stateScript[6] = "onPreFire";
stateAllowImageChange[6] = false;
stateTimeoutValue[6] = 0.1;
stateWaitForTimeout[6] = true;
stateTransitionOnTimeout[6] = "Fire";
};

function DemonFireballWandImage::onPreFire(%this,%obj,%slot) { %obj.playthread(2,armattack); }
function DemonFireballWandImage::onStopFire(%this,%obj,%slot) { %obj.playthread(2,root); }
--- End code ---
Masterlegodude:
Try putting "explodeOnDeath = true;" into your projectile data, your weapon uses an arming delay, and most weapons i've seen that use that also use explodeOnDeath, so i assume that's a necessary thing to have otherwise something like radius damage breaks
Brixmon:

--- Quote from: Masterlegodude on November 02, 2017, 07:08:06 PM ---Try putting "explodeOnDeath = true;" into your projectile data, your weapon uses an arming delay, and most weapons i've seen that use that also use explodeOnDeath, so i assume that's a necessary thing to have otherwise something like radius damage breaks

--- End quote ---
That still won't fix it.
Can bounce explosions even deal radius damage? The projectile is meant to last a while, bouncing around and doing radius damage whenever it bounces, but it's not working. It might deal radius damage on its death explosion, but that's hard to test, since it takes so long...
Just for reference, other explosive weapons have functioning radius damage. I do have Obstructed Radius Damage enabled, if that helps, but disabling it had no effect on the problem earlier.

Edit: Spawning a long line of hole bots makes testing that easy. The final explosion IS dealing raidus damage, but the bounces refuse to do anything.
Masterlegodude:
I don't know how Gravity Cat's zombie thing does it's stuff, but i've never even heard of a 'bounce' explosion, maybe it's possible that the 'bounceExplosion' variable is just a thing specific to Gravity Cat's mod?

It is possible to script your weapon to spawn an explosion whenever the projectile collides with anything, but not with this 'bounceExplosion' thing
Brixmon:

--- Quote from: Masterlegodude on November 02, 2017, 07:24:45 PM ---I don't know how Gravity Cat's zombie thing does it's stuff, but i've never even heard of a 'bounce' explosion, maybe it's possible that the 'bounceExplosion' variable is just a thing specific to Gravity Cat's mod?

It is possible to script your weapon to spawn an explosion whenever the projectile collides with anything, but not with this 'bounceExplosion' thing

--- End quote ---
Uh... what? I don't know how you could've not heard of the bounce explosion thing. It's present in a lot more than that, and in fact, Gravity Cat's mod didn't include any bounce explosions in its wand projectiles.
You can find the bounceExplosion thing in the MAS Orb Launcher, the default Pong projectile, the energy ball projectile... it's used for practically every bouncing projectile.
And the Orb Launcher defines radius damage for its specific bounce explosion. Maybe I need different explosions for both in order for the damage to work?

Edit: Nope. Making a special bounce explosion doesn't fix it either.
Navigation
Message Index
Next page
Previous page

Go to full version