Can you mount a light to an item?

Author Topic: Can you mount a light to an item?  (Read 1413 times)

I'm trying to get a light to mount to the right hand and I am unable to get it to work.

It still mounts to the left hand even though the torch is in the right.

Quote
ForceRequiredAddOn("Weapon_Gun");
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 fxLightData(swol_torchLight)
{
   LightOn = true;
   radius = 6;
   brightness = 9;
   color = "0.8 0.7 0.4 1";


   FlareOn         = false;
   // FlareTP         = true;
   // Flarebitmap      = "base/lighting/corona";
   // FlareColor      = "1 1 1";
   // ConstantSizeOn   = false;
   // ConstantSize   = 1;
   // NearSize      = 3;
   // FarSize         = 0.5;
   // NearDistance   = 10.0;
   // FarDistance      = 30.0;
   // FadeTime      = 0.1;
   // BlendMode      = 0;

   AnimColor      = false;
   AnimBrightness   = true;
   AnimOffsets      = false;
   AnimRotation   = false;
   LinkFlare      = false;
   LinkFlareSize   = false;
   MinColor      = "1 1 0";
   MaxColor      = "0 0 1";
   MinBrightness   = 0.0;
   MaxBrightness   = 5.0;
   MinRadius      = 0.1;
   MaxRadius      = 10;
   StartOffset      = "-5 0 0";
   EndOffset      = "5 0 0";
   MinRotation      = 0;
   MaxRotation      = 359;

   SingleColorKeys   = false;
   RedKeys         = "AWTCFAH";
   GreenKeys      = "AWTCFAH";
   BlueKeys      = "AWTCFAH";
   
   BrightnessKeys   = "DEDEDFGF";
   RadiusKeys      = "AZAAAAA";
   OffsetKeys      = "AZAAAAA";
   RotationKeys   = "AZAAAAA";

   ColorTime      = 1.0;
   BrightnessTime   = 1.0;
   RadiusTime      = 1.0;
   OffsetTime      = 1.0;
   RotationTime   = 1.0;

   LerpColor      = false;
   LerpBrightness   = false;
   LerpRadius      = false;
   LerpOffset      = false;
   LerpRotation   = false;
};

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;
   
   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[3]         = 1000;
   stateEmitter[2]               = swol_torchFireEmitter;
   stateEmitterTime[2]            = 10000;
   stateTransitionOnTimeout[3]      = "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[2]               = "FireA";
   stateTimeoutValue[3]         = 1.2;
   stateEmitter[2]               = swol_torchSmokeEmitter;
   stateEmitterTime[2]            = 1.2;
   stateTransitionOnTimeout[2]      = "Done";
   
   stateName[3]               = "Done";
};

function swol_torchImage::onIgnite(%db,%pl,%slot)
{
   serverPlay3D(swol_torchIgniteSound,%pl.getPosition());
   %pl.playThread(3,plant);
   %pl.startTorchSched = %db.schedule(150,mountLight,%pl,%slot);
}
function swol_torchImage::mountLight(%db,%pl,%slot)
{
    %pl.light = new fxLight()
    {
        datablock = swol_torchLight;
    };
    missionCleanup.add(%pl.light);
    %pl.light.setTransform(%pl.getPosition());
    %pl.light.attachToObject(%pl);
    %pl.light.player = %pl;
    %pl.playAudio(2,swol_torchLoopSound);
}
//function swol_torchImage::putOutTorch(%db,%pl,%slot)
//{
   //if(isObject(%pl.light))
   //{
      //%pl.light.delete();
      //%pl.playAudio(2,swol_torchEndSound);
      //%pl.schedule(0,mountImage,swol_torchImageEnd,0);
      //%db.schedule(1800,unMountEnd,%pl,%slot);
      //%pl.playThread(3,plant);
   //}
   //else
   //{
      //cancel(%pl.startTorchSched);
   //}
//}
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)
{
   if(isObject(%pl.light))
   {
      %pl.light.delete();
      %pl.playAudio(2,swol_torchEndSound);
   }
   else
   {
      cancel(%pl.startTorchSched);
   }
   %pl.lastTorchTime = getSimTime();
   
}

« Last Edit: October 23, 2018, 03:43:02 PM by King Tøny »

Once I get this fixed I need to turn it into an attackable weapon but I'm waiting on fixing the light first.

Add this to the weapon image's datablock
Code: [Select]
   hasLight = true;
   lightType = "PulsingLight";
   lightTime = 10;
   lightRadius = 4;
   lightColor  = "1 1 1 1";

'lightTime' is the speed of the pulse animation, the higher the value, the faster the pulsing, if you don't want the light to pulsate, then remove the whole 'lightTime' line and replace the PulsingLight type with ConstantLight

The light is still mounted to the left hand


How can I get it to mount to the right?

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?
Code: [Select]
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

The fix removed the torchloop sound.

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?
image lights are broken that's why its not utilized in this, the light is attached to the player, they are only visible to host because they aren't transferred over network properly

Also, there's no reason for this item to require Weapon_Gun if it uses nothing from it
thats completely wrong since the image uses emitters from the gun

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
doesn't matter that a state number is missing, although it does look sloppy, originally there was another image state for that one and I just removed it


your best course of action to getting a light attached to the players right hand is to create a bot with no model, mount it to the right hand and then mount the light to the bot, this seems ridiculous but this is the best way to achieve what you want

I decided to scrap the entire script.

I just need help with this instead.

I need to mount a light to an item.



Code: [Select]
datablock AudioProfile(GemSparkleSound)
{
   filename    = "./torchloop.wav";
   description = AudioClosestLooping3d;
   preload = true;
};

//light
datablock fxLightData(swol_torchLight)
{
LightOn = true;
radius = 6;
brightness = 9;
color = "0.8 0.7 0.4 1";

FlareOn = false;
// FlareTP = true;
// Flarebitmap = "base/lighting/corona";
// FlareColor = "1 1 1";
// ConstantSizeOn = false;
// ConstantSize = 1;
// NearSize = 3;
// FarSize = 0.5;
// NearDistance = 10.0;
// FarDistance = 30.0;
// FadeTime = 0.1;
// BlendMode = 0;

AnimColor = false;
AnimBrightness = true;
AnimOffsets = false;
AnimRotation = false;
LinkFlare = false;
LinkFlareSize = false;
MinColor = "1 1 0";
MaxColor = "0 0 1";
MinBrightness = 0.0;
MaxBrightness = 5.0;
MinRadius = 0.1;
MaxRadius = 10;
StartOffset = "-5 0 0";
EndOffset = "5 0 0";
MinRotation = 0;
MaxRotation = 359;

SingleColorKeys = false;
RedKeys = "AWTCFAH";
GreenKeys = "AWTCFAH";
BlueKeys = "AWTCFAH";

BrightnessKeys = "DEDEDFGF";
RadiusKeys = "AZAAAAA";
OffsetKeys = "AZAAAAA";
RotationKeys = "AZAAAAA";

ColorTime = 1.0;
BrightnessTime = 1.0;
RadiusTime = 1.0;
OffsetTime = 1.0;
RotationTime = 1.0;

LerpColor = false;
LerpBrightness = false;
LerpRadius = false;
LerpOffset = false;
LerpRotation = false;
};

// Emitters and Particles

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";
};


datablock ShapeBaseImageData(TorchLightImage)
{
  shapeFile = "base/data/shapes/empty.dts";
  emap = true;
   mountPoint = 0;
   offset = "0 0 1";
   item = "";
   
   doColorShift = true;
   colorShiftColor = "0.37 0.25 0.1 1";
   melee = true;
   armReady = true;
   
   hasLight = true;
   lightType = "PulsingLight";
  radius = 6;
   brightness = 9;
   color = "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] = "Fire";
  stateTransitionOnTimeout[0] = "Fire";
  stateWaitForTimeout[0] = true;
  stateTimeoutValue[0] = 1000;
  stateEmitter[0] = swol_torchFireEmitter;
 stateLight[0] = PulsingLight;
  stateEmitterTime[0] = 1000;
};





//////////////////////////////////////////////////////////



// Gems Item Datas

//emerald

function RPGxEmeraldItem::onAdd(%this, %obj)
{
%obj.mountImage(TorchLightImage,0);
 %obj.playAudio(0, GemsparkleSound);
Parent::onAdd(%this, %obj);
}

function RPGxEmeraldImage::onMount(%this, %obj, %slot)
{   
    %obj.mountImage(TorchLightImage,1);
    Parent::onMount(%this, %obj, %slot);
}

function RPGxEmeraldImage::onUnMount(%this, %obj, %slot)
{
    %obj.unMountImage(1);
    %obj.stopAudio(0);
    Parent::onUnMount(%this, %obj, %slot);
}


I can mount an emitter and sound to an item, but is mounting a light possible?

I guess lights are forgeted.

Quote
datablock ShapeBaseImageData(TorchLightImage)
{
  shapeFile = "base/data/shapes/empty.dts";
  emap = true;
   mountPoint = 0;
   offset = "0 0 1";
   item = "";
   
   doColorShift = true;
   colorShiftColor = "0.37 0.25 0.1 1";
   melee = true;
   armReady = true;
   
   hasLight = true;
lightType = "PulsingLight";
  radius = 8;
   brightness = 10;
   color = "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] = "Fire";
  stateTransitionOnTimeout[0] = "Fire";
  stateWaitForTimeout[0] = true;
  stateTimeoutValue[0] = 1000;
  stateEmitter[0] = swol_torchFireEmitter;
  stateEmitterTime[0] = 1000;
};


this only works for the host.

After 5 hours of getting pissed off at the game and lights being broken when not syncing up I decided to just let it stay mounted to the left hand............