Currently, I'm using a trigger that runs when a unit dies, and if the unit matches the last created unit for the triggering player, then another unit respawns.
However, this is failing when the unit dies is neural parasited, probably because the "triggering player" has now changed to the infestor owner (and so the unit that dies doesn't match up to the last created unit for that player).
I've tried a couple of things like checking for neural parasite buff on death, but that isn't working (maybe because since the unit's dead when the trigger activates, theres no unit to have the buff anymore).
Anyway, is there a way to get around this? I've been messing around with the function "old unit owner" but that isn't doing anything
Wait, I'm confused, you want it so when a unit dies, another unit spawns in it's place? I made a thread about something similar and it could all be done via the data editor, and being neural parasited doesn't effect it I believe. Maybe you should go look and try that method? Otherwise I dunno, triggers aren't my fortey.
Haha okay looks like I didn't explain it well enough.
So for each player, they're assigned one unit. Whenever a unit dies, if that unit matches the assigned unit for the triggering player, then it respawns a unit for the triggering player at a specified point on the map. The new respawned unit then replaces the assigned unit for the triggering player.
But when a unit gets neural parasited and it dies during that time, theres no respawn.
I had a look at your thread and I'm not sure if its applicable, since the respawn unit is a random unit chosen from 50, rather than a set unit. That, and I still haven't gotten my head around the data editor, so everything there about validators confused me haha.
My stuff actually gives a specific unit to another specific unit. So like, if a Medic dies, it'd spawn a Marine, every time. It's just the way it's set up, it uses a single set, and then via validators confirms the correct unit spawns from the correct unit. But if you don't know enough about the data editor to jerry-rig it to suit your needs, I am deffinently not the guy to try to explain it :( Sorry
I'm not sure what you mean by that, but I think thats what I'm doing right now. Its not the respawning I'm having trouble with, its the fact that neural parasite is changing the "triggering player" for when "a unit dies". I've pasted the respawn trigger
Events
Unit - Any Unit dies
Local Variables
p = 0 <Integer>
Random Integer = 0 <Integer>
Random Unit = No Game Link <Game Link - Unit>
Conditions
Racing Unit[(Triggering player)] == (Triggering unit)
Actions
Variable - Set Random Integer = (Random integer between 1 and 59)
General - Switch (Actions) depending on Current Sprint[(Triggering player)]
Cases
General - If (1)
Actions
Unit - Create 1 Unit Bank[Random Integer] for player (Triggering player) at Spawn 1 using default facing (No Options)
Etc
Etc
Default
Variable - Set Racing Unit[(Triggering player)] = (Last created unit)
Basically Racing Unit [*] is a saved variable of the current unit owned by each player, and the unit that dies has to match that stored unit in order for a respawn. Then the new unit is set to Racing Unit [*]. But when your unit gets neural parasited, it fails the "Racing Unit[(Triggering player)] == (Triggering unit)" condition.
What you could do since I think all players have one unit anyway is to have the trigger event on a pericdic event timer looped and have a condition for when Number of units in unit group = 0 and have action respawn the varaible unit and reset that to that variable again and also add it back to the unit group that why you dont need to worry about nerual parasite screwing up your triggering player.
Yeah I've considered that option, but I was hoping for a more elegant solution than having to have a trigger on loop continuously. The map tends to be a bit laggy as it is, and I don't know what that might do to it.
Also, if a unit stored in a unit bank dies on the map, does it get removed? so that "racing unit [triggering player] == no unit?" Because I think I might have tried that by adding something like that at the end of the trigger, where it checks every player, but it didn't work, which I thought to mean the unit in the group doesnt get cleared.
Modify the Neural Parasite behaviour. Give it a damage responce that stops any fatal damage. Make it run a dummy effect that removes the neural parasite behaviour.
The downside is that neural parasited units will take an extra shot to kill, if you care at all.
Even though I've got a working trigger I'd still like to know how to do this. I've found "Fatal" with a tick box in Damage Response, but I'm not quite sure how to go from there (I'm not very good with data editor at all)
Currently, I'm using a trigger that runs when a unit dies, and if the unit matches the last created unit for the triggering player, then another unit respawns.
However, this is failing when the unit dies is neural parasited, probably because the "triggering player" has now changed to the infestor owner (and so the unit that dies doesn't match up to the last created unit for that player).
I've tried a couple of things like checking for neural parasite buff on death, but that isn't working (maybe because since the unit's dead when the trigger activates, theres no unit to have the buff anymore).
Anyway, is there a way to get around this? I've been messing around with the function "old unit owner" but that isn't doing anything
Wait, I'm confused, you want it so when a unit dies, another unit spawns in it's place? I made a thread about something similar and it could all be done via the data editor, and being neural parasited doesn't effect it I believe. Maybe you should go look and try that method? Otherwise I dunno, triggers aren't my fortey.
Haha okay looks like I didn't explain it well enough.
So for each player, they're assigned one unit. Whenever a unit dies, if that unit matches the assigned unit for the triggering player, then it respawns a unit for the triggering player at a specified point on the map. The new respawned unit then replaces the assigned unit for the triggering player.
But when a unit gets neural parasited and it dies during that time, theres no respawn.
I had a look at your thread and I'm not sure if its applicable, since the respawn unit is a random unit chosen from 50, rather than a set unit. That, and I still haven't gotten my head around the data editor, so everything there about validators confused me haha.
My stuff actually gives a specific unit to another specific unit. So like, if a Medic dies, it'd spawn a Marine, every time. It's just the way it's set up, it uses a single set, and then via validators confirms the correct unit spawns from the correct unit. But if you don't know enough about the data editor to jerry-rig it to suit your needs, I am deffinently not the guy to try to explain it :( Sorry
Why not preload those units into a variable?
Say Unit[1] = Red's Unit Uni[2] = Blue's unit.
Once they die just create another one and put him in the variable.
@obliviron: Go
I'm not sure what you mean by that, but I think thats what I'm doing right now. Its not the respawning I'm having trouble with, its the fact that neural parasite is changing the "triggering player" for when "a unit dies". I've pasted the respawn trigger
Events
Unit - Any Unit dies
Local Variables
p = 0 <Integer>
Random Integer = 0 <Integer>
Random Unit = No Game Link <Game Link - Unit>
Conditions
Racing Unit[(Triggering player)] == (Triggering unit)
Actions
Variable - Set Random Integer = (Random integer between 1 and 59)
General - Switch (Actions) depending on Current Sprint[(Triggering player)]
Cases
General - If (1)
Actions
Unit - Create 1 Unit Bank[Random Integer] for player (Triggering player) at Spawn 1 using default facing (No Options)
Etc Etc
Default
Variable - Set Racing Unit[(Triggering player)] = (Last created unit)
Basically Racing Unit [*] is a saved variable of the current unit owned by each player, and the unit that dies has to match that stored unit in order for a respawn. Then the new unit is set to Racing Unit [*]. But when your unit gets neural parasited, it fails the "Racing Unit[(Triggering player)] == (Triggering unit)" condition.
What you could do since I think all players have one unit anyway is to have the trigger event on a pericdic event timer looped and have a condition for when Number of units in unit group = 0 and have action respawn the varaible unit and reset that to that variable again and also add it back to the unit group that why you dont need to worry about nerual parasite screwing up your triggering player.
@gamfvr: Go
Yeah I've considered that option, but I was hoping for a more elegant solution than having to have a trigger on loop continuously. The map tends to be a bit laggy as it is, and I don't know what that might do to it.
Also, if a unit stored in a unit bank dies on the map, does it get removed? so that "racing unit [triggering player] == no unit?" Because I think I might have tried that by adding something like that at the end of the trigger, where it checks every player, but it didn't work, which I thought to mean the unit in the group doesnt get cleared.
keep your event a unit dies
then just loop through your units and break the loop when your loop unit == dying unit
-> you now know which unit died and which number in the array it had.
Modify the Neural Parasite behaviour. Give it a damage responce that stops any fatal damage. Make it run a dummy effect that removes the neural parasite behaviour.
The downside is that neural parasited units will take an extra shot to kill, if you care at all.
@Zytrug: Go
Thanks, this worked! Hopefully this won't lag it too much if a lot of these triggers fire off at once
@Eiviyn: Go
Even though I've got a working trigger I'd still like to know how to do this. I've found "Fatal" with a tick box in Damage Response, but I'm not quite sure how to go from there (I'm not very good with data editor at all)