Staredit Network

Staredit Network -> UMS Assistance -> Toggle with interceptor.
Report, edit, etc...Posted by rockz on 2007-02-02 at 18:35:17
I want to have building interceptors toggle the deaths of "cave". Is there any reason this doesn't work?

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Protoss Interceptor", "Anywhere", At least, 1);
Deaths("Current Player", "Cave", Exactly, 0);

Actions:
Preserve Trigger();
Remove Unit("Current Player", "Protoss Interceptor");
Display Text Message(Always Display, "Cave set to 1");
Set Deaths("Current Player", "Cave", Set To, 1);
}

//-----------------------------------------------------------------//

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Protoss Interceptor", "Anywhere", At least, 1);
Deaths("Current Player", "Cave", Exactly, 1);

Actions:
Preserve Trigger();
Remove Unit("Current Player", "Protoss Interceptor");
Display Text Message(Always Display, "Cave Set to 0");
Set Deaths("Current Player", "Cave", Set To, 0);
}

//-----------------------------------------------------------------//

If I build an interceptor, both are run. I could change it so that it doesn't remove it, and you need to build two interceptors to set it to 0, but I want to see if there is an easier way.
Report, edit, etc...Posted by Undead-Fox on 2007-02-02 at 18:42:34
Why do you need interceptors?

Perhaps, you could use a nuclear silo in some section of the map and have it detect when a nuke is inside it or something? And when it's not... obviously.

Or, you could perhaps use the dropship command system? Where you have various units {maybe heroes if you're using the normal ones for other things}, and when one is unloaded, it does the desired effect, and when it is loaded back in by the player, it goes off. {Do this with two locations, one affecting Low/Mid/High Air, the other affecting Low/Mid/High Terrain, respectively.}

Just a thought.
Report, edit, etc...Posted by Koltz on 2007-02-02 at 18:45:25
Could be because the second trigger runs at the same time as the first, they loop


Try using the modify unit hangar count command
Report, edit, etc...Posted by Undead-Fox on 2007-02-02 at 18:48:02
But how? The first trigger REMOVES the interceptor, so there is no interceptor requirement met for the second trigger?
Report, edit, etc...Posted by Koltz on 2007-02-02 at 18:50:05
The kill unit trigger runs at the end of the trigger, allowing other triggers even after it to activate

Remove unit, so far, has been proven to be instant. This could be a new discovery?
Report, edit, etc...Posted by Undead-Fox on 2007-02-02 at 18:53:04
You could put a Switch at the end of each trigger? And each time one of the triggers is run, it will enable or disable that switch. Enabled, the 1st goes. Disabled, the 2nd goes.
Report, edit, etc...Posted by rockz on 2007-02-02 at 19:00:49
I don't want to use a switch, since cave is already one of my key switches. If I switch the order of these triggers, it works the first time, then continues the same way (where both triggers run).

Modify unit hangar count really should be Add to unit hangar count. You can't subtract.

Also, the problem seems to be in the bring condition, since the remove unit doesn't seem to kick in immediately.
Report, edit, etc...Posted by Dark_Marine_123 on 2007-02-02 at 19:05:52
I've always found problems with deaths of UNplacable units. Try a different unit tongue.gif
Report, edit, etc...Posted by rockz on 2007-02-02 at 19:15:09
This works. Not as I had wanted to work exactly, but it does more or less prove that the remove unit action is slow, and can be used later in other triggers, whereas the deaths are truly instant.

This trigger sets cave to 1 when there is 1 interceptor, and sets cave to 0 when there are 2, then removes them all. Since I have the remove thing AFTER the first, the remove unit is effectively instant. I'm pretty much guessing that the remove unit is actually removed at the end of the trigger run. Likewise, the COMMAND or BRING conditions work for the entire trigger run, I think.

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Protoss Interceptor", "Anywhere", At least, 1);
Deaths("Current Player", "Cave", Exactly, 0);

Actions:
Preserve Trigger();
Display Text Message(Always Display, "Cave set to 1");
Set Deaths("Current Player", "Cave", Set To, 1);
}

//-----------------------------------------------------------------//

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Protoss Interceptor", "Anywhere", At least, 2);
Deaths("Current Player", "Cave", Exactly, 1);

Actions:
Preserve Trigger();
Remove Unit("Current Player", "Protoss Interceptor");
Display Text Message(Always Display, "Cave set to 0");
Set Deaths("Current Player", "Cave", Set To, 0);
}

//-----------------------------------------------------------------//
Report, edit, etc...Posted by Laser_Dude on 2007-02-02 at 19:29:23
Remove unit is not instant. You'd need to make some sort of switch to specify that one has already run, since they're both going to fire. And no matter which order you put them in, both are going to fire, unless you put the switch in the first one. Just add a set switch 1 action in your first one, and a switch 1 is cleared condition in the second. Don't forget another trigger after both constantly clearing switch 1.
Next Page (1)