Skip to content

Commit

Permalink
fixed kv3 header
Browse files Browse the repository at this point in the history
  • Loading branch information
robincodex committed May 26, 2022
1 parent 7800a57 commit 62235bb
Show file tree
Hide file tree
Showing 3 changed files with 1,459 additions and 1,298 deletions.
7 changes: 7 additions & 0 deletions __tests__/KeyValues3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,4 +646,11 @@ Second line of a multi-line string literal.
expect(root.FindIDTraverse(c3.ID)).toBe(c3);
expect(a3.GetArray().FindIDTraverse(a2.ID)).toBeUndefined();
});

test('Check KeyValues3 Header', async () => {
const root = await LoadKeyValues3(join(__dirname, 'npc/particle.vpcf'));
expect(root.GetHeader()).toBe(
'<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:vpcf36:version{d15c9157-10e0-47bc-9333-1ac81da07b8d} -->'
);
});
});
153 changes: 153 additions & 0 deletions __tests__/npc/particle.vpcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:vpcf36:version{d15c9157-10e0-47bc-9333-1ac81da07b8d} -->
{
_class = "CParticleSystemDefinition"
m_nMaxParticles = 128
m_nBehaviorVersion = 12
m_nFirstMultipleOverride_BackwardCompat = 4
m_controlPointConfigurations =
[
{
m_name = "preview"
m_drivers =
[
{
m_iAttachType = "PATTACH_WORLDORIGIN"
m_entityName = "self"
},
]
},
]
m_Emitters =
[
{
_class = "C_OP_InstantaneousEmitter"
m_nParticlesToEmit =
{
m_nType = "PF_TYPE_LITERAL"
m_flLiteralValue = 200.0
}
},
]
m_Initializers =
[
{
_class = "C_INIT_RandomLifeTime"
m_fLifetimeMin = 0.15
m_fLifetimeMax = 1.25
},
{
_class = "C_INIT_RandomColor"
m_ColorMin = [ 0, 128, 0 ]
m_ColorMax = [ 60, 179, 113 ]
m_nTintBlendMode = "2"
},
{
_class = "C_INIT_RandomRadius"
m_flRadiusMax = 5.0
},
{
_class = "C_INIT_CreateWithinSphere"
m_fRadiusMax =
{
m_nType = "PF_TYPE_CONTROL_POINT_COMPONENT"
m_nMapType = "PF_MAP_TYPE_DIRECT"
m_flLiteralValue = 2.0
m_nControlPoint = 1
m_nScalarAttribute = 3
m_nVectorAttribute = 6
m_nVectorComponent = 0
m_flRandomMin = 0.0
m_flRandomMax = 1.0
m_nRandomMode = "PF_RANDOM_MODE_CONSTANT"
m_flLOD0 = 0.0
m_flLOD1 = 0.0
m_flLOD2 = 0.0
m_flLOD3 = 0.0
m_flNoiseOutputMin = 0.0
m_flNoiseOutputMax = 1.0
m_flNoiseScale = 0.1
m_vecNoiseOffsetRate = [ 0.0, 0.0, 0.0 ]
m_flNoiseOffset = 0.0
m_nNoiseOctaves = 1
m_nNoiseTurbulence = "PF_NOISE_TURB_NONE"
m_nNoiseType = "PF_NOISE_TYPE_PERLIN"
m_nNoiseModifier = "PF_NOISE_MODIFIER_NONE"
m_flNoiseTurbulenceScale = 1.0
m_flNoiseTurbulenceMix = 0.5
m_flNoiseImgPreviewScale = 1.0
m_bNoiseImgPreviewLive = true
m_nInputMode = "PF_INPUT_MODE_CLAMPED"
m_flMultFactor = 1.0
m_flInput0 = 0.0
m_flInput1 = 1.0
m_flOutput0 = 0.0
m_flOutput1 = 1.0
m_nBiasType = "PF_BIAS_TYPE_STANDARD"
m_flBiasParameter = 0.0
m_Curve =
{
m_spline = [ ]
m_tangents = [ ]
m_vDomainMins = [ 0.0, 0.0 ]
m_vDomainMaxs = [ 0.0, 0.0 ]
}
}
m_fSpeedMax = 1040.0
m_LocalCoordinateSystemSpeedMax = [ 0.0, 0.0, 50.0 ]
m_bDisableOperator = true
},
{
_class = "C_INIT_RandomSequence"
m_nSequenceMax = 30
},
{
_class = "C_INIT_CreateSpiralSphere"
m_nDensity = 32
m_flInitialRadius = 32.0
m_flInitialSpeedMin = 900.0
m_flInitialSpeedMax = 1200.0
},
]
m_Operators =
[
{
_class = "C_OP_BasicMovement"
m_Gravity = [ 0.0, 0.0, 500.0 ]
m_fDrag = 0.05
},
{
_class = "C_OP_InterpolateRadius"
m_flStartScale = 10.0
m_flEndScale = 2.0
},
{
_class = "C_OP_Decay"
},
{
_class = "C_OP_PositionLock"
},
{
_class = "C_OP_ColorInterpolate"
m_ColorFade = [ 34, 139, 34 ]
},
]
m_Renderers =
[
{
_class = "C_OP_RenderSprites"
m_nRefractBlurType = "2"
m_flOverbrightFactor = 10.0
VisibilityInputs =
{
m_flInputMax = 0.0
}
m_vecTexturesInput =
[
{
m_hTexture = resource:"materials/particle/msg/msg_radiance.vtex"
},
]
m_nOutputBlendMode = "PARTICLE_OUTPUT_BLEND_MODE_ADD"
},
]
}
Loading

0 comments on commit 62235bb

Please sign in to comment.