Thanks, guys! Both of those triggers make perfect sense but I have a few more questions.
I want to pick the players from whom a unit must be hidden based on whether they control units that are on the same level as the triggering unit. I was planning to do this by using an array to assign every player-controlled unit a value: 0 = it isn't in the building; 1 = it is on the first floor; 2 = it is on the second floor; etc.
So the trigger that I have in mind would work something like this:
Event - A unit enters the second floor
Action (1) - Change the array value of the triggering unit to 2
Action (2) - Pick every player that does not control a unit with an array value of 2 and change the triggering unit's size to 0%
Action (3) - Change the unit size of every unit with an array value of 2 to 100% for the player who controls the triggering unit
So here are my questions:
1. In theory, should this trigger work? (i.e. hide units from players who don't control units on the same floor)
2. I am not terribly familiar with variables. Should I use an array or a hashtable?
3. How would I actually change a unit's particular array / hashtable "floor" value when it enters a certain floor? I know how to make simple variable changes using "set variable", but how do I reference a specific unit's array / hashtable "slot"?
4. If I want to hide a unit from all players in a group, how would I place players in that group based on the "floor" values of the units that they control? Again, I know how to use simple variable references ("if variable = X then do action) but how do I reference the specific array / hashtable "slot" for each player's units?
I know I am asking for a lot of help here, so I apologise if this comes across as a lazy request for someone to write my entire trigger for me. I think I "get it" in theory, but I have very limited experience in practice.