HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Building Time

05-10-2008, 05:53 AM#1
Quldan Elwood
Is there a way to change the build time of units/building in game. (example: it take say 30 seconds to build a tower. If I get the "motivated workers" upgrade i want to make the build time lower (probably by 10% each upgrade))
05-10-2008, 03:30 PM#2
Panto
Urk... there's not an easy way, no.

How many upgrades were you planning to make available? How many buildings are affected? The safest way is probably to make different versions of each building and use Chaos or something similar to upgrade your peasants.
05-10-2008, 05:04 PM#3
rulerofiron99
In that case, the safest way is also the more resources way.

Some quick solutions I can think of:
-If it's a human-based race, make a dummy unit that powerbuilds.
-Related to the previous point, play around with the powerbuild rate in the Repair (Human) ability, maybe make multiple levels of it
-Use Unit - Set (<unit>) construction progress to <percentage>% in a looping trigger, and if you can't find a way to get the current progress, use current HP.
05-10-2008, 08:02 PM#4
ArchWorm
ruler, yes, we can crush on building being damaged, so have to handle that.
But it's not that bad, as I remember, there's a func. to get constr. progress
05-11-2008, 02:57 PM#5
Quldan Elwood
i tried using the Set (<unit>) construction progress to <percentage>% but even more problems came up with picking the right building b/c when i began building another of the same type both building would then change their % to the same %.
The unit dummy idea sounds pretty good ill give it a try.
Making a unit for every lv of the unit seems like a pain b/c if i have where a particular unit-type event i would have to make sure it's for every unit that also equals say a "farm". But i think if u use an array of unit types for each building (like the "farm") i think i might be able to pull something together. Thank you all for your input
05-11-2008, 05:43 PM#6
Pyrogasm
Well here's a solution: have different units for the build phase only (units with different build times I mean). Then, when the building finishes building, chaos morph it into some standard building.

So you might have the workers building a unit called "Farm (Fast)", and then a trigger like this:
Trigger:
Farm
Collapse Events
Unit - A unit Finishes construction
Collapse Conditions
(Unit-type of (Constructed structure)) Equal to Farm (Fast)
Collapse Actions
Unit - Add (Chaos (Fast Farm)) to (Constructed structure)
And then it will be a normal farm.
05-11-2008, 06:03 PM#7
Quldan Elwood
Well this is what i came up with using the "dummy"
(Note: Current_farm is a variable connected to a trigger that changes per "motivated workers" upgrade)
Trigger:
Building Farm
Collapse Events
Unit- A Unit begins construction
Collapse Conditions
(Unit Type of [constructing structure]) equal to Farm(dummy)
Collapse Actions
Unit- remove (triggering unit ) from the game
Unit- create 1 Current_Farm at [ position of [constructing structure]] facing default building facing degrees

Then
Trigger:
Finish Farm
Collapse Events
Unit- A Unit finishes construction
Collapse Conditions
(Unit Type of [constructed structure]) equal to Current_Farm
Collapse Actions
Unit- remove (triggering unit ) from the game
Unit- create 1 Farm at [ position of [constructing structure]] facing default building facing degrees

With a few changes i should be able to avoid creating 2 triggers for every unit
If there is any more ideas please post
05-12-2008, 02:36 AM#8
Quldan Elwood
ok nvm that doesn't work it replaces the unit with an already completed unit.
05-12-2008, 03:11 AM#9
Quldan Elwood
Quote:
Well here's a solution: have different units for the build phase only (units with different build times I mean). Then, when the building finishes building, chaos morph it into some standard building.

So you might have the workers building a unit called "Farm (Fast)", and then a trigger like this:
Trigger:
Trigger:
Farm
Collapse Events
Collapse Unit - A unit Finishes construction
Collapse Conditions
(Unit-type of (Constructed structure)) Equal to Farm (Fast)
Collapse Actions
Unit - Add (Chaos (Fast Farm)) to (Constructed structure)
And then it will be a normal farm.

The thing is the point is to keep the same building unit i guess, i could make "upgraded" types of the units but i think i may have figured it out take a look.

Trigger:
Trigger: Map Initialization
Collapse Events
Map Initialization
Conditions
Collapse Actions
Player- Make Farm (10%) Unavailable for training/construction by player (1)
Player- Make Farm (20%) Unavailable for training/construction by player (1) .....ect...ect...
---- a loop can do this for all players -----

then do

Trigger:
Trigger: Building Farm
Collapse Events
Unit- a unit finishes construction
Collapse Conditions
(Unit-type of (constructing structure)) equal to Farm (100%)...ect...ect
Collapse Actions
Unit- remove (triggering unit) from the game
Wait 0.50 seconds
--- wait so the unit being created doesn't get moved for being placed where a unit is (lag time) -----
Unit- create Farm (real)...ect..

then i would have a unit be able to build ALL the farm (%) types but not the Farm (real) but the farm (real) will replace the Farm (%) after they are completed. Also have a trigger that switches what building can/can't be build every time a "motivated workers" upgrade it completed. So far my tests have worked but i havent created the "upgrade" itself so we'll see.