Death count bug
Aug 1 2015, 5:32 pm
By: Chamomile  

Aug 1 2015, 5:32 pm Chamomile Post #1



I have a map that relies pretty heavily on using death counts for variables. The map uses player 4, whose only units are Terran Civilians immediately given to Player 1 Zerg at the start of the level, to hold these deaths. Triggers dealing with deaths tied to a specific unit (Zerglings, Hydralisks, Ultralisks, and Broodlings) work fine. Triggers that fire on total deaths do not. I've attached the map with the bug to this post, and for now plan on solving the problem by using Defiler deaths to fire triggers that are tied to total deaths, and have every trigger that adds any amount of deaths to any unit type add the same amount to Defiler deaths. This should work for now, but I'd still like to know why deaths tied to "men" or "any unit" aren't firing properly.

Attachments:
02 - Wilderness Nightmare.scm
Hits: 2 Size: 60.07kb



None.

Aug 1 2015, 5:42 pm Wormer Post #2



What do you expect when you say Deaths("Player 4", "Any unit", Exactly, 1)?

ADDED:
I believe "Any Unit", "Men" and etc. aren't valid deaths conditions entries. Probably they cause an overflow (make the condition check for a variable pointing just after the deaths table). As far as I remember, SC doesn't keep the total number of unit deaths and deaths of units falling into categories (am I wrong?). I believe, if you need to count total deaths you need to do it manually like you described.

Post has been edited 2 time(s), last time on Aug 1 2015, 5:54 pm by Wormer.



Some.

Aug 1 2015, 6:36 pm O)FaRTy1billion[MM] Post #3

👻 👾 👽 💪

You can do deaths of any unit/men/buildings/whatever in StarEdit, it would just add them up itself... let's look at this.

It does this:
Code
00460417  |> 8B048D C41F580>MOV EAX,DWORD PTR DS:[ECX*4+581FC4]      ;  Case E5 of switch 00460398
0046041E  |. 03048D 741E580>ADD EAX,DWORD PTR DS:[ECX*4+581E74]
.

So,
any unit = (int*)(0x581FC4)[player] + (int*)(0x581E74)[player] (building deaths + men deaths)
men = (int*)(0x581E74)[player] (men deaths)
buildings = (int*)(0x581FC4)[player] (building deaths)
factories = (int*)(0x5820E4)[player] (factory deaths)


EDIT:
If I am understanding the map correctly, you are setting deaths and then checking deaths of 'any unit'? Based on what I just checked, this will not work as simply as you had thought. Men, buildings, factories are their own counters that can be set with Set Deaths. If, when adding for the specific unit with triggers, you also add 1 to 'Men' (or 'Buildings') then it will work (you can't set to 'Any Unit' as that is the sum of men and buildings). Deaths being added from units being killed will work as intended.

* tl;dr: Add deaths for 'Men' instead of the specific unit in the set deaths action, then 'Any Unit' in the deaths condition will work as intended. *

Post has been edited 9 time(s), last time on Aug 1 2015, 7:52 pm by FaRTy1billion.



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!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Aug 1 2015, 8:57 pm Wormer Post #4



Excellent!.. So SC actually supports counts for groups, but it only updates them when unit actually dies on the map. These counts remain unchanged when SC executes set deaths, unless you specify the group directly. Thank you for this!



Some.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:56 am]
Oh_Man -- cool bit of history, spellsword creator talking about the history of EUD ^
[09:24 pm]
Moose -- denis
[05:00 pm]
lil-Inferno -- benis
[10:41 am]
v9bettel -- Nice
[2024-4-19. : 1:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[2024-4-18. : 10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[2024-4-18. : 10:11 pm]
Ultraviolet -- :P
[2024-4-18. : 10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
Please log in to shout.


Members Online: jun3hong, Oh_Man