• 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.

Need Help with "Sell Units"

Status
Not open for further replies.
Level 16
Joined
Oct 30, 2004
Messages
1,277
Maybe there is a simplier way, here is how i would do it: u need 3 variables, lets name them "sold1" "sold2" "sold3", set the variables as boolean and false by default

Event
Unit sold
Condition
Unit type of triggering unit equal to footmen
Actions

If
Variable sold1 equels to false
Then
Set variable sold1 true
Else
----

Then another trigger with same event and condition and this action:

If
Variable sold1 equal to true
Variable sold2 equal to false
Then
Set variable sold2 true
Else
----

Then the last trigger, again same event and condition

If
Variable sold1 equal to true
Variable sold2 equal to true
Variable sold3 equal to false
Then
Set variable sold3 true
Run trigger "whatever"
Else
------

The "whatever" trigger is the trigger where u put everything u want to happen when the 3 units are sold. U might think its easier just to put all these actions in same trigger since the event and condition is same, but dont do it. It wont work then, it will run the whole thing when the first unit is sold......so make seperate triggers. Hope this helped.
 
Level 16
Joined
Oct 30, 2004
Messages
1,277
You may want alot of things, but u must remember there are limits with the world editor, other choise is for u to learn Jass. Anyway,how many shops u want to make? My suggestion was for one shop, i though u only wanted one shop. If that is the case, then my suggestion works, and in addition if u didnt realize, in the "whatever" trigger u can make it so that the shop is removed and replaced with an copy of that shop that has everything else but not the footmen.
 
Level 5
Joined
Jul 31, 2004
Messages
108
Give the buildings 2 neutal passive, then do the neutral building remove unit, then give back

OR if that doesn't work

Make another building with the same thing, and remove the footment from it and replace the buildings as they get bought.
 
Level 4
Joined
Aug 2, 2004
Messages
37
Okay
maybe i dont have expained my self good enought

I got a shop with 3 Units Footmen, Riflemen and Knight
When one of the units i bourght for eksampel the Footmen then he will be removed from game and the number of spawn units in my map i raised with one Footmen in the side the shop is in
Then when 3 footmen is bourght he have to be removed els there comes to many spawn units
and if neutral player owns the building the units dosent kill em and thats not the idea
 
Status
Not open for further replies.
Top