ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Ore spawning

From ModEnc
Revision as of 16:54, 26 January 2008 by 78.86.141.70 (talk)
Jump to navigation Jump to search

Spawning ore with debris

This tutorial will explain how to create patches (or tiles) of ore from flying debris. Although it can be used for many other purposes such as when hooked to a weapon it becomes an ore spawning weapon, Shoot a tile, and ore appears, and such. This works on Red Alert 2 Yuri's Revenge 1.001

Intro

There are 3 main elements to controlling ore:

  • Generation of debris
  • Debris piece that becomes ore
  • Global ore properties

Generation of debris

Very easy to achieve with a DebrisTypes= tag, in practice harder to get working reliably, so start by picking a "guinea pig" unit which we will do all experiments on. I chose the Rhino Tank since you start with 4 of them in multiplayer.
In its properties add these tags as a test: ( Note: beware that there is a mistake in the original code, "Maxdebris=" should be "MaxDebris=" )

MaxDebris=6 MinDebris=4 DebrisTypes=TIRE DebrisMaximums=6 ;Later on this one, i promise

The tags are self explanatory. Test the changes by blowing up a Rhino Tank in game, you should see 4 to 6 tires flying off the tank after it explodes, if it doesnt, you messed up.

Debris piece that becomes an ore tile

Now that we know the debris generation works, we shall play with TIRE voxel debris code now. Using TIRE again as our guniea pig.

at the bottom of the code add these tags:

IsTiberium=true TiberiumRadius=1 ;how many tiles of ore we want around our impact TiberiumSpawnType=TIB07 ;type of ore to spawn 1-12 works. gems are GEM01 - 12 i think.

Now if you test this in game you will see something very strange. If you check carefully you will realise that ore in fact is spawned by the TIRE debris, yet in such small amounts that its very hard to see. If this is the case next section should sort it.

Global Ore Properties

Be aware that we are changing the global ore properties, this means that it will affect not only the ore that we spawn, but also the ore that is grown naturally by ore drills. The effect is small but significant enough to look out for.

The problem with out new spawned ore patches is that they dont grow (by grow i mean the ore in the tile stays the same density, this has nothing to do with amount of ore produced by the ore drills).

In the ore properties we have 4 entries, all are different forms of ore (Tiberium, remnants from Tiberium Sun game) [Cruentus] are gems [Riparius] is ore

In [Riparious] section change this tag:

Growth=500 ;original value is 2200

Results

Start the game and blow up your tank. If you done everything correctly the tank should blow into several tires, those, when stop bouncing should create single full patches of ore worth 275 credits.

Cleaning Up

Comming in abitt