get map name in zscript?

Mon Sep 13, 2021 11:52 am

Okay, another one. I want to modify the strife popups, use one of the popups that is obsolete in my mod to display, let's say, a world map.
Now, I know how to draw images on statusbar in zscript, that's not the case.
The case is: How do I get a map name in zscript? I found out that there is a native readonly String MapName. How do I access it in statusbar?

Re: get map name in zscript?

Mon Sep 13, 2021 12:08 pm

You could try using level.MapName, though I'm unsure if that would work.
But things like levelnum and total/killed_monsters work, so I would think level.MapName works too.

Re: get map name in zscript?

Mon Sep 13, 2021 12:16 pm

Ok, will try. :wink: Thanks again.

edit: Little clarification for those who are interested:

level.MapName returns the name of the map (for example: E1M1, MAP01, and so on).

level.FormatMapName(2) (number is a color number, 2 is white) returns name defined in mapinfo here:
Code:
map MAP1001 lookup MAP1001_NAME
{
   skybox = Sky4
   //sky1 = sky5
   cluster = 1
   music = 08DSRT1
   outsidefogdensity = 128
   skyfog = 255
   lightmode = 2
   StrifeFallingDamage
   MonsterFallingDamage
   AllowJump
   AllowCrouch
   AllowFreelook
}


So, for this case, level.FormatMapName() returns the MAP1001_NAME (string, defined in language), which is, in this case, "Ranger base".

Hope this helps somebody.