Yeah just use, "For Each Unit in Unit Group"
It will iterate and set a specified variable to the current unit and then loop to the next one.
It has to be, there is not other way to detect when a player leaves like that.
Are you trying to edit someone elses map, or are you trying to implement this yourself?
There is an event that you can give a new trigger. Any Player leaves the game.
You can then Send a text message and use the function, Player Name(Triggering Player) to get the users name as text.
I played this last night with some friends against AI. Was pretty well made, seemed a little slow at first but it reminded me greatly of WC3. Once you get some more polish on the game it'll be super awesome.
To be honest, setting variables that often will not lag the game. That's such a trivial operation in the scheme of things. I made a nice Threat System back in WC3. You can checkout the code and see how i put that together here -> http://peeeq.de/code.php?id=7067 And some Examples of it's use here -> http://peeeq.de/code.php?id=7069
There is also a new function in the editor called Unit Tag, which returns a unique integer for each unit. So you could set it up to use an array and store more information per unit. For example...
threatToBeGiven = unitSettings[GetUnitTag(TriggeringUnit)].threatAdditionAmount * unitSettings[GetUnitTag(TriggeringUnit)].threatMultiplier
This way you don't have to work directly with the Custom values and are allowed some more flexibility with your system and storage.
Let me know if you have any questions about anything!
That site will give you a link, just paste it in your response. It formats the text to look like the GUI editor.
Once you do that I'll check it out and we'll get this figured out!
Quote from fishy77: Go
I also tried this and the debug shows but the behavior isn't added.General - Pick each integer from 1 to 2, and do (Actions) Actions Unit - Add 1 Hero - Tier 0 - large nerf to (Unit (Picked integer) from Hero) from (Last created unit) Unit - Add 1 Hero - Tier 0 - large nerf to (Unit (Picked integer) from Hero 2) from (Last created unit) Debug - Display "tier 0.1 executed" as debug output using Type 01, and Do display it in the game window
It's showing because you're running the loop against predefined integers, in the 1st example, you're trying to run it against a unit from a group, if there's no unit, it doesn't run, but the 2nd example will always run twice.
Ya I noticed Duran was in the game, Duran back in BW was a shapeshifter, so it makes sense that he looks different this time. He was also the one who was all about the hybrids. And Narud is Duran backwards. He DEFINITELY is Duran! Very cool.
As far as I'm aware there's nothing included by default to accomplish this. It won't be to hard to just make yourself a function that loops and returns that value when passed an array. (I suggest a function instead of an inline while loop, that way you can build up your own toolset of functions to help any future projects you make run smoother.)
Uploaded the HD version of the video!
Most of the maps were made for me to test the editor and learn everything I needed for one big project, now I'm nearing the point that I want to start laying the framework for this big project. Base Race is my latest work and is in active development.
Hey guys, I just put together a little video showcasing a lot of my different SC2 projects.
Let me know what you think!
Another prototype I forgot to include in the above video:
Maps in order of viewing...
1. Base Race [In Development] Published "Up to 4 player Co-Op Defense Action RPG."
2. Top Down Fighters [Legacy Prototype] Published "Up to Player Co-Op Class Based Top Down Shooter, First map made in SC2 Editor, laggy but still fun."
3. Bomberling [In Development] Published "Up to 4 Player FFA bomberman style action."
4. Hack n Slash [ Prototype ] Unpublished "Just a simple Diablo control style map."
5. Star Screamers [ Prototype ] Unpublished "Up to 4 Player Co-Op Top Down Shooting Arena Action. (Based on Bomberling code for prototyping."
6. Ruthless [ In Development ] Unpublished "Up to 10 player Team Based RTS/Action RPG. Play is similiar to Savage, Savage 2, Natural Selection."
This video was just to showcase some of my various SC2 projects and maybe gauge the community's response to which maps they'd like to see me expand on. [EDIT] Changed link to HD video.