Короче долго мучался и сделал это.
В чём идея и зачем это надо?
Откройте файл PartTwk.xml - он огромен и ужасен. Вот сидел я перед ним и мне пришла идея - придумать свой формат вместо PartTwk.xml и описывать в нём только изменение файла. Вот, поглядите:
Code
<?xml version="1.0" encoding="UTF-8"?>
<EffectLibrary using="PartTwk">
<ComplexEffect id="WXP_Atomic">
<Effect>WXP_Atomic_Ring1</Effect>
<Effect>WXP_Atomic_Ring2</Effect>
<Effect>WXP_Atomic_Ring3</Effect>
<Effect>WXP_Atomic_Ring4</Effect>
<Effect>WXP_Atomic_Ring5</Effect>
<Effect>WXP_Atomic_Ring6</Effect>
<Effect>WXP_Atomic_Ring7</Effect>
<Effect>WXP_Atomic_Ring8</Effect>
<Effect>WXP_Atomic_Ring9</Effect>
<Effect>WXP_Atomic_Ring10</Effect>
<Effect>WXP_Atomic_Ring11</Effect>
<Effect>WXP_Atomic_Ring12</Effect>
</ComplexEffect>
<Effect id="WXP_Atomic_Ring1" base="WXP_Atomic_Base">
<ParticleVelocityRandomise x='50' y='0' z='50' />
<EmitterOriginOffset x='0' y='0' z='0' />
</Effect>
<Effect id="WXP_Atomic_Ring2" base="WXP_Atomic_Base">
<ParticleVelocityRandomise x='40' y='0' z='40' />
<EmitterOriginOffset x='0' y='10' z='0' />
<ParticleColor r='0' g='0' b='1' />
</Effect>
<Effect id="WXP_Atomic_Ring3" base="WXP_Atomic_Base">
<ParticleVelocityRandomise x='30' y='0' z='30' />
<EmitterOriginOffset x='0' y='20' z='0' />
</Effect>
<Effect id="WXP_Atomic_Ring4" base="WXP_Atomic_Base">
<ParticleVelocityRandomise x='20' y='0' z='20' />
<EmitterOriginOffset x='0' y='30' z='0' />
</Effect>
<Effect id="WXP_Atomic_Ring5" base="WXP_Atomic_Base">
<ParticleVelocityRandomise x='10' y='0' z='10' />
<EmitterOriginOffset x='0' y='40' z='0' />
</Effect>
<Effect id="WXP_Atomic_Ring6" base="WXP_Atomic_Base">
<ParticleVelocityRandomise x='20' y='0' z='20' />
<EmitterOriginOffset x='0' y='50' z='0' />
</Effect>
<Effect id="WXP_Atomic_Ring7" base="WXP_Atomic_Base">
<ParticleVelocityRandomise x='30' y='0' z='30' />
<EmitterOriginOffset x='0' y='60' z='0' />
</Effect>
<Effect id="WXP_Atomic_Ring8" base="WXP_Atomic_Base">
<ParticleVelocityRandomise x='40' y='0' z='40' />
<EmitterOriginOffset x='0' y='70' z='0' />
</Effect>
<Effect id="WXP_Atomic_Ring9" base="WXP_Atomic_Base">
<ParticleVelocityRandomise x='50' y='0' z='50' />
<EmitterOriginOffset x='0' y='80' z='0' />
</Effect>
<Effect id="WXP_Atomic_Ring10" base="WXP_Atomic_Base">
<ParticleVelocityRandomise x='60' y='0' z='60' />
<EmitterOriginOffset x='0' y='90' z='0' />
</Effect>
<Effect id="WXP_Atomic_Ring11" base="WXP_Atomic_Base">
<ParticleVelocityRandomise x='70' y='0' z='70' />
<EmitterOriginOffset x='0' y='100' z='0' />
</Effect>
<Effect id="WXP_Atomic_Ring12" base="WXP_Atomic_Base">
<ParticleVelocityRandomise x='80' y='0' z='80' />
<EmitterOriginOffset x='0' y='110' z='0' />
<ParticleColor r='1' g='0' b='0' />
</Effect>
<EffectBase id="WXP_Atomic_Base">
<Comment></Comment>
<EmitterType>0</EmitterType>
<SpriteSet>Particle.WXSprite4</SpriteSet>
<MeshAnimNodeName></MeshAnimNodeName>
<EmitterAcceleration x='0' y='0' z='0' />
<EmitterAccelerationRandomise x='0' y='0' z='0' />
<EmitterIsAttachedToLand>false</EmitterIsAttachedToLand>
<EmitterIsOfInterest>false</EmitterIsOfInterest>
<EmitterIsLaunchedFromWeapon>false</EmitterIsLaunchedFromWeapon>
<EmitterLifeTime>2000</EmitterLifeTime>
<EmitterLifeTimeRandomise>0</EmitterLifeTimeRandomise>
<EmitterMaxParticles>500</EmitterMaxParticles>
<EmitterNumCollide>0</EmitterNumCollide>
<EmitterNumSpawn>500</EmitterNumSpawn>
<EmitterNumSpawnRadnomise>0</EmitterNumSpawnRadnomise>
<EmitterOriginOffset x='0' y='9' z='0' />
<EmitterOriginRandomise x='0' y='0' z='0' />
<EmitterParticleExpireFX></EmitterParticleExpireFX>
<EmitterParticleFX></EmitterParticleFX>
<EmitterSameDirectionAsWorm>false</EmitterSameDirectionAsWorm>
<EmitterSoundFX></EmitterSoundFX>
<EmitterSoundFXVolume>1</EmitterSoundFXVolume>
<EmitterSpawnFreq>80</EmitterSpawnFreq>
<EmitterSpawnFreqRansomise>0</EmitterSpawnFreqRansomise>
<EmitterSpawnSizeVelocity x='0' y='0' />
<EmitterStartDelay>0</EmitterStartDelay>
<EmitterVelocity x='0' y='0' z='0' />
<EmitterVelocityRandomise x='0' y='0' z='0' />
<ParticleAcceleration x='0' y='-1' z='0' />
<ParticleAccelerationRandomise x='0' y='0' z='0' />
<ParticleAlpha>1</ParticleAlpha>
<ParticleAlphaFadeIn>0</ParticleAlphaFadeIn>
<ParticleAlphaVelocity>0</ParticleAlphaVelocity>
<ParticleAlphaVelocityDelay>4500</ParticleAlphaVelocityDelay>
<ParticleAlternateAccelerationN>6500</ParticleAlternateAccelerationN>
<ParticleAlternateAccelerationS>2e-006</ParticleAlternateAccelerationS>
<ParticleAnimationFrame>0</ParticleAnimationFrame>
<ParticleAnimationFrameRandomise>0</ParticleAnimationFrameRandomise>
<ParticleAnimationSpeed>0</ParticleAnimationSpeed>
<ParticleAnimationSpeedRandomize>0</ParticleAnimationSpeedRandomize>
<ParticleAttractor x='0' y='0' z='0' />
<ParticleAttractorRandomise x='0' y='0' z='0' />
<ParticleAttractorIsActive>false</ParticleAttractorIsActive>
<ParticleCanEnterWater>false</ParticleCanEnterWater>
<ParticleCollisionFreq>0</ParticleCollisionFreq>
<ParticleCollisionImmuneTime>0</ParticleCollisionImmuneTime>
<ParticleCollisionMinAlpha>0</ParticleCollisionMinAlpha>
<ParticleCollisonRadius>0</ParticleCollisonRadius>
<ParticleCollisonRadiusOffset x='0' y='0' z='0' />
<ParticleCollisonRadiusVelocity>0</ParticleCollisonRadiusVelocity>
<ParticleCollisionShowDebug>false</ParticleCollisionShowDebug>
<ParticleCollisionWormDamageMagnitude>0</ParticleCollisionWormDamageMagnitude>
<ParticleCollisionWormImpulseMagnitude>0</ParticleCollisionWormImpulseMagnitude>
<ParticleCollisionWormImpulseYMagnitude>0</ParticleCollisionWormImpulseYMagnitude>
<ParticleCollisionWormPoisonMagnitude>0</ParticleCollisionWormPoisonMagnitude>
<ParticleCollisionWormType>0</ParticleCollisionWormType>
<ParticleColor r='0' g='0' b='0' />
<ParticleExpireShake>true</ParticleExpireShake>
<ParticleExpireShakeLength>1000</ParticleExpireShakeLength>
<ParticleExpireShakeMagnitude>0</ParticleExpireShakeMagnitude>
<ParticleIsAlternateAcceleration>true</ParticleIsAlternateAcceleration>
<ParticleIsEffectedByWind>false</ParticleIsEffectedByWind>
<ParticleIsSpiral>false</ParticleIsSpiral>
<ParticleIsUnderWaterEffect>false</ParticleIsUnderWaterEffect>
<ParticleLandCollideType>0</ParticleLandCollideType>
<ParticleLife>20000</ParticleLife>
<ParticleLifeRandomise>500</ParticleLifeRandomise>
<ParticleMass>-0.5</ParticleMass>
<ParticleNumColors>1</ParticleNumColors>
<ParticleNumFrames>1</ParticleNumFrames>
<ParticleOrientation x='0' y='0' z='0' />
<ParticleOrientationRandomise x='0' y='0' z='0' />
<ParticleOrientationVelocity x='0' y='0' z='0' />
<ParticleOrientationVelocityRandomise x='0' y='0' z='8' />
<ParticleSize x='8' y='8' />
<ParticleSizeOriginIsCenterPoint>false</ParticleSizeOriginIsCenterPoint>
<ParticleSizeRandomise>0</ParticleSizeRandomise>
<ParticleSizeVelocity x='-0.2' y='-0.2' />
<ParticleSizeVelocityRandomise x='-0.1' y='-0.1' />
<ParticleSizeVelocityDelay>2750</ParticleSizeVelocityDelay>
<ParticleSizeVelocityDelayRandomise>600</ParticleSizeVelocityDelayRandomise>
<ParticleFinalSizeScale x='0' y='0' />
<ParticleFinalSizeScaleRandomise>0</ParticleFinalSizeScaleRandomise>
<ParticleSizeFadeIn>0</ParticleSizeFadeIn>
<ParticleSizeFadeInRandomize>0</ParticleSizeFadeInRandomize>
<ParticleSizeFadeInDelay>0</ParticleSizeFadeInDelay>
<ParticleSizeFadeInDelayRandomize>0</ParticleSizeFadeInDelayRandomize>
<ParticleRenderScene>0</ParticleRenderScene>
<ParticleSpiralRadius>0</ParticleSpiralRadius>
<ParticleSpiralRadiusRandomise>0</ParticleSpiralRadiusRandomise>
<ParticleSpiralRadiusVelocity>0</ParticleSpiralRadiusVelocity>
<ParticleSpiralRadiusVelocityRandomise>0</ParticleSpiralRadiusVelocityRandomise>
<ParticleSpiralRadiusSizeVelocity>0</ParticleSpiralRadiusSizeVelocity>
<ParticleVelocity x='0' y='0.02' z='0' />
<ParticleVelocityRandomise x='12' y='0' z='12' />
<ParticleVelocityIsNormalised>true</ParticleVelocityIsNormalised>
</EffectBase>
</EffectLibrary>
Опишу формат:
Code
<ComplexEffect id="WXP_Atomic">
<Effect>WXP_Atomic_Ring1</Effect>
<Effect>WXP_Atomic_Ring2</Effect>
<Effect>WXP_Atomic_Ring3</Effect>
<Effect>WXP_Atomic_Ring4</Effect>
<Effect>WXP_Atomic_Ring5</Effect>
<Effect>WXP_Atomic_Ring6</Effect>
<Effect>WXP_Atomic_Ring7</Effect>
<Effect>WXP_Atomic_Ring8</Effect>
<Effect>WXP_Atomic_Ring9</Effect>
<Effect>WXP_Atomic_Ring10</Effect>
<Effect>WXP_Atomic_Ring11</Effect>
<Effect>WXP_Atomic_Ring12</Effect>
</ComplexEffect>
Будет заменено на:
Code
<XContainerResourceDetails id="WXP_Atomic">
<Value href="WXP_Atomic-0"/>
<Name>WXP_Atomic</Name>
<Flags>81</Flags>
</XContainerResourceDetails>
<EffectDetailsContainer id="WXP_Atomic-0">
<EffectNames>WXP_Atomic_Ring1</EffectNames>
<EffectNames>WXP_Atomic_Ring2</EffectNames>
<EffectNames>WXP_Atomic_Ring3</EffectNames>
<EffectNames>WXP_Atomic_Ring4</EffectNames>
<EffectNames>WXP_Atomic_Ring5</EffectNames>
<EffectNames>WXP_Atomic_Ring6</EffectNames>
<EffectNames>WXP_Atomic_Ring7</EffectNames>
<EffectNames>WXP_Atomic_Ring8</EffectNames>
<EffectNames>WXP_Atomic_Ring9</EffectNames>
<EffectNames>WXP_Atomic_Ring10</EffectNames>
<EffectNames>WXP_Atomic_Ring11</EffectNames>
<EffectNames>WXP_Atomic_Ring12</EffectNames>
</EffectDetailsContainer>
Кроме того в XDataBank для этого контейнера будет дописана строчка
Code
<ContainerResources href="WXP_Atomic"/>
Последний большой контейнер - копия эффекта из PartTwk.xml, то есть я взял содержимое ParticleEmitterContainer и поместил его в EffectBase. Это будет базой для всех новых контейнеров. Базу можно сразу поменять - никто не мешает(я вроде там время жизни частиц поменял)
Идём дальше:
Code
<Effect id="WXP_Atomic_Ring2" base="WXP_Atomic_Base">
<ParticleVelocityRandomise x='40' y='0' z='40' />
<EmitterOriginOffset x='0' y='10' z='0' />
<ParticleColor r='0' g='0' b='1' />
</Effect>
Это превратится в ParticleEmitterContainer. Как это произойдёт? Программа смотрит в base="WXP_Atomic_Base" в контейнере Effect, ищет в файле контейнер EffectBase с id="WXP_Atomic_Base", и на его основе, заменяя тэги ParticleVelocityRandomise, EmitterOriginOffset и ParticleColor создаёт новый контейнер!
Таким образом на основе <Effect id="WXP_Atomic_Ring2" base="WXP_Atomic_Base"> и <EffectBase id="WXP_Atomic_Base"> мы получим это:
Code
<XContainerResourceDetails id="WXP_Atomic_Ring2">
<Value href="WXP_Atomic_Ring2-0"/>
<Name>WXP_Atomic_Ring2</Name>
<Flags>81</Flags>
</XContainerResourceDetails>
<ParticleEmitterContainer id="WXP_Atomic_Ring2-0">
<Comment/>
<EmitterType>0</EmitterType>
<SpriteSet>Particle.WXSprite4</SpriteSet>
<MeshAnimNodeName/>
<EmitterAcceleration x="0" y="0" z="0"/>
<EmitterAccelerationRandomise x="0" y="0" z="0"/>
<EmitterIsAttachedToLand>false</EmitterIsAttachedToLand>
<EmitterIsOfInterest>false</EmitterIsOfInterest>
<EmitterIsLaunchedFromWeapon>false</EmitterIsLaunchedFromWeapon>
<EmitterLifeTime>2000</EmitterLifeTime>
<EmitterLifeTimeRandomise>0</EmitterLifeTimeRandomise>
<EmitterMaxParticles>500</EmitterMaxParticles>
<EmitterNumCollide>0</EmitterNumCollide>
<EmitterNumSpawn>500</EmitterNumSpawn>
<EmitterNumSpawnRadnomise>0</EmitterNumSpawnRadnomise>
<EmitterOriginOffset x="0" y="10" z="0"/>
<EmitterOriginRandomise x="0" y="0" z="0"/>
<EmitterParticleExpireFX/>
<EmitterParticleFX/>
<EmitterSameDirectionAsWorm>false</EmitterSameDirectionAsWorm>
<EmitterSoundFX/>
<EmitterSoundFXVolume>1</EmitterSoundFXVolume>
<EmitterSpawnFreq>80</EmitterSpawnFreq>
<EmitterSpawnFreqRansomise>0</EmitterSpawnFreqRansomise>
<EmitterSpawnSizeVelocity x="0" y="0"/>
<EmitterStartDelay>0</EmitterStartDelay>
<EmitterVelocity x="0" y="0" z="0"/>
<EmitterVelocityRandomise x="0" y="0" z="0"/>
<ParticleAcceleration x="0" y="-1" z="0"/>
<ParticleAccelerationRandomise x="0" y="0" z="0"/>
<ParticleAlpha>1</ParticleAlpha>
<ParticleAlphaFadeIn>0</ParticleAlphaFadeIn>
<ParticleAlphaVelocity>0</ParticleAlphaVelocity>
<ParticleAlphaVelocityDelay>4500</ParticleAlphaVelocityDelay>
<ParticleAlternateAccelerationN>6500</ParticleAlternateAccelerationN>
<ParticleAlternateAccelerationS>2e-006</ParticleAlternateAccelerationS>
<ParticleAnimationFrame>0</ParticleAnimationFrame>
<ParticleAnimationFrameRandomise>0</ParticleAnimationFrameRandomise>
<ParticleAnimationSpeed>0</ParticleAnimationSpeed>
<ParticleAnimationSpeedRandomize>0</ParticleAnimationSpeedRandomize>
<ParticleAttractor x="0" y="0" z="0"/>
<ParticleAttractorRandomise x="0" y="0" z="0"/>
<ParticleAttractorIsActive>false</ParticleAttractorIsActive>
<ParticleCanEnterWater>false</ParticleCanEnterWater>
<ParticleCollisionFreq>0</ParticleCollisionFreq>
<ParticleCollisionImmuneTime>0</ParticleCollisionImmuneTime>
<ParticleCollisionMinAlpha>0</ParticleCollisionMinAlpha>
<ParticleCollisonRadius>0</ParticleCollisonRadius>
<ParticleCollisonRadiusOffset x="0" y="0" z="0"/>
<ParticleCollisonRadiusVelocity>0</ParticleCollisonRadiusVelocity>
<ParticleCollisionShowDebug>false</ParticleCollisionShowDebug>
<ParticleCollisionWormDamageMagnitude>0</ParticleCollisionWormDamageMagnitude>
<ParticleCollisionWormImpulseMagnitude>0</ParticleCollisionWormImpulseMagnitude>
<ParticleCollisionWormImpulseYMagnitude>0</ParticleCollisionWormImpulseYMagnitude>
<ParticleCollisionWormPoisonMagnitude>0</ParticleCollisionWormPoisonMagnitude>
<ParticleCollisionWormType>0</ParticleCollisionWormType>
<ParticleColor r="0" g="0" b="1"/>
<ParticleExpireShake>true</ParticleExpireShake>
<ParticleExpireShakeLength>1000</ParticleExpireShakeLength>
<ParticleExpireShakeMagnitude>0</ParticleExpireShakeMagnitude>
<ParticleIsAlternateAcceleration>true</ParticleIsAlternateAcceleration>
<ParticleIsEffectedByWind>false</ParticleIsEffectedByWind>
<ParticleIsSpiral>false</ParticleIsSpiral>
<ParticleIsUnderWaterEffect>false</ParticleIsUnderWaterEffect>
<ParticleLandCollideType>0</ParticleLandCollideType>
<ParticleLife>20000</ParticleLife>
<ParticleLifeRandomise>500</ParticleLifeRandomise>
<ParticleMass>-0.5</ParticleMass>
<ParticleNumColors>1</ParticleNumColors>
<ParticleNumFrames>1</ParticleNumFrames>
<ParticleOrientation x="0" y="0" z="0"/>
<ParticleOrientationRandomise x="0" y="0" z="0"/>
<ParticleOrientationVelocity x="0" y="0" z="0"/>
<ParticleOrientationVelocityRandomise x="0" y="0" z="8"/>
<ParticleSize x="8" y="8"/>
<ParticleSizeOriginIsCenterPoint>false</ParticleSizeOriginIsCenterPoint>
<ParticleSizeRandomise>0</ParticleSizeRandomise>
<ParticleSizeVelocity x="-0.2" y="-0.2"/>
<ParticleSizeVelocityRandomise x="-0.1" y="-0.1"/>
<ParticleSizeVelocityDelay>2750</ParticleSizeVelocityDelay>
<ParticleSizeVelocityDelayRandomise>600</ParticleSizeVelocityDelayRandomise>
<ParticleFinalSizeScale x="0" y="0"/>
<ParticleFinalSizeScaleRandomise>0</ParticleFinalSizeScaleRandomise>
<ParticleSizeFadeIn>0</ParticleSizeFadeIn>
<ParticleSizeFadeInRandomize>0</ParticleSizeFadeInRandomize>
<ParticleSizeFadeInDelay>0</ParticleSizeFadeInDelay>
<ParticleSizeFadeInDelayRandomize>0</ParticleSizeFadeInDelayRandomize>
<ParticleRenderScene>0</ParticleRenderScene>
<ParticleSpiralRadius>0</ParticleSpiralRadius>
<ParticleSpiralRadiusRandomise>0</ParticleSpiralRadiusRandomise>
<ParticleSpiralRadiusVelocity>0</ParticleSpiralRadiusVelocity>
<ParticleSpiralRadiusVelocityRandomise>0</ParticleSpiralRadiusVelocityRandomise>
<ParticleSpiralRadiusSizeVelocity>0</ParticleSpiralRadiusSizeVelocity>
<ParticleVelocity x="0" y="0.02" z="0"/>
<ParticleVelocityRandomise x="40" y="0" z="40"/>
<ParticleVelocityIsNormalised>true</ParticleVelocityIsNormalised>
</ParticleEmitterContainer>
После всего этого в XDataBank дописываются ссылки на ресурсы:
Code
<ContainerResources href="WXP_Atomic_Ring1"/>
<ContainerResources href="WXP_Atomic_Ring2"/>
<ContainerResources href="WXP_Atomic_Ring3"/>
<ContainerResources href="WXP_Atomic_Ring4"/>
<ContainerResources href="WXP_Atomic_Ring5"/>
<ContainerResources href="WXP_Atomic_Ring6"/>
<ContainerResources href="WXP_Atomic_Ring7"/>
<ContainerResources href="WXP_Atomic_Ring8"/>
<ContainerResources href="WXP_Atomic_Ring9"/>
<ContainerResources href="WXP_Atomic_Ring10"/>
<ContainerResources href="WXP_Atomic_Ring11"/>
<ContainerResources href="WXP_Atomic_Ring12"/>
Что мы получили? С помощью коротенького файла сделали 12 колец от взрыва базуки, при этом у некоторых поменяли цвет, сделали смещение по вертикали, изменили радиус. И всё в этом мелком файле!
Всё делал с помощью <oXygen/> XML Editor. Все необходимые файлы прикреплены
Программа берёт файла WXP.xsl - это правило, по которому надо делать преобразование и два файла - base_PartTwk.xml(стандартный PartTwk-основа для нового файла) и wxpIn.xml(где описаны наши эффекты). На выходе получает WXP.xml, которым можно заменить PartTwk.xml в игре