If the image mounts in the right hand, and the light data i posted above is in that image's datablock, then the light should also be in that hand
Maybe all of that other stuff you have that tries to mount the light isn't functioning properly, try this?
datablock AudioProfile(swol_torchIgniteSound)
{
filename = "./torchIgnite.wav";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(swol_torchEndSound)
{
filename = "./torchEnd.wav";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(swol_torchLoopSound)
{
filename = "./torchLoop.wav";
description = AudioClosestLooping3d;
preload = true;
};
datablock ParticleData(swol_torchFireParticle)
{
dragCoefficient = 1;
gravityCoefficient = -1.2;
inheritedVelFactor = 0;
constantAcceleration = 0;
lifetimeMS = 400;
lifetimeVarianceMS = 200;
textureName = "base/data/particles/cloud";
spinSpeed = 0;
spinRandomMin = -20;
spinRandomMax = 20;
colors[0] = "1 1 0.25 0.4";
colors[1] = "1 0.7 0.25 0.8";
colors[2] = "1 0 0 0";
sizes[0] = 0.1;
sizes[1] = 0.35;
sizes[2] = 0.2;
times[1] = 0.3;
times[2] = 1;
useInvAlpha = true;
};
datablock ParticleEmitterData(swol_torchFireEmitter)
{
ejectionPeriodMS = 4;
periodVarianceMS = 0;
velocityVariance = 0;
ejectionVelocity = 0;
ejectionOffset = 0.11;
thetaMin = 0;
thetaMax = 180;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
lifetimeMS = 0;
particles = swol_torchFireParticle;
uiName = "Torch Fire";
};
datablock ParticleData(swol_torchSmokeParticle)
{
dragCoefficient = 2;
gravityCoefficient = -0.8;
inheritedVelFactor = 0;
constantAcceleration = 0;
lifetimeMS = 400;
lifetimeVarianceMS = 200;
textureName = "base/data/particles/cloud";
spinSpeed = 0;
spinRandomMin = -20;
spinRandomMax = 20;
colors[0] = "0.4 0.4 0.4 0.2";
colors[1] = "0.6 0.5 0.3 0.3";
colors[2] = "0.3 0.3 0.3 0";
sizes[0] = 0.1;
sizes[1] = 0.35;
sizes[2] = 0.2;
times[1] = 0.3;
times[2] = 1;
useInvAlpha = true;
};
datablock ParticleEmitterData(swol_torchSmokeEmitter)
{
ejectionPeriodMS = 4;
periodVarianceMS = 0;
velocityVariance = 0.4;
ejectionVelocity = 0;
ejectionOffset = 0.11;
thetaMin = 0;
thetaMax = 180;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
lifetimeMS = 0;
particles = swol_torchSmokeParticle;
uiName = "Torch Smoke";
};
//////////
// item //
//////////
datablock ItemData(torchItem)
{
category = "Weapon"; // Mission editor category
className = "Weapon"; // For inventory system
// Basic Item Properties
shapeFile = "./Torch.dts";
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;
//gui stuff
uiName = "Torch";
iconName = "./icon_torch";
doColorShift = true;
colorShiftColor = "0.471 0.471 0.471 1.000";
// Dynamic properties defined by the scripts
image = swol_torchImage;
canDrop = true;
};
datablock shapeBaseImageData(swol_torchImage)
{
className = "WeaponImage";
shapeFile = "./torch.dts";
emap = true;
mountPoint = 0;
offset = "0 0 0";
item = "";
doColorShift = true;
colorShiftColor = "0.37 0.25 0.1 1";
melee = true;
armReady = true;
hasLight = true;
lightType = "PulsingLight";
lightTime = 10;
lightRadius = 6;
lightColor = "0.8 0.7 0.4 1";
eyeOffset = "0.7 1.4 -0.8";
eyeOffset = "";
rotation = "0 0 0 180";
eyeRotation = "0 0 0 0";
stateName[0] = "Ready";
stateTimeoutValue[0] = 0.1;
stateTransitionOnTimeout[0] = "Ignite";
stateName[1] = "Ignite";
stateScript[1] = "onIgnite";
stateTimeoutValue[1] = 0.2;
stateEmitter[1] = gunFlashEmitter;
stateEmitterTime[1] = 0.1;
stateTransitionOnTimeout[1] = "FireA";
stateName[2] = "FireA";
stateTimeoutValue[2] = 1000;
stateEmitter[2] = swol_torchFireEmitter;
stateEmitterTime[2] = 10000;
stateTransitionOnTimeout[2] = "FireB";
stateName[3] = "FireB";
stateTimeoutValue[3] = 0.01;
stateEmitter[3] = swol_torchFireEmitter;
stateEmitterTime[3] = 1000;
stateTransitionOnTimeout[3] = "FireA";
};
datablock shapeBaseImageData(swol_torchImageEnd)
{
className = "WeaponImage";
shapeFile = "./torch.dts";
emap = true;
mountPoint = 0;
offset = "-0.008 0.01 -0.13";
item = "";
doColorShift = true;
colorShiftColor = "0.37 0.25 0.1 1";
armReady = true;
eyeOffset = "0.7 1.4 -0.8";
eyeOffset = "";
rotation = "0 0 0 180";
eyeRotation = "0 0 0 0";
stateName[0] = "Ready";
stateTimeoutValue[0] = 0.1;
stateTransitionOnTimeout[0] = "FireA";
stateName[1] = "FireA";
stateTimeoutValue[1] = 1.2;
stateEmitter[1] = swol_torchSmokeEmitter;
stateEmitterTime[1] = 1.2;
stateTransitionOnTimeout[1] = "Done";
stateName[2] = "Done";
};
function swol_torchImage::onIgnite(%db,%pl,%slot)
{
serverPlay3D(swol_torchIgniteSound,%pl.getPosition());
%pl.playThread(3,plant);
}
function swol_torchImage::unMountEnd(%db,%pl,%slot)
{
if(%im = %pl.getMountedImage(0))
{
if(%im == nameToId(swol_torchImageEnd))
{
%pl.unMountImage(0);
%pl.playThread(0,root);
if(%im = %pl.getMountedImage(0))
{
if(%im.armReady)
{
%pl.playThread(0,armReadyRight);
}
}
}
}
}
function swol_torchImage::unMountCheck(%db,%pl,%slot)
{
if(!isObject(%pl.getMountedImage(0)))
%pl.playThread(0,armReadyRight);
}
function swol_torchImageEnd::unMountCheck(%db,%pl,%slot)
{
if(!isObject(%pl.getMountedImage(0)))
%pl.playThread(0,armReadyRight);
}
function swol_torchImage::onUnMount(%db,%pl,%slot)
{
%pl.playAudio(2,swol_torchEndSound);
%pl.lastTorchTime = getSimTime();
parent::onUnMount(%db,%pl,%slot);
}
Also, there's no reason for this item to require Weapon_Gun if it uses nothing from it
Also also, i fixed the numbers in the image states, the [#]'s, which are important for ordering what comes when and what group of states a state belongs to