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.
[07:46 am]
RIVE -- :wob:
[2024-4-22. : 6:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
[2024-4-20. : 8:09 pm]
Vrael -- woo baby talk about a time crunch
[2024-4-20. : 8:08 pm]
Vrael -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
so that gives me approximately 27 more years to finish tenebrous before you get to it?
Please log in to shout.


Members Online: Ultraviolet, Roy