[Workshop Resource] Map Identifier - Map Detection Script UPDATED

Initial post. (You don't want to see this, it's ugly)

[Workshop] Map Identifier Script


There's currently no built-in way to determine which map you're playing on and this frustrated me a little... so I went and made something that could tell you. :D
READ ME:
Unfortunately, I've recently found that this method isn't 100% reliable for maps that can be used in both regular play, and Arcade play. (Maps such as King's Row & Blizzard World were the play area is restricted)

It’s still a good enough method of getting the current map, as only the restricted versions of the regular maps have issues, but still, I’m going to try and find a new method. (Or if Blizzard would hurry and add it themselves, that would be extra noice)

I’ve tried to come up with the most reliable method of checking the map and for now, I think this is pretty accurate. However, I’m still trying to come up with better ideas for the sake of efficiency and because… why not? It’s pretty good efficient now, sitting at only 3 actions, plus an optional one from the user if you decide to change it’s variable location

The script:

I managed to compact the script into just 3 actions. With this current method, It could probably go down to 2 and maybe 1, but I think that's where it maybe starts to get a little unstable having such a large action element. :man_shrugging: - See the codes at the bottom of the page. I recently compressed it into a single action.

The maps (important):

So currently, it recognises every map with a slight downside for Arcade variant maps and Capture maps like Ilios, Oasis etc..
  • Invalid information Capture maps are made using 3 maps in the same world, each at different positions. This means that it you can't detect which part you're currently playing in, unless you write another script to do so.
  • Capture maps are made using 3 maps in the same world, at different positions. Only when playing on a non-arcade control map, you can check which section you're currently on by getting the ObjectiveIndex. I've made a list of these and put them in the map ID's section.
  • Arcade maps are mostly all variants of existing maps, but each play on a different world. With the exception of Oasis City Center & Ilios Ruins, they are all distinguishable from every other map. The two mentioned exceptions share the same ID as their main map.
    Detecting the 2 exceptions:
    • Ilios Ruins: The Map ID will either be 12, 30 or 31. If the map ID is 30 or 31, just look down the list. If it's 12, however, get the ObjectiveIndex of the map. 0=Arcade variant | 2 = Ruins.
    • Oasis City Center: Unfortunately there doesn't seem to be a way of detecting between Arcade and Control variants. The Obj. Index in Control is 0 and obviously the arcade version would return 0 anyway. :/ Let me know if you find a fix to this!

It's a big ugly wall of text, I know, I'm sorry. D:
How do you use it?
Add my rule to the top of your Workshop script and at the beginning of the game, it'll give you a number ID representing the current map.

  • The script preset has everything set to default so you're free to work on top of it being imported.
  • If you want to import the script into an existing project:
    1. Save your current project.
    2. Import my rule using the code. (This will overwrite your current script)
    3. Copy my rule.
    4. Load your project preset.
    5. Paste my rule.
    6. Done! My map identifier rule will appear at the bottom so move it to the top.

The map ID is saved in Global Variable A, so just add another action to the bottom to set it where you want. For example: SetGlobalVariable(B, (GlobalVariableA)).

Make sure you keep the rule at the very top of your script to ensure there are no conflicting variables.

Map ID's

Normal Maps:


IDMap Name
0Black Forest
1Blizzard World
2Busan
3Castillo
4Château Guillard
5Dorado
6Ecopoint: Antarctica
7Eichenwalde
8Hanamura
9Havana
10Hollywood
11Horizon Lunar Colony
12Ilios (Arcade variant: Ruins | Obj.Index: 2)
13Junkertown
14King's Row
15Lijiang Tower
16Necropolis
17Nepal
18Numbani
19Oasis (Arcade variant: City Center)
20Paris
21Petra
22Rialto
23Route 66
24Temple of Anubis
25Volskaya Industries
26Watchpoint: Gibraltar
27Ayutthaya

Arcade Map Variants:


28Busan Downtown
29Busan Sanctuary
30Ilios Lighthouse
31Ilios Well
32Lijiang Control Center
33Lijiang Garden
34Lijiang Night Market
35Nepal Sanctum
36Nepal Shrine
37Nepal Village
38Oasis Gardens
39Oasis University

Control map Objective Indexes:


Map NameObj. Index
Busan Downtown0
Busan Sanctuary1
Busan MEKA Base2
- -- -
Ilios Lighthouse0
Ilios Well1
Ilios Ruins2
- -- -
Lijiang Night Market0
Lijiang Garden1
Lijiang Control Center2
- -- -
Nepal Village0
Nepal Shrine1
Nepal Sanctum2
- -- -
Oasis City Center0
Oasis Gardens1
Oasis University2

Normal Script (1 Rule, 3 Actions):

  • v1.0: 5VAQA

For those interested, I've compressed it all into one action:
There shouldn't really be any issues, but I wouldn't recommend using this as I haven't tested the stability.
I would also highly recommend not opening the action to avoid the risk of crashing.

*USE AT OWN RISK* - I'm not responsible for any crashes resulting in loss of work.


Update: I've used this single action plenty of times and I'm yet to have any issues. I'd still advise not opening it if you have a potato PC, but if you do, just wait for a second or two if your client stops responding; it'll come back.
Continue:
  • v1.0: THQFD

Edit 1:
Changed some of the information regarding map variants and getting the current control map being played.

If you catch any maps that are incorrect or not working let me know ASAP! I’ve done my best to try and write everything as accurately and as carefully as I could to avoid errors, but I’m only human.

Enjoy!
*money on an update in a couple days from now making all my work redundant xD*


Map Identifier Script


There's currently no built-in way to detect which map is in play, so I've created this resource that can tell you.

In an effort to use as few actions as possible, I’ve managed to compile this script into just 1 action. I strongly advise not opening the action to avoid crashing. Using it in your script anyway is completely safe, however.


How do I use it?

Once you've imported the script into your project, it's advised that you place this rule at the very top, above all other rules.

When the script is run, Global Variable A will be set to a specific value, relating to an index of a map from 0-52. You can find the list of map indexes slightly below this.

Simple. :slight_smile: If you do have any questions, however, feel free to ask.
Join the Discord for more info and updates: https://discord.gg/fmsu6ba


Map ID's:
Old & Broken - "Version 2.0"

Some Info:

Control maps have a separate ID for their Arcade variant. For example, Ilios can be played normally, but also has an ID for its Deathmatch mode.

IDMap Name
0Black Forest
1Blizzard World
2Busan
3Castillo
4Château Guillard
5Dorado
6Ecopoint: Antarctica
7Eichenwalde
8Hanamura
9Havana
10Hollywood
11Horizon Lunar Colony
12Ilios
13Junkertown
14King's Row
15Lijiang Tower
16Necropolis
17Nepal
18Numbani
19Oasis
20Paris
21Petra
22Rialto
23Route 66
24Temple of Anubis
25Volskaya Industries
26Watchpoint: Gibraltar
27Ayutthaya
28Busan Downtown
29Busan Sanctuary
30Ilios Lighthouse
31Ilios Ruins
32Ilios Well
33Lijiang Control Center
34Lijiang Garden
35Lijiang Night Market
36Nepal Sanctum
37Nepal Shrine
38Nepal Village
39Oasis City Center
40Oasis Gardens
41Oasis University

IDMap NameMap Type
0AyutthayaArcade
1Black ForestArcade
2Blizzard WorldNormal
3Blizzard WorldArcade
4BusanNormal
5Busan DowntownArcade
6Busan SanctuaryArcade
7CastilloArcade
8Chateau GuillardArcade
9DoradoArcade
10DoradoNormal
11Ecopoint: AntarcticaArcade
12EichenwaldeNormal
13EichenwaldeArcade
14HanamuraNormal
15HanamuraArcade
16HavanaArcade
17HavanaNormal
18HollywoodNormal
19HollywoodArcade
20Horizon Lunar ColonyNormal
21Horizon Lunar ColonyArcade
22IliosNormal
23Ilios LighthouseArcade
24Ilios RuinsArcade
25Ilios WellArcade
26JunkertownNormal
27King's RowNormal
28King's RowArcade
29Lijiang Control CenterArcade
30Lijiang GardenArcade
31Lijiang Night MarketArcade
32Lijiang TowerNormal
33NecropolisArcade
34NepalNormal
35Nepal SanctumArcade
36Nepal ShrineArcade
37Nepal VillageArcade
38NumbaniNormal
39OasisNormal
40Oasis City CenterArcade
41Oasis GardensArcade
42Oasis UniversityArcade
43ParisNormal
44ParisArcade
45PetraArcade
46RialtoNormal
47Route 66Normal
48Temple of AnubisNormal
49Temple of AnubisArcade
50Volskaya IndustriesNormal
51Volskaya IndustriesArcade
52Watchpoint: GibraltarNormal

Versions:

v2.0 (Fixed a lot of accuracy issues)
Code: VDZ5W
Text Import:
rule("§ Map Identifier v2.0 - Xerxes § | DO NOT OPEN - *CRASH WARNING* | Default: G.VarA - Copy the action and edit the text to change"){event{Ongoing - Global;}actions{Set Global Variable(A, Round To Integer(Add(Distance Between(Nearest Walkable Position(Vector(-500.000, 0, 0)),Nearest Walkable Position(Vector(500, 0, 0))), Distance Between(Nearest Walkable Position(Vector(0, 0, -500.000)),Nearest Walkable Position(Vector(0, 0, 500)))), Down));Set Global Variable(A, Index Of Array Value(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Empty Array, 153), 468), 1196), 135), 139), 477), 184), First Of(Filtered Array(Append To Array(Append To Array(Empty Array, 343), 347), Compare(Current Array Element, ==, Global Variable(A))))), 366),First Of(Filtered Array(Append To Array(Append To Array(Empty Array, 433), 436), Compare(Current Array Element, ==,Global Variable(A))))), 403), First Of(Filtered Array(Append To Array(Append To Array(Empty Array, 382), 384), Compare(Current Array Element, ==, Global Variable(A))))), 993), 386), First Of(Filtered Array(Append To Array(Append To Array(Empty Array, 331), 348), Compare(Current Array Element, ==, Global Variable(A))))), 659), 145), 569), 384), 1150), 371), 179),497), 374), 312), 324), 434), 297), 276), 330), 376), 347), 480), 310), 342), 360), 364), 372), 370), 450), 356), 305),Global Variable(A)));}}
Complete Remake (latest version)
Code: YDAPM (This will come with every Global Variable option A-Z)
Text Code: https://pastebin.com/n27xszn5

Enjoy!

23 Likes

That’s a good deal of experimenting, work, and documentation! Much thanks for the contribution to the community!

Nitpick: Doesn’t give the map name, but rather an ID/Index. :stuck_out_tongue:

*You know they will… but had you not made this, they never would have.

1 Like

Wow big up to you, I will definitely check it.

So every map on every mode is recognized here ?

Awesome, I see you already reduced it to 1 rule.

You don’t realy need another script to figure out on which part of a capture map you are, there is already ‘objective index’ for that

Yea, it’s not exactly accurate, but I was trying to title it something that people would be searching for lol.

Thanks, it took me a while lol. Yup, every map :smiley:

Skirmish doesn’t have an objective so it’s impossible to get information like this.

If I remember correctly, the objective is technically there in Skirmish but not active so you can grab the objective position. Found this out when I was teleporting Sombra bots on Control Maps.

1 Like

Yea, after I posted the comment, I began to question myself and went to actually test it lol. I’ll update the post/comment once I have all the values.

1 Like

I was gonna say, I posted my comment after trying it myself in skyrmish mode :smiley:

I already tested it, objective index works as well.

1 Like

Yup, my bad :stuck_out_tongue:. All fixed and updated now. Thanks for pointing it out.
If I find a way of doing it efficiently, I’ll probably try and update my script to detect which control map is being played without having to add anymore actions/rules.

1 Like

Hello, [Xerxes]! After the last update something happened to the Havana map. Identifier shows id = -1 (was 9 before). Can you try to fix this please?

I really love that you have done. It’s such a useful thing.

Fixed a billion things wrong with it in v1.0 and it also now works again after a recent Overwatch update broke it.

I honestly didn’t really think anyone used it tbh… xD Everything’s working as normal again, and it’s been given a huge improvement. Enjoy!

1 Like

Thank you! You are the best ^^

You are a god. I’m amazed you got this down into 2 actions

Thanks haha. It took me a long time to come up with this version - went through so many different failed attempts.

In v1.0, it was possible with just 1 very big action. The only issue was it would break for some maps such as the Deathmatch variants of Blizzard World, King’s Row etc… In this version though, 2 actions is the smallest I could make it in order to work across all maps reliably, but I’m happy with the outcome. :slight_smile:

2 Likes

This is solid man. Going to use this in my Halo mode, where weapon pick-ups change depending on the map you are playing.

Edit - It’s giving Illios Ruins as #7 in-game, which overlaps Eichenwalde

1 Like

omggggggggggggggggggggggggg… time to fix things again. Thanks for letting me know though!

OK,i fixed some bugs

  • 41 Oasis University will return -1,last value should to be 304 but input 305 :frowning:
  • 31 Ilios Ruins will return 7,see the same 347 ? I used a few tricks to distinguish them.
  • Only fixed Bugs in DEATHMATCH’s maps, i didn’t check other maps.
    TEXTCODE:
rule("§ Map Identifier v2.0 - Xerxes § | DO NOT OPEN - *CRASH WARNING* | Default: G.VarA - Copy the action and edit the text to change")
{
	event
	{
		Ongoing - Global;
	}

	actions
	{
		Set Global Variable(A, Round To Integer(Add(Distance Between(Nearest Walkable Position(Vector(-500.000, 0, 0)),
			Nearest Walkable Position(Vector(500, 0, 0))), Distance Between(Nearest Walkable Position(Vector(0, 0, -500.000)),
			Nearest Walkable Position(Vector(0, 0, 500)))), Down));
		Set Global Variable(A, Index Of Array Value(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(Append To Array(
			Append To Array(Append To Array(Empty Array, 153), 468), 1196), 135), 139), 477), 184), First Of(Filtered Array(
			Append To Array(Append To Array(Empty Array, 343), Add(347, Multiply(Round To Integer(Distance Between(Vector(54.859, 22.305,
			-67.830), Nearest Walkable Position(Vector(54.859, 22.305, -67.830))), To Nearest), 10000))), Compare(Current Array Element,
			==, Global Variable(A))))), 366), First Of(Filtered Array(Append To Array(Append To Array(Empty Array, 433), 436), Compare(
			Current Array Element, ==, Global Variable(A))))), 403), First Of(Filtered Array(Append To Array(Append To Array(Empty Array,
			382), 384), Compare(Current Array Element, ==, Global Variable(A))))), 993), 386), First Of(Filtered Array(Append To Array(
			Append To Array(Empty Array, 331), 348), Compare(Current Array Element, ==, Global Variable(A))))), 659), 145), 569), 384),
			1150), 371), 179), 497), 374), 312), 324), 434), 297), 276), 330), 376), 347), 480), 310), 342), 360), 364), 372), 370), 450),
			356), 304), Global Variable(A)));
	}
}
1 Like

thx for actually explaining what u did (:

How do we implement the fixes in our game?