• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Techtree requirement

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
I need a number of the same building to be used as a tech-tree requirement.
For example, A Grunt requires 1 WarMill, Headhunters requires 2 WarMills and Demolisher Requires 3 Warmills.

Any ideas how to make this?
 
Level 18
Joined
Mar 7, 2005
Messages
824
how about making 3 different upgrades.. with just the info "You need 1 WarMill" or "You need 2 WarMills"

now just use a trigger and check if the player owns 1 or 2 or more warmills, and then just research one of the upgrades via trigger.. so the unit is acutally useable..

That's how I would do it..
 
Level 11
Joined
Feb 16, 2009
Messages
760
And what if the one WarMill was destroyed?
I would make a trigger that adds +1 to a integer value whenever a WarMill is builded. Then make a trigger to check on training of a unit if the integer value is high enough, or else refund the user and destroy the trained unit
 
Level 4
Joined
Jan 24, 2009
Messages
124
Fixies

  • Upgrade
    • Events
      • Unit - a unit finishes construction
    • Conditions
      • Unit - unit type of triggering unit is equal to Blacksmith
    • Actions
      • set Blacksmiths<gen> = blacksmiths + 1
  • Downgrade
    • Events
      • Unit - a unit dies
    • Conditions
      • Unit - unit type of triggering unit is equal to Blacksmith
    • Actions
      • set Blacksmiths<gen> = blacksmiths - 1
  • AllowHeadhunter
    • Events
      • Unit - a unit begins training
    • Conditions
      • Unit - unit type of triggering unit is equal to HeadHunter
    • Actions
      • if Blacksmiths > 1 then do nothing else do Order training unit to STOP
Blacksmits is a integer value.(numbers)
so when a unit a unit finishes a blacsmith it ads +1 to the current value
and when you try to make a HeadHunter it checks the Integer value
if it is lower than 1 and removes 1 from Blacksmiths value if it dies...:grin:
 
Level 10
Joined
Nov 5, 2008
Messages
536
  • Upgrade
    • Events
      • Unit - a unit finishes construction
    • Conditions
      • Unit - unit type of triggering unit is equal to Blacksmith
    • Actions
      • set Blacksmiths<gen> = blacksmiths + 1
  • Downgrade
    • Events
      • Unit - a unit dies
    • Conditions
      • Unit - unit type of triggering unit is equal to Blacksmith
    • Actions
      • set Blacksmiths<gen> = blacksmiths - 1
  • AllowHeadhunter
    • Events
      • Unit - a unit begins training
    • Conditions
      • Unit - unit type of triggering unit is equal to HeadHunter
    • Actions
      • if Blacksmiths > 1 then do nothing else do Order training unit to STOP
Blacksmits is a integer value.(numbers)
so when a unit a unit finishes a blacsmith it ads +1 to the current value
and when you try to make a HeadHunter it checks the Integer value
if it is lower than 1 and removes 1 from Blacksmiths value if it dies...:grin:

Thanks for your trigger! But that does mean that all units are trainable from the beginning, but the training is just canceled when a unit begins training. There is no way to make units in buildings being "unclickable" with the text - "Requires 1 Warmill" Etc?
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
if you change availability th units are not even shown.

you can use different requirements, for your first unit you make it require a normal warmill. then you create 2 more buildings. one is named "2 Warmills" and the other "3 Warmills" they are invisible and unselectable. then you use an integer as explained above (although you will have to use an array if you want it for more then 1 player). when your integer reaches "2" , you create the building "2 Warmills" somewhere on the edge of the map. the same for 3 warmills. you set your headhunter requirement to "2 Warmills" and the demolisher to "3 Warmills". the it will show the text you want. use if/then/else in the integer triggers to check if one of your warmills is destroyed and then destroy the requirement building.

if its too complicated, i can explain it otherwise, or maybe when i have time later i can do the triggers.
 
Level 8
Joined
Nov 9, 2008
Messages
502
If you want to manipulate techtree requirements both ways you need to use dummy units for the requirements.

EDIT: Yes what above post says :>
 
Level 10
Joined
Nov 5, 2008
Messages
536
if you change availability th units are not even shown.

you can use different requirements, for your first unit you make it require a normal warmill. then you create 2 more buildings. one is named "2 Warmills" and the other "3 Warmills" they are invisible and unselectable. then you use an integer as explained above (although you will have to use an array if you want it for more then 1 player). when your integer reaches "2" , you create the building "2 Warmills" somewhere on the edge of the map. the same for 3 warmills. you set your headhunter requirement to "2 Warmills" and the demolisher to "3 Warmills". the it will show the text you want. use if/then/else in the integer triggers to check if one of your warmills is destroyed and then destroy the requirement building.

if its too complicated, i can explain it otherwise, or maybe when i have time later i can do the triggers.

Thanks for your info. The trigger above posted by errorz can I make, but I think that the trigger you are describing is a bit hard for me to do, considering all players have their own number of Warmills. But it sounds exactly like what I need! If you have the time to make this for me, I'm gonna give you the biggest rep I have ever given cause this is a very important feature on my map.
 
Status
Not open for further replies.
Top