Sound in models

This is a forum where you can ask our code monkeys for assistance. Questions on technical help belong here.
aeipathy
Posts: 164
Joined: Tue Dec 29, 2009 12:00 am

Sound in models

Postby aeipathy » Mon Jul 12, 2010 10:14 pm

Here is the code for RifleImpact.mdl

Code: Select all

// Converted Tue Jul 13 12:44:24 2010
// MdlxConv Version Mar  3 2007.
Version {
   FormatVersion 800,
}
Model "RifleImpact" {
   BlendTime 150,
   MinimumExtent { -28.939100, -73.151497, -73.644600 },
   MaximumExtent { 28.969801, 73.571701, 73.078598 },
   BoundsRadius 103.749001,
}
Sequences 1 {
   Anim "Birth" {
      Interval { 167, 1033 },
      NonLooping,
   }
}
Textures 2 {
   Bitmap {
      Image "Textures\Dust3.blp",
   }
   Bitmap {
      Image "Textures\Yellow_Star_Dim.blp",
   }
}
Materials 1 {
   Material {
      Layer {
         FilterMode AddAlpha,
         Unshaded,
         static TextureID 0,
         Alpha 6 {
            Linear,
            167: 0.000000,
            200: 0.000000,
            233: 0.720000,
            533: 0.000000,
            900: 0.000000,
            1033: 0.000000,
         }
      }
   }
}
Geoset {
   Vertices 4 {
      { 0.015300, -20.263500, 20.190701 },
      { 0.015300, -20.263500, -20.757000 },
      { 0.015300, 20.684200, 20.190701 },
      { 0.015300, 20.684200, -20.757000 },
   }
   Normals 4 {
      { 1.000000, 0.000000, 0.000000 },
      { 1.000000, 0.000000, 0.000000 },
      { 1.000000, 0.000000, 0.000000 },
      { 1.000000, 0.000000, 0.000000 },
   }
   TVertices 4 {
      { 0.000000, 0.000000 },
      { 0.000000, 1.000000 },
      { 1.000000, 0.000000 },
      { 1.000000, 1.000000 },
   }
   VertexGroup {
      0,
      0,
      0,
      0,
   }
   Faces 1 6 {
      Triangles {
         { 0, 1, 2, 3, 2, 1 },
      }
   }
   Groups 1 1 {
      Matrices { 0 },
   }
   MinimumExtent { -28.939100, -73.151497, -73.644600 },
   MaximumExtent { 28.969801, 73.571701, 73.078598 },
   BoundsRadius 103.749001,
   MaterialID 0,
   SelectionGroup 0,
}
Bone "Plane01" {
   ObjectId 0,
   Billboarded,
   GeosetId 0,
   GeosetAnimId None,
   Scaling 5 {
      Linear,
      167: { 0.054101, 0.054101, 0.054101 },
      200: { 0.816502, 0.816502, 0.816501 },
      233: { 1.445970, 1.445970, 1.445970 },
      300: { 2.370940, 2.370940, 2.370940 },
      900: { 3.653740, 3.653740, 3.653740 },
   }
}
PivotPoints 2 {
   { 0.015347, 0.210431, -0.283191 },
   { 0.287152, -0.273106, -0.559543 },
}
ParticleEmitter2 "BlizParticle01" {
   ObjectId 1,
   Unshaded,
   static Speed 380.000000,
   static Variation 0.000000,
   static Latitude 180.000000,
   static Gravity 0.000000,
   Squirt,
   LifeSpan 0.300000,
   EmissionRate 4 {
      DontInterp,
      0: 0.000000,
      167: 0.000000,
      200: 31.500000,
      367: 0.000000,
   }
   static Width 0.000000,
   static Length 0.000000,
   Additive,
   Rows 1,
   Columns 1,
   Head,
   TailLength 1.000000,
   Time 0.300000,
   SegmentColor {
      Color { 1.000000, 1.000000, 1.000000 },
      Color { 1.000000, 1.000000, 1.000000 },
      Color { 1.000000, 1.000000, 1.000000 },
   },
   Alpha { 255, 255, 0 },
   ParticleScaling { 13.700000, 9.400000, 0.100000 },
   LifeSpanUVAnim { 0, 0, 1 },
   DecayUVAnim { 0, 0, 1 },
   TailUVAnim { 0, 0, 1 },
   TailDecayUVAnim { 0, 0, 1 },
   TextureID 1,
}


EventObject "SNDxKRIF" {
   ObjectId 2,
   EventTrack 1 {
      167,
   }
}



But how come the sound doesn't play? I am 100% sure the eventobject code (SNDxKRIF) is right but this is my first time putting a sound in a model so I don't really know what to do.

Code: Select all

EventObject "SNDxKRIF" {
   ObjectId 2,
   EventTrack 1 {
      167,
   }
}


Help is much appreciated!