Idea: THN animation editor with 3D display.
-
Late to the scene, but THN is actually LUA 2.1 or similar. there’s a craptonne of stuff you can do with it linking to in-space/out of menu events. Pulling random numbers/system time/keymapping, is all theoretically doable.
I had a long, long list of functions a while back, and was actually halfway through making a wiki for it all , but the URL appears to have died. Will see what I can find. -
A 3D THN editor would be amazing, just for doing new campaign. It could be do a new life for freelancer, and someone can creat a freelancer 2, I think creat a freelancer 2 by a mod is not a good way, Why? Because all people will give the name of their mods Freelancer 2.
-
With my little experience, I offer my help.
I do not know how to reverse-engineering. But with with many heads we may come to something.
On a side note, I am working on a THN -> LUA compiler interface. I did not find it in Freelancer Tools. The interface it-self is ready. I am now working on starting the LUA compiler. This first version works one file at the time. The next one will work on batches.
-
Make sure you’re using the updated FLEd-Thorn version.
-
FLEd-Thorn comes with the lua compiler, so yes.
lua\luac32 -o script.thn script.thn.lua ```That will take the decompiled file **script.thn.lua** and recompile it back to **script.thn**. @fdussault: There's also the ["native" decompiler](http://the-starport.net/freelancer/forum/viewtopic.php?post_id=30586#forumpost30586) you might like to look at. I'll be making it work on entire directory trees at some stage.
-
Adoxa,
I notice there is a call to a DACOM DLL.
Do you - or any one - have a way to find the entry point signatures?
I am refering to the function names and their parameter types and uses.
… because I have no idea what is called and what this is doing.On a side track, is there anyone knowing a Digital Anvil Freelancer developper?
-
That’s the problem with virtual functions - names have to be guessed from context; number and type of parameters and return type can be gleaned from the disassembly. Since a disassembler can’t really interpret a virtual function (something like call [edx+1C] could be anything), I haven’t worried about decoding what I don’t need.
-
TheDvDMan wrote:
Can we please get back to the subject?Sure.
So you want a 3D editor.
This editor should (add to it):
-
Read or access FL’s files
-
Read and display objects (in 3D)
-
Position the objects and cameras
-
Create the paths
-
Have a timeline
-
Write LUA files
-
Compile and write THN files
This is a big project.
Is there an animation software we may “upgrade” to read/access FL files and write LUA files?
-
-
i’d rather suggest some plugin to convert animations done with C4D, 3ds max or LightWave than an entirely new rendering program. because what we have there pretty much is doing what we write in thn’s, so only thing is to read out the format, convert it to the thn format and save it up as a thn file.
-
After seeing everything else it can do… anyone ever thought of Blender?? It WOULD take a ton of scripting… but with the right params in the right places it could well be used for the visual part…
Just have to work out how to crosstalk between THN’s and Python… but its about the most versatile platform i can think of… & no… i have no idea how you’d do it… It’s just a theory based on the fact Blender is fast becoming the tool for mostly everything else (via Python scripting) in other games.
So what you’d need is…
A THN/Python converter/re-converter <-this would be the “magic”
All FL’s tga/dds’s extracted from the FX files (for consistency)
& way! Too much time on your hands… 8-)Best of luck… be nice to stop doing all this in my head and have a tool for the task… (like Doom3’s particle ed… yay… that saved me weeks)
-
i think, the effects conversion is not even necessary, as particle effects and beam effects are supported by blender and the conversion would not translate effects but only names and reference names, so the visual of effects or the models are unnecessary, only dimensions, positions, motions.
-
-
UTFImageExporter will extract the lot (not .thn’s though… i think…) if pointed towards the DATA file of Freelancer… you may want to be a bit more precise though… extracting SHIPS, SOLAR & FX separately will save trying to sort it all out after extraction…
As i said…l not sure if it works on .thn’s but UTF Editor will do that if needed.
Blender wont read a .mat file… or a .thn no matter what scripts you throw at it… and besides… it takes a few mins to extract the textures… but would take forever to try and get python to read a .mat file 8-)
EDIT: Using LW / 3dsMax or other commercial app for this task defeats the purpose… bad enough we MUST use ms3d to convert ships already… Please… I beg ye… Use blender… “think of the children”
-
okay, now, the extraction of all the mat and txm texture nodes is no SDK and can be done by simply saving the nodes as tga/dds depending on whether the node is called MIP[digit] or MIPS. the image extractor does nothing else but searching for these nodes and saving them up with a file extension as needed for graphic programs to read.
besides we only would need bounding boxes or approximations of the models to plan and convert a thn from a rendering program (the thn does NOT contain any models, effects or textures, ONLY references), so we don’t even need a script to make the program read utf’s; it however is possible by using the same decryption code we have in the UTF editors, the image extractor and the model importer and the ale editor (or simply the UTF/XML) already. there is no problem with this.
and, last but not least, the UTF editor would not make anything with a thn file as the thorn is a standalone freelancer format rather than any kind of UTF archive. it is more comparable with the ini’s themselves - a pure code file. what you see on the editor when opening up a thn, and you think its rubbish, it is the encrypted version. open a vanilla ini and you see the same rubbish. -
For your information, an other group discuss of “THN Rotation Matrix Calculator”
Please let me summarize for my own (and others) understanding.
-
We can NOT directly access FL files from, let say, Blender. We need to first convert them - or those needed. We already have UTF editors that do this. UTFImageExporter seems to be the tool to use. Our editor might use it. To be seen.
-
Thorn files are scripts referring ini files referring to tga/dds files.
This mean will will have to generate these ini files too - if needed.
-