7 | | == Step1 : Removing BuildingAI hack. |
8 | | Currently instead of using the consecrated path through [https://trac.wildfiregames.com/browser/ps/trunk/source/graphics/UnitAnimation.cpp#L198 UnitAnimation:198] [https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js#L350 BuildingAI:350] forces the game to play a sound, while that should be handled by the animation tag in the actors. |
9 | | This is the reason some building actors still have the following code: |
10 | | |
11 | | {{{ |
12 | | #!xml |
13 | | <animations> |
14 | | <animation event="0.5" load="0.0" name="attack_ranged" speed="100"/> |
15 | | </animations> |
16 | | }}} |
17 | | |
18 | | I propose to include the following variant in all the files that are supposed to shoot arrows. Comment are there as an indication, and will not be included. |
19 | | |
20 | | `art/variants/structures/base_defensive.xml`: |
21 | | {{{ |
22 | | #!xml |
23 | | <?xml version="1.0" encoding="utf-8"?> |
24 | | <variant name="base" frequency="1"> |
25 | | <!-- {string} - default: "" - m_FileName - file - Name of the dae / psa animation file --> |
26 | | <!-- {string} - default: "" - m_AnimName - name - Anim Name used by UnitAI and to find the SoundGroup --> |
27 | | <!-- {string} - default: "" - m_ID - id - Arbitrary Anim name for sync --> |
28 | | <!-- {integer} - default: 0 - m_Frequency - frequency - Frequency of the animation the --> |
29 | | <!-- {integer} - default: 1.0 - m_Speed - speed - (percentage of anim time) the number is divided by 100 --> |
30 | | <!-- {float} - default: 0.0 - m_ActionPos - event - m_ActionPos (percentage of anim time) --> |
31 | | <!-- {float} - default: 0.0 - m_ActionPos2 - load - m_ActionPos2 (Moment when to show/hide the projectile) (percentage of anim time) --> |
32 | | <!-- {float} - default: - 1.0 - m_SoundPos - sound - Sound offset (percentage of anim time) If not present, event is used instead --> |
33 | | <animations> |
34 | | <animation event="0.0" file="" frequency="1" load="0.0" sound="-1.0" speed="0" name="idle" id="idle_01"/> |
35 | | <animation event="0.0" file="" frequency="1" load="0.0" sound="-1.0" speed="0" name="attack_ranged" id="attack_ranged_01"/> |
36 | | </animations> |
37 | | <props> |
38 | | <prop actor="props/units/weapons/arrow_front.xml" attachpoint="loaded-projectile"/> |
39 | | <prop actor="props/units/weapons/arrow_front.xml" attachpoint="projectile"/> |
40 | | </props> |
41 | | </variant> |
42 | | |
43 | | }}} |
44 | | |
45 | | Plus: Writing a script to find the affected templates would be nice |
46 | | |
47 | | == Step 2 Move sound handling to `MissileHit` instead of doing it in UnitAI. |
| 7 | == Move sound handling to `MissileHit` instead of doing it in UnitAI. |