[Solved]Convert NewGame menu to zscript

Moderator: GZDoom Developers

Post Reply
Collegia Titanica
Posts: 83
Joined: Thu Jan 25, 2018 1:37 pm

[Solved]Convert NewGame menu to zscript

Post by Collegia Titanica »

Had a cool idea, lock a difficulty setting until the highest available is beaten (and by that I mean complete 7 maps on that difficulty). [Diablo 3 anyone ?]

Same thing could be used(in mods) to lock episodes, to make it one by one, like a proper campaign. If someone is pairing a campaign with this mod, one could add a certain threshold to level completion/difficulty. This has never been done before here ..

If this thing was to be ported over, I imagine it would be a matter of a few overrides and some obscure cvar saved somewhere. Shouldn't be too hard
Last edited by Collegia Titanica on Fri Jan 25, 2019 8:25 am, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Convert NewGame menu to zscript

Post by Graf Zahl »

The new game menu chain is programmatically generated. "Shouldn't be too hard" is somewhat misunderstanding this thing because it has to follow a strict protocol to allow the engine to start a game afterward. The safest way to ensure that this protocol isn't broken is to not expose the menu to scripting.
Collegia Titanica
Posts: 83
Joined: Thu Jan 25, 2018 1:37 pm

Re: Convert NewGame menu to zscript

Post by Collegia Titanica »

Well then, is this even doable in any way ?
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Convert NewGame menu to zscript

Post by Enjay »

Collegia Titanica wrote:Well then, is this even doable in any way ?
You can circumvent the skill menu entirely and use a map to select the difficulty setting (similar to how it was done in Quake).*

So, I suppose you could have the routes to the harder difficulty settings in the map blocked by a barrier of some sort (again, similar to how the later episodes in Quake are blocked). Then when you complete the last map for the first time, it would make the next difficulty up available in the difficulty setting map... rinse and repeat for all difficulties.


*It's done via [wiki]ChangeSkill[/wiki] so, given that it's in ACS, there are a number of different ways that you could implement it.
Collegia Titanica
Posts: 83
Joined: Thu Jan 25, 2018 1:37 pm

Re: Convert NewGame menu to zscript

Post by Collegia Titanica »

Starting a game should change to PREMAP, black map, input locked, a zscript menu activated that has the same visuals as the current skill selection for familiarity.

However, this menu's difficulties will only be selectable/clickable if they are available.Each zscript version of a diff. corresponds to it's "normal" counterpart.

The only question is, how do I circumvent the skill menu ? I'd need some sort of "Start" button that changes map from TITLEMAP to this PREMAP when clicked. IF I know that, I could pull the rest of this off
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: Convert NewGame menu to zscript

Post by Arctangent »

Collegia Titanica wrote:The only question is, how do I circumvent the skill menu ? I'd need some sort of "Start" button that changes map from TITLEMAP to this PREMAP when clicked. IF I know that, I could pull the rest of this off
No, not remotely. The noskillmenu episode property does exactly what you need without any ridiculous workarounds. In fact, have a direct quote from the wiki description:
This is useful for WADs that implement skill selection by an introduction map.
User avatar
AFADoomer
Posts: 1322
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: Convert NewGame menu to zscript

Post by AFADoomer »

I've attached a .pk3 that uses a ZScript event handler and a custom menu class to 'lock' the skill menu by redirecting the skill menu entry's "new game" action to a menu that just says "This skill is locked" and changing the color of the menu item.

You can quickly test the menu by starting a new game and using 'netevent unlockskill x' in the console, where 'x' is the number of the skill you want to unlock (starting at skill 0) - so 'netevent unlockskill 3' will unlock up to skill 3 (all but Nightmare).

In-game, you an use ACS to unlock a skill level...

Code: Select all

ScriptCall("SkillCheck", "SetLevel", 3);
will do the same as the command listed above.
Attachments
skillunlock.pk3
(1.96 KiB) Downloaded 118 times
Collegia Titanica
Posts: 83
Joined: Thu Jan 25, 2018 1:37 pm

Re: Convert NewGame menu to zscript

Post by Collegia Titanica »

Absolutely incredible. Amazing.

You will live forever.
gramps
Posts: 300
Joined: Thu Oct 18, 2018 2:16 pm

Re: Convert NewGame menu to zscript

Post by gramps »

AFADoomer wrote:I've attached a .pk3
Thanks for posting that, very interesting. Had no idea the menus were so flexible. This inspired me to do a simplified "save+quit" and "resume game" single-save permadeath menu :twisted:

Not sure how future-proof this kind of stuff is supposed to be, but it's fun to mess with.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”