So I'm trying to make the old SC1 style buyer system where you bring X amount of units to a beacon and it removes the units and then gives you what you purchased. It seems 10x harder to make in SC2 and I'm having a hard time getting my head around on it. So far this is what I've got:
Events
Unit - ((String(Civilian (Male))) from the Global data table) Enters Tank 4
Local Variables
Conditions
(Number of Living units in (Civilian (Male) units in Zealot 1 owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 4
Actions
Unit - Remove (Triggering unit) from the game
Unit - Create 1 Siege Tank (Tank Mode) for player (Triggering player) at (Center of Tank 4) using default facing (No Options)
So, what I've got would work perfectly if the unit only cost one thing. But since it costs 4, it's just going to remove one civilian since only one civilian is considered the triggering unit. How could I change this?
I'd do something different than removing the triggering unit.
Unit Group - Pick each unit in (Civilian (Male) units in Ambush 2 Units owned
by player Any Player matching Excluded: Missile, Dead, Hidden, with at most 4)
and do (Actions)
Actions
Unit - Remove (Picked unit) from the game
Well that sort of worked. When I tried putting 5 civilians onto it, it created 2 tanks and left me with 3 civilians which means that it ran the trigger twice and didn't remove all the picked units for some reason...
I created a test map to see if I could make it work. So far it seems to work, but I'm not sure how you managed to put 5 civilians in before it created the tank. I ended up with a tank the instant the 4th entered the region.
So I'm trying to make the old SC1 style buyer system where you bring X amount of units to a beacon and it removes the units and then gives you what you purchased.It seems 10x harder to make in SC2 and I'm having a hard time getting my head around on it.So far this is what I've got:
Events
Unit - ((String(Civilian (Male))) from the Global data table) Enters Tank 4
Local Variables
Conditions
(Number of Living units in (Civilian (Male) units in Zealot 1 owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 4
Actions
Unit - Remove (Triggering unit) from the game
Unit - Create 1 Siege Tank (Tank Mode) for player (Triggering player) at (Center of Tank 4) using default facing (No Options)
So, what I've got would work perfectly if the unit only cost one thing.But since it costs 4, it's just going to remove one civilian since only one civilian is considered the triggering unit.How could I change this?
I am doing something similar for my 'Pick Your Defense' remake. Basically I create one region and send all the units you buy from this type of 'shop' there. Then in another trigger I check what player the unit is owned by. If it's, for example, player 1, the unit will be moved to whatever location you specify. Doing it this way means less work and an easy way of getting units to whoever buys them. Here I'll even share with you one of the triggers I use to buy units;
BuyHydralisksEventsUnit-AnyUnitEnterswithin1.25of(PositionofBeacon(ProtossLarge)[67.50,67.50])LocalVariablesConditions(Unittypeof(Triggeringunit))==ShoppingCartActionsGeneral-Wait0.3RealTimesecondsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Raceofplayer(Ownerof(Triggeringunit)))==Zerg(Player(Ownerof(Triggeringunit))Minerals)>=75ThenPlayer-Modifyplayer(Ownerof(Triggeringunit))Minerals:Subtract75Unit-Kill(Triggeringunit)Unit-Create2Hydraliskforplayer(Ownerof(Triggeringunit))at(CenterofUnitTransfer)usingdefaultfacing(NoOptions)UI-Display"You've bought two Hydralisks."for(Playergroup((Ownerof(Triggeringunit))))toSubtitleareaUnit-Create1ShoppingCartforplayer(Ownerof(Triggeringunit))at(CenterofRespawnShopUnit)usingdefaultfacing(NoOptions)UnitSelection-Select(Lastcreatedunit)forplayer(Ownerof(Triggeringunit))ElseUI-Display"You need to be playing as Zerg and ..."for(Playergroup((Ownerof(Triggeringunit))))toSubtitlearea
Unit transfer is the location that moves the units to wherever. I'm sure you could mod this a little bit for what you need. On a side note, why are you using a data for the unit type? o.o It would be easier just to specify it in the conditions using 'Unit type of unit'...
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I'm trying to make the old SC1 style buyer system where you bring X amount of units to a beacon and it removes the units and then gives you what you purchased. It seems 10x harder to make in SC2 and I'm having a hard time getting my head around on it. So far this is what I've got:
Events
Unit - ((String(Civilian (Male))) from the Global data table) Enters Tank 4
Local Variables
Conditions
(Number of Living units in (Civilian (Male) units in Zealot 1 owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 4
Actions
Unit - Remove (Triggering unit) from the game
Unit - Create 1 Siege Tank (Tank Mode) for player (Triggering player) at (Center of Tank 4) using default facing (No Options)
So, what I've got would work perfectly if the unit only cost one thing. But since it costs 4, it's just going to remove one civilian since only one civilian is considered the triggering unit. How could I change this?
I'd do something different than removing the triggering unit.
Something like that might work.
Edit: attached screenshot for clarity.
Well that sort of worked. When I tried putting 5 civilians onto it, it created 2 tanks and left me with 3 civilians which means that it ran the trigger twice and didn't remove all the picked units for some reason...
I created a test map to see if I could make it work. So far it seems to work, but I'm not sure how you managed to put 5 civilians in before it created the tank. I ended up with a tank the instant the 4th entered the region.
Map attached.
@goofoffjw: Go
hmm, odd the only thing different is the event (I said civlian rather than any unit). thanks for the help.
I am doing something similar for my 'Pick Your Defense' remake. Basically I create one region and send all the units you buy from this type of 'shop' there. Then in another trigger I check what player the unit is owned by. If it's, for example, player 1, the unit will be moved to whatever location you specify. Doing it this way means less work and an easy way of getting units to whoever buys them. Here I'll even share with you one of the triggers I use to buy units;
Unit transfer is the location that moves the units to wherever. I'm sure you could mod this a little bit for what you need. On a side note, why are you using a data for the unit type? o.o It would be easier just to specify it in the conditions using 'Unit type of unit'...