XML:TRAM: Difference between revisions

2,676 bytes added ,  17 March 2014
adding what I learned from making Domino Knockdowns
m (xml+dae for calculating extents)
(adding what I learned from making Domino Knockdowns)
Line 741: Line 741:
                 <BodyPart>-1</BodyPart>
                 <BodyPart>-1</BodyPart>
             </ONCPParticle>
             </ONCPParticle>
==Adding extents to an existing animation==
Let's say that you want to convert a non-attack animation to a damage-dealing animation. Non-attack TRAMs do not have extents information used to notify the AIs about incoming attacks, so how do you generate this information from the animation?
:1. Export the animation to XML with a body attached. If you extract using just "-extract:xml dest_folder TRAMsomething.oni", you'll get the 3D animation data inside the XML (namely, the tags Heights, Velocities, Rotations, PositionOffset, and Positions; for an attack animation, you'll also get Attacks and AttackRing, and inside Attacks' elements, each Attack element will have Extents at the end of it).
:However, if you extract this same animation using "-extract:xml dest_folder TRAMsomething.oni '''-anim-body ONCCtramuser.oni'''", the animation data will be placed in a DAE file along with the character model geometry. Be sure to pick a body with a representative size for the character classes that will actually use this TRAM, because the extents will be calculated from it. The XML file will be very short without the 3D data in it. This is how we want the non-attack TRAM to look. We do not know the extents information that should go in Extents or AttackRing, so we just want to add the part that distinguishes a DAE-extracted attack TRAM XML from a DAE-extracted non-attack TRAM XML. That part is the Attacks section, without the Extents under each Attack.
:2. First, consider whether the TRAM should have something added to its Flags section, like Attack or ThrowTarget.
:3. Now add to the XML of the non-attack TRAM data in the following format (after the <SelfDamage /> section, typically):
        <Attacks>
            <Attack>
                <Start>1</Start>
                <End>10</End>
                <Bones>RightWrist RightFist</Bones>
                <Flags />
                <Knockback>4</Knockback>
                <HitPoints>10</HitPoints>
                <HitType>KnockdownHead</HitType>
                <HitLength>5</HitLength>
                <StunLength>8</StunLength>
                <StaggerLength>0</StaggerLength>
            </Attack>
        </Attacks>
:Do not add an AttackRing section after Attacks.
:4. Import this with "-create dest_folder TRAMsomething.xml". The Extents sections and the AttackRing will be calculated by OniSplit from the attached DAE.
:5. If you need this information for a patch mod, run "-extract:xml" on the TRAMsomething.oni you've created, <u>without</u> using "-anim-body". Now you can copy the Extents and AttackRing data to your XML patch. For an example of how the patch should look, see the Domino Knockdowns mod.


<!-- Careful what you post here Paradox, TRAM XML format is changing a little bit in the next Onisplit -->
<!-- Careful what you post here Paradox, TRAM XML format is changing a little bit in the next Onisplit -->
==fw throws==
==fw throws==
Situation: you load two chars into Mod Tools and rotate (+/-180°) the throw target char because you want them to stand face to face. When you are done animating, the target animation would need to be reversed again: multiplying the velocities with -1, also the rotation needs a tweak. So far it looks like you need *(-1) for the x rotation and -/+180° (depending on your initial change) for the y rotation.
Situation: you load two chars into Mod Tools and rotate (+/-180°) the throw target char because you want them to stand face to face. When you are done animating, the target animation would need to be reversed again: multiplying the velocities with -1, also the rotation needs a tweak. So far it looks like you need *(-1) for the x rotation and -/+180° (depending on your initial change) for the y rotation.