Freelancer Community Network


Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

**Tutorial** - Intro scripts

Here you find the different tutorials on editing and MODing Freelancer

Post Sun Jun 06, 2004 11:30 am

**Tutorial** - Intro scripts

I know it has been covered by bobthedog one year ago, but I thought there were missing infos.
Firts, you'll need the Fled-Thorn.
This program will allow you to edit thn files.
Once they are decompressed, you don't need to compress them, alike the inis.

Also, having a 3d prog will help you a lot !
I know it's hard to get a good one, but I think milkshape will do the work great.

Now that we have progs, lets start.
Decompress the file Intro_waterplante.thn, witch is in the DATA/SCRIPTS/INTRO folder.
Open it with notepad and take a look at the structure.

Here is the beginig of the file :

duration=361.872

entities={
{
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
}
},

One important thing : I advise you to keep the tabulation system cause it is alot more clear. The forum can't display it, so take a look at existing blocs, or download the text version of this tut.

So, let describe this part : the duration entry is the duration time (in second) of the scene. After this time past, it will restart the scene from the begining.

Then is the most important part, the entities.
In this bloc (will call it like that every thing that is put into "{" and "}" ), all objects of the scene will be referenced.
The "Scene" bloc is almost the same in every files, so keep it.

As you can see, every bloc is finished by a coma just after the ending "}".
The only exeption is the last bloc witch has no coma.
Be careful : if you make a sintax error, the screen will be black, and you won't see anything.
Althoug, if you make reference errors (like typing li_fighter"s" instead of li_fighter) the object won't appear and the scene will shows.

Now, take a look at the "planet_mercury_200_2" bloc.
It's the first "phisical" object of the sene.
Here it is :

{
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"
}
},

The "type" is always COMPOUND for phisical objects.
The "template_name" is the reference to the file listed in the "category" (here "Solar" --> Solararch.ini)
"lt_grp" seems to be a "light group", but i'm not sure of this, since changing it will sometimes turn the object dark or ligh...
For "srt_grp" (="sort group" ), i dont know what it meens, but it's not important since you can make a good scene without changing this !
Dito for the "usr_flg" (="user_flag" ).
The "flags" entry is a list of params that you can borrow from existing objects. It's not always the same, so check wath it should be for a ship or another object.

Now, the hardest part : "spacialprops".
You have two entries in it : "pos" (= position in XYZ, like in systems) and "orient" (witch i can't undersand at the moment). If you change it, you'll see your planet beeing deformed... So, I think there is no links to the orientation of the object.

After, there is the "userprops" entry.
Into this one is the "category", witch define (as i said earlier) in witch file to take the archetype.
You can put :
- "Solar" for bases, planet and other objects (exept suns). It will read solararch.ini.
- "Spaceship" for ships but also for battleships, gunships, cruiser, etc. It will read shiparch.ini.

Now, another exemple, and one of the most usefull : path.
There aren't any in waterplanet, so take one from gasminer !
A simple one :

{
entity_name="Path_1",
type=MOTION_PATH,
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
}
}
},
pathprops={
path_type="CV_CROrientationSplinePath",
path_data="OPEN, {7760.895996,612.463013,-4181.623535}, {1.000000,0.000000,0.000000,0.000000}, {6997.041504,612.463013,-1500.000000}, {1.000000,0.000000,0.000000,0.000000}, "
}
},

You see that there is no template for a path.
Always let the path coordinates at zero, you'll see why later.
So we'll jump to the most important part : the "pathprops".
I havet seen anything else than "CV_CROrientationSplinePath" in the "path_type", so keep it like that.
Now is the more intersting part : the "path_data"
Here are referenced all the path parts. They are also in XYZ and they are calculated the same as other coordinates, exept that they are relative to the path emplacement.
You can also see that there is, after every coordinates, this : {1.000000,0.000000,0.000000,0.000000}
I've seen in other path that this is changed somtimes, but I don't know what is the use of that...

Thats now done for phisical objects, and if you want to add effects, then just take a look at bob's tut, whith explain it well.
Also, you may have a few questions :
Q : "How do the hell I know where to put my object entry ?"
A : Wherever you want in the entities entry !

Q : "How do I know how to place my object in space ?"
A : That's where the 3d prog is usefull : you'll have to remake the scene in your prog.
IE : In 3dsmax, divide everything by 10. For the camera, but only if it doesn't have any "orient" params (that why I chose Intro_waterplanet.thn) it should be easy to place it, since it always point to a simple direction.
There is also an important point : the field of view.
Take the exemple of the waterplanet camera : the fov is settled at 30.
But, you'll see in 3dsmax the if you put 30 in the fov entry, it won't be good.
The reason ? I don't know why, but if you mutliply by 2 (60) that will be corect...

Now, you should know the basics for the entities, and you're ready to learn "events".


Edited by - Chips on 10/31/2004 7:35:23 AM

Post Sun Jun 06, 2004 11:31 am

Envents are alot more simple than entites.
They are all about motion, exept the effects ones and the "Set Camera".
So, we will start with the more simple one : "START_SPATIAL_PROP_ANIM"
The one I chose let you aply a rotation to an object. I've taken it from waterplanet, this is the first event :

{
0,
START_SPATIAL_PROP_ANIM,
{
"planet_watblucld_1500_4"
},
{
duration=360.1,
target_type=ROOT,
spatialprops={
axisrot={
360,
NEG_Y_AXIS
}
}
}
},

The first number set when do you want the animation to start at.
Usualy settled at zero (in seconds), you can do waterver you want with it, exept, of course, make it starts after the end of the scene, cause you won't ever see you motion.
After, there is "planet_watblucld_1500_4". It is the object witch the anim will be applied on.
Then is the duration (in second). If you put 10, you'll see your planet spining very fast and stoping when 10 seconds are gone.
Target type isn't important, but what's next is :
Into the "axisrot" bloc, the first number is the degree of the rotation, and the "NEG_Y_AXIS" is the direction of the rotation.

Now, lets take a look at a more complex one :

{
0,
START_PATH_ANIMATION,
{
"Ships_ge_large_transport_12_copy_1",
"Path_1"
},
{
duration=60,
start_percent=0,
stop_percent=1,
offset={
0,
0,
0
},
up=Y_AXIS,
front=NEG_Z_AXIS,
flags=POSITION + ORIENTATION + LOOK_AT
}
},

I've stolen it from gasminer :p !
This type of anim is, for sure, the most usefull.
It says witch path is applied at witch object.
Note that a path can only be applied to one object.
Even if you want two ships to follow the same path, you'll have do two identical path (but with diferent names).

So, as bob said, the two names are :
For the first, the object the path is puted on.
And for the second, the path that is used.
After, there is a duration again, but you know how to define it.
Then, a start_percent and stop_percent.
They are most of time 0 and 1, but you can put 0.5 and 0.75.
This will make the ship starting at the half of the path and stoping at the 3/4 of it. The duration will still stay the same.
The rest isn't important, exept the "flags".
If you only put POSITION, your ship will follow the path keeping looking the same way and without rotating.
For more realism, keep "POSITION + ORIENTATION + LOOK_AT".

That's ok for the events.

So, now, you should have the requiered knowledge to make a good intro scene.
Is there is still something that you want to know, email me and i'll try to answer your questions !

Here is a list of what you can't do :

- Making ships having a trail, contrails or dinamic engine (relative to its speed).
The engine effect is constant and always settled to the lower apparence.
- Playing sounds.
- Making the sun or other effects to always showing.
Ie : when the scene is finished and restart, all effects are stoped and restart together. You can't do anyting against that.

And here is a list of what you can do :

- Making moving camera !!!
Simply aply it a motion path !

Er... you can also do alot of things ! But I won't list them all, you're surely clever enought to find them by your self !

So, hope that helps !

Post Sun Jun 06, 2004 10:54 pm

Great work Archangel!

*Stickied*

Eraser
Moderator for The Lancers Reactor
Creator of the TLR FTP Upload Service
E-Mail: eraser@lancersreactor.com
MSN: get_erased@hotmail.com

Post Mon Jun 07, 2004 7:46 am

It's an honour !
Thank you so much !

Post Mon Aug 16, 2004 7:49 pm

I've been trying to put hardpoints on my ship but it is not working. I mean come on, what ship can't land, attack, move, cruise, etc. I need serious help on this and I haven't found any tutorials on adding hard points that has really worked for me so please. Help me experiened ship creator people I need advice/tutorials for ship hard points and similar ship-like goodness.

Post Sun Aug 29, 2004 2:15 pm

Hu ?!
If you want to add hardpoints to a ship, this is a wrong place for asking...
If not, then excuse me and re-write your message (i'm still messed with english...but you've certainly found this out ).

Post Tue Aug 31, 2004 4:29 pm

i might be a bit slow when i comes to modding (or anything else hahaha) but kdding aside i didn't follow this

Post Thu Sep 23, 2004 8:01 am

Hello Archangel,

you have done a great job with your tutorial! Now i have a question to you:
Can i post your Tutorial on T 'n' G (Link in signature)?? If you want I'll add your name, too.

Greetings from Paddy...



_____________________________

Post Fri Oct 08, 2004 8:30 am

@Thazell: Hardpointing is covered in Drizzt's Ship Creating Tutorial on this site

Post Sat Oct 16, 2004 8:28 pm

Question: how do I add a nebula to the intro scene? And, for that matter, an asteroid field? I am trying to make an intro scene set in Alaska.

MK

Post Sat Oct 30, 2004 5:48 pm

Anything on my above question?

MK

*edit*

Here are the relevent parts of my intro:

{
entity_name="nebula_Li05_nebula",
type=COMPOUND,
template_name="nebula_Li05_nebula",
lt_grp=0,
srt_grp=-100,
usr_flg=1,
flags=LIT_DYNAMIC,
spatialprops={
pos={
0,
0,
0
},
orient={
{
-0.09350700000000001,
0,
0.995619
},
{
0,
1,
0
},
{
-0.995619,
0,
-0.09350700000000001
}
}
},
userprops={
category="Prop"
}
}

Edited by - mknote on 10/30/2004 6:55:05 PM

Post Sun Nov 07, 2004 11:59 am

Sorry, the FL script engine doesn't allow nebulae or asteroid fields !
To do so, you must make a misson with a script that control the camera in a premade system. It's a lot harder and will take more time, but that's the only way, until source code is released !

Best regards,
Archangel.

Post Sat Sep 24, 2005 11:30 am

Is there another link to be able to dowload the THN decompressor as the link isn't working

Post Fri Oct 14, 2005 4:01 am

yeah gimme a min i shall host it

Post Sun Jul 29, 2007 8:08 pm

Archangel,
Thanks for posting your turorial. I hope this will provide me with the enlightenment I needed to create some of my own intro's and other related THN's.
Next

Return to Freelancer Editing Tutorial Forum

cron
Hosted by The-Starport
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.