Always();
Deaths(P8, Exactly, 0, 1);
SetAllianceStatus(P1, Ally);
Comment("ally");
-
Deaths(P8, AtLeast, 1, 1);
SetAllianceStatus(P1, Enemy);
SetInvincibility(Disable, Hero, CurrentPlayer, city);
SetInvincibility(Disable, -=HERO=-, CurrentPlayer, city);
Comment("enemy");
PreserveTrigger();
-
Deaths(P8, AtLeast, 1, 1);
SetDeaths(P8, Subtract, 1, 1);
Comment("subtract");
PreserveTrigger();
-
SO when i want p8 to unally p1 for 2 seconds i just set the deaths of 1 to 2. Right? Why wont it work?
You didn't use a preserve trigger on the ally trigger.
It doesn't work because as soon as the unally trigger is done, the next one activates, setting the deaths back to 0, letting the re-ally trigger execute.
Either put in a wait somewhere, or (more recommended) put in a physical timer. I personally am a fan of timing things using a running unit, but it'd probably easier to just use a dying terran building of known burn-down time to control it. The first trigger would reset the deaths of 1 back to 0, create a dying building, and set a switch, in that order, and also unally the player. Then the next trigger should be that if the switch is set but no building is detected, clear the switch and re-ally the player. So the whole thing could be done in two triggers instead of three.
Oh and, the Always condition is unnecessary whenever you are using other conditions. Conditions are always processed as AND: if ALL of them are true, then the trigger executes. An ALWAYS trigger is simply a perpetual TRUE, so it only makes a difference if it's the only condition. Similarly a NEVER trigger is a perpetual FALSE and stops the trigger, but that's another story...
You also didn't set deaths for unit "1" to 1 anywhere.
fred, that set thing is in antoher trigger.
Okay, what is the problem? You say it doesn't work, does it stay unallied or does it not unally at all? Need details...
if you have hyper triggers try setting it to 24 or something and so then(if it adds and subtracts deaths in the same amount of time) itll be two seconds insteal of 1/12 of a second