Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

One of my favorite ways to play the original StarCraft was in a "Team" game. In this game type, multiple players on the same "team" would share control, resources, supply, and even the same starting location. It was like playing as 1 player, only 2 humans were controlling it. It was a lot of fun.

I want to do something very similar in StarCraft 2, but I need to create a custom map in the Galaxy Editor to do it.

I found the editor can quite easily emulate this behavior. There is a Trigger action "Set Alliance for Player Group" to "...treat each other as Ally With Shared Vision, Control, And Spending." To use this, I create units for only 1 of the players, and then set all players to be allied with each other in this way. All the other players get no units and no resources. This makes it so 1 player is the actual owner of all the units and everyone else is tagging along with full control.

This nearly works! The problem is that if I am not the actual owning player, I can't actually see how many minerals/gas/supply the team has. This makes it pretty difficult to build stuff.

What would be the best way to display to the other players how many Minerals/Gas/Supply the team has?

share|improve this question

migrated from gaming.stackexchange.com Jan 9 '11 at 19:33

This question came from our site for passionate videogamers on all platforms.

    
For reference, the game type was called "Team Melee", which was partially made obsolete by the "Shared Control" option in standard melee games. Unfortunately they took out the option of shared resources. –  Resorath Jan 7 '11 at 21:26
    
I am very interested in playing on this map. Is this map posted on battle.net? Can I play with this map and apply your settings to others? I love this method of play and have been trying to find an optimal version of Team Melee. I have thought about making one myself but if the work is already done I won't bother :) Please let me know if this is available by posting here or shooting me a message at spmurphy at googles e-mail. –  user5503 Feb 17 '11 at 6:05

2 Answers 2

up vote 4 down vote accepted

Meanwhile, I figured it out! As @Wikwocket says, custom Dialogs are the way to go; however, here's a very detailed explanation of precisely how I did it.

First off, for convenience I made a new Record in the Trigger Editor I called ResourceDialogUI.

New Record in the Trigger Editor

I also had to make a variable of type "- Record / ResourceDialogUI," which I cleverly also called ResourceDialogUI.

I then painstakingly recreated the positions and sizes of the ingame Resources UI to make a UI that looks almost, but not quite, entirely like the defaults. Also I turned off the defaults. I hope these numbers are useful to someone else too.

New UI setup to mimic the ingame UI

Edit: dialogSizeX might need to be a little bigger and dialogRightBuffer correspondingly larger to account for supply sizes in the triple digits; otherwise you get ... truncation.

Then it's just a matter of updating the numbers at appropriate times using ResourceDialogUI.MineralsText etc. and the "Player Property" getter function to get the values. To update, I simply used a Trigger that fires every .5 seconds, and it works pretty well. It's not as nice as the default text, which "rolls" around to the real numbers, but I'm sure I could polish that.

Also of note: Supply is "SuppliesUsed / SuppliesMade." That took me a couple tries. I was not able to get the color to update to red when you need more supplies; the trigger to set the text color on the fly didn't seem to actually do anything.

My map lets you join other teams on the fly, so I also added in a Trigger to change the icons to appropriate race-specific icons. Using a local variable "race" which is a "Game Link -> Race," here's what does that:

Trigger to update race icons

share|improve this answer

I would think you could add a panel near the upper-right of the screen showing your team's resources/supply. A lot of custom maps have little info panels all over the screen so I'm sure this is possible. The only trick would be getting it to show just your team's stats, not those of both teams.

You may want to ask this at gamedev.stackexchange.com as well; custom map building is kind of a game development topic, and policy questions like "how should I show X to the player" are also within their scope.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.