get map name in zscript?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
ramon.dexter
Posts: 1529
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

get map name in zscript?

Post by ramon.dexter »

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?
Jarewill
 
 
Posts: 1766
Joined: Sun Jul 21, 2019 8:54 am

Re: get map name in zscript?

Post by Jarewill »

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.
User avatar
ramon.dexter
Posts: 1529
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: get map name in zscript?

Post by ramon.dexter »

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: Select all

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.
Post Reply

Return to “Scripting”