Skajaquada
Crazy Engineer
- Joined
- Mar 4, 2007
- Messages
- 134
I want to share what I've found out about the FTSXML-file during the week and see if anyone can help me with a problem that seem to be a dead-end.
It's really simple, if we use the gunship as an example you need to define bones to use as markers for the effects in the FSXML-file, like this:
Those bones can then be accessed through that name in the FTSXML-file. If they're not defined there only the skeleton-root can be used.
Then the FTSXML-file, for the gunship, looks something like this:
There's not much to it. The event_tracks-set seem to be purly for the Nexus-GUI as removing them does nothing, however I've found that they're good for reminding what the track 1, 2, 3 and 4 means. The triggers-set contains definitions for effects, sounds, transfer and something called action (I've no idea what "action" is, I assume it's something that's referenced in the FSMXML-file that I haven't dug to deep into yet, though removing them does nothing, perhaps it's something to do with the Nexus GUI).
Then for each row you can set a ID (only used to reference other rows in the same file it seems), start-time (relative to the animation-file), duration (0 seem to be for playing the entire effect), repeat, ref-ID to reference ID, ec (the ID of the animation like 1100 for attack and so on, set in the FSXML-file), track (seem to refer to the event_tracks-set used for the Nexus-GUI), tier (it's says "priority" and is set to always in Nexus but I don't really know what it is), event (referes to the effect- or sound-names like ART_DEF_VEFFECT_AIR_DEATH_02 in civ5artdefines_viseffects.xml) and bone (it's the marker or bone in your 3D-file where the effect will show).
There are also tangent.x, tangent.y and tangent.z as well as speed for the transfer-event. Speed 0 is the fastest and catapult seem to have around 15 or 20, to get a reference. The tangent-coordinates are about the shape of the curve of the projectile's path. As you can see in any FTSXML-file for a unit using proectiles the ID in the effect-events refere to a transfer ref-ID. I don't fully understand how they use the tangent-coordinates, but tangent-coordinates are usually the direction on a point of a curve. It might be worth something imagining it as the direction the projectile is fierd in. It's probably best to just use the tangent-coordinates for a catapult if you want a projectiles that roughly follows that path and the gunship's tangent-coordinates if you want a more straight going projectile
That's that, I've tried these things and I've managed to get the effects to be used by my units in game, got the projectiles to follow different paths and so on.
What I've snagged in is finding a way to adjust the scale of the effect. They're all defined in civ5artdefines_viseffects.xml as this;
I'm not sure how to change that scale-attribute. Doing this didn't work:
Or any variations of set scale. I also couldn't find VisEffectArtInfo in the database, to base one of those XML-queries on that. It would be nice if someone had a solution for that, though it was really my backup-plan as I really think there should be a way to change the scale of an effect when it's used. I couldn't find any reference to it so I've spent some time now just trying to put "scale" a little here and there in the unit-files and FTSXML.
There're two things that I think could be clues in the civ5artdefines_unitmembers.xml, these two entries:
The first makes a reference to a scale-attribute apparently for the child-effect of something. Many effects have child-effects for the impacts. I believe it's there for the same reason fHitEffectScale is. One thing that confuses me about that entry is that I can't find it in the database. That mainly lead me to try putting in "scale" a little here and there, like fFireEffectScale and so on.
The second I think is important because the ID is the name of an effect. I don't know if it's a coincident since the only other IDs used are just "PROJECTILE". I was hoping you could declare IDs there and maybe the fHitEffectScale would apply to them. But I don't know, a scale-attribute there wouldn't make much sense since the effects in the FTSXML aren't really linked to the weapon. It's more the animation-files if anything.
Can anyone help with these last two? My only backup-plan after this is changing the scale of my models before I export them in 3DS Max but that will put a lot of limitations on me, plus it'll be tedious work. It really seem to me there should be something in the FTSXML-file like "scale" like "speed" and "tangent.x". Wouldn't that make sense?
It's really simple, if we use the gunship as an example you need to define bones to use as markers for the effects in the FSXML-file, like this:
Code:
<BoneUsage>
<Bone name="First propeller07"/>
<Bone name="Box02"/>
<Bone name="Landing gear01"/>
<Bone name="fx_MachineGun"/>
<Bone name="base"/>
<Bone name="Airplane tail"/>
<Bone name="Cabin door02"/>
<Bone name="fx_PROJECTILE_02"/>
<Bone name="fx_PROJECTILE_03"/>
<Bone name="fx_PROJECTILE_01"/>
<Bone name="fx_PROJECTILE_04"/>
<Bone name="WORLD_center"/>
</BoneUsage>
Those bones can then be accessed through that name in the FTSXML-file. If they're not defined there only the skeleton-root can be used.
Then the FTSXML-file, for the gunship, looks something like this:
Code:
<trigger_system type="FGrannyTimedTriggerSystem">
<event_tracks>
<event_track ec="1000">
<track id="1" name="Sound"/>
<track id="2" name="Effect"/>
<track id="3" name="Transfer"/>
<track id="4" name="Action"/>
<track id="5" name="Effect"/>
</event_track>
.
.
.
<event_track ec="1180">
<track id="1" name="Sound"/>
<track id="2" name="Effect"/>
<track id="3" name="Transfer"/>
<track id="4" name="Action"/>
</event_track>
</event_tracks>
<triggers>
<trigger type="FTimedTriggerAction" id="146" time="1.15414" duration="0" repeat="0" ec="1140" track="4" tier="0" action="1"/>
.
.
.
<trigger type="FTimedTriggerAction" id="153" time="3.11654" duration="0" repeat="0" ec="1140" track="4" tier="0" action="1"/>
<trigger type="FTimedTriggerAction" id="89" time="1.0403173" duration="0" repeat="0" ec="1160" track="4" tier="0" action="1"/>
<trigger type="FTimedTriggerTransfer" id="217" time="4.53703642" duration="0" repeat="0" ec="1160" track="3" tier="0" refid="214" speed="0" tangent.x="0.0244559254" tangent.y="-0.981143057" tangent.z="-0.191729456"/>
<trigger type="FTimedTriggerTransfer" id="91" time="1.428115" duration="0" repeat="0" ec="1100" track="3" tier="0" refid="190" speed="0" tangent.x="-0.037577223" tangent.y="-0.988899" tangent.z="-0.1437589"/>
<trigger type="FTimedTriggerTransfer" id="277" time="1.908078" duration="0" repeat="0" ec="1180" track="3" tier="0" refid="282" speed="0" tangent.x="-0.000254473678" tangent.y="-0.9844668" tangent.z="-0.175570861"/>
.
.
.
<trigger type="FTimedTriggerEffect" id="97" time="0.334052" duration="1.15" repeat="0" ec="2100" track="5" tier="0" event="ART_DEF_VEFFECT_GUNSHIP_MACHINE_GUN_MUZZLE" bone="fx_MachineGun"/>
<trigger type="FTimedTriggerEffect" id="182" time="1.64865685" duration="0.12" repeat="0" ec="2100" track="5" tier="0" event="ART_DEF_VEFFECT_GUNSHIP_ROCKET_PROJECTILE" bone="fx_PROJECTILE_01"/>
.
.
.
<trigger type="FTimedTriggerSound" id="139" time="0.09680498" duration="0" repeat="0" ec="2200" track="1" tier="-1" event="AS3D_UNIT_HELICOPTER_GUNSHIP_TANK_HIT_B" bone=""/>
<trigger type="FTimedTriggerSound" id="130" time="2.87927" duration="0" repeat="0" ec="1200" track="1" tier="-1" event="AS3D_UNIT_HELICOPTER_GUNSHIP_TANK_HIT_B" bone=""/>
</triggers>
</trigger_system>
There's not much to it. The event_tracks-set seem to be purly for the Nexus-GUI as removing them does nothing, however I've found that they're good for reminding what the track 1, 2, 3 and 4 means. The triggers-set contains definitions for effects, sounds, transfer and something called action (I've no idea what "action" is, I assume it's something that's referenced in the FSMXML-file that I haven't dug to deep into yet, though removing them does nothing, perhaps it's something to do with the Nexus GUI).
Then for each row you can set a ID (only used to reference other rows in the same file it seems), start-time (relative to the animation-file), duration (0 seem to be for playing the entire effect), repeat, ref-ID to reference ID, ec (the ID of the animation like 1100 for attack and so on, set in the FSXML-file), track (seem to refer to the event_tracks-set used for the Nexus-GUI), tier (it's says "priority" and is set to always in Nexus but I don't really know what it is), event (referes to the effect- or sound-names like ART_DEF_VEFFECT_AIR_DEATH_02 in civ5artdefines_viseffects.xml) and bone (it's the marker or bone in your 3D-file where the effect will show).
There are also tangent.x, tangent.y and tangent.z as well as speed for the transfer-event. Speed 0 is the fastest and catapult seem to have around 15 or 20, to get a reference. The tangent-coordinates are about the shape of the curve of the projectile's path. As you can see in any FTSXML-file for a unit using proectiles the ID in the effect-events refere to a transfer ref-ID. I don't fully understand how they use the tangent-coordinates, but tangent-coordinates are usually the direction on a point of a curve. It might be worth something imagining it as the direction the projectile is fierd in. It's probably best to just use the tangent-coordinates for a catapult if you want a projectiles that roughly follows that path and the gunship's tangent-coordinates if you want a more straight going projectile

That's that, I've tried these things and I've managed to get the effects to be used by my units in game, got the projectiles to follow different paths and so on.
What I've snagged in is finding a way to adjust the scale of the effect. They're all defined in civ5artdefines_viseffects.xml as this;
Code:
<VisEffectArtInfo>
<Name>ART_DEF_VEFFECT_ANTI_TANK_MUZBLAST_01</Name>
<Transform>
<Translation x="0.0" y="0.0" z="0.0"/>
<Rotation x="-90.0" y="0.0" z="0.0"/>
<Scale>0.6</Scale>
</Transform>
<fBaseDuration>0.1</fBaseDuration>
<fBaseDurationScale>1.0</fBaseDurationScale>
<ParticleEffects>
<ParticleEffect>
<Name>ART_DEF_PEFFECT_ARTILLERY_MUZBLAST_01</Name>
</ParticleEffect>
</ParticleEffects>
</VisEffectArtInfo>
I'm not sure how to change that scale-attribute. Doing this didn't work:
Code:
<VisEffectArtInfo>
<Update>
<Set Transform.Scale="2"/>
<Where Name="ART_DEF_VEFFECT_ANTI_TANK_MUZBLAST_01"/>
</Update>
</VisEffectArtInfo>
Or any variations of set scale. I also couldn't find VisEffectArtInfo in the database, to base one of those XML-queries on that. It would be nice if someone had a solution for that, though it was really my backup-plan as I really think there should be a way to change the scale of an effect when it's used. I couldn't find any reference to it so I've spent some time now just trying to put "scale" a little here and there in the unit-files and FTSXML.
There're two things that I think could be clues in the civ5artdefines_unitmembers.xml, these two entries:
Code:
<Weapon>
<fProjectileSpeed>0.8</fProjectileSpeed>
<fVisKillStrengthMin>100.0</fVisKillStrengthMin>
<fVisKillStrengthMax>100.0</fVisKillStrengthMax>
<bIsDropped>1</bIsDropped>
<fAreaDamageDelay>0.5</fAreaDamageDelay>
<WeaponTypeTag>EXPLOSIVE</WeaponTypeTag>
<WeaponTypeSoundOverrideTag>ATOMICBOMB</WeaponTypeSoundOverrideTag>
<bWaitForEffectCompletion>1</bWaitForEffectCompletion>
[B]<fProjectileChildEffectScale>1.0</fProjectileChildEffectScale>[/B]
</Weapon>
Code:
<Weapon>
[B]<ID>ART_DEF_VEFFECT_MECH_ROCKET_PROJECTILE</ID>[/B]
<fVisKillStrengthMin>5.0</fVisKillStrengthMin>
<fVisKillStrengthMax>12.0</fVisKillStrengthMax>
<fProjectileSpeed>5.3</fProjectileSpeed>
<WeaponTypeTag>EXPLOSIVE</WeaponTypeTag>
<WeaponTypeSoundOverrideTag>EXPLOSION20POUND</WeaponTypeSoundOverrideTag>
</Weapon>
The first makes a reference to a scale-attribute apparently for the child-effect of something. Many effects have child-effects for the impacts. I believe it's there for the same reason fHitEffectScale is. One thing that confuses me about that entry is that I can't find it in the database. That mainly lead me to try putting in "scale" a little here and there, like fFireEffectScale and so on.
The second I think is important because the ID is the name of an effect. I don't know if it's a coincident since the only other IDs used are just "PROJECTILE". I was hoping you could declare IDs there and maybe the fHitEffectScale would apply to them. But I don't know, a scale-attribute there wouldn't make much sense since the effects in the FTSXML aren't really linked to the weapon. It's more the animation-files if anything.
Can anyone help with these last two? My only backup-plan after this is changing the scale of my models before I export them in 3DS Max but that will put a lot of limitations on me, plus it'll be tedious work. It really seem to me there should be something in the FTSXML-file like "scale" like "speed" and "tangent.x". Wouldn't that make sense?