XML:FILM: Difference between revisions

2,587 bytes added ,  14 November 2023
m
no edit summary
m (saving this issue before I forget it again)
 
mNo edit summary
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Notes about FILM*.dat (file is generated by [[Dev_Mode#Hotkeys_2|F9 hotkey]] in dev mode), might be useful for a converter tool later.
{{XML_File_Header | prev=DPge | type=FILM | next=HPge | name=Film}}


IIRC, FILM*.oni storage type is big endian and FILM*.dat is little endian.
==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 level''X''_Final).
* For best results (esp. for running and jumping), use the same character for recording and playing the FILM files.
* 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>
: <DesiredFacing>
: <HeadFacing>
: <HeadPitch>


{|BORDER=1 CELLSPACING=0 CELLPADDING=2 STYLE="border-style:solid; border-collapse:collapse; empty-cells:show; background-color:#f9f9f9;" ALIGN=left
==BSL support==
|width=160px|
playback ''ai_name FILM_name''
|width=160px| FILM*.dat offset
playback ''script_id FILM_name''
|width=160px| FILM*.oni offset
 
|-
==How to make your own FILM==
| x-position of the character
* They will be saved next to the running game application. The first file will be named "saved_film000.dat".
| 0x100
* Enter [[Developer Mode]] to record a FILM.
| 0x068
: F9 - start record
|-
: F10 - stop record
| y-position of the character
: F11 - play record
| 0x104
 
| 0x06C
===FILM converting===
|-
Converting FILM*oni to FILM*.xml:<br>
| z-position of the character
onisplit -extract:xml xml_dir level''XX_name''/FILM*.oni
| 0x108
 
| 0x070
Converting saved_film*.dat to saved_film*.xml:<br>
|-
onisplit film2xml xml_dir source_dir/saved_film*.dat
| body facing
 
| 0x10C
Converting *.xml to *oni:<br>
| 0x0754
onisplit -create oni_dir xml_dir/*.xml
|-
 
| desired facing
==<Keys>==
| 0x110
: None
| 0x078
: Escape
|-
: Console
| head facing
: Pause
| 0x114
: Cutscene1
| 0x07C
: Cutscene2
|-
: F4
| looking up or down
: F5
| 0x118
: F6
| 0x080
: F7
|-
: F8
| film lenght in frames
: StartRecord
| 0x11C
: StopRecord
| 0x084
: PlayRecord
|-
: F12
| array size
: LookMode
| 0x13C
: Screenshot
| 0x09C
: Forward
|-
: Backward
| first element
: TurnLeft
| (some garbage before first element?)
: TurnRight
| 0x0A0
: 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.
 
<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}}
8,464

edits