XML:FILM: Difference between revisions

From OniGalore
m (copy edit)
(added a lesson learned from level18's FILMIntroTCTF02; might as well build up a separate advice section since this is not general information)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{XML_File_Header | type=FILM | prev=DOOR | next=HPge | name=character animation playback }}
{{XML_File_Header | prev=DPge | type=FILM | next=HPge | name=Film}}


==General information==
==General information==
* The XML code on this page is compatible with OniSplit '''v0.9.61.0''' and '''v0.9.68.0'''.
* The XML code on this page is compatible with OniSplit '''v0.9.61.0''' and '''v0.9.68.0'''.
* FILM*.oni files are level-specific (they are usually used in cutscenes and can be found in level''X''_Final).
* FILM*.oni files are level-specific (they are usually used in cutscenes and can be found in level''X''_Final).
* For best results (esp. for running and jumping), use the same character for recording and playing the FILM files.
* The tags below have their values in radians. [http://www.unitconversion.org/angle/radians-to-degrees-conversion.html This page] can convert between radians and degrees.
* Holster and unholster is the same key event, so make sure the character has their weapon holstered/unholstered as you planned or it will affect their ability to sprint.
* The tags below have their values in radians. [http://www.unitconversion.org/angle/radians-to-degrees-conversion.html THIS] page can convert radians to degrees and vice versa.
: <Facing>
: <Facing>
: <DesiredFacing>
: <DesiredFacing>
: <HeadFacing>
: <HeadFacing>
: <HeadPitch>
: <HeadPitch>
==Cautionary advice==
* For best results (esp. for running and jumping), use the same character for recording and playing the FILM files.
* Even when using the same character, turning can rotate the character at a different speed when the FILM is played on you as the player character (Konoko shapeshifted to whoever) versus an AI character. Make sure to test the FILM on an AI if it's meant to be played on an AI.
* Holster and unholster is the same key event, so make sure the character has their weapon holstered/unholstered as expected going into the FILM playback.


==BSL support==
==BSL support==
Line 98: Line 101:
     </Instance>
     </Instance>
  </Oni>
  </Oni>
==Frame structures==
FILM allows two structures for <Frames>.
===Fixed structure===
There are always 4 elements within <FILMFrame>.
            <FILMFrame>
                <MouseDeltaX>0</MouseDeltaX>
                <MouseDeltaY>0</MouseDeltaY>
                <Keys></Keys>
                <Frame>0</Frame>
            </FILMFrame>
===Modular structure===
There can be one up to three elements.
<nowiki><Time></nowiki> is used instead of <Frame>.
<MouseDelta> is an array of X and Y.
            <Frame>
                <nowiki><Time>0</Time></nowiki>
            </Frame>
            <Frame>
                <nowiki><Time>25</Time></nowiki>
                <MouseDelta>0.25 0</MouseDelta>
            </Frame>
            <Frame>
                <nowiki><Time>223</Time></nowiki>
                <MouseDelta>0 -0.25</MouseDelta>
                <Keys>Forward</Keys>
            </Frame>


{{XML}}
{{XML}}

Latest revision as of 15:16, 30 March 2026

FILM : Film
XML modding tips
See HERE to start learning about XML modding.
See HERE if you are searching for information on how to handle object coordinates.
See HERE for some typical modding errors and their causes.
XML.png
XML

DPge << Other file types >> HPge

switch to OBD page

General information

  • The XML code on this page is compatible with OniSplit v0.9.61.0 and v0.9.68.0.
  • FILM*.oni files are level-specific (they are usually used in cutscenes and can be found in levelX_Final).
  • The tags below have their values in radians. This page can convert between radians and degrees.
<Facing>
<DesiredFacing>
<HeadFacing>
<HeadPitch>

Cautionary advice

  • For best results (esp. for running and jumping), use the same character for recording and playing the FILM files.
  • Even when using the same character, turning can rotate the character at a different speed when the FILM is played on you as the player character (Konoko shapeshifted to whoever) versus an AI character. Make sure to test the FILM on an AI if it's meant to be played on an AI.
  • Holster and unholster is the same key event, so make sure the character has their weapon holstered/unholstered as expected going into the FILM playback.

BSL support

playback ai_name FILM_name
playback script_id FILM_name

How to make your own FILM

  • They will be saved next to the running game application. The first file will be named "saved_film000.dat".
  • Enter Developer Mode to record a FILM.
F9 - start record
F10 - stop record
F11 - play record

FILM converting

Converting FILM*oni to FILM*.xml:

onisplit -extract:xml xml_dir levelXX_name/FILM*.oni

Converting saved_film*.dat to saved_film*.xml:

onisplit film2xml xml_dir source_dir/saved_film*.dat

Converting *.xml to *oni:

onisplit -create oni_dir xml_dir/*.xml

<Keys>

None
Escape
Console
Pause
Cutscene1
Cutscene2
F4
F5
F6
F7
F8
StartRecord
StopRecord
PlayRecord
F12
LookMode
Screenshot
Forward
Backward
TurnLeft
TurnRight
StepLeft
StepRight
Jump
Crouch
Punch
Kick
Block
Walk
Action
Hypo
Reload
Swap
Drop
Fire1
Fire2
Fire3

Sample XML

"[...]" below stands for additional <FILMFrame>...</FILMFrame> blocks.

<?xml version="1.0" encoding="utf-8"?>
<Oni>
   <Instance id="0" type="FILM">
       <Position>414.461334 50 666.26355</Position>
       <Facing>4.767578</Facing>
       <DesiredFacing>4.767578</DesiredFacing>
       <HeadFacing>0</HeadFacing>
       <HeadPitch>-0.196971774</HeadPitch>
       <FrameCount>165</FrameCount>
       <Animations>
           <String></String>
           <String></String>
       </Animations>
       <Frames>
           <FILMFrame>
               <MouseDelta>0 0</MouseDelta>
               <Keys></Keys>
               <Frame>0</Frame>
           </FILMFrame>
           [...]
       </Frames>
   </Instance>
</Oni>

Frame structures

FILM allows two structures for <Frames>.

Fixed structure

There are always 4 elements within <FILMFrame>.

           <FILMFrame>
               <MouseDeltaX>0</MouseDeltaX>
               <MouseDeltaY>0</MouseDeltaY>
               <Keys></Keys>
               <Frame>0</Frame>
           </FILMFrame>

Modular structure

There can be one up to three elements.

<Time> is used instead of <Frame>.

<MouseDelta> is an array of X and Y.

           <Frame>
               <Time>0</Time>
           </Frame>
           <Frame>
               <Time>25</Time>
               <MouseDelta>0.25 0</MouseDelta>
           </Frame>
           <Frame>
               <Time>223</Time>
               <MouseDelta>0 -0.25</MouseDelta>
               <Keys>Forward</Keys>
           </Frame>