The function Number of living units in unit group works as intended but not with number of dead units in unit group. Apart from this, is there any other means to reference other units (apart from triggering unit) if say, I want to refer to the creator of unit and unit created (2 different units) at different events (say an Effect Used event and a Unit Dies event). Gladly appreciate any advice.
Dead units are removed from the game unless you modify the Stats: Death Time field under the Units data type.
You could always store those units to global variables for later use. Try the Original Caster Of Unit function.
The Original Caster Of Unit function does not work probably because the unit is created through a trigger event. I tried setting up the created unit's custom value (X of Point & Y of Point) to the position of the creator, then when the created unit dies or is removed, made the created unit respawn at the position of the creator by creating a variable with function (Point from XY - whereby X reflects the custom value X of Point of the creator's position and Y reflects the custom value Y of Point of the said creator's position).
Everything works, but there is a slight problem, which is when the creator dies, the created unit will still spawn regardless of whether the creator lives or dies. I tried the condition Unit is Alive == False (hereby the Creator) but I run into a trouble of referencing the Creator since the Unit Dies or Unit Is Being Removed event function triggering unit references the created unit and not the creator. Moreover, I used a dummy effect "HHBomberPlatformCreateDummy" at HH-Strike Platform's Unit Birth effect to create the created unit -> HH-Strike Fighter.
So, any advice? It is only when the Creator dies that the created unit still spawns which is an issue. Note that this project is a mod and not a map because otherwise, pre-placed units value in a map can always be referenced/ referred to.
1. Create a dummy death effect for the Creator unit (Strike Fighter Platform).
2. Create a global integer variable (which serves to mark the Creator death count).
3. Create an Effect Used trigger -> Using the dummy death effect in step 1. Then under Actions -> modify variable (integer variable created in step 2) to +1 (which marks the death count).
4. Under Unit Being Removed / Unit Dies event for the Created unit (HH-Strike Fighter), create an IF-Then-Else condition.
IF -> Integer Variable > 0.
Then -> Stop Trigger (Current Trigger).
Else -> Create a HH-Strike Fighter Action.....
Which means if any Strike Fighter Platform (Creator) dies, then stop the current trigger, or else, create a Strike Fighter (Created unit).....
Hi, there,
The function Number of living units in unit group works as intended but not with number of dead units in unit group. Apart from this, is there any other means to reference other units (apart from triggering unit) if say, I want to refer to the creator of unit and unit created (2 different units) at different events (say an Effect Used event and a Unit Dies event). Gladly appreciate any advice.
Dead units are removed from the game unless you modify the Stats: Death Time field under the Units data type.
You could always store those units to global variables for later use. Try the Original Caster Of Unit function.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
In reply to DrSuperEvil:
Thanks for the response. Will try out as suggested.
If created by a trigger then use a global variable array to mark it using the last created unit function.
I assume there is no carry over of kills or experience or inventory.
Tried the opposite of having a filter condition that the unit it is spawning next to is alive?
Probably need to add newly created units to a unit group then.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
In reply to DrSuperEvil:
Issue solved. The following steps:-
1. Create a dummy death effect for the Creator unit (Strike Fighter Platform).
2. Create a global integer variable (which serves to mark the Creator death count).
3. Create an Effect Used trigger -> Using the dummy death effect in step 1. Then under Actions -> modify variable (integer variable created in step 2) to +1 (which marks the death count).
4. Under Unit Being Removed / Unit Dies event for the Created unit (HH-Strike Fighter), create an IF-Then-Else condition.
IF -> Integer Variable > 0.
Then -> Stop Trigger (Current Trigger).
Else -> Create a HH-Strike Fighter Action.....
Which means if any Strike Fighter Platform (Creator) dies, then stop the current trigger, or else, create a Strike Fighter (Created unit).....
Thanks for your help.