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** - Analyzing bars/room

Here you find the different tutorials on editing and MODing Freelancer

Post Mon Jul 05, 2004 8:14 am

**Tutorial** - Analyzing bars/room

This is an imcomplete tutorial. I'm so busy at the moment and I can't continue. It would be a waste to throw these data away and not to share what I know to others so here it goes. Beside, I'm stuck with the camera positions. This tutorial does not show how to import a new 3D mesh of a room. If I disappear for a long time, please continue my work. Thanks.

Sooner or later we'll make new bars or rooms and it would be nice if they're different from the rest.
For adventure mod, you might want to add an extra room such as restaurant (see Kusari bars) , hotel lounge (see Houston commodity room) , hospital, etc...

So let's analyze all the hardpoints, props, table, NPC and see what happens.
________________________________________________________________________________________________
- Utility, Tools, Tutorials, References:
- NotePad: to edit text files
- THN Decompiler
- Freelancer Head Accessory Collection to see pictures of helmets, sunglasses, hats, etc...
- Tutorial: "Creating New Hardpoints": learn more about the Position and Orientation
- "Hardpoint Orientation Calculator ": might works
- Tutorial: "Intro scripts ", it'll show you more info about category "Solar" & "Spaceship" + camera path
- Freelancer SDK: in case you mess up and want to restore some files.
- Freelancer base pictures with archetype: pictures of bases.
- More Freelancer base pictures: more info.
- ***Info*** All Bases and Systems NickName = RealName: what's Li01_01?
- Faction code: what's li_p_grp?
________________________________________________________________________________________________
Tutorial:
- Consists of 8 parts:
- Part I: the Header
- Part II: Lighting
- Part III: Room View
- Part IV: Tables
- Part V: Props
- Part VI: NPC
- Part VII: Events
- Part VIII: Download templates
________________________________________________________________________________________________
- Pictures of New York bars
- Manhattan, Pittsburgh, Missouri, Trenton, Norfolk, Newark, West Pt., Detroit Munition, Ft. Bush, Buffalo, Rochester, Baltimore
- Pictures of Texas bars
- Houston, LPI Huntsville, Mississippi, Beaumont Base, LPI Sugarland, Osiris
- some bars are similar so I'll reuse the same pictures.

Edited by - buckaroobanzai on 3/28/2006 6:23:18 AM

Post Mon Jul 05, 2004 8:16 am



- Let's use the Pittsburgh bar in New York, Liberty space, to analyze.
- In Liberty space, the only bar we can customize is this plain kind --> pl_01_bar
- Pittsburgh, Buffalo Base, Rochester, Benton, & West Point bars are similiar in looks but with different hardpoints.
- For other bars, the tables and chairs are hard coded in the 3D mesh. We can't move the tables around.

- Files to examine:
data\universe\li01\bases\rooms\Li01_02_Bar.ini
data\scripts\bases\pl_01_bar_hardpoint_01.thn
data\missions\mbases.ini
data\PetalDB.ini : 3D mesh files of the rooms, declares props files
- Location code: Li01_02; that's Pittsburgh, NY.

- Instructions:
1. Look at the picture of the Pittsburgh bar .
2. Look at the file data\universe\li01\bases\rooms\Li01_02_Bar.ini and you'll see it uses the script pl_01_bar_hardpoint_01.thn
3. Now use the THN Decompiler and decompile the file: data\scripts\bases\pl_01_bar_hardpoint_01.thn

- We'll see the code for the header part below and let's analyze:
<pre><font size=1 face=Courier>_____________________________________________________________
duration = 10000
entities={
}
events={}
_____________________________________________________________ </font></pre>

- duration: that's in seconds. It's an infinite loop. But for every 10000 seconds, we'll see the same thing again. For example, fly-by debris when you look out to the windows.
- entities: inside the brackets "{" and "}", we'll declare hardpoints for Trent, bartender, tables, props, camera, etc...
- events: not sure what it is but we don't really need them. We'll cover this later. You can always delete it or make it empty like this: events={} . Notice: there's no comma before the "events" declaration.
====================================================================================================

Declaring the room
Now for the next part, we should declare the room like this:
<pre><font size=1 face=Courier>_____________________________________________________________
duration = 10000
entities={
{
srt_grp=0,
usr_flg=0,
lt_grp=0,
ambient={0,0,0},
entity_name = "Layer_Pl_01_Bar_hardpoint",
type=9,
front=2,
spatialprops={pos={0,0,0},
orient={{1,0,0},{0,1,0},{0,0,1}}},
up=1,
template_name=""
},
}
events={}
_____________________________________________________________ </font></pre>

- for each set of "{" and "}", it must be separated with a comma. For the last set, delete the comma. If you miss a comma or have an extra comma, all you see is a black screen. So make sure all bracket sets have opening & closing brackets following by a comma.
- entity_name: we should name it with "Layer_" and follow by the same name as the file name.
====================================================================================================

Here's a typical code of shadow and glaring lights:
<pre><font size=1 face=Courier>_____________________________________________________________
{
srt_grp=0,
usr_flg=0,
type=5,
lightprops={
diffuse={0,0,0},
atten={1,0,4e-006},
color={255,255,255},
theta=90,
ambient={0,0,0},
on=0,
cutoff=98.999977,
type=3,
direction={0,0,1},
range=2000,
specular={0,0,0}
},
entity_name="LtShadowSource",
lt_grp=0,
spatialprops={
pos={0,0,0},
orient={
{0.9999980000000001,0,-0.001769},
{0.001769,-0.002306,0.999996},
{-4e-006,-0.999997,-0.002306}
}
},
template_name=""
},
{
srt_grp=0,
usr_flg=0,
type=5,
lightprops={
diffuse={0.74902,0.74902,0.74902},
atten={1,0,4e-006},
color={255,255,255},
theta=90,
ambient={0,0,0},
on=0,
cutoff=98.999977,
type=1,
direction={0,0,1},
range=2000,
specular={0,0,0}
},
entity_name="LtGlareSource",
lt_grp=0,
spatialprops={
pos={-10.25598,13.610908,8.294198},
orient={
{0.7431680000000001,0,0.669105},
{0.034747,0.998651,-0.038593},
{-0.668202,0.05193,0.742165}
}
},
template_name=""
},
_____________________________________________________________ </font></pre>

- Best way is to copy and paste, and then change the value of the diffuse.
====================================================================================================
ROOMVIEW
- Look at the file: data\universe\li01\bases\rooms\Li01_02_Bar.ini and you'll see Camera_0
- back to the file data\scripts\bases\pl_01_bar_hardpoint_01.thn and you'll see a code like this:
<pre><font size=1 face=Courier>_____________________________________________________________
{ template_name="",
srt_grp=0,
usr_flg=0,
type=3,
entity_name="Camera_0",
lt_grp=0,
spatialprops={pos={-10.25598,3.610907,8.294198},
orient={{0.7431680000000001,0,0.669105},
{0.034747,0.998651,-0.038593},
{-0.668203,0.05193,0.742165}}
},
cameraprops={farplane=4000,
nearplane=1,
hvaspect=1.333333,
fovh=35
}
},
_____________________________________________________________ </font></pre>

- Camera_0 is the angle where you to view the entire room after Trent enters.
- Here's a typical view of the Pittsburgh bar .
- Orientation is very important. Wrong angle might make us miss a view of a NPC.

Edited by - buckaroobanzai on 3/12/2006 6:32:44 PM

Post Mon Jul 05, 2004 8:18 am



- A typical code of a table:
<pre><font size=1 face=Courier>_____________________________________________________________
{ srt_grp=0,
flags=4,
usr_flg=0,
type=1,
entity_name="li_table_round_1",
lt_grp=0,
spatialprops={
pos={3.462287,0,-3.791593},
orient={{0.7608780000000001,0,-0.648895},
{0,1,0},
{0.648895,0,0.7608780000000001}}
},
userprops={category="Prop"},
template_name="li_table_round"
},
_____________________________________________________________ </font></pre>
- pos: that's XYZ axis; (0,0,0) is the center; most likely, the ground is close to 0 on the Y-axis
X is to the right, Y is up, and Z is to the rear
- orientation: since the table is round, it doesn't matter much
- entity_name: any name you like, i.e. Table1, Table2, etc...
- template_name: that is the table type, in this case, it's li_table_round
- We can use other House tables too: Bretonia (br_table_round), Kusari (ku_table_round), Rheinland (rh_table_round) ; the colors are different.
- category: should be "Prop" in this case. Other categories are: "Solar" (solararch.ini), "Spaceship" (shiparch.ini).

Table location in the Pittsburgh bar, NY:
li_table_round_1: (3.462287,0,-3.791593)
li_table_round_2: (-3.537018,0,-3.791593)
li_table_round_3: (-3.537018,0,3.788198)
li_table_round_4: (3.752435,0,3.993148)
________________________________________________________________________________________________
Pictures of tables
li_table_round, br_table_round
ku_table_round and rh_table_round are similar to the li_table_round with different colors.

- the files are in:
data\bases\liberty\li_table_round_chairs.3db
data\bases\bretonia\br_table_round_chairs.3db
data\bases\kusari\ku_table_round_chairs.3db
data\bases\rheinland\rh_table_round_chairs.3db
- You can import these files into Milkshape3D and look at the 3D mesh.
- .3db files are the combo of 3D mesh + texture; Alone, .cmp is the 3D mesh and .mat is the texture

Edited by - buckaroobanzai on 3/28/2006 6:21:23 AM

Post Mon Jul 05, 2004 10:27 am



here's a typical code for an ashtray in the Pittsburgh bar:

<pre><font size=1 face=Courier><font size=1 face=Courier>___________________________________________________________________
{ srt_grp=0,
flags=4,
usr_flg=0,
type=1,
entity_name="Prop_ashtray_2_1",
lt_grp=0,
spatialprops={
pos={-3.411232, 0.805292, -3.89842},
orient={{-0.488498,0,0.872565},
{0,1,0},
{-0.872565,0,-0.488498}}
},
userprops={Priority="Room_Prop_1",
category="Prop"},
template_name="ashtray_2"
},
___________________________________________________________________ </font> </font></pre>
- pos: that's XYZ axis; (0,0,0) is the center of the room; most likely, the ground which is on the Y-axis is near zero point.
X direction is to the right, Y direction is up, and Z direction is to the rear
- orientation: you can place the glass standing up or lying down
- entity_name: any name you like, i.e. ashtray_2_on_table1, ashtray_2__on_table2, etc...
- template_name: the official name of the props; see some pictures below
- category: should be "Prop" in this case. Other categories are: "Solar" (solararch.ini), "Spaceship" (shiparch.ini).
- Table height: for Liberty table (li_table_round), just place the prop on the Y-axis between 0.783199 and 0.945419
- Props files are in the directory: data\characters\props
- 3D mesh files of the rooms: data\PetalDB.ini

- Here're some props on the tables in Pittsburgh bar, NY:
Prop_ashtray_2_1 (-3.411232, 0.805292, -3.89842),
Prop_Bottle_2_1 (-3.440457, 0.945419, 3.708827),
Prop_Bottle_2_2 (3.413948, 0.945419, -3.926737),
Prop_glass_green_1 (3.578886, 0.783199, -3.739675),
Prop_glass_green_2 (3.848161, 0.833056, 4.083414),
Prop_ashtray_2_2 (3.768134, 0.805293, 3.960698)
_______________________________________________________________________________________________
ORIENTATIONS :
- Here're some typical orientations for some props, just copy & paste:
- ashtrays: orient={{1,0,0},{0,1,0},{0,0,1}}
- bottles: orient={{1,0,0},{0,0,-1},{0,1,0}}
- glasses: orient={{1,0,0},{0,0,-1},{0,1,0}}
_______________________________________________________________________________________________
- Other props in a bar are:
ashtray_1, ashtray_2, ashtray_3
bottle_1, bottle_2, bottle_3
bottle_wine_1, bottle_wine_2, bottle_wine_3, beerbottle
glass_blue, glass_metal_1 or mug_1, glass_wine_1,
glass_1, glass_2, glass_green or tumbler
barcloth_wadded, barcloth_flat
_______________________________________________________________________________________________
- Beside these props, we can place other props such as helmet, sunglasses, sidearms, etc...
- Download the Freelancer Head Accessory Collection to see pictures of helmets, sunglasses, hats, etc...
- other items in the directory data\characters\props: box_01, blixx_crystal, baton_stun, and many more...

Edited by - buckaroobanzai on 3/28/2006 8:04:24 AM

Edited by - buckaroobanzai on 4/18/2006 10:35:17 AM

Post Tue Jul 06, 2004 6:05 am

Howdy buckaroobanzai
I haven't heard from you in like ages...
Nice to have someone with your tallent back.

Post Sat Jul 17, 2004 3:22 pm

NPC

- In this game, NPC are the people that you'll talk in a room to get rumors, bribes, locations of wrecks, missions, etc...
- When we move the tables around, we have to re-assign new hardpoints for camera angles and places to sit or stand.

- We still use the Pittsburgh bar in NY
- Look at the file data\missions\mbases.ini and you'll see character density for the Pittsburgh bar is 2. That's 2 NPCs. For Pittsburgh bar, the most people we have is 2. The bartender is fixed so we don't count the bartender. We don't count Trent either. You can change the character density to more than 2 but since there's only 2 hardpoints for the NPC to stand, we'll see only 2 people beside the bartender.
- If we look at the file: data\scripts\bases\pl_01_bar_hardpoint_01.thn, we see a whole bunch of hardpoints for NPC, Trent, the bartender, and camera positions.
- Pittsburgh has only 2 NPC, but why there're a whole bunch of hardpoints? Let's look at the bartender. If we can understand him, then we might figure the other NPCs.

- Trent hardpoint: entity_name="Zg/PC/Player/01/A/Stand "; pos={5.04758,0,-7.351979}. This is where he stands when he enters the room. And then later on, he'll walk up to a NPC to talk.

- the bartender has 3 hardpoints:
entity_name="Zs/NPC/Bartender/01/A/Stand ", pos={-6.490998,0,-4.60336}: this is where he stands all the times
entity_name="Zs/NPC/Bartender/01/P/Stand ", pos={-5.143674,-0.0054,-3.706102}: this is where Trent stands to talk to the NPC
entity_name="Zs/NPC/Bartender/01/P2/Stand ", pos={-5.581836,0,-3.974612}: this is where Trent stands too; not sure why we need this hardpoint.

- and then, the bartender has a bunch of camera positions:
- ACS/Camera = "Actor Camera Single?"; NPC upper body shot only.
- AC2/Camera = "Actor Camera Two people?"; side view of both people, Trent & NPC. Should focus more on NPC than Trent.
- ACOH/Camera = "Actor Camera Opposite Head?"; NPC upper body shot but looking from the back of Trent head
- ACU/Camera = "Actor Camera Upclose?"; is the face shot of the NPC upclose; i.e., when they look at the credit card.

- PCS/Camera = "Player Camera Single?"; Trent upper body shot only.
- PC2/Camera = "Player Camera Two people?"; side view of both people, Trent & NPC. Should focus more on Trent than the NPC.
- PCO/Camera = "Player Camera Opposite?"; the angle you look at Trent's upper body from the back of the NPC head.
- PCU/Camera = "Player Camera Upclose?"; also the angle you look at Trent's face upclose like when he reaches into his pocket to take out the rep card.
- WFC/Camera: = "Waiting for Command" ; when you read an event (rumor, bribe, or a mission), behind in the background, that's where the camera is pointing at. This is just an extra angle to show off. We really don't need it. Just copy & paste any position.

- TCI/Camera : Look like it's the angle where Trent reach in his pants' pocket to get the credit card. We hardly see this angle.

- Actor Camera: focus more on the NPC than Trent.
- Player Camera: focus more on Trent than the NPC. So for PC2/Camera, we get to see both people, but it focuses more on Trent. A little confusing. Even Microsoft messed up on these shots.

Edited by - buckaroobanzai on 3/28/2006 8:20:31 AM

Post Sat Jul 17, 2004 5:12 pm


<pre><font size=1 face=Courier>__________________________________________________
events={
{
0,
8,
{
"Lonnigan_news_screen",
"Set_li_09_depot"
},
{
flags=6,
target_part="NewsVendor_ni",
target_type=2,
front=5,
up=1,
duration=40,
offset={
0,
0,
0
}
}
}
}
__________________________________________________ </font></pre>

Post Tue Jul 20, 2004 1:24 pm



- I made some new rooms by modifying the old bars. You can download, use them, and edit to your perfection.

- Download - > New Bars/Rooms v. 1.08. (have to right click on the mouse, and choose "Save Target As..." )
- Always use the latest version. I might change a few minor details to the old bars.

- For the Maine bar, I used the battleship Missouri bar. I added 1 more NPC hardpoint. Now we can have up to 8 NPCs in a bar including the bartender. Also added a few more bottles, glasses.
- Ithaca bar: I used the Pittsburgh bar. You can have up to 8 NPCs in that bar. The bartender also counts as an NPC. Also added some sunglasses.
- Durango bar: based on the Houston bar. You can have up to 8 NPCs in that bar. Also added some props such as boxes and blix crystal.
- Gunnison bar: I used the Newark bar. This bar can squeeze up to 14 NPCs.
- Chisos bar: based on Denver bar. You can have up to 9 NPCs.
- Brazos bar: I used another version of Newark bar. This bar can only have up to 13 NPCs.
- For the Brazos restaurant in Texas, I used the Nagumo bar. This room can have up to 8 NPCs.

- Pictures of the NEW Pittsburgh, Missouri, Houston, Denver, Newark bars, a restaurant, cafe,
dig site, lab, & hospital.
- Pictures of the old Pittsburgh, Missouri, Houston, Denver, Newark, Nagumo bars.

- You can used these bars in your mods.
- When you add a new base, you have to edit a lot of files:
- data\equipment\market_misc.ini
- data\equipment\market_ships.ini
- data\equipment\market_commodities.ini
- data\missions\news.ini
- data\missions\mBases.ini

- Your new bases should be in the directory: data\universe\systems\li01\bases
- Your new rooms should be in the directory: data\universe\systems\li01\bases\rooms

- Hopefully in the future, I can make new 3D mesh and import in. Then we can have brand new bars/room. In the mean time, we just modify the old bars

_____________________________________________
Revisions:
v. 1.08: added a 3D mesh of the li_table_round_chairs.ms3d and standingtable1.ms3d in Milkshape format. You can use the Milkshape 3D program to view or edit them.
- The standing table is just like the one in the Manhattan bar; prop = standingtable1, bases\liberty\standingtable1.3db
- Also added some .jpg pictures of some props in the directory Data\characters\props
v. 1.07: I resurrected the lab room but I placed on the Cambridge Research Station.
v. 1.06: I resurrected the dig site but I place on the planet Cambridge.
v. 1.05: for this version, I tackle the problem if adding an outdoor cafe in a cityscape with traffic in the background. It's on planet Mojave in California. Also retouch some old bars since I have a lot of experiences now.
v. 1.04: Added a hospital on planet Mojave in California.
v. 1.03: For this version, I tackle the problem of adding a restaurant. Check it out on planet Brazos in Texas system.
v. 1.02: - added a new bar on planet Gunnison in the Colorado system, some new bars on planet Chisos and Brazos in the Texas system.
v. 1.01: - added a new bar on planet Durango in the Colorado system.
v. 1.00: - added a new bar on planet Maine in New York and another new bar on the Ithaca Research Station, New York.

Edited by - buckaroobanzai on 3/28/2006 10:59:30 AM

Post Thu Jul 22, 2004 9:17 am

Would be better to suggest people use the SDK than the FL 1.0 package. Nice work though with the rooms.

Post Sat Jul 09, 2005 10:02 am

*Bump* can't let this one dissappear

Post Mon Apr 24, 2006 11:36 am




version 1.03

- This is a poor man version of a utility. I don't know how to program in Basic or C++ so we're stuck with web pages. It's not that bad. Just follow steps by steps from #1 to #8, copy and paste the code, and you can have a new bar in any minute. Also included is a mod. Just fly to the Pittsburgh bar in New York and you'll see a new bar.

- For installing and activating/deactivating Mods use the
Freelancer Mod Manager v1.31 - download it here.

To install this MOD into the Mod Manager
double left click on barmaker103.zip.flmod
and the Mod Manager will get the mod ready to activate.

- Use your favorite web browser and open the file: Freelancer Mod Manager\mods\1barmaker\index.html
______________________________________________
download this utility: Bar maker v. 1.03
______________________________________________
v. 1.03: more NPC hardpoints
v. 1.02: add a few more tables
v. 1.01: add a few more hardpoints for NPC and tables
v. 1.00: initial release


Edited by - buckaroobanzai on 6/9/2006 1:20:30 PM

Post Thu Jun 01, 2006 8:10 am

I have no time now to check it out now, but this probably will become one of those Tools A Modder Can't Live Without.

Thanks!!!

AD8

Post Tue Jun 13, 2006 11:59 am

Thank you from someone with much more imagination than coding skills. I appreciate you sharing your talents and tools.

Return to Freelancer Editing Tutorial Forum