Tutorial: Orbiting Planets
due to several reasons (the most important being: lack of time) i`m preparing retirement.
i have been very happy, finding answers to most of the problems i encountered modding freelancer, back in the days when i started -so i decided to finally write a tutorial to contribute and share a nice invention by myself to make all mods better (no offense)
this is about making orbiting planets, here we go:
(note: since this is an advanced project i could not be bothered to write an easy step by step tutorial, experienced modders should be able to follow me)
the main approach (only one i could ever think of) is to have a center object (invisible) with hardpoints far out of it`s origin and to connect "planets" to it (via loadout), then make it spin.
i said "planets" cause you might know usual freelancer planets aren`t 3db/cmp but sph files (not capable of having hardpoints assigned to them) -so you`d actually have to make planets 3db/cmp for this to work. (use space_arch_shield.sur and flmodeltool by anton to add proper collision detection)
in order to connect them to the center object, planets need a hardpoint ex.SpConnect01 at their origin.
that`s it, planets done ..
next,
use any 3db/cmp for the center object, doesn`t need mat, neither sur file -but in order to connect planets to it, add some hardpoints: ex.HpMount01 - HpMount09 (remember they need to be far out, i used 50k - 200k distance from center)
now there is a problem,
orbiting planets would just disappear if it`s center object gets out of sight (cause "they are one" -lodranges don`t work on some things things, trust me ..
here`s the solution:
open up the center object with utf-editor, expand multilevel-level0-vmeshpart->vmeshref
select interpret data as float array, click on vmeshref and edit:
scroll down to the very last number and change it a very high value (i used 1 mio) -this defines the objects radius and is important for visibility.
that`s it -job done,
now off to the required ini files ..
data/equipment/select_equip.ini: *typical entry for orbiting planets*
<pre><font size=1 face=Courier>
[CargoPod
nickname = custom_planet_01
DA_archetype = xxx\xxx\your_custom_planet.cmp
material_library = xxx\xxx\your_custom_planet.mat
LODranges = 0, 999999
HP_child = SpConnect01
hit_pts = 4000
mass = 2000
explosion_arch = explosion_large_debris
</font></pre>
data/solar/solararch.ini: *typical entry for the center object*
<pre><font size=1 face=Courier>
[Solar
nickname = orb_planets_center
ids_name = 1
ids_info = 1
type = NON_TARGETABLE
DA_archetype = xxx\xxx\your_center_object.cmp
LODranges = 0, 999999
solar_radius = 100000
shape_name = NNM_SM_ROCK_ASTEROID
hit_pts = 999999961690316250000000000000000000.000000
mass = 10000000000000000000
loadout = orb_planets_loadout_01
</font></pre>
data/solar/loadouts.ini: *typical entry for a center objects loadout*
<pre><font size=1 face=Courier>
[Loadout
nickname = orb_planets_loadout_01
equip = custom_planet_01, HpMount01
</font></pre>
data/universe/systems/xxx/xxx.ini: *typical system entry*
<pre><font size=1 face=Courier>
[Object
nickname = xxx_orbit_01
pos = 0, 0, 0
archetype = orb_planets_center
loadout = orb_planets_loadout_01
spin = 0.000000, 0.100000, 0.000000
rotate = x, y, z
</font></pre>
ok that`s it folks, go ahead with questions if you have any.
but don`t ask about docking, it just wouldn`t work because of the auto pilot.
this was supposed to add to the scenery / atmosphere !!
a known issue: too low value for spin might result in them orbiting planets stopping after some time .. you have to fiddle with it, also: take care there`s nothing in their orbit they could collide with.
as an example and proof of concept you can download this video
and if you`re missing the codec .. get it here
yours,
RimShot
Edited by - RimShot on 5/26/2005 11:26:55 AM