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** - Adding new infocards + dll for custom items

Here you find the different tutorials on editing and MODing Freelancer

Post Mon Jul 21, 2003 5:58 pm

**Tutorial** - Adding new infocards + dll for custom items

Version 1.2 by HFH_MACK 9-22-2003

This is a LENGTHY Tutorial part A and part B.
(Posted as a NEW Subject to Avoid LOTS of confusion) as Zen has asked me to finish the work and field the questions.)

It Details how to ADD a NEW SHIP to pittsburgh without having to remove any other ships and without Deleting another ship from the ID list. It explains how to add new IDs to the DLL file types and how to add new infocard descriptions without losing the original infocards of the template ship.

I would like to thank Pu_Raydo, Hans Olo, Dixi and Zen who have posted to the Lancers Reactor with much knowledge. Also to UNSETH who provided the basic formula for locating resources in the DLL and the Lancers Reactor... for sharing all this on the net.

YOU WILL NEED These Files located here:
http://lancersreactor.com/t/download/do ... asp?id=563
(and FLMM, and Bini.exe and wordpad and notepad or similar)

Please post your REPLIES to the forum HERE


Edited by - Chips on 10/31/2004 8:07:00 AM

Post Mon Jul 21, 2003 6:34 pm

TUTORIAL: ADD NEW items (SHIPS) + INFOCARD DLL without removing the old.

PART A by HFH_MACK (completed 7-21-2003), Revision 2 (9-22-03)

I would like to thank Pu_Raydo, Hans Olo, Dixi and Zen who have posted to the Lancers Reactor with much knowledge. Also to UNSETH who provided the basic formula for locating resources in the DLL and the Lancers Reactor... for sharing all this on the net.

*** This presumes you have reviewed most of the tutorials and have an ADVANCED understanding of modding and the dangers of modding ***
*** Send all flames to : yourself@youraddress_for_Not_Heeding_The_Warning ***
*** you take full responsibility for using any of these suggestions ***
*** I suggest creating a new mod folder using FLMM 1.2 and putting all the files that you plan on altering there so that the mod can be activated and deactivated ***

In order to use this Tutorial please obtain the programs:
FLMM1.2, ResHack, FLEd-ids or the flini referrer (flidref.exe), notepad, wordpad, and a Dec <----> Hex converter.

EDIT: links active at the time of writing below for the downloads may no longer exist. The downloads can be located here:
http://lancersreactor.com/t/download/do ... asp?id=563
(I will keep the original links posted for historical purposes)

This is a huge tutorial that delves into many areas. It is not a simple step by step guide to do only one thing... so be patient as you go through it. YOU MUST READ THE ENTIRE TUTORIAL (PART A) PRIOR TO PERFORMING IT...

***I have found that cutting and pasting from this screen (forum screen) MIGHT introduce buggy code... It is Probably better to always cut and paste from the original files... just to make sure. When I have done it the easy way... bugs creep in***

PURPOSE: Our purpose here is to use multiple methods to show how to Literally add new items to FreeLancer and thus to a DLL. This is NOT a COPY and ALTER MOD... this is a COPY and ADD Mod. We will NOT be altering ANY Original Equipment, ships or names of those items...
EDIT: (Except for those that use the Manhatten shortcut later in the tutorial which sells the Rhino II instead of the original Rhino)

We will USE original items to make the new stuff. Again... ALL the ORIGINAL stuff will be in the game UNCHANGED (except for those that opt for the shortcut).

To do that we will take the original Rhino template and make modifications to our template to make the Rhino II. In this mod we are not simply altering an existing ship. Rather we are keeping the original and adding a new ship... with a NEW ID and NEW INFOCARDS.

WHY Mess with the DLL?
Reason: This allows for addons without removing any of the original components.
and because FreeLancer uses them to store certain descriptions of things... such as ships, equipment etc... and without altering these DLLs we cannot "add" new ships with correct descriptions.

EDIT: There is a new program called FreeLancer IDS Generator that may be able to do this without altering the DLL here:
http://www.lancersreactor.com/t/downloa ... asp?id=551.
I have not tested this...
__________________________________________________________________
OK so make text versions of the .ini files using bini.exe or whatever...
then MAKE YOUR BACK UP OF THE FREELANCER DIRECTORY NOW!

Once that's done we can start:
EDIT: PLEASE NOTE THAT FLMM 1.2 is VERY FINICKY with its mod files...
YOU HAVE TO WORK WITH INACTIVATED MODS... Here's why you NEED a BACKUP:
1. If something is corrupted you can simply copy the lost files from the backup folder back to the original.
2. FLMM has a nasty habit... IT WILL DELETE MULTIPLE ORIGINAL FILES IF you DELETE a file from within a MOD... somtimes this can be repaired with restore.
WHEN you DELETE a FILE in a MOD in either the active or inactive state it will tell you that there is an error... regardless of whether or not the file is needed... one way around this is to copy the mod to another folder then choose Delete MOD in the FLMM then recopy the MOD back to the FLMM folder... This will allow the mod to work even though you have removed part of it. FLMM does not seem to care if you add or change files if they are inactive but you cannot DELETE a file unless you remove the mod completely... then close FLMM, restore the MOD and reload FLMM to bring it back... I guess this releases the file list that FLMM stores...


MOSTLY all of The Files will be placed in the mod folder:
USE FLMM 1.2 TOOLs and open your Mod Folder... In that create a folder called ADD_RhinoII.

ADD_RhinoII will eventually contain: DATA folder and EXE folder
DATA folder contains: EQUIPMENT folder, SHIPS folder, constants.ini
EQUIPMENT folder contains: goods.ini, market_ships.ini
SHIPS folder contains: shiparch.ini
EXE folder contains: freelancer.ini, infocards_new.dll, and nameresources.dll

GO ahead and make the above folders in your FLMM 1.2 mod folder and copy over the text version of all the .ini files and nameresources.dll to thier respective locations. DO NOT COPY THE INFOCARDS.DLL YET.
The only file above that cannot be copied over right now is the infocards_new.dll file. We will create/MODIFY that below.
Placing it in the directory now may result in failure.

*** WARNING: Do not make the mistake of modifying the original files... all of the changes I mention below should be done on the files within the ADD_RhinoII mod of FLMM. I cannot tell you how many hours will be wasted debugging... only to discover that you edited the original in its original folder hahaha (yea it happens)...
_______________________________________________________________________

DLL files contain the descriptions of the ships, equipment etc that appear in FreeLancer... When we make mods without editing these we cannot see our mods as they truly have been done. There are many DLL's. These are internally referenced by FL using a number for each DLL.
The freelancer.ini file usually at
C:\Program Files\Microsoft Games\Freelancer\EXE\freelancer.ini
references the DLLs.

Open the freelancer.ini and FIND the part that says
[Resources
DLL = InfoCards.dll ; Contains all infocard text resources
DLL = MiscText.dll ; Contains other bulk text resource: rumor, offer, and mission text
DLL = NameResources.dll ; Contains names of things, primarily
DLL = EquipResources.dll ;Contains names of equipment (in string table) and infocards for equipment (in HTML resources)
DLL = OfferBribeResources.dll ; Contains random mission offers and bribes
DLL = MiscTextInfo2.dll ;Contains MP UI elements as well as other misc. textDLL Numbers

Pu_Raydo points out that [Resources DLLs are iterated numerically as follows:
1 InfoCards.dll
2 MiscText.dll
3 NameResources.dll
4 EquipResources.dll
5 OfferBribeResources.dll
6 MiscTextInfo2.dll
***Meaning FreeLancer uses the #1 to reference InfoCards.dll and the #6 to reference MiscTextInfo2.dll***

(later we will add 7th DLL called infocards_new.dll but not right now)

UNSETH notes that changing the order of the original resources in this file will "mess" up FL.
Apparently... It is possible in the freelancer.ini to put your own resource DLLs in
the file to get a better overview. The DLL numbers will become logically
7,8, 9 etc.
Interestingly enough... FreeLancer HIDES its info in a formula.
(It appears this is native to the DLL itself)

So, I pause to digress about this...
If one looks here:
C:\Program Files\Microsoft Games\Freelancer\DATA\SHIPS\shiparch.ini

The shiparch.ini file contains a section labeled as follows:
[Ship
ids_name = 237035
...

***don't forget We cannot print the closing Bracket for [Ship }<----- should be here... but cannot due to the forum engine... please remember to close all brackets...***

USE your editor's "find" and locate 237035

This ids_name (237035) refers to a ship called "Rhino".
This can be determined several different ways.
One method is to use a previously known list of ship IDs. This method will only work if U have not changed any names. (and it won't really help us later on)

A BETTER method is a program by Dixi called FLEd-ids.exe.
To obtain a copy look here
http://hosted.nihilogic.dk/freelancer/fled-ids.zip
or try E-Mail [email protected]. (or as discussed earlier in downloads)

AND FINALLY the ever missing:
www.eyers.net/bryan/flidref.zip (flini referrer)

Since flini referrer has been unavailable for so long I chose to make this tutorial using Dixi's FLEd-ids prog. But I believe either one will do.

ALSO, one can MANUALLY determine this info without Dixi's program... it just requires much more work. Unfortunately I did not have dixi's program when I figured out this manual conversion. So GO GET IT. If U cannot get it... then make believe you are using it... to follow along, eventually U will get to the part where I explain how to manually do it.
To do this you will need a Decimal to Hexadecimal converter later in the tutorial...
I like HexBindc by live bat programming located at:
http://www.ticalc.org/archives/files/fi ... /7595.html

UNSETH has described a method on how the DLL resources are accessed here
http://www.ejoop.com/pcgames/fled/id_formula.asp

I use both methods (with modifications) herein.

To get it working: 1st you need to make a copy of the DLL file you will be modifying (NameResources.dll) and save it for back up. If U don't... then fry in your own mistakes or mine ( I will not be responsible).

OK... run the FLEd-ids.exe program...
Now in the box called game path put the exact path and directory to the game MOD. This is usually:
C:\Program Files\Freelancer Mod Manager\mods\ADD_RhinoII
(note sometimes when you 1st start the program it APPEARS to have the correct working directory but it does not... simply browse for the proper directory...
Next go to the SEARCH box.
YOU MUST Choose NameResources.dll from the dropdown list.
Just below that is an empty box... here U can type anything that you want to locate that might be in the NameResources.dll.
for example type:
anubis
click ids_name and this Will result in the following:
In the box labled ids_name / ids_info -----------------> 237041.

Since we started with the Rhino lets type:
Rhino
into the Search Box and click ids_name.
Now U will see 237035.

OK so... if U remember we already knew the ids_name for Rhino because we found it in the shiparch.ini file. What I am trying to demonstrate however is that given a specific name ,or even part of a name, this program can locate ids_names in a particular dll.
*** note that ids_name given here is really not the "NAME" but actually a NUMBER.***
*** Think of it as a reference to the ship name ***

Next... Look for the BOX called Resource extractor/editor. It has two fields ids_name and ids_info. It also has two click boxes next to each empty field labeled Get ids_name and Save ids_name and Get ids_info and save ids_info.
Take that number (237035) and put it in the ids_name field.
Click the Get ids_name box.
At the bottom of the program's window (in my version of the prog) you will see the following:
DLL #3 - NameResources.dll - Table 2527 - ResID 40427

THIS MEANS that NameResources.dll is the 3rd DLL listed in the [Resources section
and the information to be located is in Table 2527 at ResID 40427 of the DLL.
(of course we already knew NameResources.dll was DLL 3... but its nice to confirm this...)

How did the FLEd-ids do that calculation? Its a little complex...
It takes ids_name and it converts to HEX... as follows: 237035 ---> in HEX is 39DEB
Now if U do this U will see the Hex digits: H1,H2,H3,H4,H5 (see next line)
3 9 D E B
H1 H2 H3 H4 H5

where H1=3 ie the left most digit of the HEX conversion.
Ok... TAKE H2,H3,H4 ie 9DE and convert them BACK to Decimal...and add 1 ---> 2526+1
Therefore the TABLE is 2527... thus DEC(H2H3H4)+1 = Table # 2527

and Lastly... H2H3H4H5 and convert back to decimal ---> 40427
Thus ResID = 40427.

My advice is do the calculation once(or more) to understand it and then let FLEd-ids do the work for you....!

Therefore... The FLEd-ids program can convert the ids_name into the location in the DLL

Ok... so Now how do U go about SEEING this information in the actual DLL?
The first thing is you need a program that opens DLL files.
There are several out there... I found Resource Hacker (ResHack)...located here (slow but original site)
http://www.users.on.net/johnson/resourcehacker/
or
http://www.devhood.com/tools/tool_detai ... ool_id=420

There is a help file you should download as well.
Remember !!! Messing with DLL files can RUIN your system so be careful. BACK them up 1st.

Now that U have the program, go to:
C:\Program Files\Freelancer Mod Manager\mods\ADD_RhinoII\EXE\NameResources.dll
ok so COPY IT to another folder now for backup! (not in the MOD folder as it will mess up the mod)

ok now open the dll with Resource Hacker.
open the StringTable folder then scroll down and open the last numbered folder (should be 4075 for an unaltered dll) and then open the 1033 folder
You should see:
STRINGTABLE
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
65184, "Unknown Planet"
65185, "Alien Jump Gate"
65186, "The Hispania"
}

to add a new one just increase by the number by one and add the following line:
65187, "Rhino II"

so now it looks like this:
{
65184, "Unknown Planet"
65185, "Alien Jump Gate"
65186, "The Hispania"
65187, "Rhino II"
}
press the Compile Script button
then Save.

OK now MOVE the BACKUP that ResHack makes automatically out of the folder to somewhere where FLMM 1.2 can't see it... perhaps your desktop... or wherever...
You should now have a modified C:\Program Files\Freelancer Mod Manager\mods\ADD_RhinoII\EXE\NameResources.dll

*** I am not sure about this but I believe the MAX # of entries allowed for a given FOLDER is 16. Perhaps someone can help out here...(then I can edit the new info in here) Anyway... if U have more than 16 then I believe U need to make a new folder 4076 etc... and a new 1033 folder and put a new template... alas lets do that tutorial another time. Ok but at least we can add 12 more new items before that happens ***

Now go into
C:\Program Files\Freelancer Mod Manager\mods\ADD_RhinoII\DATA\SHIPS\Shiparch.ini
Look for 237035. This is the Original Rhino.

Here's what it looks like...

[Ship
ids_name = 237035
ids_info = 66573
ids_info1 = 66574
ids_info2 = 66608
ids_info3 = 66575
ship_class = 2
nickname = li_freighter
LODranges = 0, 80, 120, 200, 300, 1200
msg_id_prefix = gcs_refer_shiparch_Libf
mission_property = can_use_berths
type = FREIGHTER
DA_archetype = ships\liberty\li_freighter\li_freighter.cmp
material_library = ships\liberty\li_playerships.mat
material_library = fx\envmapbasic.mat
envmap_material = envmapbasic
cockpit = cockpits\liberty\l_freighter.ini
pilot_mesh = generic_pilot
nanobot_limit = 12
shield_battery_limit = 12
mass = 300.000000
linear_drag = 1.000000
hold_size = 80
fuse = intermed_damage_smallship01, 0.000000, 400
fuse = intermed_damage_smallship02, 0.000000, 200
fuse = intermed_damage_smallship03, 0.000000, 100
max_bank_angle = 15
camera_offset = 8, 45
camera_angular_acceleration = 0.035000
camera_horizontal_turn_angle = 20
camera_vertical_turn_up_angle = 5
camera_vertical_turn_down_angle = 20
camera_turn_look_ahead_slerp_amount = 1.000000
hit_pts = 1600
explosion_arch = explosion_li_freighter
surface_hit_effects = 0, small_hull_hit_light01, small_hull_hit_light02, small_hull_hit_light03
surface_hit_effects = 150, small_hull_hit_medium01, small_hull_hit_medium02, small_hull_hit_medium03
surface_hit_effects = 300, small_hull_hit_heavy01, small_hull_hit_heavy02, small_hull_hit_heavy03
nudge_force = 30000.000000
strafe_force = 20000
strafe_power_usage = 2
bay_door_anim = Sc_open baydoor
bay_doors_open_snd = cargo_doors_open
bay_doors_close_snd = cargo_doors_close
HP_bay_surface = HpBayDoor01
HP_bay_external = HpBayDoor02
HP_tractor_source = HpTractor_Source
num_exhaust_nozzles = 2
shield_link = l_freighter_shield01, HpMount, HpShield01
hp_type = hp_gun_special_3, HpWeapon01, HpWeapon02, HpWeapon03
hp_type = hp_gun_special_2, HpWeapon01, HpWeapon02, HpWeapon03
hp_type = hp_gun_special_1, HpWeapon01, HpWeapon02, HpWeapon03
hp_type = hp_freighter_shield_special_3, HpShield01
hp_type = hp_freighter_shield_special_2, HpShield01
hp_type = hp_freighter_shield_special_1, HpShield01
hp_type = hp_thruster, HpThruster01
hp_type = hp_mine_dropper, HpMine01
hp_type = hp_countermeasure_dropper, HpCM01
hp_type = hp_turret_special_3, HpTurret01, HpTurret02, HpTurret03, HpTurret04, HpTurret05
hp_type = hp_turret_special_2, HpTurret01, HpTurret02, HpTurret03, HpTurret04, HpTurret05
hp_type = hp_turret_special_1, HpTurret01, HpTurret02, HpTurret03, HpTurret04, HpTurret05
steering_torque = 54000.000000, 54000.000000, 104000.000000
angular_drag = 60000.000000, 60000.000000, 60000.000000
rotation_inertia = 16800.000000, 16800.000000, 16800.000000

[CollisionGroup
obj = li_starboard_sidepanel_lod1
separable = parent_impulse = 240.000000
child_impulse = 7.000000
debris_type = debris_small_ship
dmg_hp = DpStarboardsidepanel
dmg_obj = li_freighter_dmg_starboard_sidepanel_cap
separation_explosion = explosion_small_ship_breakoff
mass = 5.000000
type = Starboard_Side_Panel
hit_pts = 267
root_health_proxy = true

[CollisionGroup
obj = li_port_sidepanel_lod1
separable = parent_impulse = 240.000000
child_impulse = 7.000000
debris_type = debris_small_ship
dmg_hp = DpPortsidepanel
dmg_obj = li_freighter_dmg_port_sidepanel_cap
separation_explosion = explosion_small_ship_breakoff
mass = 5.000000
type = Port_Side_Panel
hit_pts = 267
root_health_proxy = true

[Simple
nickname = li_freighter_dmg_starboard_sidepanel_cap
DA_archetype = ships\liberty\li_freighter\li_freighter_dmg_starboard_sidepanel.3db
material_library = ships\liberty\li_playerships.mat
mass = 5.000000
LODranges = 0, 100, 1200

[Simple
nickname = li_freighter_dmg_port_sidepanel_cap
DA_archetype = ships\liberty\li_freighter\li_freighter_dmg_port_sidepanel.3db
material_library = ships\liberty\li_playerships.mat
mass = 5.000000
LODranges = 0, 100, 1200

OK SO COPY ALL OF THAT...(without cutting) and then paste it at the bottom of the SAME file.
So, for this Rhino II we want to make it better than the original Rhino in some fashion...

First go to the newly pasted section and change the ID from 237035 to 261795.

Ok Now how did we calculate that?
Specifically we take the new ResourceID 65187 and convert it to HEX. (use the converter).
This will give FEA3.
Now simply prefix that with the DLL number for the NamedResources which we know is 3.
----> 3FEA3. Convert 3FEA3 to Decimal.... -----> 261795.
(Yes, figuring that out was Soooooo much fun).
Another way to look at this conversion is The DLL # * 65536 + ResID in Decimal = 261795.
But In actuality we just use the FLEd-ids which will do the calculation for us...
Goto the box called ResID to ids_name/ids_info...
Choose NameResources.dll in the drop down menu and then type 65187 into the field...
Then click CONVERT... Bingo....261795.

OK BACK to Shiparch.ini and go to the bottom where we copied the rhino stuff...
Now we will modify some of Rhino II's stats...
look for these lines (Do not alter the original Rhino info, use your pasted copy)
[Ship
ids_name = 237035
nickname = li_freighter

and change it to:
[Ship
ids_name = 261795
nickname = li_freighter_II

and these lines (not all contiguous btw):
nanobot_limit = 12
shield_battery_limit = 12
mass = 300.000000
hold_size = 80
hit_pts = 1600

and change to:
nanobot_limit = 30
shield_battery_limit = 30
mass = 350.000000
hold_size = 120
hit_pts = 2000

and finally just after this line:
shield_link = l_freighter_shield01, HpMount, HpShield01
edit the section to look like this:
hp_type = hp_gun_special_5, HpWeapon01, HpWeapon02, HpWeapon03
hp_type = hp_gun_special_4, HpWeapon01, HpWeapon02, HpWeapon03
hp_type = hp_gun_special_3, HpWeapon01, HpWeapon02, HpWeapon03
hp_type = hp_gun_special_2, HpWeapon01, HpWeapon02, HpWeapon03
hp_type = hp_gun_special_1, HpWeapon01, HpWeapon02, HpWeapon03
hp_type = hp_freighter_shield_special_3, HpShield01
hp_type = hp_freighter_shield_special_2, HpShield01
hp_type = hp_freighter_shield_special_1, HpShield01
hp_type = hp_thruster, HpThruster01
hp_type = hp_mine_dropper, HpMine01
hp_type = hp_countermeasure_dropper, HpCM01
hp_type = hp_turret_special_5, HpTurret01, HpTurret02, HpTurret03, HpTurret04, HpTurret05
hp_type = hp_turret_special_4, HpTurret01, HpTurret02, HpTurret03, HpTurret04, HpTurret05
hp_type = hp_turret_special_3, HpTurret01, HpTurret02, HpTurret03, HpTurret04, HpTurret05
hp_type = hp_turret_special_2, HpTurret01, HpTurret02, HpTurret03, HpTurret04, HpTurret05
hp_type = hp_turret_special_1, HpTurret01, HpTurret02, HpTurret03, HpTurret04, HpTurret05
steering_torque = 54000.000000, 54000.000000, 104000.000000
angular_drag = 60000.000000, 60000.000000, 60000.000000
rotation_inertia = 16800.000000, 16800.000000, 16800.000000


OK SAVE IT.
We added:
hp_type = hp_gun_special_5, HpWeapon01, HpWeapon02, HpWeapon03
hp_type = hp_gun_special_4, HpWeapon01, HpWeapon02, HpWeapon03
which gives access to level 4 and level 5 gun weapons to Hardpoints 1,2,3.
and
hp_type = hp_turret_special_5, HpTurret01, HpTurret02, HpTurret03, HpTurret04, HpTurret05
hp_type = hp_turret_special_4, HpTurret01, HpTurret02, HpTurret03, HpTurret04, HpTurret05
which gives access to level 4 and level 5 turret weapons to Turret Hardpoints 1,2,3,4,5.
Also we are adding tonnage, and Hull strength... its only natural... since we are adding significant enhancements... its gonna fly a little slower...
(You of course can mod it ad nauseum... later)

But the ORIGINAL RHINO stuff remains as well.

Per Zen's Tutorial... Now that your ship is in the shiparch.ini we must add the relevant hull and engine for it
goto
C:\Program Files\Freelancer Mod Manager\mods\ADD_RhinoII\DATA\EQUIPMENT\goods.ini

The goods.ini folder holds information about the cost of items and references each item by a nickname. For Ships it also has a field called ship.
Look for the original Rhino nickname of li_freighter.

You should see:
[Good
nickname = lfr_hull
category = shiphull
ship = li_freighter
price = 7900
ids_name = 12002
item_icon = Equipment\models\commodities\nn_icons\li_freighter.3db

COPY THIS (without cutting)and PASTE to the end of the file with the follwing changes:
[Good
nickname = lfr_hull_II
category = shiphull
ship = li_freighter_II
price = 2900
ids_name = 12002
item_icon = Equipment\models\commodities\nn_icons\li_freighter.3db

We are making this item rediculously cheap so that when we get to Pittsburgh we can afford it... I recommend later that you make it roughly 1500-2000 more than the original rhino for balance...)

We have added a new nickname and ship but we are keeping the ids_Name = 12002 (Liberty Freighter Hull)

(I really don't know how this will affect our ship by keeping this hull... and since the new ship works fine with it I will leave it as is... perhaps I will edit this section later if I get more info)

OK... now search the goods.ini file for lfr_hull.
until you find

[Good
nickname = lfr_package
category = ship
hull = lfr_hull
addon = ge_lfr_engine_01, internal, 1
addon = li_freighter_power01, internal, 1
addon = ge_s_scanner_01, internal, 1
addon = ge_s_tractor_01, internal, 1
addon = shield01_mark01_fr, HpShield01, 1
addon = LargeWhiteSpecial, HpHeadlight, 1
addon = SlowSmallBlue, HpRunningLight01, 1
addon = SlowSmallBlue, HpRunningLight02, 1
addon = SlowSmallBlue, HpRunningLight03, 1
addon = SlowSmallBlue, HpRunningLight04, 1
addon = SlowSmallBlue, HpRunningLight05, 1
addon = SlowSmallBlue, HpRunningLight06, 1
addon = SlowSmallBlue, HpRunningLight07, 1
addon = contrail01, HpContrail01, 1
addon = contrail01, HpContrail02, 1
addon = DockingLightRedSmall, HpDockLight01, 1
addon = DockingLightRedSmall, HpDockLight02, 1

and copy (without cutting)and paste to the bottom of the same file the following:

[Good
nickname = lfr_package_II
category = ship
hull = lfr_hull_II
addon = ge_lfr_engine_01, internal, 1
addon = li_elite_power01, internal, 1
addon = ge_s_scanner_01, internal, 1
addon = ge_s_tractor_01, internal, 1
addon = shield01_mark01_fr, HpShield01, 1
addon = LargeWhiteSpecial, HpHeadlight, 1
addon = SlowSmallBlue, HpRunningLight01, 1
addon = SlowSmallBlue, HpRunningLight02, 1
addon = SlowSmallBlue, HpRunningLight03, 1
addon = SlowSmallBlue, HpRunningLight04, 1
addon = SlowSmallBlue, HpRunningLight05, 1
addon = SlowSmallBlue, HpRunningLight06, 1
addon = SlowSmallBlue, HpRunningLight07, 1
addon = contrail01, HpContrail01, 1
addon = contrail01, HpContrail02, 1
addon = DockingLightRedSmall, HpDockLight01, 1
addon = DockingLightRedSmall, HpDockLight02, 1

This step allows for the two ships to be treated differently with respect to the GEAR it starts out with...the only major change from our original:
nickname = lfr_package
...
hull = lfr_hull
and
addon = li_freighter_power01, internal, 1

was changed to:
nickname = lfr_package_II
...
hull = lfr_hull_II
and
addon = li_elite_power01, internal, 1

This basically allows the Rhino II to use the Liberty Elite Fighter Power Source... a nice upgrade... and needed because... we will be allowing the freighter to carry a higher class of weapons later in the tutorial.

Ok now (virtually) straight from Zen's Tutorial... we must add this NEW RHINO II to a place where we can PURCHASE it... as follows:

Per Zen... Most people add stuff to Manhatten, i prefer pitsburg as it only sells 1 ship be default.
*** There is a MAX of 3 ships allowed to be for sale at any 1 location... if U have more than 3... some will be lost ***
_________________________________________________________________
Ok so, Goto
C:\Program Files\Freelancer Mod Manager\mods\ADD_RhinoII\DATA\EQUIPMENT\Market_Ships.ini

Open Market_ships.ini and look for this :
For Manhatten : base = Li01_01_base
For Pittsburg : base = Li01_02_Base
when you find Li01_02_Base you will see the following :
code:

[BaseGood
base = Li01_02_base
marketgood = gf1_package, 0, -1, 0, 0, 1, 1, 1
marketgood = gf2_package, 4, -1, 0, 0, 1, 1, 1
marketgood = gf4_package, 13, -1, 0, 0, 1, 1, 1
marketgood = gf5_package, 24, -1, 0, 0, 1, 1, 1
marketgood = gf6_package, 30, -1, 0, 0, 1, 1, 1
marketgood = bwf_package, 4, -1, 0, 0, 1, 1, 1
marketgood = bwe_package, 20, -1, 0, 0, 1, 1, 1
marketgood = bwe2_package, 30, -1, 0, 0, 1, 1, 1
marketgood = bwfr_package, 10, -1, 0, 0, 1, 1, 1
marketgood = cof_package, 8, -1, 0, 0, 1, 1, 1
marketgood = coe_package, 28, -1, 0, 0, 1, 1, 1
marketgood = coe2_package, 32, -1, 0, 0, 1, 1, 1
marketgood = lf_package, 1, -1, 0, 0, 1, 1, 1
marketgood = le_package, 2, -1, 0, 0, 1, 1, 1
marketgood = lfr_package, 1, -1, 1, 1, 0, 1, 1
marketgood = bf_package, 6, -1, 0, 0, 1, 1, 1
marketgood = be_package, 8, -1, 0, 0, 1, 1, 1
marketgood = bfr_package, 4, -1, 0, 0, 1, 1, 1
marketgood = kf_package, 10, -1, 0, 0, 1, 1, 1
marketgood = ke_package, 13, -1, 0, 0, 1, 1, 1
marketgood = kfr_package, 10, -1, 0, 0, 1, 1, 1
marketgood = rf_package, 20, -1, 0, 0, 1, 1, 1
marketgood = re_package, 22, -1, 0, 0, 1, 1, 1
marketgood = rfr_package, 20, -1, 0, 0, 1, 1, 1
marketgood = pf_package, 2, -1, 0, 0, 1, 1, 1
marketgood = pe_package, 13, -1, 0, 0, 1, 1, 1
marketgood = pfr_package, 4, -1, 0, 0, 1, 1, 1
marketgood = bhf_package, 4, -1, 0, 0, 1, 1, 1
marketgood = bhe_package, 13, -1, 0, 0, 1, 1, 1
marketgood = bhe2_package, 26, -1, 0, 0, 1, 1, 1
marketgood = oe_package, 16, -1, 0, 0, 1, 1, 1


We need to add a line that will allow our ship to be sold... note that there is a specific format to this... (and unfortunately I don't know the exact format... if anyone knows more please post this...)

The format is:

marketgood = XXX_package, X1, X2, X3, X4, X5, X6, X7

where X1 = level required to buy ship (from 0 to whatever)
X2 = -1 (has to do with friendliness)
X3 = 0 or 1 (where 0 means NOT available and 1 means IS available)
X4 = 0 or 1 (don't know)
X5 = 0 or 1 (don't know)
X6 = 0 or 1 (don't know)

Ok so for all that we DO know... if we put
marketgood = lfr_package_II, 0, -1, 1, 1, 0, 1, 1
at the end of that section... we see
...
marketgood = bhe2_package, 26, -1, 0, 0, 1, 1, 1
marketgood = oe_package, 16, -1, 0, 0, 1, 1, 1
marketgood = lfr_package_II, 0, -1, 1, 1, 0, 1, 1

EDIT: changed above to allow purchase at level zero.
____________________________________________________________________
SHORTCUT EDIT: I have noticed that it takes an ENORMOUS AMOUNT OF TIME to GET TO PITTSBURGH... So...FOR THOSE WHO WANT TO FORGO THAT HUGE TRIP I HAVE ADDED THIS SHORTCUT
Goto C:\Program Files\Freelancer Mod Manager\mods\ADD_RhinoII\DATA\EQUIPMENT\Market_Ships.ini

Open Market_ships.ini and look for Manhatten (base = Li01_01_base)
remove the Original :
[BaseGood
base = Li01_01_base
marketgood = gf1_package, 0, -1, 0, 0, 1, 1, 1
marketgood = gf2_package, 4, -1, 1, 1, 0, 1, 1
marketgood = gf4_package, 13, -1, 0, 0, 1, 1, 1
marketgood = gf5_package, 24, -1, 0, 0, 1, 1, 1
marketgood = gf6_package, 30, -1, 0, 0, 1, 1, 1
marketgood = bwf_package, 4, -1, 0, 0, 1, 1, 1
marketgood = bwe_package, 20, -1, 0, 0, 1, 1, 1
marketgood = bwe2_package, 30, -1, 0, 0, 1, 1, 1
marketgood = bwfr_package, 10, -1, 0, 0, 1, 1, 1
marketgood = cof_package, 8, -1, 0, 0, 1, 1, 1
marketgood = coe_package, 28, -1, 0, 0, 1, 1, 1
marketgood = coe2_package, 32, -1, 0, 0, 1, 1, 1
marketgood = lf_package, 1, -1, 1, 1, 0, 1, 1
marketgood = le_package, 2, -1, 0, 0, 1, 1, 1
marketgood = lfr_package, 1, -1, 1, 1, 0, 1, 1
marketgood = bf_package, 6, -1, 0, 0, 1, 1, 1
marketgood = be_package, 8, -1, 0, 0, 1, 1, 1
marketgood = bfr_package, 4, -1, 0, 0, 1, 1, 1
marketgood = kf_package, 10, -1, 0, 0, 1, 1, 1
marketgood = ke_package, 13, -1, 0, 0, 1, 1, 1
marketgood = kfr_package, 10, -1, 0, 0, 1, 1, 1
marketgood = rf_package, 20, -1, 0, 0, 1, 1, 1
marketgood = re_package, 22, -1, 0, 0, 1, 1, 1
marketgood = rfr_package, 20, -1, 0, 0, 1, 1, 1
marketgood = pf_package, 2, -1, 0, 0, 1, 1, 1
marketgood = pe_package, 13, -1, 0, 0, 1, 1, 1
marketgood = pfr_package, 4, -1, 0, 0, 1, 1, 1
marketgood = bhf_package, 4, -1, 0, 0, 1, 1, 1
marketgood = bhe_package, 13, -1, 0, 0, 1, 1, 1
marketgood = bhe2_package, 26, -1, 0, 0, 1, 1, 1
marketgood = oe_package, 16, -1, 0, 0, 1, 1, 1

and replace it with:
[BaseGood
base = Li01_01_base
marketgood = gf1_package, 3, -1, 0, 0, 1, 1, 1
marketgood = gf2_package, 4, -1, 1, 1, 0, 1, 1
marketgood = gf4_package, 13, -1, 0, 0, 1, 1, 1
marketgood = gf5_package, 24, -1, 0, 0, 1, 1, 1
marketgood = gf6_package, 30, -1, 0, 0, 1, 1, 1
marketgood = bwf_package, 4, -1, 0, 0, 1, 1, 1
marketgood = bwe_package, 20, -1, 0, 0, 1, 1, 1
marketgood = bwe2_package, 30, -1, 0, 0, 1, 1, 1
marketgood = bwfr_package, 10, -1, 0, 0, 1, 1, 1
marketgood = cof_package, 8, -1, 0, 0, 1, 1, 1
marketgood = coe_package, 28, -1, 0, 0, 1, 1, 1
marketgood = coe2_package, 32, -1, 0, 0, 1, 1, 1
marketgood = lf_package, 1, -1, 1, 1, 0, 1, 1
marketgood = le_package, 2, -1, 0, 0, 1, 1, 1
marketgood = bf_package, 6, -1, 0, 0, 1, 1, 1
marketgood = be_package, 8, -1, 0, 0, 1, 1, 1
marketgood = bfr_package, 4, -1, 0, 0, 1, 1, 1
marketgood = kf_package, 10, -1, 0, 0, 1, 1, 1
marketgood = ke_package, 13, -1, 0, 0, 1, 1, 1
marketgood = kfr_package, 10, -1, 0, 0, 1, 1, 1
marketgood = rf_package, 20, -1, 0, 0, 1, 1, 1
marketgood = re_package, 22, -1, 0, 0, 1, 1, 1
marketgood = rfr_package, 20, -1, 0, 0, 1, 1, 1
marketgood = pf_package, 2, -1, 0, 0, 1, 1, 1
marketgood = pe_package, 13, -1, 0, 0, 1, 1, 1
marketgood = pfr_package, 4, -1, 0, 0, 1, 1, 1
marketgood = bhf_package, 4, -1, 0, 0, 1, 1, 1
marketgood = bhe_package, 13, -1, 0, 0, 1, 1, 1
marketgood = bhe2_package, 26, -1, 0, 0, 1, 1, 1
marketgood = oe_package, 16, -1, 0, 0, 1, 1, 1
marketgood = lfr_package_II, 0, -1, 1, 1, 0, 1, 1
Save it.

ok all we did was remove the original rhino from Manhattan:
marketgood = lfr_package, 1, -1, 1, 1, 0, 1, 1
and add
marketgood = lfr_package_II, 0, -1, 1, 1, 0, 1, 1

to manhattan solely for the purpose of showing you that Rhino_II exists...
(This is only for those who don't desire to wade thru the 15 minute clips EVERY time they need to redo some of the code during debugging... To Restore the Original Rhino back to Manhattan simply remove the Manahattan changes and re-paste the original manhattan code...)

__________________________________________________________________
We should see the Rhino II for sale in pittsburgh as well. (even without the shortcut)

Apparently... You can take the same SHIP and reference it to another package with say... different starting equipment... and offer it for sale elsewhere... or even in the same location.
_________________________________________________________________________________
OK So now goto FLMM 1.2 and open your mod folder... make sure all the folders are properly placed in any subfolders etc... For example... there should be a DATA and EXE folder inside. and these folders should contain those items (that were previously altered) in thier respective subfolders... Check to make sure the modifications are correct.
And now launch FreeLancer... If you are lucky you have a saved game somewhere at pittsburgh otherwise start fresh... and after like 15 mins of game play (hahaha) hopefully you can find PITTSBURGH... and U should see the Rhino II for Sale for dirt cheap... (or if you used the shortcut you can see it in Manhattan)
DON't BUY IT YET...
SAVE the GAME... Ok now Buy it.
Remember... we have not altered the Rhino II's infocards yet... so it APPEARS to have 80 cargo... and 12/12 bots/shields... but If you have the money... U can see that you can purchase 120 cargo items and 30/30 bot/shields and also your weapons last a few seconds longer if continuously fired.

Ok If this works for you ... Great. If not... then I am sorry... but do not send a bunch of posts about how it messed your system up... I cannot debug your system. If there are suggestions, typos, add-ons, or other things that would HELP the community plz let me know.
Ps... I don't do this professionally... this is a hobby. Lets Keep It fun.

NEXT: Tutorial PART B how to Make the Ship Have INFOCARDS that WORK!


Edited by - HFH_MACK on 22-09-2003 21:31:07

Post Mon Jul 21, 2003 6:35 pm

TUTORIAL: ADD NEW items (SHIPS) + INFOCARD DLL without removing the old.

PART B by HFH_MACK (completed 7-21-2003), REVISED (9-22-03)

I would like to thank Pu_Raydo, Hans Olo, Dixi and Zen who have posted to the Lancers Reactor with much knowledge. Also to UNSETH who provided the basic formula for locating resources in the DLL and the Lancers Reactor... for sharing all this on the net.


*** This presumes you have reviewed most of the tutorials and have an ADVANCED understanding of modding and the dangers of modding ***
*** Send all flames to : yourself@youraddress_for_Not_Heeding_The_Warning ***
*** you take full responsibility for using any of these suggestions ***
*** I suggest creating a new mod folder using FLMM 1.2 and putting all the files that you plan on altering there so that the mod can be activated and deactivated ***

PLEASE REVIEW PART A:

OK... so here is a quick overview of part A

1. IDENTIFIED the Rhino template ids_name = 237035
2. Used FLEd-ids to determine the Rhino DLL # = 3, DLL TABLE = 2527... and ResID = 40427.
3. Looked at the DLL info with the information using Resource Hacker (ResHACK)
4. ADDed to the NameResources.dll a line 65187 as shown...
STRINGTABLE
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
65184, "Unknown Planet"
65185, "Alien Jump Gate"
65186, "The Hispania"
65187, "Rhino II"
}

5. Copied the original Rhino template \DATA\SHIPS\Shiparch.ini using theoriginal rhino ID = 237035.
6. Pasted it back (without deleting the original) and modified the new pasted
version by changing the ID from 237035 to 261795.
7. Learned how we calculated the new ID 261795 by back calculating the recently added ResourceID 65187
8. Modified the Rhino II stats.
9. Copied the oringal goods.ini Rhino info and pasted with new nickname = lfr_hull_II
and new ship = li_freighter_II
10 Made it cheap by lowering the price..., added power upgrade etc... weapons upgrade..
11 ADDED NEW RHINO II to \DATA\EQUIPMENT\Market_Ships.ini at Pittsburg :
base = Li01_02_Base
12 Finally used FLMM 1.2 to test our mod and saw the Rhino II for sale... along WITH the ORIGINAL Rhino... BUT the Infocards STILL show the same STATS... even though they are not actually the same... as can be proven by purchasing 30 shields for Rhino II

AND NOW Tutorial PART B how to Make the Ship Have INFOCARDS that WORK!

OK First DOWNLOAD ZEN's InfoCards: He has made these templates to assist in making new infocards rather than making them from scratch... (You will need a program that decompresses .rar files....) The cards are currently located at
http://www.duwx.com/freelancer/zen_docs.rar
EDIT: now available here:
http://lancersreactor.com/t/download/do ... asp?id=563
At least now we have a permanent storage location locally.

Create a working folder in your desktop called "FL_Work"
(if you have the ORIGINAL ZEN infocards: Copy the INFOCARDS.exe into it... and run it.
(While it is possible to skip this step by simply copying from my paste below... You WILL need Zen's custom DLL later so go ahead and get it)
Those that download from the Forum will not need to run the Infocards.exe as they have already been extracted... and placed separately in the zip)

U will see the files Ra_ids_info.html, Ra_ids_info1.html, Ra_ids_info2.html, and Ra_ids_info3.html in the "FL_Work" folder.

We are going to rename them so that they MATCH thier FUTURE DLL home.
Rename Ra_ids_info.html as Rh_II_ids_info1.html
Rename Ra_ids_info1.html as Rh_II_ids_info2.html
Rename Ra_ids_info2.html as Rh_II_ids_info3.html
Rename Ra_ids_info3.html as Rh_II_ids_info4.html
*** notice I have renamed them to 1 higher number, the actual name does not really matter... I just numbered them different to match the folder numbers but they could have been named anything... as long as you remember which file goes to which folder in the DLL ***

Here we change the infocards...(4 cards)

INFOCARD1 = Description of ship when you click the inventory button both in space and when docked.
INFOCARD2 = Description of your ship STATS in space. (It is the condensed form of Infocards 3 & 4)
INFOCARD3 = Description of the STATS NAMES that appear just to the right while docked...further to right is where the infocard 4 is displayed... You should make Infocard3 and Infocard4 ALIGN so that the STATS Description matches the Stats numbers...
INFOCARD4 = Description of STATS Numbers that appear on the right most side when docked.

(of course later you can mod these to say whatever you want)

RIGHT CLICK Rh_II_ids_info1.html and choose "open with" and select WORDPAD ( Unicode compliant is a must)...(not notepad)
You should now see the original Ra info card template made by Zen...
Delete the contents... and put this in:
<?xml version="1.0" encoding="UTF-16"?>
<RDL>
<PUSH/>
<TEXT> </TEXT>
<PARA/>
<TRA data="1" mask="1" def="-2"/>
<JUST loc="center"/>
<TEXT>Stats</TEXT>
<PARA/>
<TRA data="0" mask="1" def="-1"/>
<JUST loc="left"/>
<TEXT> </TEXT>
<PARA/>
<TEXT>Guns/Turrets: 3/5</TEXT>
<PARA/>
<TEXT>Armor: 2000</TEXT>
<PARA/>
<TEXT>Cargo Holds: 120</TEXT>
<PARA/>
<TEXT>Max Batteries/NanoBots: 30/30</TEXT>
<PARA/>
<TEXT>Optimal Weapon Class: 3</TEXT>
<PARA/>
<TEXT>Max. Weapon Class: 5</TEXT>
<PARA/>
<TEXT>Additional Equipment: M, CM</TEXT>
<PARA/>
<PARA/>
<POP/>
</RDL>

SAVE IT.

Now for the next infocard...
RIGHT CLICK Rh_II_ids_info2.html and choose open with... and select WORDPAD...
delete the contents and put in:
<?xml version="1.0" encoding="UTF-16"?>
<RDL>
<PUSH/>
<TRA data="1" mask="1" def="-2"/>
<JUST loc="center"/>
<TEXT>The Enhanced "Rhino II".</TEXT>
<PARA/>
<TRA data="0" mask="1" def="-1"/>
<JUST loc="left"/>
<TEXT>Liberty Industries enhanced the "Rhino II" with additional hull plating, an elite fighter power core, larger cargo space, and greater repair reserves.</TEXT>
<PARA/>
<TEXT>The resulting "Rhino II" is a formidable Freighter, albeit slightly more cumbersome than the Original Rhino due to the added tonnage.</TEXT>
<PARA/><PARA/>
<TEXT>This ship is truly a Combat Freighter and well worth the price.</TEXT>
<PARA/><PARA/>
<TEXT></TEXT>
<PARA/>
<POP/>
</RDL>

SAVE IT

Now for the next infocard...
RIGHT CLICK Rh_II_ids_info3.html and choose open with... and select WORDPAD...
CONFIRM IT LOOKS LIKE THIS:
<?xml version="1.0" encoding="UTF-16"?>
<RDL>
<PUSH/>
<TRA data="1" mask="1" def="-2"/>
<TEXT>Stats</TEXT>
<PARA/>
<TRA data="0" mask="1" def="-1"/>
<TEXT> </TEXT>
<PARA/>
<TEXT>Guns/Turrets</TEXT>
<PARA/>
<TEXT>Armor:</TEXT>
<PARA/>
<TEXT>Cargo Holds:</TEXT>
<PARA/>
<TEXT>Max Batteries/NanoBots:</TEXT>
<PARA/>
<TEXT>Optimal Weapon Class:</TEXT>
<PARA/>
<TEXT>Max. Weapon Class:</TEXT>
<PARA/>
<TEXT>Additional Equipment: </TEXT>
<PARA/>
<POP/>
</RDL>

It probably does and therefore you won't need to change anything.

and finally the last infocard...
RIGHT CLICK Rh_II_ids_info4.html and choose open with... and select WORDPAD...
delete the contents and put in:
<?xml version="1.0" encoding="UTF-16"?>
<RDL>
<PUSH/>
<TEXT> </TEXT>
<PARA/>
<TEXT> </TEXT>
<PARA/>
<TEXT>3/5</TEXT>
<PARA/>
<TEXT>2000</TEXT>
<PARA/>
<TEXT>120</TEXT>
<PARA/>
<TEXT>30/30</TEXT>
<PARA/>
<TEXT>3</TEXT>
<PARA/>
<TEXT>5</TEXT>
<PARA/>
<TEXT>M, CM</TEXT>
<PARA/>
<POP/>
</RDL>

SAVE IT.

OK so now you have updated the DESCRIPTIONS of the Rhino II... but You still need to get them into a FreeLancer DLL... Zen has done some work for us here by deleting an entire infocard.dll template and leaving only 1 set of entries...as a starter...
I strongly recommend using it. I refer you to his description of the infocard DLL mechanics to enhance your knowledge...

ok so open his tutorial download and find \freelancer modding s h i t\dll info working
please note that as Zen has put the word S H I T (without the spaces) in the directory... you might have to use some... well editing...
ok... so copy the infocards_new.dll into your FL_Work folder.
(again those that have downloaded from within the forum will not have to do the above step... as infocards_new.dll has been placed in the zip. Simply extract it form the zip)

Now... open infocards_new.dll with ResHack.
You will see a folder called Version Info and a folder called 23.
Open the 23 folder. You will see 4 folders labeled 1, 2, 3, and 4.
Open folder 1. Click 1033. Now Right Click 1033. Choose REPLACE RESOURCE.
A Popup appears... click the Open File with new resource button....
goto to your FL_Work folder and click Rh_II_ids_info1.html
Click OPEN.
You will now see a Replace a resource Pop Up...
In Resource Type field: put 23
In Resource Name: put 1
In Resource Language: put 1033
Then Click Replace...

Open folder 2. Click 1033. Now Right Click 1033. Choose REPLACE RESOURCE.
A Popup appears... click the Open File with new resource button....
goto to your FL_Work folder and click Rh_II_ids_info2.html
Click OPEN.
You will now see a Replace a resource Pop Up...
In Resource Type field: put 23
In Resource Name: put 2
In Resource Language: put 1033
Then Click Replace...

*** note the only thing we have done is add 1 to the Resource Name ***

Now goto folder #3... repeat the same using Rh_II_ids_info3.html
except for the Resource Name put 3
the rest is the same...
Do this same pattern Rh_II_ids_info4.html

Choose file/save and SAVE IT.

______________________________________________________________

Ok... SO now we have a infocards_new.dll with NEW descriptions of the Rhino II.
Confirm this by re-opening the infocards_new.dll and looking at the text with the folders 1-4. It should show the modifications. If it does not... then Repeat the process and make sure you save it...
Clearly more info cards for other ships can made using the same pattern.. simply add 1 each time... (until 16 then I believe you have to make a new containing folder)

Now we have to NOTIFY FreeLancer... that this DLL exists...
so...

Copy the newly altered dll from FL_Work into:
C:\Program Files\Freelancer Mod Manager\mods\ADD_RhinoII \EXE
Copy freelancer.ini to the EXE directory of your Mod Folder if not already done.
and Open freelancer.ini

LOOK FOR:
[Resources
DLL = InfoCards.dll ; Contains all infocard text resources
DLL = MiscText.dll ; Contains other bulk text resource: rumor, offer, and mission text
DLL = NameResources.dll ; Contains names of things, primarily.
DLL = EquipResources.dll ;Contains names of equipment (in string table) and infocards for equipment (in HTML resources)
DLL = OfferBribeResources.dll ; Contains random mission offers and bribes
DLL = MiscTextInfo2.dll ;Contains MP UI elements as well as other misc. text

Ok ... add the following line just below the DLL = MiscTextInfo2.dll line...
DLL = infocards_new.dll ; Contains our CUSTOM InfoCards...

(dont forget the space after the dll that separates the semicolon...)

now Save it...

OK now we must get the ResID Numbers for our new entries...
RUN FLEd-ids
To get FLEd-ids to convert this for us goto GAME PATH.
C:\Program Files\Freelancer Mod Manager\mods\ADD_RhinoII

Goto ResID to ids_name/ids_info and choose infocards_new.dll
(not infocards.dll)
In the field RESOURCE ID: enter 1 (for folder #1 of our new infocard DLL)
Click Convert.
You will see 458753 in the output box.
Copy that and paste it into the Resource extractor/editor... ids_name field and click Get ids_name. In the bottom of the program output window... you should see:
DLL #7 - infocards_new.dll - Table 1 - ResID 1
Now put 458753 into the Resource extractor/editor... ids_info field and click Get ids_info.

you will see:
<?xml version="1.0" encoding="UTF-16"?>
<RDL>
<PUSH/>
<TEXT> </TEXT>
<PARA/>
<TRA data="1" mask="1" def="-2"/>
<JUST loc="center"/>
<TEXT>Stats</TEXT>
<PARA/>
<TRA data="0" mask="1" def="-1"/>
<JUST loc="left"/>
<TEXT></TEXT>
<PARA/>
<TEXT>Guns/Turrets: 3/5</TEXT>
<PARA/>
<TEXT>Armor: 2000</TEXT>
<PARA/>
<TEXT>Cargo Holds: 120</TEXT>
<PARA/>
<TEXT>Max Batteries/NanoBots: 30/30</TEXT>
<PARA/>
<TEXT>Optimal Weapon Class: 3</TEXT>
<PARA/>
<TEXT>Max. Weapon Class: 5</TEXT>
<PARA/>
<TEXT>Additional Equipment: M, CM</TEXT>
<PARA/>
<PARA/>
<POP/>
</RDL>

and the outpute window at the bottom will show:
DLL #7 - infocards_new.dll - ResID 1

This confirms that our infocard is there.
By entering a 2,3,4 respectively FLEd-ids will calculate the id for each new infocard.

I will show you how to get the information manually...

The infocards DLL info looks different from the NameResources.dll info.

The formula for infocards_new.dll will be the same as for infocards.dll.
It is simply (DLL # * 65536) + N
where N = The Folder # of the XML information in the infocards_new.dll

For example
Lets determine the ID # for infocards_new.dll (DLL #7) for folder #1 which contains a description of the Rhino II :

The ID for the 1st infocard is:
7 * 65536 (in decimal) + The folder # 1
--->458752+1 = 458753

The ID for the 2nd infocard is:
is 7 * 65536 (in decimal) + The folder # 2
---> 458752+2 = 458754

for the 3rd infocard it is:
---> 458752+3 = 458755

and the 4th infocard it is:
---> 458752+4 = 458756

(once we reach the 16 th entry we may have adjust the formula for the containing folder... alas that may have to be another tutorial)

My list ends up as follows:
Rh_II_ids_info1.html in DLL 7, Table 23, Folder 1---> ID 458753
Rh_II_ids_info2.html in DLL 7, Table 23, Folder 2---> ID 458754
Rh_II_ids_info3.html in DLL 7, Table 23, Folder 3---> ID 458755
Rh_II_ids_info4.html in DLL 7, Table 23, Folder 4---> ID 458756

Ok... so as U see once you get your initial value... its just a matter of adding the folder number... to get the ID...

I am putting Zen's (edited) wording here in regards to the ADDITION of more infocards:
__________________________________________________________________
remember this formula if you want to add more than a few infocards to the game.
ResID = "1-15"
Table = 1
DLL = 7
ResID = "16-31"
Table = 2
DLL = 7
ResID = "32-47"
Table = 3
DLL = 7
ResID = "48-63"
Table = 4
DLL = 7
If you notice this is a basic hex addition 1-15 = 1-F in hex everytime to pass this it adds 1 to the table below and so on.
ResID = "256 - 271"
Table = 17
DLL = 7
ResID = "272-286"
Table = 18
DLL = 7
Thought i would add that for those who were stuck with this one
p/s - This way of refrencing works in exactly the same way as the ids_name for each infocard (ids_info) is the same as each entry in the string table data for the ids_name.
______________________________________________________________________________

OK LASTLY...
open your modified shiparch.ini
search for 261795
which is the id for our Rhino II.

You will see
[Ship
ids_name = 261795
ids_info = 66573
ids_info1 = 66574
ids_info2 = 66608
ids_info3 = 66575

change this to:
[Ship
ids_name = 261795
ids_info = 458753
ids_info1 = 458754
ids_info2 = 458755
ids_info3 = 458756

SAVE IT.

Now goto FLMM 1.2 and open your mod folder... make sure all the folders are properly placed in any subfolders etc... For example... there should be a DATA and EXE folder inside. and these folders should contain those items (that were previously altered) in thier respective subfolders...
ACTIVATE your mod...
And now launch FreeLancer...Hopefully you can find PITTSBURGH... and U should see the Rhino II for Sale alongside the original rhino.
You created NEW Rhino II's infocards... and this should show the Rhino II to have 120 cargo... and 30/30 bots/shields... etc... with the new description.

(Also to be true to our word those who removed the original rhino on manhattan should should go ahead and restore the Manhattan Rhino and make sure Rhino II is on Pittsburgh)

AND FINALLY ONE LAST WORD:
I have reviewed this Tutorial MULTIPLE TIMES to make sure it works... and sadly... I have encountered Numerous WIERD glitches... which I must attribute to FLMM which sometimes deletes files and also to the unknown... for example 1 time I was completely unable to get the infocards_new.dll to work at all but on a repeat attempt it worked fine. I can only guess that even a small deviation from the exact method can result in failure... Be assured that I have succesfully created these WORKING infocards several times now... from scratch.

I do hope this works for you ... If not... then I am sorry... but do not send a bunch of posts about how it messed your system up... I cannot debug your system. If there are suggestions, typos, add-ons, or other things that would HELP the community plz let me know.
Remember... Lets Keep It fun.



Edited by - HFH_MACK on 22-09-2003 21:45:00

Post Thu Jul 24, 2003 3:31 pm

excellent tutorial!

Post Thu Jul 24, 2003 7:35 pm

Just a quick point. FLMM 1.2 contains a command to add resources in your script. For example:

ids_name = 0 ;GENERATESTRRES("Javelin Turret"

adds a normal string resource with the string =Javelin Turret and assigns the id number for you. You do a similar thing for XML resources but with the GENERATEXMLRES(...).

Why not use this instead of having to create your own dll? I for one find it much easier.

Post Fri Jul 25, 2003 7:29 pm

I would love to... I searched everywhere for Instructions on how to use FLMM 1.2 but since I could not ever find any I winged it...
Can U point me to somewhere that has a good tutorial or forum on that...?
Thanks.

Post Fri Aug 22, 2003 1:45 am

Excellent tutorial, well done with plenty of detail!
In part B you said you needed Zen's infocards. Well I have gone to his website and it seems I can't access them. So is there a link anywhere else for them, or can I get a dll template from somewhere else. That's basically what I need and if I understand the use of the Zen's infocards, that's the purpose of having them. If there is another way of creating new infocards or adding new string tables, please let me know.

Post Mon Sep 01, 2003 11:44 pm

I am working on placing them in the FL Download section. I have submitted them and hope they are placed there soon.
Edit... I attempted to upload but its not working... I have E-mailed the Admin.

There is another way to get what you want...
It requires copying the DLL and renaming it then Manually Removing the entries until you are left with a BAREBONES .dll (thats how Zen did it).
I have not done it this way but I suspect it would be done as follows:
Copy the .dll and rename it as per the tutorial then follow the tutorial just as it says and replace the resources then delete ALL the remaining resources that you have not replaced... ( I think that might be easier)... however I have not personally used this method and cannot say that it would work for sure. Its work intensive meaning it would require over 1000 manual resource deletions... (ie it might take a while... maybe a few seconds for each deletion.)

As soon as I can get the DLLs uploaded I will post an update.
EDIT: YES THE FILES NEEDED ARE NOW HERE:
http://lancersreactor.com/t/download/do ... asp?id=563
Just un Zip and Gooooo

{HFH}MACK


Edited by - HFH_MACK on 22-09-2003 21:51:03

Post Sat Sep 06, 2003 2:17 pm

Well - I followed this step by tedious step and not only did it crash the server but it deleted my entire mod too.
The console had an error dealing with an archetype.
What went wrong????

Post Sun Sep 07, 2003 10:40 am

TUTORIAL ON HOW TO FIX YOUR SYSTEM AFTER THIS TUTORIAL SCREWS IT UP

I finally fixed my copy of Freelancer after attempting this tutorial - but at a high price. The author wasn't kidding about the warning folks - so DO NOT ATTEMPT THIS TUTORIAL UNLESS YOU ARE WILLING TO DO THE FOLLOWING:

1) Uninstall Freelancer
2) Uninstall FLMM and all your mods
3) Uninstall your server operator
2) Uninstall FL Ship Studio (ResHack - Ship Studio - Bini) Had to delete the entire folder
3) Uninstall Freelancer Explorer - including the C runtime components extracted to Windows/System32 folder - Did not uninstall correctly - had to delete entire Freelancer explorer folder. - Deleted the following files from Windows/System 32
- ANSI_FOR_WIN98 (folder) - atl71.dll - MFC71.dll - MFC71u.dll - msvcp71.dll - msvcr71.dll
4) Delete Freelancer folder from My Documents/My Games - (save data for both MP and SP)
5) Wipe Freelancer server registry keys
(Start menu - run - regedit - hkey_current_user - software - microsoft - FLSERVER <-(delete this one))
6) Reinstalled freelancer / problem solved.

Note that a system restore (WinXP) will not help solve the problem as it is one of the 1st things attempted.
Also note that doing all of these things to correct a problem is only one step short of having to do a full windows reinstall since every FL component had to be expelled before reinstalling.
-Edited to reflect accurate registry key deletion method. - Delete FLSERVER key folder ONLY!
- Edited to correct typo in step #3

Edited by - SmokeRingHalo on 07-09-2003 11:44:33

Edited by - SmokeRingHalo on 07-09-2003 11:49:10

Post Sun Sep 21, 2003 2:56 am

Sorry to hear that... it is very daunting to say the least all that U had to go thru... Backing up the originals is critical!
So, Having run this myself and knowing it works on the Single PLayer I would put a warning out to those trying to make it work on a server to be careful.
Also, it is clear from what you have mentioned that you some how corrupted your FreeLancer files... This could be avoided by making sure not to perform any changes on your original files... and only work from within the Mod... however... remember that you should not work within an ACTIVATED mod... as it messes it up. So all work should be done in inactivated state... be sure to move any DLL backups that RESHACK creates in your mod folder (it makes backups automatically)... Then when done activate the mod...
If something goes wrong... deactivate it. Remember modifying, adding, or deleting files in an ACTIVATED MOD will really screw things up. I believe there is also a restore originals option in FLMM... however just to be extra careful you may want to create an extra backup of the originals in a separate folder as FLMM sometimes fails to restore...

EDIT: PS... I have experienced similar problems... using mods... and by replacing the files that the mod alters in the original FL directory with the backed up ORIGINAL (yea U know the one your supposed to make hehehe) I was able to fix the problem. I eventually discovered I made a typo in my mod that caused the crash... but upon fixing that it went fine.

Edited by - HFH_MACK on 21-09-2003 20:57:10

Edited by - HFH_MACK on 24-10-2003 19:57:21

Post Tue Sep 23, 2003 3:22 pm

I would also like to extend my gratitude for this tutorial. Great work!
But one thing puzzles me a little. I am in the progress of modding Freelancer for several month now (adding new ships as i make them in Milkshape, as well as some from the various released mods here on TLR, adding weapons, equipment ect.) and not once ran into trouble. It should be noted that I do everything manually, not with FLMM and consorts. It may take longer, but I have far greater control. Also, I use MS Visual .NET Corporate Edition for .dll editing/making, not ResHack. Is that really that much of a difference? I am quite surprised, really. Or maybe it's just me and my dumb luck... ^_^" Anyways, thanks again. It's always great to see such tutorials.

T448

Post Tue Sep 23, 2003 11:11 pm

You are indeed fortunate! Never to get any problems... heheheh... well don't mess with success! I hope you make backups though.

The FLMM is a neat program tho. ( I am not doing it justice here...) but essentially it keeps your MODS organized into folders and allows you to activate 1 or more Mods at a time... and deactivate as well... it also has some ability to check whether or not a MOD is compatible with another. One of the down sides to it, is that occasionally it does not properly copy or delete a file or files... most often this occurs when altering files in the ACTIVE MOD'S Folder or deleting ANY files from either active or inactive mods...
In regards to using MS visual .NET I believe that ANY resource editor will work... some better than others... ResHack was chosen because its FREE... (ahhhh)
{HFH}MACK

Edited by - HFH_MACK on 01-10-2003 19:01:11

Post Mon Jan 05, 2004 7:33 am

Ha Zens old tutorial.

Excellent. I thought we had lost it.

Here is a empty dll to add all that stuff and in the archive is Zens xml docs above too.

http://www.respawn.co.uk/modules.php?na ... tit&lid=21

Great work bud

Giskard

Post Mon Jan 05, 2004 2:19 pm

Wow.... And here I thought this thread had died.... and gone to.... well you know where all those dead threads go...
hehehe
Thanks... there is a bunch of files in the DOWNLOAD section that also include (I believe) Zen's empty DLL... and XML stuff.... its all Zipped up...
But having extras won't hurt.
This Thread has been Inactive for So long... If anyone really needs to get a hold of me.... EMAIL me at [email protected]
PLEASE INCLUDE IN THE SUBJECT: FREELANCER
Otherwise I might delete the E-mail for spam...
MACK

Return to Freelancer Editing Tutorial Forum