Author Topic: Could somebody make this weapon akimbo?  (Read 398 times)

Code: [Select]
if(!isObject(LumberjackAxeItem))
{
AddDamageType("LumberjackAxe",   '<bitmap:Add-Ons/GameMode_CRP/Shapes/CI/CI_LumberjackAxe> %1',    '%2 <bitmap:Add-Ons/GameMode_CRP/Shapes/CI/CI_LumberjackAxe> %1', 0.5, 1);
datablock ProjectileData(LumberjackAxeProjectile)
{
directDamage = 10;
directDamageType = $DamageType::LumberjackAxe;
radiusDamageType = $DamageType::LumberjackAxe;
explosion = SwordExplosion;

muzzleVelocity = 50;
velInheritFactor = 1;

armingDelay = 0;
lifetime = 100;
fadeDelay = 70;
explodeOnDeath = false;
bounceElasticity = 0;
bounceFriction = 0;
isBallistic = false;
gravityMod = 0.0;

hasLight = false;
lightRadius = 1.0;
lightColor = "0 0.25 0.5";
};
datablock ItemData(LumberjackAxeItem)
{
category = "Weapon";
className = "Weapon";

shapeFile = "Add-Ons/GameMode_CRP/Shapes/LumberjackAxe.dts";
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;

uiName = "Lumberjack Axe";
iconName = "Add-Ons/GameMode_CRP/Shapes/ItemIcons/Icon_LumberjackAxe";
doColorShift = false;

image = LumberjackAxeImage;
canDrop = true;
};
datablock ShapeBaseImageData(LumberjackAxeImage)
{
shapeFile = "Add-Ons/GameMode_CRP/Shapes/LumberjackAxe.dts";
emap = true;
mountPoint = 0;
eyeOffset = "0 0 0";
offset = "0 0 0";
correctMuzzleVector = false;
className = "WeaponImage";

item = LumberjackAxeItem;
ammo = " ";
projectile = LumberjackAxeProjectile;
projectileType = Projectile;

melee = true;
doRetraction = false;
armReady = true;

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

stateName[0] = "Activate";
stateTimeoutValue[0] = 0.1;
stateTransitionOnTimeout[0] = "Ready";

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

stateName[2] = "PreFire";
stateScript[2] = "onPreFire";
stateAllowImageChange[2] = false;
stateTimeoutValue[2] = 0.1;
stateTransitionOnTimeout[2] = "Fire";

stateName[3] = "Fire";
stateTimeoutValue[3] = 0.1;
stateTransitionOnTimeout[3] = "PreCheckFire";
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateWaitForTimeout[3] = true;

stateName[4] = "PreCheckFire";
stateTimeoutValue[4] = 0.15;
stateTransitionOnTimeout[4] = "CheckFire";

stateName[5] = "CheckFire";
stateTransitionOnTriggerUp[5] = "StopFire";
stateTransitionOnTriggerDown[5] = "PreFire";

stateName[6] = "StopFire";
stateTransitionOnTimeout[6] = "Ready";
stateTimeoutValue[6] = 0.1;
stateAllowImageChange[6] = false;
stateWaitForTimeout[6] = true;
stateSequence[6] = "StopFire";
};
}
function LumberjackAxeImage::onPreFire(%this, %obj, %slot)
{
%obj.playthread(2, shiftAway);
}
I want it to be automatic and have a 1 sec delay between fires.
« Last Edit: January 09, 2013, 08:31:17 PM by Plexious »

This is coding help, not coding sweatshop. Look at Weapon_Guns_Akimbo/Weapon_AkimboGun.cs

It seems self explanatory to me.