Gobbles commented in optionsDlg.cs that his setWindowStyle(); function is the "hackyest Hackyiest HAxx evar." I'd like to challenge this with a method I came up with this weekend that bypasses the projectile system on 20+ weapons, saving loads of datablocks:
from dtbinit.cs:
Code:
from acidgun.cs
Code:
Code:
the projectile in the script was removed and the projectile set in the imagedata changed to hack3projectile. There is no difference in-game, and it reduces the datablock count by 1. Times this by the 20+ weapons I hacked, and you'll see this add up, or to be more accurate, subtract down.
from dtbinit.cs:
Code:
////////SuperFuntimeMegaPenisUltraHack////////
datablock ProjectileData(HackProjectile)//bullets
{
projectileShapeName = "dtb/data/shapes/weapons/grenade.dts";
directDamage = 40;
radiusDamage = 0;
damageRadius = 0.5;
muzzleVelocity = 200;
armingDelay = 0;
lifetime = 20000;
fadeDelay = 16000;
bounceElasticity = 0;
bounceFriction = 0;
isBallistic = true;
gravityMod = 1;
damagetype = '%1 or %2 (whoever is testing the weapon) needs to learn to code';
};
//The point of this is to have a single projectile used by most weapons,
//which can have all it's shit redefined, saving shitloads of datablocks.
//Unfortunatly, I cannot redefine the shape, so I'll need to make few templates
//for different kinds of weapons to use. -DShiznit
datablock ProjectileData(Hack2Projectile)//missiles
{
projectileShapeName = "dtb/data/shapes/weapons/missile.dts";
directDamage = 40;
radiusDamage = 0;
damageRadius = 0.5;
muzzleVelocity = 200;
armingDelay = 0;
lifetime = 20000;
fadeDelay = 16000;
bounceElasticity = 0;
bounceFriction = 0;
isBallistic = true;
gravityMod = 1;
damagetype = '%1 or %2 (whoever is testing the weapon) needs to learn to code';
};
datablock ProjectileData(Hack3Projectile)//beams
{
projectileShapeName = "";
directDamage = 40;
radiusDamage = 0;
damageRadius = 0.5;
muzzleVelocity = 200;
armingDelay = 0;
lifetime = 20000;
fadeDelay = 16000;
bounceElasticity = 0;
bounceFriction = 0;
isBallistic = true;
gravityMod = 1;
damagetype = '%1 or %2 (whoever is testing the weapon) needs to learn to code';
};
exec("dtb/server/scripts/weapons/sword.cs");//melee weapons, contains mining code
function HackProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
tbmcollison(%this,%obj,%col,%fade,%pos,%normal);
tbmcollison(%this,%obj,%col,%fade,%pos,%normal);
tbmradiusDamage
(%obj, VectorAdd(%pos, VectorScale(%normal, 0.01)),
%this.damageRadius,%this.radiusDamage,%this.damageType,%this.impulse);
}
function Hack2Projectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
tbmcollison(%this,%obj,%col,%fade,%pos,%normal);
tbmcollison(%this,%obj,%col,%fade,%pos,%normal);
tbmradiusDamage
(%obj, VectorAdd(%pos, VectorScale(%normal, 0.01)),
%this.damageRadius,%this.radiusDamage,%this.damageType,%this.impulse);
}
function Hack3Projectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
tbmcollison(%this,%obj,%col,%fade,%pos,%normal);
tbmcollison(%this,%obj,%col,%fade,%pos,%normal);
tbmradiusDamage
(%obj, VectorAdd(%pos, VectorScale(%normal, 0.01)),
%this.damageRadius,%this.radiusDamage,%this.damageType,%this.impulse);
}
from acidgun.cs
Code:
projectile = Hack3Projectile;
projectileType = Projectile;
Code:
function AcidgunImage::onFire(%this, %obj, %slot)//edited by DShiznit for SuperFuntimeMegaPenisUltraHack
{
// Get the type of projectile we are gonna fire
%projectile = %this.projectile;
//this is where the hacking takes place -DShiznit
%projectile.directDamage = 3;
%projectile.radiusDamage = 2;
%projectile.damageRadius = 1.5;
%projectile.explosion = AcidgunExplosion;
%projectile.particleEmitter = AcidgunTrailEmitter;
%projectile.muzzleVelocity = 40;
%projectile.dragCoeffiecient = 50.0;
%projectile.velInheritFactor = 1;
%projectile.armingDelay = 0;
%projectile.lifetime = 5000;
%projectile.fadeDelay = 0;
%projectile.bounceElasticity = 0;
%projectile.bounceFriction = 0;
%projectile.isBallistic = true;
%projectile.gravityMod = 1;
%projectile.hasLight = false;
%projectile.lightRadius = 3.0;
%projectile.lightColor = "0.2 0.055 0.0 0.8";
%projectile.damagetype = '%1 was melted by %2';
%projectile.impulse = 20;//added this for onCollision
the projectile in the script was removed and the projectile set in the imagedata changed to hack3projectile. There is no difference in-game, and it reduces the datablock count by 1. Times this by the 20+ weapons I hacked, and you'll see this add up, or to be more accurate, subtract down.