added:
-gradual mining (like in starcraft) instead of mining the whole mineral at once. "minerals health" = remaining ressources
-multiple units can be defined as ressource dropoff. Deployed metalstorage trucks and landed flagships make a cool combination.
-miners do not try to drop ressources at enemy dropoffs anymore
-only mark allied miners/dropoffs
-no more endless ressource by repairing partly mined minerals
( repairable = false in bminerals.lua)
changing:
-i will probally change recognizing dropoffs, miners, ressources. So that it is done by a custom tag in their UnitDef thing instead of by unitname.
-same with the cargo, units need a cargo tag instead of this table thing. maybe this way units can read the tag and if cargo > 0 show the unit carrying a mineral piece
---------
maps can contain lua too, right?
I would suggest that maps use lua to place ressources via CreateUnit because it is more flexible than features on a map.
I did a hackish example by putting the mineralplacement thing into game_spawn.lua but it could look like this:
Maps lua contains
Code: Select all
--4 large mineral fields in the open:
SpawnRessourceField (2500,1500, 12, 300)
SpawnRessourceField (5200,2000, 12, 300)
SpawnRessourceField (3000,6000, 12, 300)
SpawnRessourceField (5500,6000, 12, 300)
--2 small mineral fields on the central hills:
SpawnRessourceField (3100,4600, 5, 100)
SpawnRessourceField (4500,3200, 5, 100)
result:
The SpawnRessourceField function:
Code: Select all
local function SpawnRessourceField (x,z, number, spread)
for i = 0, number, 1 do
local sx = x+math.random (-spread,spread)
local sz = z+math.random (-spread,spread)
local sh = Spring.GetGroundHeight(sx, sz)
local res = Spring.CreateUnit(ressource_name, sx, sh, sz, 0, Spring.GetGaiaTeamID())
Spring.GiveOrderToUnit(res, CMD.ONOFF, { 0 }, {} )
Spring.SetUnitAlwaysVisible(res, true)
end
end
That only gives some basic mineral patches. But one could also do something like...
-randomly place minerals on high/low terrain (this way i made rings of minerals around the hills)
-only place on grass terrain
-place minerals near water
-mapoption in lobby for different settings: ressources at startpoint or more in the center?
-adjust ressources to player count
if a non-ct map is played, that does not contain such lua one could place ressources based on metal like S44 does with flags.
blabla...cool i rambled one a half screen full. lol what do you even want the gameplay/ressource system to be?