HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detecting ability use with shared unit control

07-24-2004, 04:16 PM#1
johnfn
I have hit a rather big block in the development of this zone defense. Let me explain the problem, and then how it seems there is no way to solve it.

I have a barracks for each of my zones. You need to bring enough units to the barracks to control the zone. However this would sometimes lead to problems because there would be a huge battle in a zone and then suddenly half the attack force dissapears because you just got the zone. So I decided to have a little button enabling you to buy the zone when you wanted to on the barracks. Sounds easy, but turns out to be a lot more difficult.

My first try was to have shared unit control for all barracks and then use triggering player. That doesnt work because you cant use triggering player.

My second try was to detect who was currently selecting the barracks and combine that with how many units they both have at the time in the zone, but that dosent work either because you cant use the selection unit group in conditions.

My third try was to have the barracks sell a unit that would be interpreted as buying the barracks. The unit sells fine, but you can also sell the unit with a bought barracks, leading to all sorts of bugs.

Technically I could use two different types of barracks with the selling unit solution, but swapping buildings in my map has a bad reputation of putting them in all different places.

I am stumped with this problem. Any help is greatly appriciated. (I give rep!:P)
07-24-2004, 04:20 PM#2
Electromancer
I would make it an item or something, and have it sell to a unit. Then, the unit who gets the item would lose the item, and the owner of the unit would gain control of the zone IF they had enough units in there. Otherwise, they would get the message "Not enough units" or something.

You could also just do "buying unit" or something. Or owner of buying unit. Your choice.
07-24-2004, 04:20 PM#3
Shimrra
You could try Neutral Building - Remove Unit Type to remove the unit after you buy and thus eliminating the bug. If the Barracks goes neutral again, you can add the unit back.
07-24-2004, 04:30 PM#4
johnfn
Quote:
Originally Posted by Shimrra
You could try Neutral Building - Remove Unit Type to remove the unit after you buy and thus eliminating the bug. If the Barracks goes neutral again, you can add the unit back.
Ughhhh... I knew there was something like this... Next time perhaps I'll check the GUI list more throughly.

Electromancer - Your solution would work except for the fact that that item would still be sellable even with a barracks. I think I'll stick with units now that I know how to do it (for some reason I think of it more cleaner)

Thanks to both of you.