Changing the map name during gameplay?

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.

Changing the map name during gameplay?

Postby Caru » Sun Jan 03, 2021 1:08 pm

So this is a bit of a weird question. I tried asking about this on DoomWorld about a month ago but never got a reply; perhaps this is more of a zdoom question since the answer will probably involve scripting of some kind (which is also why I've put it on this subforum -- mods, feel free to move this somewhere else if I'm wrong).

I had this idea a while back of a MAP11 homage in which the name of the map changes every time you open the automap (variations on "Circle of Death" and "'O' of Destruction; silly things like "Circle of Circle", "Destruction of Death", etc.). I've had no luck achieving anything like this so far with standard MAPINFO/LANGUAGE setups, nor with my limited knowledge of ACS; I fear zscript may be necessary, and those are still pretty uncharted waters for me. But it's also possible I've been completely overlooking some easy way of doing this that's been around since the early Boom days.

I guess my question has two parts:

1) Is it possible to change the map title (as displayed on the automap) in the middle of gameplay at all?
2) If so, is there a way to randomly draw from a list of strings a la the Quit Game message? (I have been unable to figure out how that's implemented so I'm assuming it's hardcoded, or at a minimum requires zscript?)
Joined: 04 Nov 2020

Re: Changing the map name during gameplay?

Postby Caru » Mon Jan 04, 2021 12:31 pm

Sidenote, unrelated, and sorry for double posting, but it's kind of important:

I'm the same person who posted this question yesterday, and I'm signed into the same profile I signed into yesterday. I say that because for some reason this site is displaying my name on that post as "Rebecca Brondleworth". I have no idea who that is. I am not Rebecca Brondleworth, and I would suspect the real one would like to know someone's posting under her name (albeit by accident). I did not sign into that profile, or any profile different from this one (in case it happens again with this post, my real profile name is Caru). Something might be seriously wrong here, and if the site is getting profiles mixed up it might open up a security risk.
Joined: 04 Nov 2020

Re: Changing the map name during gameplay?

Postby wildweasel » Mon Jan 04, 2021 1:11 pm

That's just a plug-in our forum uses that gives silly randomized names to guest posters. You just forgot to log in before starting your thread. No worries, though, I can assign it to your account easily.
User avatar
change o' pace.
Moderator Team Lead
Joined: 15 Jul 2003

Re: Changing the map name during gameplay?

Postby AFADoomer » Mon Jan 04, 2021 2:23 pm

I *think* that the only way to do this is to use ZScript to:
1) Create a new status bar based off of the Doom status bar
2) Re-code the native DoDrawAutomapHUD automap drawing function in ZScript (it's native code in shared_sbar.cpp).
3) Replace the call to the FormatMapName function in the code in step 2 with some logic to do the random name selection
4) Use your new ZScript status bar's DrawAutoMapHUD function to call the code in step 2

This is quite complicated for a novice ZScript user (and I may be over-complicating this, but I don't think so)... So... See attached.

This automap drawing code will randomly pick a LANGUAGE entry that is formatted properly ([map name]_RN[0-n] - so MAP01_RN0, MAP01_RN1, MAP01_RN2, etc. would work for MAP01), and will swap that string in as the map name, and will pick a random string each time the automap is activated. If the entry isn't valid, the map will just display the normal map name.

The attached .pk3 has 4 random strings set up in LANGUAGE for MAP11 as an example.
You do not have the required permissions to view the files attached to this post.
User avatar
Joined: 15 Jul 2003

Return to Scripting

Who is online

Users browsing this forum: MFG38 and 2 guests