Post Sun Mar 25, 2007 12:56 am

**Tutorial** - Making animated asteroid-miners

Ok, because I love, beside the great ships of the mods,
the addons in the space, here is an example of an animated mining-ship,
which we see in Sirius.

I want to define a ship, which we can destroy and make loot.
And I want to see damage during this 'operation', lets say smoke and fire,
when the miner got some hits.

[u1. Some new effects[/u
To show smoke, we'll have to assign effects to some hardpoints at the objects.
If you use effects with wrong hardpoints, the effects wont shown.
With the prog HardCMP by Louva-Deus & Shsan, you can easy find the right ones
and their position.
Here are the ones for the miner:
hardpoint = HpTurret_U1_01
hardpoint = HpTurret_U1_02
hardpoint = HpTurret_U1_03
hardpoint = HpTurret_U1_04
hardpoint = HpTurret_U2_01
hardpoint = HpTurret_U2_03
hardpoint = HpTurret_U2_04
hardpoint = HpTurret_U3_01

In the file effects.ini, you'll find a lot of nice effects like explosions etc.

The effect-combinations, which are started during our attack, are defines as fuses
in the file fuses.ini.

Here, I add this at the bottom:
<pre><font size=1 face=Courier>
;---------------------------------------------
; effects for destroyable roid-miner
;---------------------------------------------

[fuse
name = intermed_damage_roidminer01; <<< first stage of damage
lifetime = 1
death_fuse = false

[start_effect
effect = gf_continuous_fire
hardpoint = HpTurret_U1_01
hardpoint = HpTurret_U1_02
hardpoint = HpTurret_U1_03
hardpoint = HpTurret_U1_04
at_t = 0.000000
attached = true

[start_effect
effect = gf_burningdoor
hardpoint = HpTurret_U2_03
hardpoint = HpTurret_U2_04
at_t = 0.000000
attached = true

[start_effect
effect = gf_rh_continuoussmoke
hardpoint = HpTurret_U2_01
hardpoint = HpTurret_U3_01
at_t = 0.000000
attached = true

[fuse
name = intermed_damage_roidminer02; <<< second stage of damage
lifetime = 1
death_fuse = false

[start_effect
effect = gf_continuous_damage
hardpoint = HpTurret_U1_01
hardpoint = HpTurret_U1_02
at_t = 0.000000
attached = true

[start_effect
effect = gf_prisonattack_bigsmoke
hardpoint = HpTurret_U2_03
hardpoint = HpTurret_U2_04
at_t = 0.000000
pos_offset = 0, 0, 0
ori_offset = 0, 0, 0
attached = true

[start_effect
effect = gf_prisonattack_additive_worldsmoke
hardpoint = HpTurret_U1_03
hardpoint = HpTurret_U1_04
at_t = 0.000000
pos_offset = 0, 0, 0
ori_offset = 0, 0, 0
attached = true
</font></pre>

[HR

[u2. The new roid-miner-object[/u
Ok, now we'll have to define a new solar, if we don't want to change the old
code.
Here is the code, I have added in the solararch.ini:
<pre><font size=1 face=Courier>
[Solar
nickname = Roid_Miner_Destroyable
ids_name = 261159
ids_info = 66140
type = SATELLITE
DA_archetype = Ships\utility\mining\mining.cmp
material_library = ships\utility\utility_ships.mat
material_library = fx\envmapbasic.mat
envmap_material = envmapbasic
LODranges = 0, 750, 1300, 2000, 12000
mass = 10000.000000
solar_radius = 350
shape_name = NNM_SM_MINING
hit_pts = 150000
fuse = intermed_damage_roidminer01, 0.000000, 90000; stage one effect
fuse = intermed_damage_roidminer02, 0.000000, 60000; stage two effect
fuse = drop_cargo_fuse, 0.000000, 1
explosion_arch = explosion_asteroid_miner
destructible = true
loadout = Miner_Destroyable_Loadout01
</font></pre>

To give the pirates some loot, I have defined a new loadout for the miner.
BTW, here you can add some nice turrets to give the miner some power !
BTW #2: Here is the definition of the animation during normal operation,
e.g. mining_ship_enhaust. You see, you can add any effect also without an attack,

File: /solar/loadouts.ini
<pre><font size=1 face=Courier>
[Loadout
nickname = Miner_Destroyable_Loadout01
equip = infinite_power
equip = ge_s_scanner_02
equip = mining_ship_enhaust, HpExhaust01
equip = mining_ship_enhaust, HpExhaust02
equip = mining_ship_dust01, HpDust01
equip = mining_ship_dust02, HpDust02
equip = mining_ship_armhit01, HpDust01
equip = mining_ship_armhit02, HpDust02
equip = mining_ship_hitsparks, HpDust01
equip = mining_ship_sucking01, HpSuck01
equip = mining_ship_sucking02, HpSuck02
equip = mining_ship_arms
equip = co_miner_turret01, HpTurret_U1_01
equip = co_miner_turret01, HpTurret_U1_02
equip = co_miner_turret01, HpTurret_U1_03
equip = co_miner_turret01, HpTurret_U1_04
equip = co_miner_turret02, HpTurret_U2_01
equip = co_miner_turret02, HpTurret_U2_02
equip = co_miner_turret02, HpTurret_U2_03
equip = co_miner_turret02, HpTurret_U2_04
equip = co_miner_turret03, HpTurret_U3_01
equip = co_miner_turret03, HpTurret_U3_02
equip = armor_scale_5
equip = SlowLargeWhite, HpRunningLight01
equip = SlowLargeWhite, HpRunningLight02
equip = SlowLargeWhite, HpRunningLight07
equip = SlowLargeWhite, HpRunningLight08
equip = LargeWhiteSpecial, HpRunningLight09
equip = LargeWhiteSpecial, HpRunningLight10
equip = mining_ship_engine_sound,
cargo = commodity_construction_machinery, 2
cargo = commodity_mining_machinery, 4
cargo = co_miner_turret02, 3
cargo = co_miner_turret03, 3
cargo = ge_s_battery_01, 5
cargo = ge_s_repair_01, 50
</font></pre>

[HR

[u3. Placing in space[/u
After this hard works, you can use the miners to make your space more interesting:

Here an example from a new system in our mod, Br08.ini

<pre><font size=1 face=Courier>
;the miner-ship
[Object
nickname = Br08_Roid_Miner_01
ids_name = 60225
pos = -39763, 0, 32519
rotate = 0, 35, 0
archetype = Roid_Miner_Destroyable; <<<<<<<<<<
ids_info = 66140
reputation = fc_maf_grp
difficulty_level = 19
pilot = pilot_solar_hardest;<<<< important for the activation of the turrets
behavior = NOTHING

;the asteroid
[Object
nickname = Br08_ast_solar_beryllium_60_1
pos = -39847, -40, 32408
rotate = 90, 90, 0
archetype = ast_solar_beryllium_60
</font></pre>

In this way, you can add many many nice things, not only the roid miners !
And the effect-thing is important e.g. to make the attack of weapon-platforms
more interesting.
Have fun :-)

TaknTar, EvolvedOnes.com