Starting a new game/map/episode from ZScript?

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Posts: 80
Joined: Sun Apr 15, 2012 2:58 pm

Starting a new game/map/episode from ZScript?

Post by TheShadsy »

I've been building a custom map selection menu in ZScript, which uses Level.ChangeLevel to jump to the selected map. Unfortunately, Level.ChangeLevel only works while a game is active, so I can't use this to replace the EpisodeMenu that would be accessed during the pre-game titlemap.

Thinking about it in terms of CCMDs, Level.ChangeLevel is pretty similar to changemap, which also only works when a game is active. So it would be great to have a ZScript equivalent of the map CCMD as well, which can start a new game from an arbitrary map.

Looking through c_cmds.cpp, it looks like this could be done through G_DeferedInitNew. Maybe this can be exposed to ZScript? Being able to start on a specific skill level — or with a specific episode — would be give modders the most flexibility to develop new menus. It would be especially helpful if it could be used in a UI context; right now I'm changing levels through a network event (because Level.ChangeLevel causes some quirks when called from a UI), and I know network events don't work from the titlemap either.

Maybe something like...
WhateverStructGoesHere.NewMap(string mapName, int skill = -1);
WhateverStructGoesHere.NewEpisode(string episodeName, int skill = -1);

(I think I submitted a similar feature request a year or two ago; that one was pretty vague, but this one should be more specific and actionable.)

Return to “Feature Suggestions [GZDoom]”