Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Spawn items after kill
Spawn items after kill
Nov 17 2013, 12:05 pm
By: DrZygote214  

Nov 17 2013, 12:05 pm DrZygote214 Post #1



Hey, I want to spawn a crystal whenever a player kills an ultralisk. The crystal should appear right where the ultra died.

Don't know how to do this. There are going to be multiple ultras on the map, so not sure how to make a location center on a dead unit.

plz help.



None.

Nov 17 2013, 4:44 pm Roy Post #2

An artist's depiction of an Extended Unit Death

If the Ultralisks do not have a speed upgrade, you can use http://www.staredit.net/topic/11454/ to uniquely track them.

You can also look at my response in a similar topic regarding detecting unit death, but the system mentioned has a high rate of failure.




Nov 17 2013, 5:35 pm Sacrieur Post #3

Still Napping

You don't need to detect their death.

Create the crystal beforehand, and Move Unit → LID. You can even do this by just detecting when the ultra isn't there.

Because the collision frame blocks the crystal from being moved, as soon as the frame is removed upon the ultra's death, the crystal will be moved to the LID's location.



None.

Nov 17 2013, 6:18 pm Roy Post #4

An artist's depiction of an Extended Unit Death

Quote from Sacrieur
Because the collision frame blocks the crystal from being moved, as soon as the frame is removed upon the ultra's death, the crystal will be moved to the LID's location.
This isn't true for power-ups. It will move the crystal on top of the Ultralisk, and the Ultralisk will continuously be displaced and migrate northward uncontrollably.

The trigger condition must check that there is no Ultralisk at the LID before moving/creating the crystal.




Nov 17 2013, 6:39 pm Sacrieur Post #5

Still Napping

Trigger
Players
[Ultralisk Owner]
Conditions
  • Current Player brings exactly 0 Zerg Ultralisk to LID [n].
  • Current Player suffers exactly 1 death of Vespene Geyser.
  • Actions
  • Move Unit: move 1 Khaydarin Crystal from [storage location] to LID [n].
  • Set deaths for Current Player: set deaths of Vespene Geyser to 0.
  • Preserve trigger.


  • Piece of Torrasque cake.

    And remember that you don't want to spawn khaydarin crystals endlessly, so we have to do garbage collecting. This can be done with a simple death counter switch. Alternatively it can be done using switches, but DCs are the favored method among mappers due to their nature of being player specific, while switches are universal.

    Post has been edited 6 time(s), last time on Nov 17 2013, 7:16 pm by Sacrieur.



    None.

    Nov 18 2013, 1:15 am DrZygote214 Post #6



    I don't think this is viable. If i knew there were always gonna be 12 ultralisks, then i could make 12 locations.

    But the number of ultras is arbitrary. They will spawn at random times and a random number will be on the map.

    Besides, even if I did it with 12 locations, they would probably all center on ONE ultra, instead of 1 location for 1 ultra each.

    Post has been edited 1 time(s), last time on Nov 18 2013, 1:20 am by DrZygote214.



    None.

    Nov 18 2013, 1:57 am Roy Post #7

    An artist's depiction of an Extended Unit Death

    Quote from DrZygote214
    But the number of ultras is arbitrary. They will spawn at random times and a random number will be on the map.
    It doesn't need to be a fixed number; you just need enough locations to cover the max number of Ultralisks that could be on the map at a given time. Then you just recycle them as Ultralisks die and new ones are spawned.

    Alternatively, you can only place LIDs on Ultralisks that are near the players' unit(s). This would work well if the player only controls a single unit, but there can be many Ultralisks on the map at a given time. This would require you to use a second player to tag/untag Ultralisks as they enter the "hostile" range. (E.g., Make all Ultralisks owned by Player 7 when they aren't near players. When an Ultralisk owned by Player 7 approaches a player, move the LID onto it and give it to Player 8.)

    Quote from DrZygote214
    Besides, even if I did it with 12 locations, they would probably all center on ONE ultra, instead of 1 location for 1 ultra each.
    Read the http://www.staredit.net/topic/11454/ topic more carefully: the system's sole purpose is to individually track units of the same type owned by the same player. It's exactly what you're asking for here.

    If LIDs are not an option, you can also consider the other one I mentioned, explained in http://www.staredit.net/topic/6619/ and demonstrated in this proof-of-concept map: Duplicating Marines. It only works 50% of the time, but I would assume you aren't building a system where an item drops 100% of the time, so it may actually work out well for you.




    Nov 18 2013, 4:58 pm sakuckoinvius Post #8



    Just throwing out an idea like that... wouldn't it be easier to just make a location follow your hero (the size gonna depend of the range of your unit, of course) and then make some kind of "detect ultralisk death", move a different location to this position and spawn the item you want? It should work 100% of the time beside if you have massive amount of ultralisk that die at the same time (which is close to impossible with a single unit with hypertriggers on)



    None.

    Nov 18 2013, 5:19 pm Roy Post #9

    An artist's depiction of an Extended Unit Death

    Quote from sakuckoinvius
    [...] and then make some kind of "detect ultralisk death", move a different location to this position [...]
    And herein lies the problem DrZygote is trying to solve: there is no way to reliably move a location onto a dead unit. The method I mentioned only has a 50℅ success rate (depending on which frame the unit dies on), and LIDs are the only other known way of tracking the location of a non-unique unit.

    The other things you mentioned are not necessary if the above issue is solved.




    Nov 18 2013, 5:57 pm jjf28 Post #10

    Cartography Artisan

    You could spawn at the last known location, as if the ultra defecated as it died :P



    TheNitesWhoSay - Clan Aura - github

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

    Nov 18 2013, 9:24 pm Roy Post #11

    An artist's depiction of an Extended Unit Death

    Quote from jjf28
    You could spawn at the last known location, as if the ultra defecated as it died :P
    Right, but you'd still need a way to individually track the location of each Ultralisk. This would be the LID approach, which would look highly accurate, as it's a 1px location that always follows the Ultralisk (until its death).

    It would be more difficult to place the crystal from an older location than from wherever the LID lands. I'm not sure what you're suggesting to do that solves the problem at hand further.




    Nov 21 2013, 7:46 pm sakuckoinvius Post #12



    Quote from Roy
    Quote from sakuckoinvius
    [...] and then make some kind of "detect ultralisk death", move a different location to this position [...]
    And herein lies the problem DrZygote is trying to solve: there is no way to reliably move a location onto a dead unit. The method I mentioned only has a 50℅ success rate (depending on which frame the unit dies on), and LIDs are the only other known way of tracking the location of a non-unique unit.

    The other things you mentioned are not necessary if the above issue is solved.
    I was thinking some kind of "scan ultra in the following hero location" that move a small location to the ultralisk, when 0 ultralisk and some condition that doesn't spam spawn (like moving back the location somewhere that block the condition), action: spawn crystal (if it's 100%) otherwise imploy a binary rate.

    That was my idea of tracking ultralisk in the following hero's ultralisk. You (Roy) should be used to my ideas since we worked for couple maps together :P

    I dunno if it could to block the possibility that could be like 2-3 ultralisks in the same location. Maybe mixing with LID and/or ID.

    I was wondering, is it possible to set ID to spawning unit or the only way to do so is to just make it spawn in orders on the map. If so, that would be helpful as well to just spawn on ID based forcing ultralisks to spawn first when the map starts... but that would be pretty rough grid system spawning right at the beginning... :) Have fun thinking about this Roy :)



    None.

    Nov 21 2013, 8:27 pm Sacrieur Post #13

    Still Napping

    Quote from sakuckoinvius
    Quote from Roy
    Quote from sakuckoinvius
    [...] and then make some kind of "detect ultralisk death", move a different location to this position [...]
    And herein lies the problem DrZygote is trying to solve: there is no way to reliably move a location onto a dead unit. The method I mentioned only has a 50℅ success rate (depending on which frame the unit dies on), and LIDs are the only other known way of tracking the location of a non-unique unit.

    The other things you mentioned are not necessary if the above issue is solved.
    I was thinking some kind of "scan ultra in the following hero location" that move a small location to the ultralisk, when 0 ultralisk and some condition that doesn't spam spawn (like moving back the location somewhere that block the condition), action: spawn crystal (if it's 100%) otherwise imploy a binary rate.

    That was my idea of tracking ultralisk in the following hero's ultralisk. You (Roy) should be used to my ideas since we worked for couple maps together :P

    I dunno if it could to block the possibility that could be like 2-3 ultralisks in the same location. Maybe mixing with LID and/or ID.

    I was wondering, is it possible to set ID to spawning unit or the only way to do so is to just make it spawn in orders on the map. If so, that would be helpful as well to just spawn on ID based forcing ultralisks to spawn first when the map starts... but that would be pretty rough grid system spawning right at the beginning... :) Have fun thinking about this Roy :)

    Sounds terribly complicated for something that can be done simpler.

    Azrael has already made a system for Index IDs, found here.



    None.

    Nov 25 2013, 3:25 am rockz Post #14

    ᴄʜᴇᴇsᴇ ɪᴛ!

    kills to cash is 1000x simpler than deaths into units.

    The only way I know how to do this is by limiting the max # of ultraslisks on the map (or in a location), creating enough triggers to filter through all of them using a location identification, and detect when a player kills an ultra, then find out which one died with a 50% success rate. You still know that a player killed an ultralisk, so you can always just award any bonuses directly to the player automatically.



    "Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [01: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:
    [2024-4-27. : 9:38 pm]
    NudeRaider -- Ultraviolet
    Ultraviolet shouted: NudeRaider sing it brother
    trust me, you don't wanna hear that. I defer that to the pros.
    [2024-4-27. : 7:56 pm]
    Ultraviolet -- NudeRaider
    NudeRaider shouted: "War nie wirklich weg" 🎵
    sing it brother
    [2024-4-27. : 6:24 pm]
    NudeRaider -- "War nie wirklich weg" 🎵
    Please log in to shout.


    Members Online: Roy