[Closed] [Solved]Convert NewGame menu to zscript

Moderator: GZDoom Developers

[Solved]Convert NewGame menu to zscript

Postby Collegia Titanica » Thu Jan 24, 2019 1:17 pm

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 9:25 am, edited 1 time in total.
Collegia Titanica
 
Joined: 25 Jan 2018
Discord: 2834

Re: Convert NewGame menu to zscript

Postby Graf Zahl » Thu Jan 24, 2019 1:25 pm

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.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Convert NewGame menu to zscript

Postby Collegia Titanica » Thu Jan 24, 2019 2:44 pm

Well then, is this even doable in any way ?
Collegia Titanica
 
Joined: 25 Jan 2018
Discord: 2834

Re: Convert NewGame menu to zscript

Postby Enjay » Thu Jan 24, 2019 3:01 pm

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 ChangeSkill so, given that it's in ACS, there are a number of different ways that you could implement it.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Convert NewGame menu to zscript

Postby Collegia Titanica » Thu Jan 24, 2019 4:11 pm

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
Collegia Titanica
 
Joined: 25 Jan 2018
Discord: 2834

Re: Convert NewGame menu to zscript

Postby Arctangent » Thu Jan 24, 2019 4:16 pm

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
Arctangent
squawky
 
Joined: 06 Nov 2014
Discord: SquawkyAtan#2371

Re: Convert NewGame menu to zscript

Postby AFADoomer » Thu Jan 24, 2019 8:06 pm

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 allExpand view
ScriptCall("SkillCheck", "SetLevel", 3);
will do the same as the command listed above.
Attachments
skillunlock.pk3
(1.96 KiB) Downloaded 16 times
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: Convert NewGame menu to zscript

Postby Collegia Titanica » Fri Jan 25, 2019 9:25 am

Absolutely incredible. Amazing.

You will live forever.
Collegia Titanica
 
Joined: 25 Jan 2018
Discord: 2834

Re: Convert NewGame menu to zscript

Postby gramps » Sun Jan 27, 2019 4:08 am

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.
gramps
 
Joined: 18 Oct 2018


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: DotBot and 1 guest