LordFjord''s THN info
@ Rankor you posted in the Newbie thread concerning the intro THN's, THN's are not noob material so rather than cluttering up that thread I'll post info here.
The first thing you will need is Fled_Thorn, this decompresses them allowing you to edit them with a text editor. I'm sorry to say that a text editor is still the only way we have of editting them, Accushot was working on a program but I haven't heard anything about it in ages.
What I'm posting is LordFjord's thn tutorial from the old infinity forums, I copied it about a week before the forums got hacked last year and afaik all of the good stuff on that site is now gone.
After reading this you might regret asking as thn's are not for the faint hearted.
What is a thn file
THN files hold all animation sequences in cutscenes, rooms on bases, also the menu background scenes.
All things that are in ingame-graphics and not actually in space flight mode are thn animations.
Original Freelancer has manymany of these for the singlplayer cutscenes or just for filling the docked bases with a bit ambience and light.
Everything that moves there was scripted into detail - every single bypassing "traffic" ship on planets and so on.
This tutorial is a reference to the possible sections I found, not an example.
I learned many parts of this from Lancersreactor and additional researched revealed a few more details.
Install the thn-decompiler. make sure the LUA dir is set up correctly and select a thn file. It will be decoded. It will work in a decompiled format, just like ini-files.
The thn file is divided into 2 big sections, above that u can declare the complete duration of the animation (in seconds).
duration = 300
entities={ ...
< list all entities here >
}
and
events={ ...
< sequences and events go here >
}
you need to declare EVERYTHING, from the largest planet to the smalles engine-effect.
A bit theory:
positions are always: x, z, y (well, it is actually x, y, z but those are aligned differently as in school-maths)
orientations are more complex, this hardpoint tutorial cna be helpful to find out the rough values: click me
I will try to list all sections i found and my guess what they mean:
entities:
scene
i don't know why u need it, it is never referredd to in the future.
havent tested if it works without one, but all files i checked so far have it.
Code:
{
entity_name="Scene_Untitled",
type=SCENE,
template_name="",
lt_grp=0,
srt_grp=0,
usr_flg=0,
spatialprops={
pos={
0,
0,
0
},
orient={
{
1,
0,
0
},
{
0,
1,
0
},
{
0,
0,
1
}
},
up=Y_AXIS,
front=Z_AXIS,
ambient={
128,
128,
128
}
},
declaring a ship
Code:
{
entity_name="Ship_01",
type=COMPOUND,
template_name="pi_elite2",
lt_grp=0,
srt_grp=0,
usr_flg=0,
flags=LIT_DYNAMIC,
spatialprops={
pos={
0.000000,
-1000.000000,
7000.000000
},
orient={
{
1,
0,
0
},
{
0,
1,
0
},
{
0,
0,
1
}
}
},
userprops={
category="Spaceship"
}
},
template_name= this is the reference to shiparch.ini
pos={ <------------positioning as described above, only important for fixed objects
orient={ <---------orientation as described above
category= <-------"Spaceship" for ships, "Solar" for planets, other objects
declaring an effect
In this case it is the ship's engine. Note that some ships have several engines, u need an entry for each one.
Code:
{
entity_name="Ship_01_Engine_1",
type=PSYS,
template_name="gf_co_smallengine02_fire",
lt_grp=0,
srt_grp=0,
usr_flg=0,
flags=LIT_DYNAMIC + LIT_AMBIENT,
spatialprops={
pos={
0,
0,
0
},
orient={
{
1,
0,
0
},
{
0,
1,
0
},
{
0,
0,
1
}
}
},
psysprops={
sparam=0
}
},
Position values are not important as we will link this to the ship later.
declaring a planet/other opbject
very similar to our other objects, just for reference:
Code:
{
entity_name="planet_mercury_200_2",
type=COMPOUND,
template_name="planet_mercury_200",
lt_grp=0,
srt_grp=0,
usr_flg=0,
flags=LIT_DYNAMIC,
spatialprops={
pos={
325.583038,
-2031.342896,
-1040.869141
},
orient={
{
1,
0,
0
},
{
0,
1,
0
},
{
0,
0,
1
}
}
},
userprops={
category="Solar"
}
},
Typical it's to long
Edited by - Bejaymac on 11/25/2006 3:55:24 PM
Edited by - Bejaymac on 11/25/2006 3:57:55 PM
The first thing you will need is Fled_Thorn, this decompresses them allowing you to edit them with a text editor. I'm sorry to say that a text editor is still the only way we have of editting them, Accushot was working on a program but I haven't heard anything about it in ages.
What I'm posting is LordFjord's thn tutorial from the old infinity forums, I copied it about a week before the forums got hacked last year and afaik all of the good stuff on that site is now gone.
After reading this you might regret asking as thn's are not for the faint hearted.
What is a thn file
THN files hold all animation sequences in cutscenes, rooms on bases, also the menu background scenes.
All things that are in ingame-graphics and not actually in space flight mode are thn animations.
Original Freelancer has manymany of these for the singlplayer cutscenes or just for filling the docked bases with a bit ambience and light.
Everything that moves there was scripted into detail - every single bypassing "traffic" ship on planets and so on.
This tutorial is a reference to the possible sections I found, not an example.
I learned many parts of this from Lancersreactor and additional researched revealed a few more details.
Install the thn-decompiler. make sure the LUA dir is set up correctly and select a thn file. It will be decoded. It will work in a decompiled format, just like ini-files.
The thn file is divided into 2 big sections, above that u can declare the complete duration of the animation (in seconds).
duration = 300
entities={ ...
< list all entities here >
}
and
events={ ...
< sequences and events go here >
}
you need to declare EVERYTHING, from the largest planet to the smalles engine-effect.
A bit theory:
positions are always: x, z, y (well, it is actually x, y, z but those are aligned differently as in school-maths)
orientations are more complex, this hardpoint tutorial cna be helpful to find out the rough values: click me
I will try to list all sections i found and my guess what they mean:
entities:
scene
i don't know why u need it, it is never referredd to in the future.
havent tested if it works without one, but all files i checked so far have it.
Code:
{
entity_name="Scene_Untitled",
type=SCENE,
template_name="",
lt_grp=0,
srt_grp=0,
usr_flg=0,
spatialprops={
pos={
0,
0,
0
},
orient={
{
1,
0,
0
},
{
0,
1,
0
},
{
0,
0,
1
}
},
up=Y_AXIS,
front=Z_AXIS,
ambient={
128,
128,
128
}
},
declaring a ship
Code:
{
entity_name="Ship_01",
type=COMPOUND,
template_name="pi_elite2",
lt_grp=0,
srt_grp=0,
usr_flg=0,
flags=LIT_DYNAMIC,
spatialprops={
pos={
0.000000,
-1000.000000,
7000.000000
},
orient={
{
1,
0,
0
},
{
0,
1,
0
},
{
0,
0,
1
}
}
},
userprops={
category="Spaceship"
}
},
template_name= this is the reference to shiparch.ini
pos={ <------------positioning as described above, only important for fixed objects
orient={ <---------orientation as described above
category= <-------"Spaceship" for ships, "Solar" for planets, other objects
declaring an effect
In this case it is the ship's engine. Note that some ships have several engines, u need an entry for each one.
Code:
{
entity_name="Ship_01_Engine_1",
type=PSYS,
template_name="gf_co_smallengine02_fire",
lt_grp=0,
srt_grp=0,
usr_flg=0,
flags=LIT_DYNAMIC + LIT_AMBIENT,
spatialprops={
pos={
0,
0,
0
},
orient={
{
1,
0,
0
},
{
0,
1,
0
},
{
0,
0,
1
}
}
},
psysprops={
sparam=0
}
},
Position values are not important as we will link this to the ship later.
declaring a planet/other opbject
very similar to our other objects, just for reference:
Code:
{
entity_name="planet_mercury_200_2",
type=COMPOUND,
template_name="planet_mercury_200",
lt_grp=0,
srt_grp=0,
usr_flg=0,
flags=LIT_DYNAMIC,
spatialprops={
pos={
325.583038,
-2031.342896,
-1040.869141
},
orient={
{
1,
0,
0
},
{
0,
1,
0
},
{
0,
0,
1
}
}
},
userprops={
category="Solar"
}
},
Typical it's to long
Edited by - Bejaymac on 11/25/2006 3:55:24 PM
Edited by - Bejaymac on 11/25/2006 3:57:55 PM