[HELP] create a raf file of an existing one (Persona 5 Dynamic Theme)

Discussion in 'General PS3 Discussion' started by BlackCrow613, Sep 20, 2019.

  1. 4
    0
    5
    BlackCrow613

    BlackCrow613 Forum Noob

    Joined:
    Sep 20, 2019
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    5
    Gender:
    Male
    Hi. I have a problem.

    2 days ago I extracted anim_1.jpg from Persona 5 Protagonist Special Theme because it has an animation that I like and I planned to use it in custom themes

    there were files edge, anim, skel, edge.invbind, etc
    [all files are in this link]

    http://www.mediafire.com/file/16bjd5spd71r6ly/Persona_5_Anim_Files.rar/file

    I got the script (js)
    but the xml does not work when using it in raf compiler.

    I tried to fix the xml. unsuccessfully.

    I looked at sites to know how to fix this problem and I couldn't find a solution. I need help. please
     
  2. 11,921
    4,768
    497
    pinky

    pinky Bitsiboo's Other Half Developer

    Joined:
    Mar 8, 2015
    Messages:
    11,921
    Likes Received:
    4,768
    Trophy Points:
    497
    Gender:
    Male
    Location:
    The Great Gig in the Sky
    never done this before, but you may need the jsx (an encoded js for the script). you can do this with rcomage.
     
  3. 4
    0
    5
    BlackCrow613

    BlackCrow613 Forum Noob

    Joined:
    Sep 20, 2019
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    5
    Gender:
    Male
    thanks pinky, i will try it
    the jsx file is in the download link
    js is also there
     
  4. 11,921
    4,768
    497
    pinky

    pinky Bitsiboo's Other Half Developer

    Joined:
    Mar 8, 2015
    Messages:
    11,921
    Likes Received:
    4,768
    Trophy Points:
    497
    Gender:
    Male
    Location:
    The Great Gig in the Sky
    the js shouldn't be a part of the dumped theme. it's decoding it to .js. the jsx should be, yes. I assume that's what's happening. if you used p3t extractor, I actually don't remember it decoding the jsx script file by default, so use rco mage to encode/decode. you may need a certain version of it, 'cause one of the versions has a bug to where it doesn't work at all.
     
  5. 4
    0
    5
    BlackCrow613

    BlackCrow613 Forum Noob

    Joined:
    Sep 20, 2019
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    5
    Gender:
    Male
    certain version? rcomage or raf? I have no idea
    I extracted all those files with simplyzip and p3textractor

    And if you mean rcomage version, which one do you recommend?


    I downloaded rcomage version 111 and converted jsx to js with these commands:

    "c: \ rcomage \ Rcomage> rcomage.exe vsmxdec phantom_theme_hero.jsx phantom_theme_hero.js"

    but this appears

    "Reading VSMX ...
    Error: Not a valid VSMX file.
    Error: Failed to decode VSMX. "

    I opened a hexadecimal editor and I changed the value "02" to "01"
    and it worked

    this is what appears if you open notepad:

    NAME background
    NAME Array
    NAME Actor
    CONST_STRING "bg01"
    CALL_INBUILT args=1
    NAME Actor
    CONST_STRING "bg02"
    CALL_INBUILT args=1
    NAME Actor
    CONST_STRING "bg03"
    CALL_INBUILT args=1
    NAME Actor
    CONST_STRING "bg04"
    CALL_INBUILT args=1
    NAME Actor
    CONST_STRING "bg05"
    CALL_INBUILT args=1
    CALL_INBUILT args=5
    ASSIGN
    END_STATEMENT
    NAME background
    CONST_INT 4
    ARRAY_INDEX
    METHOD position
    CONST_FLOAT 0.000000
    CONST_FLOAT 0.000000
    CONST_FLOAT 300.000
    NEGATE
    UNKNOWN_49 0x49
    ADD
    SET position
    END_STATEMENT
    NAME background
    CONST_INT 3
    ARRAY_INDEX
    METHOD position
    CONST_FLOAT 0.000000
    CONST_FLOAT 0.000000
    CONST_FLOAT 300.000
    NEGATE
    UNKNOWN_49 0x49
    ADD
    SET position
    END_STATEMENT
    NAME background
    CONST_INT 2
    ARRAY_INDEX
    METHOD position
    CONST_FLOAT 0.000000
    CONST_FLOAT 50.0000
    NEGATE
    CONST_FLOAT 0.000000
    UNKNOWN_49 0x49
    ADD
    SET position
    END_STATEMENT
    NAME background
    CONST_INT 1
    ARRAY_INDEX
    METHOD position
    CONST_FLOAT 0.000000
    CONST_FLOAT 100.000
    CONST_FLOAT 80.0000
    UNKNOWN_49 0x49
    ADD
    SET position
    END_STATEMENT
    NAME background
    CONST_INT 0
    ARRAY_INDEX
    METHOD position
    CONST_FLOAT 0.000000
    CONST_FLOAT 0.000000
    CONST_FLOAT 0.000000
    UNKNOWN_49 0x49
    ADD
    SET position
    END_STATEMENT
    NAME background
    CONST_INT 4
    ARRAY_INDEX
    METHOD scale
    CONST_FLOAT 1.10000
    CONST_FLOAT 1.25000
    CONST_FLOAT 1.10000
    UNKNOWN_49 0x49
    MULTIPLY
    SET scale
    END_STATEMENT
    NAME background
    CONST_INT 3
    ARRAY_INDEX
    METHOD scale
    CONST_FLOAT 1.10000
    CONST_FLOAT 1.25000
    CONST_FLOAT 1.10000
    UNKNOWN_49 0x49
    MULTIPLY
    SET scale
    END_STATEMENT
    NAME background
    CONST_INT 2
    ARRAY_INDEX
    METHOD scale
    CONST_FLOAT 1.10000
    CONST_FLOAT 1.30000
    CONST_FLOAT 1.10000
    UNKNOWN_49 0x49
    MULTIPLY
    SET scale
    END_STATEMENT
    NAME background
    CONST_INT 1
    ARRAY_INDEX
    METHOD scale
    CONST_FLOAT 1.10000
    CONST_FLOAT 1.25000
    CONST_FLOAT 1.10000
    UNKNOWN_49 0x49
    MULTIPLY
    SET scale
    END_STATEMENT
    NAME background
    CONST_INT 0
    ARRAY_INDEX
    METHOD scale
    CONST_FLOAT 1.10000
    CONST_FLOAT 1.10000
    CONST_FLOAT 1.10000
    UNKNOWN_49 0x49
    MULTIPLY
    SET scale
    END_STATEMENT
    NAME i
    CONST_INT 0
    ASSIGN
    END_STATEMENT
    NAME i
    NAME background
    PROPERTY length
    TEST_LESS_THAN
    JUMP_IF_TRUE line=148
    JUMP line=189
    NAME i
    INCREMENT
    END_STATEMENT
    JUMP line=138
    NAME background
    CONST_INT 4
    ARRAY_INDEX
    METHOD setAnimSpeed
    NAME i
    CONST_FLOAT 0.250000
    CALL_METHOD args=2
    END_STATEMENT
    NAME background
    CONST_INT 3
    ARRAY_INDEX
    METHOD setAnimSpeed
    NAME i
    CONST_FLOAT 0.250000
    CALL_METHOD args=2
    END_STATEMENT
    NAME background
    CONST_INT 2
    ARRAY_INDEX
    METHOD setAnimSpeed
    NAME i
    CONST_FLOAT 0.300000
    CALL_METHOD args=2
    END_STATEMENT
    NAME background
    CONST_INT 1
    ARRAY_INDEX
    METHOD setAnimSpeed
    NAME i
    CONST_FLOAT 0.250000
    CALL_METHOD args=2
    END_STATEMENT
    NAME background
    CONST_INT 0
    ARRAY_INDEX
    METHOD setAnimSpeed
    NAME i
    CONST_FLOAT 0.250000
    CALL_METHOD args=2
    END_STATEMENT
    JUMP line=144
    END_SCRIPT

    as you will see, "unkown" appears in some parts

    what should I do?
     
  6. 11,921
    4,768
    497
    pinky

    pinky Bitsiboo's Other Half Developer

    Joined:
    Mar 8, 2015
    Messages:
    11,921
    Likes Received:
    4,768
    Trophy Points:
    497
    Gender:
    Male
    Location:
    The Great Gig in the Sky
    yes, that's one of the bugs of rcomage. sometimes it will even display Chinese Hanzi characters as well. I think if you remove those, it will encode, but who knows what that might actually be. I've messed with the script, making an image move in different directions, but I can't remember if I had that problem at that time. however, I have seen that sort of thing before. here's what I've used: http://www.mediafire.com/file/c67cniu5vm74k06/CBS.rar/file I can't recall the version number, just remembered it was on my mediafire account.
     
    BlackCrow613 likes this.
  7. 4
    0
    5
    BlackCrow613

    BlackCrow613 Forum Noob

    Joined:
    Sep 20, 2019
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    5
    Gender:
    Male
    Thanks, I tried it and this is the result.
    NAME background
    NAME Array
    NAME Actor
    CONST_STRING "bg01"
    CALL_NEW args=1
    NAME Actor
    CONST_STRING "bg02"
    CALL_NEW args=1
    NAME Actor
    CONST_STRING "bg03"
    CALL_NEW args=1
    NAME Actor
    CONST_STRING "bg04"
    CALL_NEW args=1
    NAME Actor
    CONST_STRING "bg05"
    CALL_NEW args=1
    CALL_NEW args=5
    ASSIGN
    END_STATEMENT
    NAME background
    CONST_INT 4
    ARRAY_INDEX
    METHOD position
    CONST_FLOAT 0.000000
    CONST_FLOAT 0.000000
    CONST_FLOAT 300.000
    NEGATE
    MAKE_VECTOR items=3
    ADD
    SET position
    END_STATEMENT
    NAME background
    CONST_INT 3
    ARRAY_INDEX
    METHOD position
    CONST_FLOAT 0.000000
    CONST_FLOAT 0.000000
    CONST_FLOAT 300.000
    NEGATE
    MAKE_VECTOR items=3
    ADD
    SET position
    END_STATEMENT
    NAME background
    CONST_INT 2
    ARRAY_INDEX
    METHOD position
    CONST_FLOAT 0.000000
    CONST_FLOAT 50.0000
    NEGATE
    CONST_FLOAT 0.000000
    MAKE_VECTOR items=3
    ADD
    SET position
    END_STATEMENT
    NAME background
    CONST_INT 1
    ARRAY_INDEX
    METHOD position
    CONST_FLOAT 0.000000
    CONST_FLOAT 100.000
    CONST_FLOAT 80.0000
    MAKE_VECTOR items=3
    ADD
    SET position
    END_STATEMENT
    NAME background
    CONST_INT 0
    ARRAY_INDEX
    METHOD position
    CONST_FLOAT 0.000000
    CONST_FLOAT 0.000000
    CONST_FLOAT 0.000000
    MAKE_VECTOR items=3
    ADD
    SET position
    END_STATEMENT
    NAME background
    CONST_INT 4
    ARRAY_INDEX
    METHOD scale
    CONST_FLOAT 1.10000
    CONST_FLOAT 1.25000
    CONST_FLOAT 1.10000
    MAKE_VECTOR items=3
    MULTIPLY
    SET scale
    END_STATEMENT
    NAME background
    CONST_INT 3
    ARRAY_INDEX
    METHOD scale
    CONST_FLOAT 1.10000
    CONST_FLOAT 1.25000
    CONST_FLOAT 1.10000
    MAKE_VECTOR items=3
    MULTIPLY
    SET scale
    END_STATEMENT
    NAME background
    CONST_INT 2
    ARRAY_INDEX
    METHOD scale
    CONST_FLOAT 1.10000
    CONST_FLOAT 1.30000
    CONST_FLOAT 1.10000
    MAKE_VECTOR items=3
    MULTIPLY
    SET scale
    END_STATEMENT
    NAME background
    CONST_INT 1
    ARRAY_INDEX
    METHOD scale
    CONST_FLOAT 1.10000
    CONST_FLOAT 1.25000
    CONST_FLOAT 1.10000
    MAKE_VECTOR items=3
    MULTIPLY
    SET scale
    END_STATEMENT
    NAME background
    CONST_INT 0
    ARRAY_INDEX
    METHOD scale
    CONST_FLOAT 1.10000
    CONST_FLOAT 1.10000
    CONST_FLOAT 1.10000
    MAKE_VECTOR items=3
    MULTIPLY
    SET scale
    END_STATEMENT
    NAME i
    CONST_INT 0
    ASSIGN
    END_STATEMENT
    NAME i
    NAME background
    PROPERTY length
    TEST_LESS_THAN
    JUMP_IF_TRUE line=148
    JUMP line=189
    NAME i
    INCREMENT
    END_STATEMENT
    JUMP line=138
    NAME background
    CONST_INT 4
    ARRAY_INDEX
    METHOD setAnimSpeed
    NAME i
    CONST_FLOAT 0.250000
    CALL_METHOD args=2
    END_STATEMENT
    NAME background
    CONST_INT 3
    ARRAY_INDEX
    METHOD setAnimSpeed
    NAME i
    CONST_FLOAT 0.250000
    CALL_METHOD args=2
    END_STATEMENT
    NAME background
    CONST_INT 2
    ARRAY_INDEX
    METHOD setAnimSpeed
    NAME i
    CONST_FLOAT 0.300000
    CALL_METHOD args=2
    END_STATEMENT
    NAME background
    CONST_INT 1
    ARRAY_INDEX
    METHOD setAnimSpeed
    NAME i
    CONST_FLOAT 0.250000
    CALL_METHOD args=2
    END_STATEMENT
    NAME background
    CONST_INT 0
    ARRAY_INDEX
    METHOD setAnimSpeed
    NAME i
    CONST_FLOAT 0.250000
    CALL_METHOD args=2
    END_STATEMENT
    JUMP line=144
    END_SCRIPT

    unknown is not there
    what should I do?
    And what do I do with the rest? the xml file?
    <?xml version="1.0" ?>
    <raf version="1.20000004768">
    <texture-table num="4">
    <texture ext="1" fileindex="22" id="_special_theme_hero_2.gtf" wrap_p="1" wrap_s="1" wrap_t="1"/>
    <texture ext="1" fileindex="23" id="_special_theme_hero_3.gtf" wrap_p="1" wrap_s="1" wrap_t="1"/>
    <texture ext="1" fileindex="20" id="_special_theme_hero_0.gtf" wrap_p="1" wrap_s="1" wrap_t="1"/>
    <texture ext="1" fileindex="21" id="_special_theme_hero_1.gtf" wrap_p="1" wrap_s="1" wrap_t="1"/>
    </texture-table>
    <model-table num="5">
    <model id="bg1">
    <skeleton fileindex="6"/>
    <geometry fileindex="4"/>
    <animation end="53.3333015442" fileindex="7" id="bg1_anim"/>
    <inv-bind fileindex="5"/>
    </model>
    <model id="bg3">
    <inv-bind fileindex="13"/>
    <skeleton fileindex="14"/>
    <geometry fileindex="12"/>
    <animation end="53.3333015442" fileindex="15" id="bg3_anim"/>
    </model>
    <model id="bg0">
    <animation end="53.3333015442" fileindex="3" id="bg0_anim"/>
    <inv-bind fileindex="1"/>
    <geometry/>
    <skeleton fileindex="2"/>
    </model>
    <model id="bg2">
    <animation end="53.3333015442" fileindex="11" id="bg2_anim"/>
    <skeleton fileindex="10"/>
    <inv-bind fileindex="9"/>
    <geometry fileindex="8"/>
    </model>
    <model id="bg4">
    <geometry fileindex="16"/>
    <animation end="53.3333015442" fileindex="19" id="bg4_anim"/>
    <inv-bind fileindex="17"/>
    <skeleton fileindex="18"/>
    </model>
    </model-table>
    <file-table num="25">
    <file id="special_theme_hero_3.edge" src="special_theme_hero_3.edge_1.gim"/>
    <file id="special_theme_hero_0.edge" src="special_theme_hero_0.edge_1.gim"/>
    <file id="special_theme_hero_4.skel" src="special_theme_hero_4.skel_1.gim" type="2"/>
    <file id="special_theme_hero_1.edge.invbind" src="special_theme_hero_1.edge.invbind_1.gim" type="1"/>
    <file id="special_theme_hero_2.gtf" src="special_theme_hero_2.gtf_1.gim" type="4"/>
    <file id="special_theme_hero_2.skel" src="special_theme_hero_2.skel_1.gim" type="2"/>
    <file id="special_theme_hero_1.edge" src="special_theme_hero_1.edge_1.gim"/>
    <file id="special_theme_hero_2.edge.invbind" src="special_theme_hero_2.edge.invbind_1.gim" type="1"/>
    <file id="special_theme_hero_0.anim" src="special_theme_hero_0.anim_1.gim" type="3"/>
    <file id="special_theme_hero_1.gtf" src="special_theme_hero_1.gtf_1.gim" type="4"/>
    <file id="special_theme_hero_3.anim" src="special_theme_hero_3.anim_1.gim" type="3"/>
    <file id="special_theme_hero_0.gtf" src="special_theme_hero_0.gtf_1.gim" type="4"/>
    <file id="special_theme_hero_3.skel" src="special_theme_hero_3.skel_1.gim" type="2"/>
    <file id="special_theme_hero_4.edge.invbind" src="special_theme_hero_4.edge.invbind_1.gim" type="1"/>
    <file id="special_theme_hero_0.skel" src="special_theme_hero_0.skel_1.gim" type="2"/>
    <file id="special_theme_hero_3.gtf" src="special_theme_hero_3.gtf_1.gim" type="4"/>
    <file id="special_theme_hero_4.edge" src="special_theme_hero_4.edge_1.gim"/>
    <file id="special_theme_hero_4.anim" src="special_theme_hero_4.anim_1.gim" type="3"/>
    <file id="special_theme_hero_3.edge.invbind" src="special_theme_hero_3.edge.invbind_1.gim" type="1"/>
    <file id="special_theme_hero_1.anim" src="special_theme_hero_1.anim_1.gim" type="3"/>
    <file id="special_theme_hero_2.edge" src="special_theme_hero_2.edge_1.gim"/>
    <file id="special_theme_hero_2.anim" src="special_theme_hero_2.anim_1.gim" type="3"/>
    <file id="special_theme_hero_0.edge.invbind" src="special_theme_hero_0.edge.invbind_1.gim" type="1"/>
    <file id="special_theme_hero_1.skel" src="special_theme_hero_1.skel_1.gim" type="2"/>
    <file id="phantom_theme_hero.jsx" src="phantom_theme_hero.jsx_1.gim" type="5"/>
    </file-table>
    <scene actor_num="5" camera_num="1" script_num="1">
    <actor id="bg05"/>
    <camera id="camera" yfov="0.872664988041" zfar="10000.0" znear="0.00999999977648"/>
    <actor id="bg02"/>
    <script fileindex="24"/>
    <actor id="bg01"/>
    <actor id="bg03"/>
    <actor id="bg04"/>
    </scene>
    <material-table num="4">
    <material effect="pure_texture" id="bg04">
    <_texture/>
    </material>
    <material effect="pure_texture" id="bg03">
    <_texture/>
    </material>
    <material effect="pure_texture" id="bg01">
    <_texture/>
    </material>
    <material effect="pure_texture" id="bg02">
    <_texture/>
    </material>
    </material-table>
    </raf>

    Any way to compile the raf?
     
  8. 5,745
    5,349
    622
    sandungas

    sandungas Moderator Developer

    Joined:
    Dec 31, 2014
    Messages:
    5,745
    Likes Received:
    5,349
    Trophy Points:
    622
    Location:
    Babylon 20xxE series
    @BlackCrow613 you are going to hit with multiple problems, so im going to make this story short by pointing finger first to the biggest problem:
    When you extract the contents of the .RAF container there are some files (like the .SKEL and .EDGE) that was generated by the raf compiler
    In other words... originally all them was a single file with file extension .DAE (generated by the COLLADA export plugin in 3Dmax, maya, or blender) and the raf compiler made a conversion with the DAE to generate the others
    As far i know... there is no way to revert that files to his original DAE format
    This means you cant compile it with the raf compiler, because the raf compiler only acepts DAE, im not completly sure if there is some wayaround to bypass this problem but when i was looking at it i could not find how to do it
    Thats the end of your adventure probably

    But before reaching that point you are going to hit with some more big problems, i can give you some hints about how to solve them

    Most important, you should use the "CXML decompiler" tool to extract the contents of QRC, P3T, and RAF
    The "CXML decompiler" is a python script, you can copypaste it from this link and save it as a .py file in your pc (you will need python v2.7 to run it)
    https://www.psdevwiki.com/ps3/CXML_Containers#CXML_decompiler

    The contents extracted by that tool are "raw" so the extraction could be considered perfect, it also generates a .xml file that represents the "table of contents" of the original file structure
    That xml file is what you need to build the other xml required by the raf compiler (to build your custom raf)
    The xml generated by the cxml decompiler is also "raw" and is a bit different than what you need to build a RAF... so you need to convert it manually, is not a straightforward process but if you dedicate some time looking at the requirements for the raf scene.xml you will get it
    https://www.psdevwiki.com/ps3/Rich_Appearance_Format_(RAF)

    And another big problem is the .JSX file extracted by the CXML decompiler is "encoded"... is like "machine code" in low level (the kind of language good for CPU's, but very far away to be human readable)
    This file extrension .JSX is official btw, is correct, and the raf compiler generates files with file extension .JSX but internally is named VSMX

    You can use rcomage to do the conversion JSX ---> to ---> JS (javascript source code in human readable format)
    But the vsmx decompiler of rcomage lacks many opcodes... in other words, there are many javascript functions that rcomage doesnt understands... incase your JSX uses that functions the decoded output (in javascript human readable format) is going to be veeeeeeeery broken

    There is another decompiler made by Tizzyt and me that have a lot more opcodes supported and it generates a much better code :)
    It was not perfect, but it was close... in percentages lets say... the decompiler of rcomage supports around 60% of the opcodes, and the one made by Tizzyt and me was around 85%

    https://www.psdevwiki.com/ps3/VSMX
    https://www.psdevwiki.com/ps3/Coldboot.raf <--- you should use this as guinea pig for practising, i decompiled it entirelly with a hexeditor, and there is many info about it in wiki :P
     
    Algol likes this.

Share This Page