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** - System modding knowledgebase

Here you find the different tutorials on editing and MODing Freelancer

Post Thu Nov 18, 2004 6:14 am

**Tutorial** - System modding knowledgebase

Ok, here it is. Written over a year ago. Got lost with the Excelcia forum crash, was reposted on the Infinity boards, now it should be safe here and not get lost again.

I have learned many parts of this here on lancers, but a lot of things are also from self-studies and a lot of experimenting. Some of the things may be outdated / wrong - i mean its an old tut and i didnt had the time yet to fully overwork it - just to go quickly through it.

Fjord

P.S. i hope the code copy paste will work...

edit: the copy paste did work, im about to remove the phpbb tags and rearange some code segments.



Edited by - LordFjord on 11/18/2004 6:15:09 AM

Post Thu Nov 18, 2004 6:14 am

System Modding Knowledgebase

A note ahead: This tutorial was created by me ~ one year ago. Cyberion extended
and reviewed it.
This was probably the [shameless selfadmiringbeggest and best[/shameless
selfadmiring system modding tutorial ever written down. It got lost in the
big Excelcia/Infinity forum crash. The content what you read has been extracted
and recovered manually from a 190MB raw-backupfile of the forum's database.
Now to the tutorial:

This will be a huge tutorial and knowledge-base for system modding. I
write this as I learn and "decrypt" more and more parts of system-editing. It
should help to learn and speed up modding of systems by giving good examples.
I will also make a template-system to show that all things mentioned here
really work. :wink:
It will include ALL things that can be modded, with examples showing how to
create populated systems like the ones in the game (with missions, bribes,...).
This will be published and updated frequently as I make progress.
The replies to this post will handle the numerous parts of system-modding.
Best will be to go through all affected files one by one.
I do all this with notepad. Freelancer Explorer may be a nice tool to create a
system, but the result will always be a quick and dirty solution. I want to
[uunderstand[/u the details of system-modding and FLEx is just a visual tool
that hides the details - just one reason why I don't use it.

------------------------------------------------------------------------------

File organization

I will try to explain which file holds what data and how they are connected or
how they interact with each other. All paths are relative to the Freelancer
directory, i.e. I treat it as root.
Some filenames are system- and basename related. I will use < system > and <
base > for these.
A detailed description of each file will follow later. (damned, this will be a
lot of work... It will hopefully pay back the effort when it is finished and
makes system-modding easy)
This only contains files where I exactly know what they do. Will be completed
with the time.

------------------


Purchase and sale:
----------------------
Structure of these files is the same, entries are all in sections (one for each
base)

\DATA\EQUIPMENT\market_misc.ini
Contains information about the availability of weapons and equipment on ALL
bases.

\DATA\EQUIPMENT\market_ships.ini
Contains information about the availability of ships on ALL bases.

\DATA\EQUIPMENT\market_commodities.ini
Contains information about the availability of commodities on ALL bases.


Objects:
----------
These are the descriptions of all fixed objects that can be found in space.
Planets, bases, jumpholes/gates, asteroids, nebulas, stars,...

\DATA\SOLAR\asteroidarch.ini
Archetype references for all asteroids.

\DATA\SOLAR\stararch.ini
Archetype reference for all stars.

\DATA\SOLAR\solararch.ini
This is the "big" one, it holds all planets, bases and all other fixed objects.

\DATA\SOLAR\loadouts.ini
All bases/stations/objects are equipped here (guns, shields, lights,...)

\DATA\SOLAR\ASTEROIDS\< system >_< asteroid field type name >.ini
This defines the visual look and behaviour of the asteroid field used.
Minefields are also specified here.

\DATA\SOLAR\NEBULA\< system >_< nebula type name >.ini
Definition of the visual look and behaviour of nebulas.


[uUniverse:[/u
This is the complete universe that you all know in FL. Systems, bases, fields,
... everything.

\DATA\UNIVERSE\universe.ini
A list of all bases and systems. System position on the galaxy map, map
scales,... are defined here.

\DATA\UNIVERSE\shortest_illegal_path.ini
Seems to be the place to define paths that cross several systems. This one
prefers jumpholes.

\DATA\UNIVERSE\shortest_legal_path.ini
Same as above, just prefers jumpgates.

\DATA\UNIVERSE\SYSTEMS\< system >\< system >.ini
This is the main part of each system. Objects, zones, fields, patrols, their
positions, all this is found here. This is where you "shape" your system.

\DATA\UNIVERSE\SYSTEMS\< system >\BASES\< system >_< base >_base.ini
Defines a base with all its rooms.

\DATA\UNIVERSE\SYSTEMS\< system >\BASES\ROOMS\< system >_< base >_< location
>.ini

Defines a room in the base and its connection to other rooms. Also character
and ship placement.

\DATA\MISSIONS\mbases.ini
This is probably the largest and most complicated ini-file in FL.
The bases are all listed and populated here with characters (in the bar,
traders, shipdealers,..). All missions, rumors and bribes are also defined here.


Allright, this may have confused everyone I guess and i think I lost everyone's
attention by now.
Sorry, but this is a very complicated topic and it needs a lot of patience and
endurance, but I try to summarize it a bit shorter


Archetype files (these define the objects)
asteroidarch.ini
stararch.ini
solararch.ini
loadouts.ini

System files
Archetypes are used in the system files (all these are nessessary to make a
working system with bases and fields):

note: could edit this to look right on these boards, sry
<pre><font size=1 face=Courier><font size=1 face=Courier>
SOLAR + ASTEROIDS - mysystem_asteroid_field.ini
/
+ NEBULA - mysystem_nebula.ini
UNIVERSE - universe.ini
+ SYSTEMS + MYSYSTEM + BASES + ROOMS - mysystem_01_base_location1.ini
/ / - mysystem_01_base_location2.ini
/ / - ...
/ - mysystem_01_base.ini
/ - mysystem_02_base.ini
/
- mysystem.ini
MISSIONS - mbases.ini </font> </font></pre>

Purchase and sale
Probably the easiest part of system-modding.
market_misc.ini
market_ships.ini
market_commodities.ini


------------------------------------------------------------------------------


Position and rotation

It is essential to know how this works to place object in space to the spot
where you want them to be. With the right usage of these, building bases with a
lot of components is easy. Rotation is very important for tradelanes, too.

The coordinates and rotation values are both in the format X, Z, Y .
(This is not 100% right but people are more used to the school-coordinate
systems. In 3D-engines the axis are a bit different - i will use x, z, y for
easier understaning, but in "Real" its still x, y, z)

Positions:
X increases from west to east
Z increases from bottom to top
Y increases from north to south (note that this is the other way round as ppl
think, but its common in computer environments)

An important note: 10000 units in the ini-s are ~9k in space. It is not known
why. (maybe ini-s are in meters and space in yards...)

<pre><font size=1 face=Courier><font size=1 face=Courier>
x ----------0++++++++++
y -
-
-
-
-
-
0
+
+
+
+
+
+ </font> </font></pre>

Rotation:
This works by degrees. Format is again X, Z, Y
You can use both 0 to 360 or -180 to 180 values.
The value will rotate the object in an anti-clockwize (mathematically correct)
direction.

Example:
rotation = 0, 0, 0 ; <-- points to "north"
rotation = 0, 90, 0 ; <-- points to "west"
rotation = 0, 180, 0 ; <-- points to "south"
rotation = 0, -90, 0 ; <-- points to "east"

rotation = 180, 0 , 0 ; <-- object flipped upside down
rotation = 0, 0, 180 ; <-- object flipped upside down, but around the y-axis &
mirrored to 180, 0, 0

rotating around 1 axis' is fine without more calculations, but if you want to
rotate 2 or 3, you have to refer to maths a bit more to make everything
correct. (you can message me if u want more detailed info)


------------------------------------------------------------------------------

System Framework

File:
\DATA\UNIVERSE\< System >\< system >.ini

This file contains the following sections:
<pre><font size=1 face=Courier><font size=1 face=Courier>[SystemInfo
[Archetype
[EncounterParameters
[TexturePanels
[Dust
[Asteroids
[Nebula
[Music
[Ambient
[Background
[LightSource
[Object
[Zone </font> </font></pre>

Explanations:
[SystemInfo
Self-explaining. colors are RGB-format.
space_color = 0, 0, 0
local_faction = li_p_grp ; from faction_prop.ini

[Archetype
This is for preloading and cashing archetype files (cmp, .3db for example).
This section is optional.
It might increase loading time of systems, but it decreases loading time during
flight in space when a NPC pops up.
Using this is recommended to use on low-end systems.

[EncounterParameters
This section is used once for each encounter type. Those are specified in the
DATA\MISSIONS\ENCOUNTERS\ directory
Things like number, class and basic behaviour of appearing ships are set there.

[TexturePanels
This is always this entry:
file = universe\heavens\shapes.ini

[Dust
Specifies the type of dust you will find throughout the system. Zones can have
their own types of dust. One is for example the burning-effect when entering
athmospheres or getting near to suns.
Typical is:
spacedust = Dust

[Asteroids
Reference to the \DATA\SOLAR\ASTEROIDS\ entries.
Assignment of these to zones.

[Nebula
Reference to the \DATA\SOLAR\NEBULA\ entries.
Assignment of these to zones.

[Music
Self-explaining.
space = music_li_space
danger = music_li_danger
battle = music_li_battle
Hint: you can play own music or sound files (wave). Take a look at
\DATA\AUDIO\music.ini and ...\sound.ini

[Ambient
Self-explaining. RGB
color = 30, 50, 80

[Background
Here you set the background stars and background nebulas.
Pick one from an existing system.

[LightSource
Lights. Set the color, distance, type and attenuation curve.
An important thing to create the right effects and visual feeling of your
system. I think an eclipse could be possible to create

[Object
These are ALL objects that are placed into space. They usually have a position,
a rotation, the archetype (type of object).
Objects can be give loadouts to fill in hardpoints (weapons on bases,
lights,...).
Objects usually have a reputation, i.e. they belong to a faction.
All kinds of solid objects (Stars, Planets, Bases, static asteroids, wrecks,
tradelanes, jumpgates, jumpholes,...) are specified here.
I will go into detail one by one in later posts.

[Zone
Zones are all types of fields (visible or not) that contain something.
They have a position, a rotation, a shape, a size and a lot of other data
depending on their function.
Typical zones are:
asteroid fields, nebulas, encounter zones (traffic, battles), planet
athmospheres, radiation areas, low-sensor-range areas, minefields, mission
areas and sun / planet kill areas (when ramming those).
I will explain these one-by-one later.');



------------------------------------------------------------------------------

System Framework (continued)

This short section will handle the following files in the \DATA\UNIVERSE
directory:
universe.ini
shortest_illegal_path.ini
systems_shortest_path.ini

universe.ini
There are two important section types:
[System and [Base. There is a section fro each system and base in the game.

[u[System [/u
<pre><font size=1 face=Courier><font size=1 face=Courier><system>
nickname = Iw03
file = systems\Iw03\Iw03.ini
pos = 5, 10
msg_id_prefix = gcs_refer_system_Iw03
visit = 0
strid_name = 196645
ids_info = 66101
NavMapScale = 2 </font> </font></pre>
Explanation:
nickname =
Name of the System in the \UNIVERSE\SYSTEMS directory.

file =
Filename of the system ini.

pos =
This sets the location of the system in the universe map. Coordinates are
handled in a similar way as with systems X, Y.
X increases from west to east
Y increases from north to south
values range from 0 to 15 in the builtin maps. center (NY) is 7, 8

msg_id_prefix =
Format: gcs_refer_system_< system >
This is used by NPCs when messaging around.
Probably won't work for custom systems.

visit =
This seems to be a binary flag value.
flag numbers: 8765/4321 -> combined to a value from the binary pattern
1: System is shown on map from start. -> visit = 1
2-7: unknown
8: System never shows up on map. -> visit = 128

visit = 0 is the recommended value (system doesn't show up until found)

strid_name =
Name infocard reference.

ids_info =
Infocard reference for system information.

NavMapScale =
Scale of the system map. Typical entries range from 0 to 2. default is 1.


[Base
<pre><font size=1 face=Courier><font size=1 face=Courier><Base>
nickname = Iw04_02_Base
system = Iw04
strid_name = 196730
file = Universe\Systems\Iw04\Bases\Iw04_02_Base.ini
BGCS_base_run_by = W02bF36 </font> </font></pre>

nickname =
Reference name of the base.

System =
The sytem name where the base is located.

strid_name=
Infocard name reference.

file =
Location of the base ini-file.

BGCS_base_run_by =
??? maybe also a Hex offset for infocard info

-------------------
shortest_illegal_path.ini and systems_shortest_path.ini work the
same way, but use different routes to get from one to another system.

there is one section [SystemConnections for each system. The path to ALL other
systems will be inserted here in the following format.
example:
<pre><font size=1 face=Courier><font size=1 face=Courier><SystemConnections>
Path = Li01, Hi01, Li01, Li03, Iw06, Ku02, Ku03, Bw08, Ew01, Hi01
Path = Li01, Li01, Li01
Path = Li01, Li03, Li01, Li03
Path = Li01, Rh05, Li01, Li04, Iw01, Rh02, Rh01, Rh05
Path = Li01, Rh01, Li01, Li04, Iw01, Rh02, Rh01
Path = Li01, Rh03, Li01, Li04, Iw01, Rh02, Rh01, Rh03
Path = Li01, Br06, Li01, Li02, Iw04, Br02, Br04, Br06
... </font> </font></pre>
Explanation:
Path = < source > , < destination >, < list of systems passed through,
including source and destination >

example:
Path = Li01, Rh01, Li01, Li04, Iw01, Rh02, Rh01
source is NY, destination NB.
the path is NY->Texas->Bering->Hamburg->NB

The 2 files also differ in the usage of gates and holes. Its not know how this
exactly works. Also inner-system paths(waypoint are still unknown).

I am not sure if this is needed to make a system work and it seems unimportant
because waypoint over systems are rare (almost only at missions with a spread
group).
Making entries for the connected systems worked for me. (can still be extended
later. I need to test what happens when I try this with a path that has no
entry here)

EDIT: Path tested without system-entry. It will refuse to set a waypoint by
telling "no path" -> works without them, but should be done for a well-made
system.

So much to the framework of a system.


------------------------------------------------------------------------------

Connecting Systems / Jumpgates / Jumpholes
Jumpgates and holes are basically the same, just the look and docking behaviour
is different.

Example:
<pre><font size=1 face=Courier><font size=1 face=Courier>[zone
nickname = Zone_Li01_to_Li04_hole
pos = 15425, 0, 83760
shape = SPHERE
size = 2000
property_flags = 131072
visit = 128
sort = 99

[Object
nickname = Li01_to_Li04_hole
ids_name = 260916
pos = 15425, 0, 83760
Archetype = jumphole
msg_id_prefix = gcs_refer_system_Li04
ids_info = 66146
jump_effect = jump_effect_hole
visit = 0
goto = Li04, Li04_to_LI01_hole, gate_tunnel_bretonia </font> </font></pre>

Usually, only the [Object entry is needed, as that is our jumphole. The [Zone
around it can be useful though. One example is to use this as an exclusion-zone
in asteroid fields (more detail on that in later tuts). This makes sure that
there are no asteroids near the jumphole.

Explanation of entries (zones will be explained later):
[u[Object[/u

nickname, ids_name, pos, ids_info
these are very common in most ini-s and should be known by now :wink:

Archetype =
This is the model used from the solararch.ini.
Typical entries are jumphole, jumpgate, jumphole_red,...

msg_id_prefix =
Reference for NPC messages.

jump_effect =
The visual effect during the system-change.

visit =
similar flag-system as explained in the system framework under universe.ini
A common value is 0 (visible on map after spotting it)

goto =
This specifies the destination of the jump.
Format is:
goto = < destination system >, < destination object >, < visual effect during
jump >
Example:
goto = Li04, Li04_to_LI01_hole, gate_tunnel_bretonia

Important: To make the jump work in both directions you need to set up a
similar object in the destination system, just the other way round.

Creating one-way holes is possible by blocking one gate/hole in
initialworld.ini. Inner-system connections are possible without problems.


------------------------------------------------------------------------------

Tradelanes
Tradelanes

Just a few notes:
Lanes that go straight work in ANY angle.
Lanes that change direction mess up the tunnel-animation. This can be corrected
by taking out the visual effcet of the tunnel.
Just comment out the following line in select_equip.ini like this:
<pre><font size=1 face=Courier><font size=1 face=Courier>[TradeLane
...
;tl_player_travel = basic_tl_player_travel
... </font> </font></pre>

Please remember that lanes going over edges basically work, but the
direction-change is instant and will look strange at this speed when you make
turns of over ~10 degrees.

Cyberion, i need to find ur edit - it was stored seperately.


------------------------------------------------------------------------------

Dockable Bases

This is a very complicated topic, I will try to explain it into detail as good
as I can. Note that this does NOT include populating bases and missions, that
will come later.
You will need to edit several files to set up a base:

-UNIVERSE
\DATA\UNIVERSE\universe.ini
A base needs an entry here to work properly. See details in "System framework"
in a post above.

-MAP
\DATA\UNIVERSE\SYSTEMS\< system >\< system >.ini
This is the "map" of the system. The base will be placed as an object. Several
modules (objects) can be "merged" to a single base.

-BASE
\DATA\UNIVERSE\SYSTEMS\< system >\Bases\< system >_< base >_Base.ini
List of all rooms in the base and references to the room-inis.

-ROOM
\DATA\UNIVERSE\SYSTEMS\< system >\Bases\Rooms\< system >_< base >_< Room
>.ini

This contains the information about the rooms in the base.

---------------------------

MAP
Here are the entries of a typical station:
<pre><font size=1 face=Courier><font size=1 face=Courier>; *** Dockable station ***
[Object
nickname = Tut01_01
ids_name = 0
pos = 2000, -500, 10000
rotate = 0, -90, 0
Archetype = prison
ids_info = 0
base = Tut01_01_Base
dock_with = Tut01_01_Base
voice = atc_leg_f01
space_costume = br_karina_head_gen, li_female_guard_body
faction = li_p_grp
reputation = li_p_grp
behavior = NOTHING
difficulty_level = 2
loadout = prison_li_01
pilot = pilot_solar_hardest </font> </font></pre>

nickname, ids_name, ids_info, pos, rotate, faction, loadout
See in previous posts, should be clear by now.

Archetype =
This is the "look" of the base. A "gallery" system with all available types has
been made by seveal people (see another thread).

base =
This is the name of the base. It's also used for as a reference to the base-ini.

dock_with =
Docking with this object will automatically lead to docking with the named base.
Example: a planet is a base, but docking at the docking ring (a seperate
object) makes you dock at it.

voice =
The always friendly voice that greets you when docking.

space_costume =
This is the look of the person/robot that appears in the small message window
when you dock to a base.

behaviour =
??? if an object had this, then the value was always: NOTHING

difficulty_level =
Set this to a value that fits your needs. I am not sure what this is used for.

pilot =
This is the skill of the base and determines how accurate turrets will fire.

[size=16[uAdding modules to bases[/u[/size
This is explained by an example:
<pre><font size=1 face=Courier><font size=1 face=Courier>
[Object
nickname = Tut01_01_space_habitat_wide_01
pos = 2000, -300, 10000
rotate = 0, 0, 0
archetype = space_habitat_wide
reputation = li_p_grp
parent = Tut01_01 </font> </font></pre>
This is pretty easy, most difficult is to align the position and rotation of
the module.
The parent = Tut01_01 line makes that the module is NOT treated as an
individual object but as a part of the base -> you can only target the base,
not each component.
Some base modules can also be docked to, in this case you need a "dock_with ="
entry.

Making bases and modules destroyable is a more sensitive and difficult
topic, I will handle that later.


--------------------------------

BASE
A typical ini file for a base looks like this:
<pre><font size=1 face=Courier><font size=1 face=Courier>[BaseInfo;
nickname = Tut01_01_Base
start_room = Bar

[Room
nickname = Deck
file = Universe\Systems\Tut01\Bases\Rooms\Tut01_01_deck.ini

[Room
nickname = Bar
file = Universe\Systems\Tut01\Bases\Rooms\Tut01_01_bar.ini

[Room
nickname = Trader
file = Universe\Systems\Tut01\Bases\Rooms\Tut01_01_trader.ini

[Room
nickname = ShipDealer
file = Universe\Systems\Tut01\Bases\Rooms\Tut01_01_shipdealer.ini

[Room
nickname = Equipment
file = Universe\Systems\Tut01\Bases\Rooms\Tut01_01_equipment.ini </font> </font></pre>
Everything is self-explaining here.
You define the rooms of the base and assign the ini-files.

------------------------------

ROOM
The basic structure here is always the same:
<pre><font size=1 face=Courier><font size=1 face=Courier>[Room_Info
set_script = scripts\bases\Li_01_equipment_hardpoint_01.thn
scene = all, ambient, Scripts\Bases\Li_01_equipment_ambi_int_01.thn
goodscart_script = scripts\bases\Li_01_equipment_carts_01.thn

[Spiels
EquipmentDealer = manhattan_equipment_spiel

[Room_Sound
ambient = ambience_equip_ground_larger

[Camera
name = Camera_0

[CharacterPlacement
name = Zg/PC/Player/01/A/Stand

[PlayerShipPlacement
name = X/Shipcentre/01

[Hotspot
name = IDS_HOTSPOT_EXIT
behavior = ExitDoor
room_switch = Deck

[Hotspot
name = IDS_HOTSPOT_BAR
behavior = ExitDoor
room_switch = Bar

[Hotspot
name = IDS_HOTSPOT_COMMODITYTRADER_ROOM
behavior = ExitDoor
room_switch = Trader

[Hotspot
name = IDS_HOTSPOT_EQUIPMENTDEALER_ROOM
behavior = ExitDoor
room_switch = Equipment

[Hotspot
name = IDS_HOTSPOT_SHIPDEALER_ROOM
behavior = ExitDoor
room_switch = ShipDealer

[Hotspot
name = IDS_NN_REPAIR_YOUR_SHIP
behavior = Repair

[Hotspot
name = IDS_DEALER_FRONT_DESK
behavior = FrontDesk
state_read = 1
state_send = 2

[Hotspot
name = IDS_HOTSPOT_EQUIPMENTDEALER
behavior = StartEquipDealer
state_read = 2
state_send = 1

[Hotspot
name = IDS_EQUIPMENT_ROOM_RIGHT
behavior = MoveRight
state_read = 2
state_send = 1 </font> </font></pre>
Explanation:
[Room_info
The general setting of the room. Use an entry of a known place.

[Spiels
Animation sequences.

[Room_Sound
The sound/music (look up in \DATA\AUDIO\sounds.ini (music.ini)) of the room.

[Camera
"Hardpoint" of viewer camera. (all rooms are model files, just like ships)

[CharacterPlacement
Self-explaining, use a known entry.

[PlayerShipPlacement
Placement of ship if it should be visible in the area.

[Hotspot
Most important entry in the rooms. This defines where you get when you click on
an icon when docked.
Rooms can be "re-used" with the "virtual_room" feature. This way, you can place
the equipment, the merchant and the shipdealer in the same location.
The "state_read" and "state_send" entries specify actions like the change
between the room and "walking to the shipdealer's desk" for example. I haven't
figured out more details yet.

Other entries
There are a couple of other things available, like flashlights (seen in most
capitols), also other stuff.

Best is to take a look at a base/room that alredy exists in the game. There are
more than enough available "templates", so you just have to find the "right
one"

After working out all rooms, we should have a finished base, although it is not
populated, so things most probably won't work yet.
Adding characters to bases will follow shortly.

______________________________________

Virtual Rooms in bases

This section is about using virtual rooms. This means basically, that you don't
have a new room for each basic service at bases (merchant, equipment, ships).
You can place all those characters into the same room. Switching to another
service
means to enter a virtual room with the character. The location (the look,
ambience,..) stays the same.
Individual rooms for each service are usually used on planets in the unmodified
game, while virtual rooms are used almost everywhere.
I will just post a working example, the details are explained in the section
above.
(This example is from the Liberty HQ base i made)

Li01_16_Base.ini
<pre><font size=1 face=Courier><font size=1 face=Courier>[BaseInfo
nickname = Li01_16_Base
start_room = Deck

[Room
nickname = Bar
file = Universe\Systems\Li01\Bases\Rooms\Li01_16_Bar.ini

[Room
nickname = Deck
file = Universe\Systems\Li01\Bases\Rooms\Li01_16_Deck.ini

[Room
nickname = Deck2
file = Universe\Systems\Li01\Bases\Rooms\Li01_16_Deck2.ini </font> </font></pre>

------------------------

Li01_16_Bar.ini
<pre><font size=1 face=Courier><font size=1 face=Courier>[Room_Info
set_script = Scripts\Bases\Li_05_Bar_hardpoint_01.thn
scene = all, ambient, Scripts\Bases\Li_05_Bar_ambi_int_01.thn

[Room_Sound
ambient = ambience_bar_space
music = music_bar_li03

[Camera
name = Camera_0

[CharacterPlacement
name = Zg/PC/Player/01/A/Stand
start_script = scripts\bases\Li_05_Bar_enter_01.thn

[Hotspot
name = IDS_HOTSPOT_DECK
behavior = ExitDoor
room_switch = Deck

[Hotspot
name = IDS_HOTSPOT_BAR
behavior = ExitDoor
room_switch = Bar

[Hotspot
name = IDS_HOTSPOT_COMMODITYTRADER_ROOM
behavior = ExitDoor
room_switch = Deck
set_virtual_room = Trader

[Hotspot
name = IDS_HOTSPOT_EQUIPMENTDEALER_ROOM
behavior = ExitDoor
room_switch = Deck
set_virtual_room = Equipment

[Hotspot
name = IDS_HOTSPOT_SHIPDEALER_ROOM
behavior = ExitDoor
room_switch = Deck
set_virtual_room = ShipDealer

[Hotspot
name = IDS_HOTSPOT_NEWSVENDOR
behavior = NewsVendor

[Hotspot
name = IDS_HOTSPOT_MISSIONVENDOR
behavior = MissionVendor </font> </font></pre>

------------------------------------

Li01_16_Deck.ini
<pre><font size=1 face=Courier><font size=1 face=Courier>[Room_Info
set_script = Scripts\Bases\Li_05_Deck_HardPoint_01.thn
scene = all, ambient, Scripts\Bases\Li_05_Deck_ambi_int_01.thn

[Spiels
CommodityDealer = manhattan_commodity_spiel
EquipmentDealer = manhattan_equipment_spiel

[Room_Sound
ambient = ambience_deck_space_smaller

[CharacterPlacement
name = Zg/PC/Player/01/A/Stand

[PlayerShipPlacement
name = X/Shipcentre/01

[ForSaleShipPlacement
name = X/Shipcentre/02

[Camera
name = Camera_0

[Hotspot
name = IDS_HOTSPOT_DECK
behavior = ExitDoor
room_switch = Deck

[Hotspot
name = IDS_HOTSPOT_BAR
behavior = ExitDoor
room_switch = Bar

[Hotspot
name = IDS_HOTSPOT_COMMODITYTRADER_ROOM
behavior = VirtualRoom
room_switch = Trader

[Hotspot
name = IDS_HOTSPOT_EQUIPMENTDEALER_ROOM
behavior = VirtualRoom
room_switch = Equipment

[Hotspot
name = IDS_HOTSPOT_SHIPDEALER_ROOM
behavior = VirtualRoom
room_switch = ShipDealer

[Hotspot
name = IDS_NN_REPAIR_YOUR_SHIP
behavior = Repair
virtual_room = Deck

[Hotspot
name = IDS_DEALER_FRONT_DESK
behavior = FrontDesk
state_read = 1
state_send = 2
virtual_room = Trader

[Hotspot
name = IDS_HOTSPOT_COMMODITYTRADER
behavior = StartDealer
state_read = 2
state_send = 1
virtual_room = Trader

[Hotspot
name = IDS_DEALER_FRONT_DESK
behavior = FrontDesk
state_read = 1
state_send = 2
virtual_room = Equipment

[Hotspot
name = IDS_HOTSPOT_EQUIPMENTDEALER
behavior = StartEquipDealer
state_read = 2
state_send = 1
virtual_room = Equipment

[Hotspot
name = IDS_EQUIPMENT_ROOM_RIGHT
behavior = MoveRight
state_read = 2
state_send = 1
virtual_room = Equipment

[Hotspot
name = IDS_NN_REPAIR_YOUR_SHIP
behavior = Repair
virtual_room = Equipment

[Hotspot
name = IDS_DEALER_FRONT_DESK
behavior = FrontDesk
state_read = 1
state_send = 2
virtual_room = ShipDealer

[Hotspot
name = IDS_HOTSPOT_SHIPDEALER
behavior = StartShipDealer
state_read = 2
state_send = 1
virtual_room = ShipDealer

[Hotspot
name = IDS_NN_REPAIR_YOUR_SHIP
behavior = Repair
virtual_room = ShipDealer </font> </font></pre>

---------------------------

Li01_16_Deck2.ini
<pre><font size=1 face=Courier><font size=1 face=Courier>[Room_Info
set_script = Scripts\Bases\Li_05_Deck_HardPoint_01.thn
scene = all, ambient, Scripts\Bases\Li_05_Deck_ambi_int_01.thn

[Room_Sound
ambient = ambience_deck_space_smaller

[PlayerShipPlacement
name = X/Shipcentre/01

[Camera
name = Camera_0

[Hotspot
name = IDS_HOTSPOT_DECK
behavior = ExitDoor
room_switch = Deck

[Hotspot
name = IDS_HOTSPOT_BAR
behavior = ExitDoor
room_switch = Bar </font> </font></pre>

Please note that I kept the standards from the game (name conventions,
structure).
This base has 3 rooms: the bar, a deck and a 2nd deck.
The bar is self-explaining, the deck holds the merchant, the equipment and
shipdealer, the deck2 is for launching.


------------------------------------------------------------------------------


Populating Bases/Missions

...continued from the "Bases" section...

We have a base that appears in space. It has all the rooms defined, but needs a
few character to bring life to the base. Custom missions is connected very
closely with this, so I will try to explain as much as I know about them.
This all is about the biggest and maybe most complicted ini-file in FL:
\DATA\MISSIONS\mbases.ini

[color=redWARNING: bini (also other ini decompressors) mess a few lines up and
corrupt the file. I will put a link here to a corrected version (later)[/color
update with the rework of the tutorial: use the files from the Freelancer SDK
1.3. get it from lancersreactor.

Again, I will post my "tutorial" base as an example.
To make things shorter, I will comment the simpler entries and explain
complicated ones below:
<pre><font size=1 face=Courier><font size=1 face=Courier>[MBase
nickname = Tut01_01_Base
local_faction = li_p_grp
diff = 1
msg_id_prefix = gcs_refer_base_Tut01_01_Base

[MVendor
num_offers = 1, 4 ; <---min, max number of missions offered

[BaseFaction ; <--- one section like this for all factions at the base
faction = li_p_grp
weight = 30
offers_missions = true ; <--- this and the line below are messed up by bini
mission_type = DestroyMission, 0.000000, 0.442387, 100 ; <------ type, min
diffclass, max diffclass, weight
npc = Tut0101_lpolice_001_m ; <--- NPC declaration (only for additional ones -
u can put them basically in any room)

[GF_NPC ; <--- a typical bartender
nickname = Tut0101_fix_bartender
body = li_bartender_body
head = rh_bartender_head
lefthand = benchmark_male_hand_left
righthand = benchmark_male_hand_right
individual_name = 244609
affiliation = li_p_grp
voice = rvp101
bribe = fc_lr_grp, 12, 16100

[GF_NPC ; <--- a typical shipdealer
nickname = Tut0101_fix_ship
body = li_commtrader_body
head = ge_male1_head
lefthand = benchmark_male_hand_left
righthand = benchmark_male_hand_right
individual_name = 244612
affiliation = li_p_grp
voice = rvp111

[GF_NPC ; <--- a typical merchant
nickname = Tut0101_fix_trader
body = li_commtrader_body
head = br_brighton_head
lefthand = benchmark_male_hand_left
righthand = benchmark_male_hand_right
individual_name = 244610
affiliation = li_p_grp
voice = rvp101

[GF_NPC ; <--- a typical equipment dealer
nickname = Tut0101_fix_weaponsdealer
body = li_commtrader_body
head = br_sales_head
lefthand = benchmark_male_hand_left
righthand = benchmark_male_hand_right
individual_name = 244611
affiliation = li_p_grp
voice = rvp101

[GF_NPC ; <--- this is the NPC we defined above
nickname = Tut0101_lpolice_001_m
body = li_male_guard_body
head = ge_male3_head
lefthand = benchmark_male_hand_left
righthand = benchmark_male_hand_right
individual_name = 220011
affiliation = li_p_grp
voice = rvp111
misn = DestroyMission, 0.000000, 0.112387 ; <--- mission offered by NPC when u
talk to him
room = bar ; <--- location of the NPC
accessory = prop_hat_male_li_grd_visor ; this is to make him look cool 8)

; *** the rooms we defined for our base ***
[MRoom
nickname = bar
character_density = 7 ; <--- ??? probably max number of chars
fixture = Tut0101_fix_bartender, Zs/NPC/Bartender/01/A/Stand,
scripts\vendors\li_bartender_fidget.thn, bartender

[MRoom
nickname = trader
character_density = 3
fixture = Tut0101_fix_trader, Zs/NPC/Trader/01/A/Stand,
scripts\vendors\li_commtrader_fidget.thn, trader

[MRoom
nickname = ShipDealer
character_density = 2
fixture = Tut0101_fix_ship, Zs/NPC/Shipdealer/01/A/Stand,
scripts\vendors\li_shipdealer_fidget.thn, ShipDealer

[MRoom
nickname = Equipment
character_density = 2
fixture = Tut0101_fix_weaponsdealer, Zs/NPC/Equipment/01/A/Stand,
scripts\vendors\li_equipdealer_fidget.thn, Equipment </font> </font></pre>

Additional explanations:
Bribes
Our bartender offers a bribe. These are esay to set up, its just this simple
line:
bribe = fc_lr_grp, 10000, 16100
format is:
bribe = < faction >, cash factor, < DLL-reference to bribe text >
the cash factor is no multiplier, but it can be changed. Lower values make
cheaper prices, but not all seem to work.
[uHere[/u is a link to a few known values.

[GF_NPC
This is for creating NPCs - self-explaining. You assign a body, head, hands,
name, affiliation, voice, accessory and a room.
Also missions offered by NPCs are defined here.

[MRoom
The rooms we defined in the base are populated here. It is possible to place
all the "default" NPCs (trader, equipment,...) in the same room. In this case
the "virtual_rooms" I meantioned earlier are needed.

-----------------------------------------
[size=16Missions [/size

We have already set up the mission and someone who offers it to you.
I recall:
<pre><font size=1 face=Courier><font size=1 face=Courier>offers_missions = true
mission_type = DestroyMission, 0.000000, 0.442387, 100 </font> </font></pre>

mission_type = < type >, < min diffclass >,< max diffclass >, < percentage to
appear for this faction >
min and max level are for the cash, the weight defines the difficulty.

Missions offered by NPCs are a bit different:
<pre><font size=1 face=Courier><font size=1 face=Courier>misn = DestroyMission, 0.000000, 0.112387 </font> </font></pre>
Format is almost the same, no need for a faction percentage because the NPC is
only one who offers the mission.
I recall:
<pre><font size=1 face=Courier><font size=1 face=Courier>[BaseFaction
faction = li_p_grp
weight = 30 </font> </font></pre>

We still need a destination for the mission. This is placed into the main
ini-file of the system and it is a zone. example from NY:
<pre><font size=1 face=Courier><font size=1 face=Courier>[zone
nickname = zone_li01_destroy_vignette_1
pos = -23536, 0, -52599
shape = SPHERE
size = 10000
mission_type = unlawful
sort = 99.500000
vignette_type = open </font> </font></pre>

I think the vignette zones are picked at random, there are over 60 of these in
NY alone. The size defines the area where the mission takes place. If you leave
this, then mission commission will tell you that you failed cause you left the
mission area. This zone must overlap with an existing encounter zone.

Additional loot from missions:
take a look at RMLootInfo.ini, entries are pretty self-explaining.

??? Problems/unsure points ???
- mission types: i could only find the entry "destroy missions", but this
spawns also recover, destroy and baseassault missions. would be nice to specify
a certain type.
- selective mission destination: donno if its even possible...
- file: VignetteParams.ini many people have tried and failed to get the logic
behind this file. It was a script for sure that has been converted to an
ini-file.

I think this post will need a lot of overworking/overthinking when I figure out
even more details.


------------------------------------------------------------------------------


Purchase and Sale

This is an easy topic, but important to do.
files are all in \DATA\EQUIPMENTmarket_commodities.ini
market_misc.ini
market_ships.ini

The entries are also identical (except ships!). You MUST define a base in each
of these files, even if you don't sell anything at the base. Otherwise the game
will crash when you enter the base (happened to me).
A typical entry:
<pre><font size=1 face=Courier><font size=1 face=Courier>[BaseGood
base = Li01_01_base
MarketGood = li_gun01_mark01, 0, -1, 10, 10, 0, 1
... </font> </font></pre>

This was taken from market_misc.ini and shows the start of Manhattan base in NY.
The format for the entries is the same in ALL of these 3 files.

MarketGood = < 0 >, < 1 >, < 2 >, < 3 >, < 4 >, < 5 >, < 6 >
[list[*0 - Package name from any of the "goods" inis (weapon_good.ini,
st_good.ini, goods.ini, ...)
[*1 - Level requirement to buy - doesnt work in MP
[*2 - Reputation requirement, range is from -1 to 1, 0 is neutral. -1 means
everyone (including enemies) can buy it
[*3 - unknown, but it follows a pattern
[*4 - unknown, but it follows a pattern
[*5 - unknown
[*6 - base price multiplier[/list

Examples (should cover all possibilities):
Commodities
MarketGood = commodity_boron, 0, -1, 150, 500, 0, 1.300000 ;<---for sale
MarketGood = commodity_gold, 0, -1, 0, 0, 1, 2 ;<---not for sale
Equipment/Weapons
MarketGood = missile01_mark01, 0, -1, 10, 10, 0, 1 ;<---weapon
MarketGood = missile01_mark01_ammo, 0, -1, 50, 50, 0, 1 ;<---ammo

Ships
Format is a bit different, an additional field is added - it is still unknown.
price multipliers dont work for ships.

marketgood = lf_package, 1, -1, 1, 1, 0, 1, 1 ;<---patriot for sale
marketgood = lf_package, 1, -1, 0, 0, 1, 1, 1 ;<---patriot not for sale

The "not for sale" entries can be important for commodities to specify the
price., but they are irrelevant for ships.



------------------------------------------------------------------------------



Planets and Stars

This is also a small and pretty easy section. In FL, a planet and a star are
pretty the same and they behave in a very similar way. Both have an athmosphere
range where the \"burning\" effect starts and both have a zone that kills
objects who would crash into the planet/star.
Example:
PLANET:
<pre><font size=1 face=Courier><font size=1 face=Courier>[Object
nickname = Tut01_Planet_01
ids_name = 0
pos = 10000, 1000, 10000
rotate = 0, 0, 0
ambient_color = 0, 0, 0
Archetype = planet_crater_1000
ids_info = 0
spin = 0, 0.001, 0
atmosphere_range = 1200
burn_color = 160, 222, 245
reputation = li_p_grp
visit = 0

[zone
nickname = Zone_Tut01_Planet_01_death
pos = 10000, 1000, 10000
shape = SPHERE
size = 1100
damage = 10000
sort = 99.500000
density = 0
relief_time = 0
population_additive = false </font> </font></pre>
I think most entries here are self-explaining, I will take a closer look to
some of them:

[Object
...
spin = 0, 0.001, 0
This is how the object spins around the 3 axis' values are in radiants per sec
i think (i will try 2pi, then it should spin once per sec->poor citicens).
You can also rotate around another axis.
The "spin = " entry can be also used to rotate all other types of objects.
Could be nice to have base parts rotating for example solar panels, other
modules,...
I have some other fancy ideas here, but will post them when they work.

atmosphere_range = 1200
burn_color = 160, 222, 245

Self-explaining, but good to know
I think these can also be set for all kinds of objects.

Dockable planets need a docking ring and a "base = mybasename" entry.
The dockinring would have the line "dock_with = mybasename".

STAR:
Example:
<pre><font size=1 face=Courier><font size=1 face=Courier>[Object
nickname = Sun_Tut01
ids_name = 0
pos = 20000, 2000, 20000
ambient_color = 255, 255, 255
Archetype = sun_2000
ids_info = 0
star = med_white_sun
atmosphere_range = 11000
burn_color = 160, 222, 245

[zone
nickname = Zone_Tut01_sun_death
pos = 20000, 2000, 20000
shape = SPHERE
size = 10000
damage = 10000
sort = 99.500000
density = 0
relief_time = 0
population_additive = false

[LightSource
nickname = Tut01_System_LIGHT
pos = 642, 0, 198
color = 255, 255, 255
range = 120000
type = DIRECTIONAL
atten_curve = DYNAMIC_DIRECTION </font> </font></pre>
I think this is also self-explaining. Only addition is a lightsource.
I will explain lights in another tutorial.


------------------------------------------------------------------------------


A small addition to the tutorial above:
This is for NPCs and custom-factions, just a few details to extend our
knowledgebase.

Specifying cargo of faction NPCs
edit the file \DATA\EQUIPMENT\commodities_per_faction.ini

A typical entry looks like this:
<pre><font size=1 face=Courier><font size=1 face=Courier>[FactionGood
faction = gd_z_grp
MarketGood = commodity_alien_artifacts, 0, 0
MarketGood = commodity_alien_organisms, 0, 0
MarketGood = commodity_basic_alloys, 0, 0
MarketGood = commodity_consumer_goods, 0, 0
MarketGood = commodity_engine_components, 0, 0
MarketGood = commodity_fertilizers, 0, 0
MarketGood = commodity_food, 0, 0
MarketGood = commodity_H_fuel, 0, 0
MarketGood = commodity_optical_chips, , 0
MarketGood = commodity_optronics, , 0
MarketGood = commodity_oxygen, 0, 0
MarketGood = commodity_pharm, 0, 0
MarketGood = commodity_polymers, 0, 0
MarketGood = commodity_sidearms, 0, 0
MarketGood = commodity_water, 0, 0 </font> </font></pre>

I think its pretty self-explaining, but I don't know what the numbers mean.

Adding loot (in random missions) to ships that belong to custom factions
This will be dropped in addition to the usual loot (guns, equipment)
that is dropped by ships. This is also the reason why loot is a lot more than
with encounters.

edit the file \DATA\RANDOMMISSIONS\RMLootInfo.ini
A typical entry:
<pre><font size=1 face=Courier><font size=1 face=Courier>[RMBonusLoot
archetype = commodity_alien_organisms
num_to_drop = 1, 2
faction = co_shi_grp, co_be_grp, co_ti_grp, co_ss_grp, co_hsp_grp, co_nws_grp,
fc_c_grp, fc_ou_grp, fc_j_grp, fc_h_grp, fc_lr_grp, gd_gm_grp, gd_z_grp
difficulty_range = 6, 31
weight = 1 </font> </font></pre>

Entries are pretty self-explaining. num_to_drop and
difficulty_range are both min, max values. faction lists all
factions that carry this random cargo on missions.
weight is the probability that this type of loot is dropped, typical
values are 3 for batts/nanos, 5 for guns and 1 for commodities.


------------------------------------------------------------------------------

@Cyberion: pls review this one again and add what's missing
i can search the database backup for missing parts as well

If something is wrong or unclear, pls let me know.

- end of copy-paste

Fjord



Edited by - LordFjord on 11/18/2004 6:20:29 AM

Post Sat Nov 20, 2004 2:52 am

Can someone link me to a location that tells what the system names' identifyer are? I don't understand this BR_01 etc etc, what's it mean? Thanks!

Post Tue Nov 15, 2005 11:04 am

Let's save this great tutorial for future generations with a good, solid *BUMP*!

Return to Freelancer Editing Tutorial Forum