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 *** Player mountable cargopod economy

Here you find the different tutorials on editing and MODing Freelancer

Post Tue May 02, 2006 6:59 pm

*** Tutorial *** Player mountable cargopod economy

I've been playing about with getting the utility ships working for players and after a bit of playtesting. I think I've got it pretty much sorted. I thought i might post up a tutorial as i haven't done one for ages.
What this tutorial covers
1. It briefly covers getting ships like the transport working for players
2. It covers creating a new shield class for cargo pods and mounting them to player ships
3. Covers the market side of things and a couple of extra things i've added

Getting the Transport flyable
I'm pretty sure this sort of thing has been covered before so i'm not going to go into too much detail here. I did hit a few bumps along the way, which i'll name here in case other people hit them too.
The transport is pretty much flyable as it is from the original game. The main problem is the knackered viewpoint and it behaves really badly.
So, the first thing you need to do is change the view point of the normal view.
This is from SDK:
nickname = ge_transport
..
mission_property = can_use_med_moors
..
type = TRANSPORT
DA_archetype = ships\utility\transport_small\transport_small.cmp
..
mass = 500.000000
hold_size = 1000000
explosion_arch = explosion_instant
..
hp_type = hp_turret, HpTurret_U1_01, HpTurret_U1_02, HpTurret_U1_03, HpTurret_U1_04, HpTurret_U3_01
hp_type = hp_cargo_pod, HpCargo01, HpCargo02
..
HP_bay_surface = HpRunningLight08
HP_bay_external = HpMount
HP_tractor_source = HpTractor_Source
num_exhaust_nozzles = 1
hit_pts = 3000

As the ship was never meant to be flyable it doen't have the:

camera_offset = 13, 62
camera_angular_acceleration = 0.025000
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

That the other ships have, though for some reason it does have the HpTurret type references. Not quite sure why they are in there , but there you go. By adding these to the file it backs off a bit and gives you a better view of the ship. Next is the turret view. I've got to admit here that i cheated and refered all of my capitals to a cockpit file made by mancer, used along side his ships.
If you don't have it create a custom one with this in it:
[Cockpit<--close
mesh = COCKPITS\RHEINLAND\MODELS\rh_freighter_cockpit.cmp
int_brightness = 0.500000
head_turn = 40, 15
[CockpitCamera<--close
[TurretCamera<--close
tether = 0.000000, 25, 180
yaw_rotate_speed = 2.000000
pitch_rotate_speed = 1.500000
accel_speed = 5
Right so you can see you ship ok, but it steers really badly. Something like a lopsided brick which has an annoying habit of trying to roll over. After about an hour of playing around with various steering values i found out you just change
type = TRANSPORT
for
type = FREIGHTER
.. and everything works ok.. (how annoying, but there you go).

Next bit is going through utility weapons

Edited by - M-A-C-E_166 on 5/3/2006 3:48:29 AM

Post Tue May 02, 2006 7:27 pm

Right, so the file has these:
hp_type = hp_turret, HpTurret_U1_01, HpTurret_U1_02, HpTurret_U1_03, HpTurret_U1_04, HpTurret_U3_01
hp_type = hp_cargo_pod, HpCargo01, HpCargo02
The HpTurret class is unique and is only for (normally) unflyable ships. Instead, i'm going to keep that for weapons i don't want people to remove and going to use hp_type = hp_turret_special_1 for both light transports (like the repair ship and lifter) and hp_type = hp_turret_special_10 for heavy transports, gunboats and cruisers. I'm not going to go into battleships, but its all the same.
So, the next step is to go through weapon_equip and use file_replace to change any:
hp_type = hp_turret_special_1 entries with hp_type = hp_turret_special_2
instaed. There isn't any class 10 turrets in the game, unless you've added them. In which case i'm sure you can play around and choose the best way for your mod.
So, we've got two turrets that are assigned to transports only and we need to get rid of all of the other references to hp_turret_special_1 or hp_turret_special_10 from shiparch so that players can't mount their weapons. When thats all done, we do need to add to the transport entries:
hp_type = hp_turret_special_10, HpTurret_U1_01, HpTurret_U1_02, HpTurret_U1_03, HpTurret_U1_04, HpTurret_U3_01
hp_type = hp_turret_special_1, HpTurret_U1_01, HpTurret_U1_02, HpTurret_U1_03, HpTurret_U1_04, HpTurret_U3_01
Also , if i remember the transport has 5 nozzles not 1 but if you add them all it shows up when in cockpit mode. I just added 3 instead so all of the rear ones are visable.
I copied the ships/utility folder to a custom folder and added hardpoints for extra equipment, shields, countermeasures. But its up to you. I'm not going to get too side tracked as i want to get on to cargo pods today.
I did find though that the fuse might be a bit off. It tends to blow up before you run out of armour. Also, depending on if you have:
root_health_proxy = true
on, you might want to change it for the transport as the engine gets blown off and the ship dies far too easy. If you make it root_health_proxy = false and increase the armour of the archetype to the same as the ship it would be more friendly. Oh, thats another thing, the stock transport has an armour value of 3000 as standard. Thats pretty rubbish but , it relies on armour scaling to increase it to a fair level. This will depend on if you have buyable armour on your mod, but i'd be tempted to give it about 18500 instead. You will also need to limit bots and batts. The cargo hold of a million is just not happening either. I've set mine to 800, which alongside the cargopods, makes for a decent profit for non-combateers.
Well, thats about all shiparch side. I'll go into getting the ship buyable later.
The next step is to go through weapon_equip and weapon_goods and sort out the abilities of the transport weapons. Give the hp_turret_special_1 to the ones that you want mountable, along with the hp_turret_special_10's and you'll need to adjust the abilities as they are shockingly rubbish. For mine i used a simple formula:
hp_turret_special_1's have class 5, class 6 and class 7 for
co_transport_turret01_mark01 --> mark03
hp_turret_special_10's have class 6, class 7 and class 8 for
co_transport_turret02_mark01 --> mark03
hp_turret_special_10's have class 7, class 8 and class 9 for
co_train_turret01_mark01 --> mark03
It really is up to you just match the abilities of the weapon to a new cost in weapon_goods. I tend to charge them a bit more too, maybe 150% normal cost.
Next bit covers new classes in reshack

Post Tue May 02, 2006 8:10 pm

So, so far we've fixed the transport, fixed transport weapons, got them mountable to only specific ships. Next bit is to change the name of the turret class. You don't rally have to, turret class 1 or 10 is perfectly fine, but it is very easy and i think it looks better.
Open up reshack, choose resources.dll (making sure you've backed up before hand) and do a search for "Turret-Class 1" (its at 109)
Then just type in the new text and when you've finished choose compile script and save.
We'll be using reshack again later, but remember to copy the updated file into your mods exe folder. Its easy to forget as it dosen't change the modified time.
Cargopods
The whole ida of this is have mountable cargpods that are used as a commodity and are transfered from base to base. In reality, the whole adding a cargopod to a ship is normally controlled by the behaviour = trade. It assigns the right type of pod for the right commodity for npcs. So, we have to cheat..
Instead, they are shield generators which are going to be given a custom shield class and are going to be only mountable to the lifter, transport, large transport, train and (if you do it) large train.
This is a typical entry, taken st_equip.ini:

[ShieldGenerator
nickname = Cargopod_gold
ids_name = 461020
ids_info = 65898
DA_archetype = Equipment\models\commodities\crates\pod_drab.3db
material_library = Equipment\models\cargo_pods.mat
HP_child = HpConnect<--this is on the model you are using
hit_pts = 5000<--it takes damage during combat
explosion_resistance = 0.500000
debris_type = debris_normal
parent_impulse = 20
child_impulse = 80
volume = 1000.000000<--So players can't unmount easily
mass = 10
regeneration_rate = 0
max_capacity = 0
toughness = 5.400000
hp_type = hp_freighter_shield_special_10<--this is covered next
offline_rebuild_time = 12
offline_threshold = 0.150000
constant_power_draw = 0
rebuild_power_draw = 0
shield_collapse_sound = shield_offline
shield_rebuilt_sound = shield_rebuilt
shield_hit_effects = 0, gf_br_shield01
shield_hit_effects = 100, gf_br_shield02
shield_hit_effects = 500, gf_br_shield03
separation_explosion = sever_debris
LODranges = 0, 20
lootable = false

Its a shield generator, that just dosen't have any benefits. You could add a power draw if you wanted to be mean. It might be good for normally perishables. Instead you could make up some text about the cargo pod life support requiring power. Anyway, it can be mounted to only hp_freighter_shield_special_10 hardpoints. Meaning, we need to clean out a few classes for our own use.
What i did with mine was rename all freighter shields from class 1-10 to class 1-5. So, each new class has two variations each. I did actually take this further and do the same to light fighters and heavy fighters too. But, thats up to you. Either way, you need to go back through shiparch and change the maximum shields from 1-10 to 1-5 for at least the freighter ships.
Once you've done all that we are going to use:
freighter class 6 for light transports
freighter class 7 for gunboats
freighter class 8 for heavy transports
freighter class 9 for cruisers
freighter class 10 for cargo pods
You can make up your shields as you want. I've copied all of the gunboats and cruisers/destroyers to a custom folder and added bits. For some ships like the rheinland gunboat you might consider using the hp_type = hp_turret for weapons like the large forward gun to control what is mounted where. I'm not going into shields or adding hardpoints, instead i'm going on with cargo pods and reshack.
So, open up reshack again and do a search for "Freighter Shield-Class 6", it'll pop up at 108 do the renaming thing, compile script and save (don't forget to copy the updated resources over into your mod folder).
So, we have a shield generator that looks like a cargo pod and if you add to your shiparch:
hp_type = hp_freighter_shield_special_10, HpCargo01, HpCargo02
remember to keep the original entry too
hp_type = hp_cargo_pod, , HpCargo01, HpCargo02
otherwise npcships won't load up the pods as normal. It just means that you can add pods to your ship now. You will need to add the pod to st_goods as normal. When it comes to pricing its going to be up to you. I did think of just multiplying the basic commodity by 100 and thats the cost. If you do that you can use the entries from market_commodities. I wasn't too sure about it so instead just made up some numbers between 45k and 100k for various goods. This is just the basic price, now remember, its equipment so when you sell it you get 30% of its value at the base.
I've added about 40 different pods to different regions of my mod and it has been quite hard work. I opted to keep most of the trade set to each region with a couple of high price goods for those that like the long distance thing. The format that i've used is:
MarketGood = Cargopod_oxygen, 0, -1, 150, 500, 0, 0.90
Base sells the good at 90% of basic value
MarketGood = Cargopod_pharm, 0, -1, 50, 50, 0, 3.333
base buys pod at 100% (after the reduction)
The amount that is gained is set to the difficulty region of space. So, in liberty, where it would be far too easy for players to gain a profit, they only gain 5% per jump they make. Thats intentionally pretty rubbish and encourages them to "get on with it" and go to a more difficult region.
A couple of values for you:
Buying for 2.167 = 65%
Buying for 2.5 = 75%
Buying for 2.667 = 80%
Buying for 2.833 = 85%
Buying for 3 = 90%
Buying for 3.167 = 95%
Buying for 3.333 = 100%
Buying for 3.667 = 110%
That kind of thing. I treat each area separately and add any major ones like niobium in rheinland or diamonds in kusari. You can use the market_commodities for an idea, but you will need to change the buyprice. You don't need to add bad buy prices for goods mad in that region as they will only get 30% of the good anyway.


Edited by - M-A-C-E_166 on 5/2/2006 9:58:42 PM

Edited by - Mace_166 on 5/12/2006 6:52:22 PM

Post Tue May 02, 2006 8:36 pm

Well, thats mostly it. I did add a few cargpod-shield capacitors using the lifeboat model. You'll need to copy it into a custom folder and rotate and move the hpMount so that it fits properly. But it adds the ability to increase the shield abilities for the harder regions of space.
Notice how the cargopods have a volume of 1000. Thats to prevent players from mounting them and popping them into their cargo hold instead.
I did make up some commodities for the cargopod locations as they don't get added on to the best price commodity list obviously. It takes a little while to go through it, but i've made up Liberty, Bretonia, Kusari and Rheinland stockprice info cards. Its all done just with the info of the commodity itself.
If you were wondering about multiplayer, with the pod being fixed to the ship it dosen't get lost when you die. It dosen't, as far as i know, but it doest take damage and if the cargpod is reduced to 50% armour you will only get 50% of what you were expecting. You can quite easily end up not making a profit for making a dangerous cargo run. So, it isn't guarranteed. Its up to you also to choose the hitpoints of the cargo pod to match how you want your mod balanced.
A couple of other things i'll just mention are that the HpMount point of the transport and a few other ships is in the wrong place for docking nornmally. They are in front of the ship instead. Its best to move the HpMount of the ships you want to somewhere below the middle. It does mean though that other npc's have trouble docking. The npc's use the HpMount and orientate themselves to the right point for the HpDockMount. In my mod, i've changed it so that all npc ships that used to use the large_moors, use medium_moors instead and have renamed all of the entries in solararch.ini so that the large moors are medium instead. Then, added duplicate entries for certain bases that i want to allow the player to dock with using the larger ships and moved the docking order around from this
docking_sphere = berth, HpDockMountA, 5.000000, Sc_open dock1
docking_sphere = berth, HpDockMountB, 5.000000, Sc_open dock2
docking_sphere=moor_medium, HpDockMountC, 10
docking_sphere=moor_medium, HpDockMountD, 10
docking_sphere=moor_medium, HpDockMountE, 7.5
docking_sphere=moor_medium, HpDockMountF, 7.5
to this
docking_sphere=moor_large, HpDockMountC, 10
docking_sphere=moor_large, HpDockMountD, 10
docking_sphere=moor_medium, HpDockMountE, 7.5
docking_sphere=moor_medium, HpDockMountF, 7.5
docking_sphere = berth, HpDockMountA, 5.000000, Sc_open dock1
docking_sphere = berth, HpDockMountB, 5.000000, Sc_open dock2
Normally, you dock and then you try to leave the base from the berth, not from the moor that you entered. Well, big suprise, the large train isn't very good at leaving from a berth and usually bashes itself to destruction or the door closes before you have left. Not good. But, by changing the order, all of the ships that leave the station do so via the moor instead. Its not ideal for fighters, but it does mean that transports can dock with stations ok.
The mooring vessels were having trouble getting to their right position while docking and ended up vertical (after bashing into the station quite a bit). As shown:

My only solution to that was to again copy the bases to a custom folder, move the points away from the base a bit and to rotate the dockpoints 90 degrees. It works ok, and means that larger ships can dock at planets and certain stations. These are the only ones that buy and sell cargo pods. Also shown:

You might need to do the docking ring fix, but most of them seem ok. When docking to moor it still stops if you don't press the escape key while docking, but i don't know a way around that one yet.
Here's the pods and their appearances.
Pod White

Pod Red

Pod Grey

Pod Green

Pod Drab

Pod Blue

Pod Yellow


Edited by - M-A-C-E_166 on 5/2/2006 9:56:05 PM

Post Tue May 02, 2006 9:14 pm

Just thought of another one, shields on larger ships. If oyu playtest a bit you'll notice that on some ships like the rheinland battleship, using an existing shield sur dosn't work too well. So, you need to make a custom one.
The method that I used is far from perfect. Simply taking an existing sur and resizing it visually which is pretty crude. I did come up with the idea of using flmodel tool to create a joined sur that i've used as a shield. I haven't playtested too much yet but, in theory, it should work ok.
You open up Flmodeltool (great program by the way), load in the ship cmp and sur then resize the sur to cmp and make all part of the hull. Then save as a different name.
In select_equip there is the shield links. It seems to mount a big lump to you ship that takes shield damage instead of the individual components of the original ships. Make up a custom one, the 3db isn't very important. It dosen't seem to have the typical archetype as such so good news! No conflicts or preloading existing archetype problems. Just rename the Flmodeltool sur to the same name as the custom 3db and add the entry in shiparch and hopefully it'll work. I'm going to playest over the next few days and see how it all works out.

Post Wed May 03, 2006 2:48 am

Last thing covers making the ships buyable. Its done the same as normal, but i'm going to add the engine type specific to the region you are in. This would be the normal one, used for liberty:
[Good
nickname = ge_transport_hull
category = shiphull
ship = ge_transport
price = 1750000
ids_name = 12017
item_icon = Equipment\models\commodities\nn_icons\FS_shipicons\fs_shipicon_transport.3db<---That ones one of mine

[Good
nickname = ge_transport_package
category = ship
hull = ge_transport_hull
addon = ge_t_engine_01, internal, 1
addon = shield01_mark06_fr, HpShield01, 1<--I made up unique shields for mine
addon = rh_freighter_power01, internal, 1
addon = ge_s_scanner_01, internal, 1
addon = ge_s_tractor_01, internal, 1
addon = sfx_rumble_ut_large, internal, 1
addon = co_transport_turret01_mark01, HpTurret_U1_01, 1
..
addon = co_transport_turret01_mark01, HpTurret_U3_01, 1
addon = LargeWhiteSpecial, HpHeadlight, 1
addon = SlowSmallPurple, HpRunningLight01, 1
addon = SlowMediumWhite, HpRunningLight01, 1
..
addon = DockingLightRedSmall, HpDockLight02, 1

The next thing i'm going to do is create packages for bretonia, kusari and rheinland all using the same hull.
All that i am going to change, is the engine effects and the running lights.
[Good
nickname = BR_ge_transport_package
category = ship
hull = ge_transport_hull
addon = ge_bg_engine_01, internal, 1<--using the bretonia gunboat engine or creating your own. Either way, you might want to get rid of the volume value.
..
addon = SlowSmallRed, HpRunningLight01, 1
addon = SlowMediumBlue, HpRunningLight01, 1
[Good
nickname = ku_ge_transport_package
category = ship
hull = ge_transport_hull
addon = ge_kg_engine_01, internal, 1<--using the kusari gunboat engine..
..
addon = SlowSmallYellow, HpRunningLight01, 1
addon = SlowMediumGreen, HpRunningLight01, 1
[Good
nickname = rh_ge_transport_package
category = ship
hull = ge_transport_hull
addon = ge_rg_engine_01, internal, 1<--using the rheinland gunboat engine..
..
addon = SlowSmallBlue, HpRunningLight01, 1
addon = SlowMediumYellow, HpRunningLight01, 1
Then for each region, use the package for made and it'll add an interesting aspect to using the ships. You might even consider making up npc loadouts too.

Return to Freelancer Editing Tutorial Forum