When there are unnamed locations text trigedit assigns them names like "Unnamed Location (N)". If there happens to be a
named location with the same name "Unnamed Location (N)" then the truly unnamed location is being compiled into this faked location. Faked location overrides special name. I found a way to enhance this to exclude the very possibility of corrupting behavior that can be used by various map obfuscators and the like to spoil our lives.
Make behavior opposite, i.e. make any location with id N accessible via that special name "Unnamed Location (N)" no matter what. This special meaning shouldn't be covered with the fake location name "Unnamed Location (N)" even if that location exists. If faked location with name "Unnamed Location (N)" has ID K then it is still available through it's own special name "Unnamed Location (K)".
Finally, before generating text triggers check map for unnamed locations. If there are unnamed locations then use special names for
all locations in generated text, if there isn't it's safe to use locations natural names as it is now.
Optionally: rename this special name for unnamed locations to "Int:N" to better match what we have for units. In classic trigedit unnamed locations might display as "LocID:N" for consistency as well.
There is the same issue with forces that is being approached in the way opposite to locations current behavior. When there are unnamed forces their names in text triggers have special meaning, i.e. those names are not covered with faked names of the same kind. Let's say force 2 has name "Force 1", then "Force 1" in text triggers still references force 1.
Escape from this situation is the same: detect at least 1 unnamed force, and use text "Int:N" in place of all forces names in this case, otherwise natural forces names are safe and good to use. In classic trigedit display "PlayerID:N".
There is the other unpleasant situation when two entities (forces or locations) have same names. Detect that situation as well and fall back to special names of kind "Int:N" in this case too.
SummarizeMy proposal is as follows:
1. Accept special names of kind "Int:N" in text trigedit as players and locations parameters at any time.
2. Those special names are never overriden by the same names of the corresponding entities, i.e. always work in a predictable way.
3. When there is a slick situation (presence of unnamed entities or entities with equal names) fall back to usage of these special names for all entities of this kind.
4. When there is an entity with user-provided name "Int:N" we have to fall back to special names for those entities too.
5. Accept special names of kind "LocID:N" in classic trigedit for consistency with what we have for players and units.
6. If there is a location with (malformed) name "LocID:N" then choose this malformed location in classic trigedit like you already do for units in deaths with malformed names "UnitID:N".
Comment on the last point, I agree that for classic trigedit this is a good behavior for people who aren't aware about this feature. In that case people at least get what they expect.
As a useful side effect, this will allow trigger generators to prepare SCMD text triggers that reference forces and locations without knowing or caring about their proper names in the map.
Post has been edited 23 time(s), last time on Aug 10 2019, 10:40 pm by Wormer.
Some.