[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:


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

Arcade Map Variants:


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

Control map Objective Indexes:


Map Name Obj. Index
Busan Downtown 0
Busan Sanctuary 1
Busan MEKA Base 2
- - - -
Ilios Lighthouse 0
Ilios Well 1
Ilios Ruins 2
- - - -
Lijiang Night Market 0
Lijiang Garden 1
Lijiang Control Center 2
- - - -
Nepal Village 0
Nepal Shrine 1
Nepal Sanctum 2
- - - -
Oasis City Center 0
Oasis Gardens 1
Oasis University 2

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.

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

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

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?