Heya!
I'm using a mechanic in my campaign where the player is forced to avoid having many casualties.
The trigger goes like this:
CONDITION:
> DEATH: Player 1 has suffered exactly, at most, at least<?> <value> deaths of men.
ACTION:
> DISPLAY TEXT MESSAGE: Display for current player: "Casualties at unacceptable numbers. Mission Aborted."
> DEFEAT: End scenario in defeat for current player.
I need to know two things from this.
1, what should I use for the condition? Exactly, At most, or At least?
2, Is there a way for me to show the player how many men he has lost? Kind of like a counter or a leaderboard? i kinda need it to show only the player's casualties. The only thing that should be seen is the player's own color and the number of men he lost. Is there a way for me to do that?
Though, regarding the second one, I could always go for an alternative which is a notification of how much the player has lost. But I liked the counter more since its much more convenient to the player.
Sort of wish that the SCBW Modding Community was still active. </3
An artist's depiction of an Extended Unit Death
You would use "At Least" if you're saying it should happen if at least X number of units have died.
I don't think you can make a leaderboard for deaths directly; you would have to use custom score, and keep that in sync with the player's total number of deaths. I would recommend
Binary Countoffs for doing that.
You can show deaths in the leaderboard by putting an extended unit in for leaderboard kills.
Find the unitID of the death you wish to display (place it on the map, open up properties to see Unit ID), then use leaderboard kills, and in the unit field type "ID:" then your unitID+228, ex: type "ID:228" (without quotes) for deaths of terran marine (source)
As a bonus: this works on Mac too since the memory's all in nice 4-byte blocks and the tables are at the same relative positions.
The extended unit may cause trouble in SCMDraft's texttrigs though so if you use TextTrigs regularly and don't want to have to manually remove and re-add this trigger go with binary countoffs->custom scoreWoops you said deaths of men in specific.
Post has been edited 1 time(s), last time on Apr 15 2014, 4:05 pm by jjf28.
TheNitesWhoSay - Clan Aura -
githubReached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.
You can just subtract deaths for Men and add to Score, and then use the Score condition for the lose trigger.
TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB -
topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig -
topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!
You can just subtract deaths for Men and add to Score, and then use the Score condition for the lose trigger.
I'm going to sound stupid but what are the actions and conditions I should use for that?
Sort of wish that the SCBW Modding Community was still active. </3
An artist's depiction of an Extended Unit Death
Player 1AlwaysShow Leaderboard for most custom. Display label: "Total Deaths"Disable use of computer players in leaderboard calculations Player 1Current Player has suffered at least 1 deaths of [men].Set Deaths for Current Player: Subtract 1 [men].Set Score for Current Player: Add 1 custom.Preserve Trigger Player 1Current Player custom score is at least 50Display Text Message: "Casualties at unacceptable numbers. Mission Aborted."End scenario in defeat for the current player.
Player 1AlwaysShow Leaderboard for most custom. Display label: "Total Deaths"Disable use of computer players in leaderboard calculations Player 1Current Player has suffered at least 1 deaths of [men].Set Deaths for Current Player: Subtract 1 [men].Set Score for Current Player: Add 1 custom.Preserve Trigger Player 1Current Player custom score is at least 50Display Text Message: "Casualties at unacceptable numbers. Mission Aborted."End scenario in defeat for the current player. YAY!!! IT WORKED!! THANKIESSSS!!!!
Sort of wish that the SCBW Modding Community was still active. </3
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
Just be aware that when within 1 trigger loop 2 or more different types of units of Player 1 die it will only count 1. (e.g. splash)
And that there's no easy fix for it.
An artist's depiction of an Extended Unit Death
Just be aware that when within 1 trigger loop 2 or more different types of units of Player 1 die it will only count 1. (e.g. splash)
And that there's no easy fix for it.
There is an easy fix: wait for the next trigger cycle and it will decrement again. I think you've confused this scenario with kills-to-cash (or just kill score in general, or you missed the part where I'm subtracting 1 instead of setting to 0). There is no problem here with the scenario described, though it could be improved by using binary countoffs to calculate splash damage on the same cycle.
Is it possible for people to suffer a large number of deaths within a short amount of time? If so, this system may not register a loss at the moment the player is supposed to lose, because it will still be busy subtracting deaths one at a time. This would give a player who should already be dead a significant opportunity to kill more enemy units, unfairly changing the outcome of the game.
To account for this, you'd simply need to add more subtraction triggers. Looking at Roy's triggers, you would change this:
Player 1Current Player has suffered at least 1 deaths of [men].Set Deaths for Current Player: Subtract 1 [men].Set Score for Current Player: Add 1 custom.Preserve Trigger To this:
Player 1Current Player has suffered at least 1024 deaths of [men].Set Deaths for Current Player: Subtract 1024 [men].Set Score for Current Player: Add 1024 custom.Preserve Trigger Player 1Current Player has suffered at least 512 deaths of [men].Set Deaths for Current Player: Subtract 512 [men].Set Score for Current Player: Add 512 custom.Preserve Trigger Player 1Current Player has suffered at least 256 deaths of [men].Set Deaths for Current Player: Subtract 256 [men].Set Score for Current Player: Add 256 custom.Preserve Trigger Player 1Current Player has suffered at least 128 deaths of [men].Set Deaths for Current Player: Subtract 128 [men].Set Score for Current Player: Add 128 custom.Preserve Trigger Player 1Current Player has suffered at least 64 deaths of [men].Set Deaths for Current Player: Subtract 64 [men].Set Score for Current Player: Add 64 custom.Preserve Trigger Player 1Current Player has suffered at least 32 deaths of [men].Set Deaths for Current Player: Subtract 32 [men].Set Score for Current Player: Add 32 custom.Preserve Trigger Player 1Current Player has suffered at least 16 deaths of [men].Set Deaths for Current Player: Subtract 16 [men].Set Score for Current Player: Add 16 custom.Preserve Trigger Player 1Current Player has suffered at least 8 deaths of [men].Set Deaths for Current Player: Subtract 8 [men].Set Score for Current Player: Add 8 custom.Preserve Trigger Player 1Current Player has suffered at least 4 deaths of [men].Set Deaths for Current Player: Subtract 4 [men].Set Score for Current Player: Add 4 custom.Preserve Trigger Player 1Current Player has suffered at least 2 deaths of [men].Set Deaths for Current Player: Subtract 2 [men].Set Score for Current Player: Add 2 custom.Preserve Trigger Player 1Current Player has suffered at least 1 deaths of [men].Set Deaths for Current Player: Subtract 1 [men].Set Score for Current Player: Add 1 custom.Preserve Trigger Instead of only being able to convert 1 death into custom score every trigger cycle, this could convert 2047, allowing the maximum number of simultaneous deaths to be handled fairly. In other words, instead of only being able to process 12 deaths per second, this improvement can process 24564 deaths per second.
If this is a melee-like map (with the potential for mass air units, or nuclear missiles), or if there are stacked minerals/geysers or Zerg burrowing (which allow for nearly unlimited units to occupy the same space), then the limit here should be 2047 to ensure your triggers always work as they're intended, when they're intended.
There really isn't a reason to use less of these triggers, so it's better to err on the side of caution and make a few too many than one too few. If you want to make sure you're not adding unnecessary triggers, then just figure out the absolute maximum number of units which could ever die simultaneously (in the most extreme unlikely circumstance) and make sure your system can convert that many deaths every trigger cycle.
Otherwise, just start at 1024 and go down to 1, as demonstrated above. There can never be more than 1700 units in a map, so being able to handle 2047 simultaneous deaths will always be sufficient.
Edit:
it could be improved by using binary countoffs to calculate splash damage on the same cycle.
Ninja'd
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
There is an easy fix: wait for the next trigger cycle and it will decrement again.
Unfortunately not. Subtracting 1 deaths of men decrements all death counters of units belonging to men.
So when you have 1 death of marine and 1 death of ghost it will subtract 2 deaths: 1 for marine, 1 for ghost.
An artist's depiction of an Extended Unit Death
Oh, in that case, the binary countoffs Azrael posted would be necessary to partially prevent that issue. You could use "Exactly" and not use binary to take care of the issue entirely.
Post has been edited 1 time(s), last time on Apr 17 2014, 3:15 pm by Roy.
I suppose if there's a possibility that different types of units will die simultaneously for the same player, then you'd want to handle each possible unit separately, instead of combining them with "[men]". Even if you needed a copy for every unit, it'd be easy to quickly do so by applying
Farlap to the current system.
You could use "Exactly" and not use binary to take care of the issue entirely.
This is also easy to do, using
Ar3sgice's Trigger Duplicator. Just need to make sure you have a trigger for every value, up to the maximum number of simultaneous deaths possible for any given player (which in normal melee is 1698).
Post has been edited 3 time(s), last time on Apr 17 2014, 3:35 pm by Azrael.