Page 1 of 1

How to fill a region with asteroids [Solved]

Posted: Sun Oct 16, 2011 1:45 pm
by Redline
Tutorial for filling a region with asteroids:
The Steps:

Varible with number
local kNumAstLrg = 320(How many asteroids you want in the region)

Set up MemoryPoolSize

SetMemoryPoolSize("Asteroid", kNumAstLrg)
SetMemoryPoolSize("TreeGridStack", 650 )--kNumAstLrg*2.75)

Fill the region with asteroids

FillAsteroidRegion("Regionname", "Objectname", Number of Asteroids, Idk but I think it's the moving direction.);
FillAsteroidRegion("Ast_02", "spa_prop_jagged_asteroid_large", kNumAstLrg, 3.0,1.0,1.0, 0.0,-1.0,-1.0);

Create a region with the name Ast_02 in the ZeroEditor(you can call your region whatever you want. You just need to change it in the ZeroEditor too.)

It can look like this(Just a part of the LUA!):
Hidden/Spoiler:
[code] -- Level Stats
ClearWalkers()
AddWalkerType(0, 4) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)

local weaponCnt = 1024
local guyCnt = 32
local units = 72
local kNumAstLrg = 320
SetMemoryPoolSize("Aimer", 200)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 73)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 30)
SetMemoryPoolSize("EntityDroideka",40)
SetMemoryPoolSize("EntityDroid",0)
SetMemoryPoolSize("EntityHover", 20)
SetMemoryPoolSize("EnityWalker", 20)
SetMemoryPoolSize("CommandWalker",6)
SetMemoryPoolSize("EntityFlyer", 46)
SetMemoryPoolSize("ParticleTransformer::SizeTransf", 1500)
SetMemoryPoolSize("ParticleTransformer::ColorTrans" , 1784)
SetMemoryPoolSize("ParticleTransformer::PositionTr", 1500)
SetMemoryPoolSize("EntityLight", 70)
SetMemoryPoolSize("EntityRemoteTerminal", 26)
SetMemoryPoolSize("EntitySoldier",guyCnt)
SetMemoryPoolSize("SoldierAnimation", 200)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 70)
SetMemoryPoolSize("Navigator", guyCnt)
SetMemoryPoolSize("Obstacle", 150)
SetMemoryPoolSize("PassengerSlot", 0)
SetMemoryPoolSize("PathNode", 92)
SetMemoryPoolSize("UnitAgent", units)
SetMemoryPoolSize("UnitController", units)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("TentacleSimulator", 0)
SetMemoryPoolSize("RedOmniLight", 150)
SetMemoryPoolSize("SoldierAnimation", 200)
SetMemoryPoolSize("SoundSpaceRegion", 14)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo
SetMemoryPoolSize("Asteroid", kNumAstLrg)
SetMemoryPoolSize("TreeGridStack", 650 )--kNumAstLrg*2.75)


SetSpawnDelay(10.0, 0.25)

-- do any pool allocations, custom loading here
if myScriptInit then
myScriptInit()
myScriptInit = nil
end

ReadDataFile("dc:GOS\\spa_sky.lvl", "geo")

ReadDataFile("dc:GOS\\GOS.lvl", myGameMode)

SetDenseEnvironment("false")

SetParticleLODBias(1500)

FillAsteroidRegion("Ast_02", "spa_prop_jagged_asteroid_large", kNumAstLrg, 3.0,1.0,1.0, 0.0,-1.0,-1.0);
[/code]
Don't forget to save!

Last not least you need to add the object name of the odf into the ABC.req
It's important because this object is not placed in the ZeroEditor otherwise no astroids will be loaded.
You can also try crazy things like other objects.

So but in this case:

Code: Select all

REQN
{
"class"
"spa_prop_jagged_asteroid_large"
}
Don't forget to save!

Done and it works!

Edit:
Now it does work.
I solved the problem with adding a class object into the req.

Re: How to fill a region with asteroids [Solved]

Posted: Mon Oct 17, 2011 11:34 am
by Eggman
Hey, that's really helpful! :thumbs: I had been wondering how to do this.