factory that builds multiple units at once

factory that builds multiple units at once

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

factory that builds multiple units at once

Post by knorke »

Four times the flash spam \o/
Image

A factory that builds multiple clones of a unit at once.
I know some mods already have squad-building (S44) but with this you can see the units being concstructed.

Basically just define your buildspots like this:

Code: Select all

local buildSpots = {
	[1] = piece "spawn1",
	[2] = piece "spawn2",
	[3] = piece "spawn3",
	[4] = piece "spawn4",
}
(can be more than 4)
and tada.

Idea is that the unit that is "originally" built by the factory is made invisible and then you do:
buildprogress_of_clones = buildprogress_of_original_unit
until done.
:shock: :shock: And then you kill the original and only the clones survive :shock: :shock:

blabla:
1) tooltip lets you find the invisible unit:
http://h9.abload.de/img/multifaggtori52brv.jpg
(solution: find some function to hide it better or hide it in hitsphere of factory. Spring.SetUnitNoDraw (bID, true) does not do it..)

2) nanoframes of units with too long buildtime decay (lol)
(solution: do not use nanoframe animation by changing:
local newUnit = Spring.CreateUnit (bdefID, x,y,z, i, teamID, false) (was true)

3) units do not inherit waypoints/states from factory
(shouldnt be hard to put in, left it out for now)

4) assisting does not work
(would require some gadget part to pass the guard-click to the invisible unit)

5) units do not follow movement/rotation of the buildpad pieces
5b) nanoframes can be bumped out of the factory
(solution: put in some movectrl or magnets)

Eventually one would want to add those things but then the script would have been longer.
So I thought before I tweak it for the actual unit, here is the "simple version" without much bling-bling:
http://code.google.com/p/springtutorial ... ltipad.lua
There are even some comments!
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Re: factory that builds multiple units at once

Post by SanadaUjiosan »

Very neat! I don't know if I have any use for this right now, but I'll keep an eye on it if it gets improved.
Post Reply

Return to “Game Development”