HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Get Map Name

09-01-2007, 02:58 AM#1
inkken
Quite simple; how do i get the name of my map via trigger only?

There seem to be a SetMapName function; but no GetMapName function.
thanks in advance!
09-01-2007, 04:21 AM#2
PenguinEmperor
That depends.. WHY do you need map name? Can't you just set a variable to the name of your map, and then get it to read the Variable?
09-01-2007, 04:45 AM#3
inkken
it's for another method of map protection.
Protection from further de-protection.
09-01-2007, 04:56 AM#4
PenguinEmperor
Ahh! I see, something like if the map name isn't equal to the original name you gave it, it'll cease to work?

I dunno, maybe there's something in game cache? But ask a JASSer, As I don't really have any experience with anything beside GUI.
09-01-2007, 05:13 AM#5
DioD
string 12(or not, this affected by map itself, but its static - always same from game to game) from global string table.
09-01-2007, 04:52 PM#6
inkken
Eureka!

I found a way; all thanks to Ammorth.
09-01-2007, 05:46 PM#7
MaD[Lion]
For those who still dont know:
hm if u open the war3map.j u will see a function called config, this will be called before u load the map.
And it tells u the map name is always or most likely stored in TRIGSTR_001.

so if u wanna display map name then u can do:
Collapse JASS:
call BJDebugMsg("TRIGSTR_001")

there is always ways to exploit this tho. You can just open war3map.j and modify the function tat calls SetMapName(...) and voila, u can copy map and change name ^^
09-01-2007, 09:03 PM#8
DioD
you cant use this if map was optimized, vex opt move all string direct to code.
09-01-2007, 11:21 PM#9
Ammorth
Yes, but my method which I gave him would work, so it doesn't matter.
09-02-2007, 04:22 AM#10
MaD[Lion]
Quote:
Originally Posted by DioD
you cant use this if map was optimized, vex opt move all string direct to code.


it will always work, you just need to track down the SetMapName native, and from there track further. But if Vex Optimizer move strings then it will also bug the map name getting method, cus it will be local then.
example:
Collapse JASS:
call SetMapName("Name Of Map")
tat would not let u get the map name
09-02-2007, 05:28 AM#11
DioD
every string passed to game will be registered in string table permanently, soo with return bug you may extract it by its number.
09-02-2007, 02:12 PM#12
Ammorth
Quote:
Originally Posted by DioD
every string passed to game will be registered in string table permanently, soo with return bug you may extract it by its number.

Except if a map is loaded, the strings are regenerated. It is still possible to return the old strings, but they will not equal a string that was created after the load, even if they are the same text.
09-02-2007, 09:31 PM#13
DioD
extract string and then save somewhere for savekeep.