Author Topic: Dual Rocket not shooting Left  (Read 595 times)

It doesn't shoot one the left hand side. Note, I snipped out the non needed parts of the code.
Code: [Select]
datablock ShapeBaseImageData(LeftHandedDualRocketImage)
{
   // Basic Item properties
   shapeFile = "Add-Ons/Weapon_Rocket_Launcher/rocketlauncher.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 = BowItem;
   ammo = " ";
   projectile = rocketLauncherProjectile;
   projectileType = Projectile;


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

   doColorShift = true;
   colorShiftColor = DualRocketItem.colorShiftColor;//"0.400 0.196 0 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";
stateTransitionOnTimeout[0] = "Ready";
stateTimeoutValue[0] = 0.2;
stateSequence[0] = "ready";
   stateSound[0] = weaponSwitchSound;

stateName[1] = "Ready";
stateSequence[1] = "ready";
stateTransitionOnTriggerDown[1] = "Fire";

stateName[2] = "Fire";
stateEjectShell[2]       = true;
stateSequence[2] = "Fire";
stateTransitionOnTimeout[2] = "Smoke";
   stateWaitForTimeout[2] = true;
stateTimeoutValue[2] = 0.6;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateScript[2] = "onFire";
stateSound[2] = rocketfireSound;
   stateEmitter[2] = rocketLauncherFlashEmitter;
stateEmitterTime[2] = 0.05;
stateEmitterNode[2] = "muzzleNode";

   stateName[3] = "Smoke";
stateEmitter[3] = rocketLauncherSmokeEmitter;
stateEmitterTime[3] = 0.05;
stateEmitterNode[3] = "muzzleNode";
stateTimeoutValue[3]            = 0.01;
stateTransitionOnTimeout[3]     = "Reload";

stateName[4] = "Reload";
stateTransitionOnTriggerUp[4] = "Ready";
stateSequence[4] = "ready";


};

function DualRocketImage::onMount(%this, %obj, %slot)
{
   Parent::onMount(%this, %obj, %slot);
   //mount lefthanded gun
   %obj.mountImage(LeftHandedDualRocketImage, 1);
   //%obj.playThread(0, armreadyboth);
}
function DualRocketImage::onUnMount(%this, %obj, %slot)
{
   Parent::onUnMount(%this, %obj, %slot);
   //unmount lefthanded gun
   %obj.unMountImage(1);
   //%obj.playThread(0, root);
}


function LeftHandedDualRocketImage::onMount(%this, %obj, %slot)
{
   Parent::onMount(%this, %obj, %slot);
   %obj.playThread(1, armreadyboth);
}
function LeftHandedDualRocketImage::onUnMount(%this, %obj, %slot)
{
   Parent::onUnMount(%this, %obj, %slot);
}


Post the ShapeBaseImageData of DualRocketImage and the other 'non needed' functions it has.

Code: [Select]
//DualRockets.cs

//we'll only get this far if we actually have the Rocket Launcher add-on
//  so it's safe to directly use stuff from that
//AddDamageType(<name>, <Self Delete message>, <kill message>, <vehicle damage scale>, <is direct damage>);
AddDamageType("AkimboGun",   '<bitmap:add-ons/Weapon_Guns_Akimbo/CI_2guns> %1',    '%2 <bitmap:add-ons/Weapon_Guns_Akimbo/CI_2guns> %1',0.05,1);

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

// Basic Item Properties
shapeFile = "Add-Ons/Weapon_Rocket_Launcher/RocketLauncher.dts";
rotate = false;
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;

//gui stuff
uiName = "Dual Rocket Launcher";
iconName = "./Icon_2s";
doColorShift = true;
colorShiftColor = "0.100 0.500 0.250 1.000";

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

////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(DualRocketImage)
{
   // Basic Item properties
   shapeFile = "Add-Ons/Weapon_Rocket_Launcher/rocketlauncher.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   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 = BowItem;
   ammo = " ";
   projectile = rocketLauncherProjectile;
   projectileType = Projectile;


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

   doColorShift = true;
   colorShiftColor = DualrocketItem.colorShiftColor;//"0.400 0.196 0 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";
stateTransitionOnTimeout[0] = "Ready";
stateTimeoutValue[0] = 0.2;
stateSequence[0] = "ready";

stateName[1] = "Ready";
stateSequence[1] = "ready";
stateTransitionOnTriggerDown[1] = "Fire";

stateName[2] = "Fire";
stateEjectShell[2]       = true;
stateSequence[2] = "Fire";
stateTransitionOnTimeout[2] = "Smoke";
   stateWaitForTimeout[2] = true;
stateTimeoutValue[2] = 0.6;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateScript[2] = "onFire";
stateSound[2] = rocketFireSound;
   stateEmitter[2] = rocketLauncherFlashEmitter;
stateEmitterTime[2] = 0.05;
stateEmitterNode[2] = "muzzleNode";

   stateName[3] = "Smoke";
stateEmitter[3] = rocketLauncherSmokeEmitter;
stateEmitterTime[3] = 0.05;
stateEmitterNode[3] = "muzzleNode";
stateTimeoutValue[3]            = 0.01;
stateTransitionOnTimeout[3]     = "Reload";

stateName[4] = "Reload";
stateAllowImageChange[4] = false;
stateTransitionOnTriggerUp[4] = "Ready";
stateSequence[4] = "ready";
};


function DualRocketImage::onFireAkimbo(%this,%obj,%slot)
{
   %obj.setImageTrigger(1,1);
}


datablock ShapeBaseImageData(LeftHandedDualRocketImage)
{
   // Basic Item properties
   shapeFile = "Add-Ons/Weapon_Rocket_Launcher/rocketlauncher.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 = BowItem;
   ammo = " ";
   projectile = rocketLauncherProjectile;
   projectileType = Projectile;


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

   doColorShift = true;
   colorShiftColor = DualRocketItem.colorShiftColor;//"0.400 0.196 0 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";
stateTransitionOnTimeout[0] = "Ready";
stateTimeoutValue[0] = 0.2;
stateSequence[0] = "ready";
   stateSound[0] = weaponSwitchSound;

stateName[1] = "Ready";
stateSequence[1] = "ready";
stateTransitionOnTriggerDown[1] = "Fire";

stateName[2] = "Fire";
stateEjectShell[2]       = true;
stateSequence[2] = "Fire";
stateTransitionOnTimeout[2] = "Smoke";
   stateWaitForTimeout[2] = true;
stateTimeoutValue[2] = 0.6;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateScript[2] = "onFire";
stateSound[2] = rocketfireSound;
   stateEmitter[2] = rocketLauncherFlashEmitter;
stateEmitterTime[2] = 0.05;
stateEmitterNode[2] = "muzzleNode";

   stateName[3] = "Smoke";
stateEmitter[3] = rocketLauncherSmokeEmitter;
stateEmitterTime[3] = 0.05;
stateEmitterNode[3] = "muzzleNode";
stateTimeoutValue[3]            = 0.01;
stateTransitionOnTimeout[3]     = "Reload";

stateName[4] = "Reload";
stateTransitionOnTriggerUp[4] = "Ready";
stateSequence[4] = "ready";


};

function DualRocketImage::onMount(%this, %obj, %slot)
{
   Parent::onMount(%this, %obj, %slot);
   //mount lefthanded gun
   %obj.mountImage(LeftHandedDualRocketImage, 1);
   //%obj.playThread(0, armreadyboth);
}
function DualRocketImage::onUnMount(%this, %obj, %slot)
{
   Parent::onUnMount(%this, %obj, %slot);
   //unmount lefthanded gun
   %obj.unMountImage(1);
   //%obj.playThread(0, root);
}


function LeftHandedDualRocketImage::onMount(%this, %obj, %slot)
{
   Parent::onMount(%this, %obj, %slot);
   %obj.playThread(1, armreadyboth);
}
function LeftHandedDualRocketImage::onUnMount(%this, %obj, %slot)
{
   Parent::onUnMount(%this, %obj, %slot);
}

-CodeSnip-
Edit out the parts that say Akimbo or AkimboGun.

Like here
Code: [Select]
function DualRocketImage::onFireAkimbo(%this,%obj,%slot)
« Last Edit: August 09, 2009, 03:06:41 PM by Crysist »

Here is the new one, still doesn't shoot out the left side.
Code: [Select]
//DualRockets.cs

//we'll only get this far if we actually have the Rocket Launcher add-on
//  so it's safe to directly use stuff from that
//AddDamageType(<name>, <Self Delete message>, <kill message>, <vehicle damage scale>, <is direct damage>);
AddDamageType("DualRocket",   '<bitmap:add-ons/Weapon_Dualrockets/CI_2R> %1',    '%2 <bitmap:add-ons/Weapon_Dualrockets/CI_2R> %1',0.05,1);

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

// Basic Item Properties
shapeFile = "Add-Ons/Weapon_Rocket_Launcher/RocketLauncher.dts";
rotate = false;
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;

//gui stuff
uiName = "Dual Rocket Launcher";
iconName = "./Icon_2s";
doColorShift = true;
colorShiftColor = "0.100 0.500 0.250 1.000";

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

////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(DualRocketImage)
{
   // Basic Item properties
   shapeFile = "Add-Ons/Weapon_Rocket_Launcher/rocketlauncher.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   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 = BowItem;
   ammo = " ";
   projectile = rocketLauncherProjectile;
   projectileType = Projectile;


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

   doColorShift = true;
   colorShiftColor = DualrocketItem.colorShiftColor;//"0.400 0.196 0 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";
stateTransitionOnTimeout[0] = "Ready";
stateTimeoutValue[0] = 0.2;
stateSequence[0] = "ready";

stateName[1] = "Ready";
stateSequence[1] = "ready";
stateTransitionOnTriggerDown[1] = "Fire";

stateName[2] = "Fire";
stateEjectShell[2]       = true;
stateSequence[2] = "Fire";
stateTransitionOnTimeout[2] = "Smoke";
   stateWaitForTimeout[2] = true;
stateTimeoutValue[2] = 0.6;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateScript[2] = "onFire";
stateSound[2] = rocketFireSound;
   stateEmitter[2] = rocketLauncherFlashEmitter;
stateEmitterTime[2] = 0.05;
stateEmitterNode[2] = "muzzleNode";

   stateName[3] = "Smoke";
stateEmitter[3] = rocketLauncherSmokeEmitter;
stateEmitterTime[3] = 0.05;
stateEmitterNode[3] = "muzzleNode";
stateTimeoutValue[3]            = 0.01;
stateTransitionOnTimeout[3]     = "Reload";

stateName[4] = "Reload";
stateAllowImageChange[4] = false;
stateTransitionOnTriggerUp[4] = "Ready";
stateSequence[4] = "ready";
};


function DualRocketImage::onReload(%this,%obj,%slot)
{
   %obj.setImageTrigger(1,1);
}


datablock ShapeBaseImageData(LeftHandedDualRocketImage)
{
   // Basic Item properties
   shapeFile = "Add-Ons/Weapon_Rocket_Launcher/rocketlauncher.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 = BowItem;
   ammo = " ";
   projectile = rocketLauncherProjectile;
   projectileType = Projectile;


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

   doColorShift = true;
   colorShiftColor = DualRocketItem.colorShiftColor;//"0.400 0.196 0 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";
stateTransitionOnTimeout[0] = "Ready";
stateTimeoutValue[0] = 0.2;
stateSequence[0] = "ready";
   stateSound[0] = weaponSwitchSound;

stateName[1] = "Ready";
stateSequence[1] = "ready";
stateTransitionOnTriggerDown[1] = "Fire";

stateName[2] = "Fire";
stateEjectShell[2]       = true;
stateSequence[2] = "Fire";
stateTransitionOnTimeout[2] = "Smoke";
   stateWaitForTimeout[2] = true;
stateTimeoutValue[2] = 0.6;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateScript[2] = "onFire";
stateSound[2] = rocketfireSound;
   stateEmitter[2] = rocketLauncherFlashEmitter;
stateEmitterTime[2] = 0.05;
stateEmitterNode[2] = "muzzleNode";

   stateName[3] = "Smoke";
stateEmitter[3] = rocketLauncherSmokeEmitter;
stateEmitterTime[3] = 0.05;
stateEmitterNode[3] = "muzzleNode";
stateTimeoutValue[3]            = 0.01;
stateTransitionOnTimeout[3]     = "Reload";

stateName[4] = "Reload";
stateTransitionOnTriggerUp[4] = "Ready";
stateSequence[4] = "ready";


};

function DualRocketImage::onMount(%this, %obj, %slot)
{
   Parent::onMount(%this, %obj, %slot);
   //mount lefthanded Rocket
   %obj.mountImage(LeftHandedDualRocketImage, 1);
   //%obj.playThread(0, armreadyboth);
}
function DualRocketImage::onUnMount(%this, %obj, %slot)
{
   Parent::onUnMount(%this, %obj, %slot);
   //unmount lefthanded Rocket
   %obj.unMountImage(1);
   //%obj.playThread(0, root);
}


function LeftHandedDualRocketImage::onMount(%this, %obj, %slot)
{
   Parent::onMount(%this, %obj, %slot);
   %obj.playThread(1, armreadyboth);
}
function LeftHandedDualRocketImage::onUnMount(%this, %obj, %slot)
{
   Parent::onUnMount(%this, %obj, %slot);
}

Add stateScript[4] = "onReload"; to DualRocketImage.