• 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 requirements on Sold Units

Status
Not open for further replies.
Level 5
Joined
Oct 12, 2004
Messages
109
i just put a peasant into a tavern on a new map then added this trigger.

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -disable as An exact match
    • Conditions
    • Actions
      • Player - Limit training of Peasant to 0 for Player 1 (Red)
      • Player - Make Peasant Unavailable for training/construction by Player 1 (Red)

doesn't disable it. am i missing something?
 
Level 14
Joined
Jul 25, 2011
Messages
1,065
i just put a peasant into a tavern on a new map then added this trigger.

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -disable as An exact match
    • Conditions
    • Actions
      • Player - Limit training of Peasant to 0 for Player 1 (Red)
      • Player - Make Peasant Unavailable for training/construction by Player 1 (Red)

doesn't disable it. am i missing something?

Try removing the limit trigger.
 
I think so too...

but as far as bbfreak's original statement is concerned, it doesn't work for him when he do it via the Techtree requirements in the OE...

I'll quote it again in case you missed it...

bbfreak said:
Can you not add techtree requirements on units sold at a building? It seems that whatever requirement I add I can always buy the units. Is there anyway else to do this?
 
Level 5
Joined
Oct 12, 2004
Messages
109
i started a new test map just to make sure it wasn't a problem with my map and it still doesn't work.

I think the reason that the Any Altar works as a requirement is because its under the category Equivalents. When you try to add a peasant as a tech requirement to a sold unit it doesn't seem to require that tech requirement. Here is the test map I've created to show this.

It has 2 units in the tavern. One is a hero and the other is a unit. Both of them have a tech tree requirement of a peasant however only the hero actually requires that requirement.
 

Attachments

  • test.w3x
    16.1 KB · Views: 49
then it just proves my point that they are hardcoded by Blizzard to work only for heroes... If this was the case, its not really a new thing... there are lots of hardcoded things in wc3 (just like how making a new ability based on Cloud or Incinerate [passive] doesn't work, or how stampede cannot be casted by dummy casters etc)

I'll look at the test map and try to see if there's something that can be done...
 
Level 16
Joined
May 2, 2011
Messages
1,351
I had such problem. I made it that when the required unit comes near th building, the units are added. However, you can make it like this
event: unit buys unit
condition: number of required units owned by (owner of buying unti) = 0
actions:
remove sold unit from game
give gold back to buying player

I think it should be somethin like this
 
Level 14
Joined
Jul 25, 2011
Messages
1,065
If it works with heroes why don't you use a hero unit and when you buy it replace it with the unit you want.

Ah. That's a good idea.

  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set UNIT[0] = Peon (Hero)
    • Set REPLACE_UNIT[0] = Peon
    • Set UNIT[1] = Grunt (Hero)
    • Set REPLACE_UNUT = Grunt
  • Events
    • Unit - Unit sells a unit
  • Conditions
  • Actions
    • For each loop integer A
      • Actions
        • If all conditions are true...
          • Conditions
            • Unit type of sold unit is equal to UNIT[Anteger A]
          • Actions - then
            • Unit - Replace (Sold unit) with a REPLACE_UNIT[Integer A]
          • Actions - else
 
Status
Not open for further replies.
Top