Death Triggers
Jan 17 2015, 2:28 am
By: Oh_Man  

Jan 17 2015, 2:28 am Oh_Man Post #1

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?




Jan 17 2015, 3:21 am Roy Post #2

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




Jan 17 2015, 3:57 am Azrael Post #3



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.




Jan 17 2015, 4:00 am Lanthanide Post #4



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.

Jan 17 2015, 4:04 am jjf28 Post #5

Cartography Artisan

Quote
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




TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Jan 19 2015, 3:45 am Oh_Man Post #6

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.




Jan 19 2015, 4:01 pm rockz Post #7

ᴄʜᴇᴇsᴇ ɪᴛ!

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?"

Jan 31 2015, 1:28 pm Oh_Man Post #8

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.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:26 pm]
UndeadStar -- Vrael, since the ad messages get removed, you look like a total madman for someone that come late
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
Please log in to shout.


Members Online: DarkenedFantasies