I'm working on an RPG and in battle, there are sometimes multiple Zerglings to slay. I need to detect the location of a just-killed Zergling so I can create another unit in its blood once it dies. How?
None.
We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
You could follow each a 1x1 pixel location, but if they burrow or have speed upgrade this can easily mess up.
Otherwise you can still detect dead units for 1 frame which means it's only 50% accurate because triggers run every 2nd frame.
Also when they are owned all by the same player you wouldn't be able to center on the dead one specifically, you'd always get the leftmost.
So your best bet is using a 1x1 pixel location. And if you could use a bigger unit that would be much better because they can't outrun it as easily.
You could follow each a 1x1 pixel location, but if they burrow or have speed upgrade this can easily mess up.
Doesn't work on Zerglings, even without speed upgrade, they move too fast for their size.
The only units it works on are
- Civilian
- Goliath
- Marine (no stim)
- Medic
- SCV
- Siege Tank
- Vulture (no speed)
- Drone
- Lurker
- Ultralisk (no speed)
- Archon
- Dark Archon
- Dragoon
- High Templar
- Probe
- Reaver
You could use one of these units instead with the aforementioned 1x1 pixel locations. Drones maybe, though you'll need to issue them orders.
Another possibility is to differentiate the Zerglings by unit and player. For example, if you have a Zergling and Hero Zergling representing the same unit, you can now keep track of 2 of them at the same time. If you make them for P7 and P8 (hostile computers) you have 4 trackable units.
Post has been edited 4 time(s), last time on Oct 12 2010, 12:03 pm by DevliN. Reason: Mineral abuse.
thanks.. yer i decided to go with the 1x1 location tracker
None.
We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
Quote from name:Azrael.Wrath
The only units it works on are
[list]
I'm pretty sure it works for dts, bats and defilers too.
These are all the units which can possibly escape a 1x1 location.
Here's my theoretical list: (* indicates speed upgrade).
Nuclear Missile
Scarab
Spider Mine
Interceptor
Vulture*
Zergling*
Ultralisk*
Scourge
Broodling
Zealot*
Marine*
Firebat*
Infested Terran
Hydralisk*
Zergling
Dragoon
Dark Templar (Unit)
Infested Kerrigan
Dark Templar (Hero)
Zealot
Civilian
Firebat
Ghost
Sarah Kerrigan
Hydralisk
I'm unsure of the ghost units, hydralisk, and if marines should be included. They have a larger center than firebats, and thus may be able to handle the location.
If you want to test, test them moving DOWN, except for ghost units which should be horizontal. Most units have a very small positive y direction (zealots are 5 pixels, dts are 6 pixels, etc...)
You might have trouble with dragoons, but defilers should work. Firebats can escape, but Gui Montag can't.
"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"
Sorry guys, but why not to make the location bigger (like 2x2, 3x3 or whatever) and tweak it's size?
Some.
We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch
Because there's more than 1 ling.
Firebats can escape, but Gui Montag can't.
I didn't know Gui couldn't, thanks.
Post has been edited 2 time(s), last time on Oct 12 2010, 12:03 pm by DevliN. Reason: Mineral abuse.
An artist's depiction of an Extended Unit Death
Since it hasn't been thrown out there yet, I would suggest maybe a virtual hp system, so you could track the units that are supposed to die via triggers. Depending on the damages done upon the Zerglings, you could also try an EUD hp detection and kill* the Zergling prematurely, although moving the location onto the proper zergling would be a true hassle.
Regarding the 1x1 ID method, if the movement speed isn't crucial to your game play, you could purposefully create movement lag by moving/creating a unit above/below each Zergling. Depending on the number of Zerglings and the size of your map in general, this could create actual lag.
*Probably want to make the illusion of the Zergling dying and just move it elsewhere, because otherwise you'd lose the UnitID.
Why can't you just give the zergling to a different player once it comes within firing range of your hero and constantly move a location on it? If multiple zerglings are onscreen make all but one invincible and give the attackable one to the player that you are centering the location on.
None.
Why can't you just give the zergling to a different player once it comes within firing range of your hero and constantly move a location on it? If multiple zerglings are onscreen make all but one invincible and give the attackable one to the player that you are centering the location on.
In many cases, players will want to decide which Zergling they want to attack, not have the game decide for them. Duh.
None.
Why can't you just give the zergling to a different player once it comes within firing range of your hero and constantly move a location on it? If multiple zerglings are onscreen make all but one invincible and give the attackable one to the player that you are centering the location on.
In many cases, players will want to decide which Zergling they want to attack, not have the game decide for them. Duh.
Most people A-move to kill monsters anyways. It's rare to see people manually targeting.
Besides, the invincibility can be attributed to some sort of in-universe "unnatural power" that can be thrown into the plot. No big deal.
None.
Try take a look at this map for detecting corpses:
Attachments:
None.