• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Get Map Name

Status
Not open for further replies.
Level 2
Joined
Sep 1, 2007
Messages
12
Quite simple; how do i get the name of my map via trigger only?

*no user predefine variable.
Code:
//not what i want
udg_MyMapName = Hello

Thanks in advance!
 
Level 6
Joined
Aug 24, 2007
Messages
173
Jaeron, would you mind explaining how it works? i didnt really understand the other person's post, and I would really like to use this function in my map.
 
Level 6
Joined
Feb 2, 2005
Messages
205
He use this Function to return the String (Mapname).
Hoever you will have to test which value it is. To Test it easily you could use this function he posted.

JASS:
function GetString takes integer i returns string
    return i
    return ""
endfunction

Insert it to the Costum Map Script, and use it in a GUI Trigger like this
  • Example
    • Events
      • Time - Game Time Elapsed 5 seconds
    • Conditions
    • Actions
      • For each (tmp) from 0 to 10, do (Actions)
        • Loop - Actions
          • Costume Script: set udg_string = GetString(udg_tmp)
          • Game - Display ((Convert Integer to String(tmp)+" - "+string) to all
This would give out string 0 to 10, plus the Numbers so you can look up which is the map name, and use it later in the CostumeScript with a constant value like
JASS:
set string = GetString(4)
 
Level 6
Joined
Aug 24, 2007
Messages
173
yea, they could just delete the trigger protecting the map, but you could hide that function in a large trigger so that it's difficult to find. it would be a lot nicer than not letting anyone open it.
 
Status
Not open for further replies.
Top