- 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