Find Me On Discord (Brood War UMS Community & Staredit Network)
Okay I'm having a hard time figuring out how to do this without only using one unit.
Here's an effect I want.
> A broodling dies.
> When it dies every other unit around it changes player.
Another effect.
> An Ultralisk dies.
> Four Broodlings come out of its corpse.
Only way I can think to do this is only using one unit, ie.
Command exactly 1 utlralisk
__
Move location onto Ultralisk
Command exactly 0 Ultralisk
__
Create Four Broodlings at location.
Can anyone think of how to do this with multiple units?
An artist's depiction of an Extended Unit Death
One option is to use LIDs:
http://www.staredit.net/topic/11454/There's also death detection, but because it requires the unit to die on the same frame as the triggers are executing, there's only a 50% accuracy on it. See the following examples:
http://www.staredit.net/sc1db/file/510/ (topic:
http://www.staredit.net/topic/6619/)
http://www.staredit.net/files/649/There's a way with EUDs to make trigger cycles run on every frame to make the death detection system perfect, too, but it seems unstable:
http://www.staredit.net/topic/16427/2/#52
LIDs will work, as Roy mentioned. You need some kind of marker tracking the location of every Ultralisk on the map. While LIDs do this by giving each Ultralisk its own location, you could instead give each Ultralisk its own unit.
For example, you could have a burrowed Infested Terran created underneath every Ultralisk, and use a single 1x1 location to cycle through all the Infested Terrans each trigger cycle. For every Infested Terran, if it has an Ultralisk above it, then it is moved to the Ultralisk's position to keep it with the Ultralisk. If there is no Ultralisk above it, the Infested Terran is removed and 4 Broodlings are created instead.
The catch here is, it'll cause the Ultralisks to move slower due to having a unit constantly moved underneath them.
However, you could try giving the Ultralisks the speed upgrade. Normally, this will allow Ultralisks to escape a 1x1 location (and thus the 1x1 location being centered on the unit underneath them), but since they'll be constantly slowed down, they may end up slowing down enough to be unable to escape the tracking system.
It'd be worth a shot, anyways. Otherwise, it's LIDs or slow Ultralisks for a reliable system.
In short, there's no really clean way (ie, works perfectly every time without downsides, bad side effects or limitations) to do this for an arbitrary number of units.
One possible way, which would be visible to the player if they have detectors, would be to loop through all broodlings owned by the specific player and place a burrowed hydralisk under them owned by player 9. This means center location Z on broodling owned by player x at location y, give broodling to player 9, create hydralisk at location Z for player 9, repeat until no broodlings found. Then give all the broodlings back to the original player. Then on the next trigger cycle, cener location A on hydralisk owned by P9, check if player has brought a broodling to location A, if not then it must have died so do your death effect and remove the hydralisk.
You could optimize this a bit further.
Downsides:
- Broodlings kept getting swapped between players, so any human player who selects the unit will continually lose selection on them.
- Using burrowed units this way may not work if there's an obstruction preventing the burrowed unit from geting placed initially
- You can probably get false positives if the broodling runs away quickly or the hydralisk wasn't exactly where it should have been
LID detection means you can only have a limited number of broodlings / ultralisks on the field, since you have to have a location to track each of them and locations are limited. It means you also have to strictly control how/where/when those units are created on the battlefield so that you can always track them with a location.
Edit: Ninja'd by Azrael, but my reply adds some other aspects his didn't cover.
None.
There's a way with EUDs to make trigger cycles run on every frame to make the death detection system perfect, too, but it seems unstable
To the best of my knowledge the current dEUP setup does not work on any windows 8 computer and should not be used in serious projects (think small fun maps, or alternate versions of larger projects, etc).
off-topicish
As the root EUP actions still work: another unit setup/overflow snowball path may make dEUPs compatible with windows 8's enhanced memory security; though I myself do not plan to research EUPs more until Chkdraft reaches a more complete state.
TheNitesWhoSay - Clan Aura -
githubReached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.
Find Me On Discord (Brood War UMS Community & Staredit Network)
I think LIDs will be my best bet. I will have 3 ultras and 10 broodlings, and I have the locations to spare. I will post results later.
Thanks all.
Except broodlings can't be used by LIDs if the broodlings are mobile. Broods have a max iscript speed of 8 pixels/frame (16 pixels/trigger), and they have a 9 pixel radius. Their average speed is decreased by a brief pause where they just stop for a random amount of time. Ultralisks are similar except they just experience brief spurts of speed.
I wonder if it's possible to "fix" a broken LID system by recognizing when a unit becomes lost and utilize burrowed units to relocate the lost units?
It's also possible to use computer players to add a further complexity to the LID system. If an ultralisk drops 4 broodlings, that will likely cause a major issue, but if you have 4 computer players, it will be less of an immediate issue.
"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"
Find Me On Discord (Brood War UMS Community & Staredit Network)
I got this working fine with the Ultralisks, but I decided to ditch the Broodling idea because the drawbacks were too significant.
Instead the Broodling spell will just be a spell it periodically casts, rather than being an on-death spell.
Cheers all.