1
Modification Help / Re: claws
« on: May 10, 2009, 02:29:20 PM »im making a dual-wielded claw weapon that when you click both of the claws protrude from your hand, but i can only make one do that, as well as i want to make it so when you right click, the blades go back into your hand by calling a different animation and return to pre-draw, i used a lot from racer's walking stickim some what new to this game but how the heck do you understand and create this?!?!?!?!? i really have no idea plz personal message me to tell me i dont look back at the things i quote.
my code:Code: [Select]//HiddenBlade.cs
//////////
// item //
//////////
datablock ItemData(HiddenBladeItem)
{
category = "Weapon"; // Mission editor category
className = "Weapon"; // For inventory system
// Basic Item Properties
shapeFile = "./HiddenBlade.dts";
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;
//gui stuff
uiName = "HiddenBlade";
iconName = "./icon_HiddenBlade";
doColorShift = false;
colorShiftColor = "0.471 0.471 0.471 1.000";
// Dynamic properties defined by the scripts
image = HiddenBladeImage;
canDrop = true;
};
////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(HiddenBladeImage)
{
// Basic Item properties
shapeFile = "./HiddenBlade.dts";
emap = true;
// Specify mount point & offset for 3rd person, and eye offset
// for first person rendering.
mountPoint = 0;
offset = "0 0 0";
// 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 = false;
eyeOffset = "0 0 0";
// Add the WeaponImage namespace as a parent, WeaponImage namespace
// provides some hooks into the inventory system.
className = "WeaponImage";
// Projectile && Ammo.
item = HiddenBladeItem;
ammo = " ";
projectile = HiddenBladeProjectile;
projectileType = Projectile;
//melee particles shoot from eye node for consistancy
melee = true;
doRetraction = false;
//raise your arm up or not
armReady = false;
//casing = " ";
doColorShift = false;
colorShiftColor = "0.471 0.471 0.471 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.5;
stateTransitionOnTimeout[0] = "Ready";
stateSound[0] = WeaponswitchSound;
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Draw";
stateAllowImageChange[1] = true;
stateName[2] = "PreFire";
stateScript[2] = "onPreFire";
stateAllowImageChange[2] = false;
stateTimeoutValue[2] = 0.1;
stateTransitionOnTimeout[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "CheckFire";
stateTimeoutValue[3] = 0.2;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateWaitForTimeout[3] = true;
stateName[4] = "CheckFire";
stateTransitionOnTriggerUp[4] = "StopFire";
stateTransitionOnTriggerDown[4] = "FireHidden";
stateTransitionOnTriggerDown[4] = "Fire";
stateName[5] = "StopFire";
stateTransitionOnTimeout[5] = "ReadyDrawed";
stateTimeoutValue[5] = 0.2;
stateAllowImageChange[5] = false;
stateWaitForTimeout[5] = true;
stateSequence[5] = "StopFire";
stateScript[5] = "onStopFire";
stateName[6] = "Draw";
stateTransitionOnTimeout[6] = "ReadyDrawed";
stateSound[6] = HiddenBladeDrawSound;
stateSequence[6] = "Draw";
stateEjectShell[6] = true;
stateTimeoutValue[6] = 0.5;
stateName[7] = "ReadyDrawed";
stateTransitionOnTriggerDown[7] = "Prefire";
stateAllowImageChange[7] = true;
stateName[8] = "FireHidden";
stateTimeoutValue[8] = 0.09;
stateScript[8] = "onFireHidden";
stateTransitionOnTimeOut[8] = "ready";
};
function HiddenBladeImage::onFireHidden(%this,%obj,%slot)
{
%obj.setImageTrigger(1,0);
}
datablock ShapeBaseImageData(LeftHandedHiddenBladeImage)
{
// Basic Item properties
shapeFile = "Add-Ons/Weapon_HiddenBlade/HiddenBlade.dts";
emap = true;
// Specify mount point & offset for 3rd person, and eye offset
// for first person rendering.
mountPoint = 1;
offset = "0 0 0";
eyeOffset = 0; //"0.7 1.2 -0.5";
rotation = eulerToMatrix( "0 0 0" );
// 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 = HiddenBladeItem;
ammo = " ";
projectile = HiddenBladeProjectile;
projectileType = Projectile;
//melee particles shoot from eye node for consistancy
melee = true;
//raise your arm up or not
armReady = false;
doColorShift = false;
colorShiftColor = "0.471 0.471 0.471 1.000";
//casing = " ";
// 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.5;
stateTransitionOnTimeout[0] = "Ready";
stateSound[0] = WeaponswitchSound;
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Draw";
stateAllowImageChange[1] = true;
stateName[2] = "PreFire";
stateScript[2] = "onPreFire";
stateAllowImageChange[2] = false;
stateTimeoutValue[2] = 0.1;
stateTransitionOnTimeout[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "CheckFire";
stateTimeoutValue[3] = 0.2;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateWaitForTimeout[3] = true;
stateName[4] = "CheckFire";
stateTransitionOnTriggerUp[4] = "StopFire";
stateTransitionOnTriggerDown[4] = "Fire";
stateName[5] = "StopFire";
stateTransitionOnTimeout[5] = "ReadyDrawed";
stateTimeoutValue[5] = 0.2;
stateAllowImageChange[5] = false;
stateWaitForTimeout[5] = true;
stateSequence[5] = "StopFire";
stateScript[5] = "onStopFire";
stateName[6] = "Draw";
stateTransitionOnTimeout[6] = "ReadyDrawed";
stateSound[6] = HiddenBladeDrawSound;
stateSequence[6] = "Draw";
stateEjectShell[6] = true;
stateTimeoutValue[6] = 0.5;
stateName[7] = "ReadyDrawed";
stateTransitionOnTriggerDown[7] = "Prefire";
stateAllowImageChange[7] = true;
};
function LeftHandedHiddenBladeImage::onFire(%this, %obj, %slot)
{
Parent::onFire(%this,%obj,%slot);
if(%obj.getDamagePercent() < 1.0)
%obj.playThread(2, leftarmattack);
}
function HiddenBladeImage::onFire(%this, %obj, %slot)
{
Parent::onFire(%this,%obj,%slot);
if(%obj.getDamagePercent() < 1.0)
%obj.playThread(2, armattack);
}
function HiddenBladeImage::onMount(%this, %obj, %slot)
{
Parent::onMount(%this, %obj, %slot);
//mount lefthanded gun
%obj.mountImage(LeftHandedHiddenBladeImage, 1);
//%obj.playThread(0, armreadyboth);
}
function HiddenBladeImage::onUnMount(%this, %obj, %slot)
{
Parent::onUnMount(%this, %obj, %slot);
//unmount lefthanded gun
%obj.unMountImage(1);
//%obj.playThread(0, root);
}
function HiddenBladeImage::onPreFire(%this, %obj, %slot)
{
%obj.playthread(2, armattack);
}
function HiddenBladeImage::onStopFire(%this, %obj, %slot)
{
%obj.playthread(2, root);
}
function LeftHandedHiddenBladeImage::onPreFire(%this, %obj, %slot)
{
%obj.playthread(1, leftarmattack);
}
function LeftHandedHiddenBladeImage::onStopFire(%this, %obj, %slot)
{
%obj.playthread(1, root);
}
if anyone could help me just figure out how to make both attack/protrude that would be great