Alright, I'll explain in depth.
First of all, vision updates on the 99th frame. Now, what does "update" mean? It's simple. The fog of war is reset to ONLY be on units you currently have shared vision with. If you create a unit, vision is updated, but not removed until the next 99th frame. If you create a unit on the 98th frame, and remove it, you'll get a flash of vision, then the fog comes in. If you GIVE a unit, or turn on shared vision, it's not updated until the next vision update. A side effect of the cloaked units is that they don't immediately come into view when in the presence of a detector for something like 3-4 frames. However, they still give vision when created.
Let's do a list of frames, and what occurs.
1: First Frame, Map starts, all preplaced units are "created" at that spot, giving vision.
2: Triggers begin to run.
3: Continue normal updating
4: If you have hyper triggers on, triggers run again.
...
98: Trigger
99: Vision is now updated
100: Trigger
101: Essentially identical to frame 1, except now we've gone through one vision update
...
198: Trigger
199: Vision is now updated
200: Trigger
The idea behind my map is that you give a cloaked unit owned by a neutral player to a player with shared vision on frame 98, just before the vision update. On frame 99, vision is updated, but you can't see the cloaked unit due to the delay. On frame 100, you give it back to the neutral player so you have no chance of seeing it. This trigger set will only keep 1 area visioned for the 100 frames (~4 seconds on fastest).
To update the vision as the player moves, make a cloaked unit owned by a player with shared vision, then give it away to the neutral player in the same trigger. This will give vision, and still leave the cloaked unit for use in the previous trigger set. I only had it update whenever the player moves out of a location following him, due to the nasty habit of slowing down the unit, but if you just create it, and let it be offset from the unit, it won't slow it down.
Here's some commented triggers to help you out.
Collapsable Box
Trigger("Player 1"){
Conditions:
Bring("Current Player", "Terran Marine", "Location 0", Exactly, 0);
Actions:
Move Location("Current Player", "Terran Marine", "Anywhere", "Location 0");
Remove Unit At Location("Player 11", "Devouring One (Zergling)", All, "Anywhere");
Create Unit with Properties("Player 2", "Devouring One (Zergling)", 1, "Location 0", 1);
; Move Unit("Player 2", "Devouring One (Zergling)", 1, "Anywhere", "Location 0");
Give Units to Player("Player 2", "Player 11", "Devouring One (Zergling)", All, "Anywhere");
Preserve Trigger();
Comment("This trigger updates vision when the unit moves");
}
//-----------------------------------------------------------------//
Trigger("Player 1"){
Conditions:
Deaths("Current Player", "Terran Marine", At least, 100);
Actions:
Preserve Trigger();
Set Deaths("Current Player", "Terran Marine", Set To, 0);
Comment("Initially, the death count is 0, so we set it to 0 once it reaches 100 before the next two triggers to keep that consistent. Remember, it's frame 99 that updates, so frame 0=frame 100. It is imperative that you run this trigger all the time. The others can be set to only run at night.");
}
//-----------------------------------------------------------------//
Trigger("Player 1"){
Conditions:
Deaths("Current Player", "Terran Marine", Exactly, 96);
Actions:
Preserve Trigger();
Give Units to Player("Player 11", "Player 2", "Devouring One (Zergling)", 1, "Anywhere");
Comment("Hyper triggers begin on frame 2, so the death count is 0 on frame 2. This is frame 98, even though it says 96");
}
//-----------------------------------------------------------------//
Trigger("Player 1"){
Conditions:
Deaths("Current Player", "Terran Marine", Exactly, 98);
Actions:
Preserve Trigger();
Give Units to Player("Player 2", "Player 11", "Devouring One (Zergling)", 1, "Anywhere");
Comment("This is frame 100, directly after vision updates.");
}
//-----------------------------------------------------------------//
Trigger("Player 1"){
Conditions:
Always();
Actions:
Preserve Trigger();
Set Deaths("Current Player", "Terran Marine", Add, 2);
Comment("Hyper triggers run every other frame, so I add 2 for completeness. You can always set it to be 1, but you'll have to change the counter. It is imperative that you run this trigger all the time. The others can be set to only run at night.");
}
//-----------------------------------------------------------------//
Trigger("Player 1"){
Conditions:
Always();
Actions:
Run AI Script("-Vi0");
Run AI Script("+Vi1");
Comment("This is the nighttime initiator. Have the conditions only run during the night, possibly set a DC here for other triggers to detect that it is nighttime. You might also only let this trigger run on frame 98, so you immediately get a vision loss);
}
//-----------------------------------------------------------------//
When optical flare hits an enemy, the 100 frame counter which updates vision is set to 0, which causes these triggers to completely fail, unless the spell hit on frame 99.
"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"