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!
So let's say you have a Troll in there that costs 50 gold.
Buy Unit
Events
Unit - A unit comes within 350.00 of Ziggurat 0002 <gen>
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Triggering unit)) Current gold) Greater than 50
Then - Actions
Player - Add -50 to (Owner of (Triggering unit)) Current gold
Unit - Create 1 Footman for (Owner of (Triggering unit)) at (Position of Ziggurat 0002 <gen>) facing Default building facing (270.0) degrees
Else - Actions
Pretty simple though. If you have more units in the Merchant, wich is pretty likely, you should put a delay on lower prices (a wait action just before the If, Then, Else action).
Example:
2000 - no delay
1500 - wait 0.1 seconds
1350 - wait 0.2 seconds
1000 - wait 0.3 seconds
500 - wait 0.4 seconds
200 - wait 0.5 seconds
100 - wait 0.6 seconds
50 - wait 0.7 seconds
These prices are just examples. What I want to show you is that the lower the price gets, the higher delay you make before buying it. If you do that the AI will only buy the most expensive unit he... it can aford. Lets say it has 2010 gold, then it will buy the 2000 gold unit and nothing more cause it's out of gold. If it has 1560 gold, it will buy the 1500 gold unit and then the 50 gold unit.
You got to fix the event though, because that trigger will cause the unit to be bought when you come in range even if the shop isn't even selected or something. Other then that: It's good (no smiley fail there! )
Well you'll have to add a condition that causes only the AI units to buy from the shop. You can buy whatever you want but the AI's are restricted to the trigger functions.
Add all AI controlled units to a unit group (variable), and then make the following condition:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.