[Solved]Convert NewGame menu to zscript
Moderator: GZDoom Developers
-
- Posts: 83
- Joined: Thu Jan 25, 2018 1:37 pm
[Solved]Convert NewGame menu to zscript
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
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Convert NewGame menu to zscript
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.
-
- Posts: 83
- Joined: Thu Jan 25, 2018 1:37 pm
Re: Convert NewGame menu to zscript
Well then, is this even doable in any way ?
Re: Convert NewGame menu to zscript
You can circumvent the skill menu entirely and use a map to select the difficulty setting (similar to how it was done in Quake).*Collegia Titanica wrote:Well then, is this even doable in any way ?
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.
-
- Posts: 83
- Joined: Thu Jan 25, 2018 1:37 pm
Re: Convert NewGame menu to zscript
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
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
- Arctangent
- Posts: 1235
- Joined: Thu Nov 06, 2014 1:53 pm
- Contact:
Re: Convert NewGame menu to zscript
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: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
This is useful for WADs that implement skill selection by an introduction map.
Re: Convert NewGame menu to zscript
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... will do the same as the command listed above.
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);
- Attachments
-
- skillunlock.pk3
- (1.96 KiB) Downloaded 118 times
-
- Posts: 83
- Joined: Thu Jan 25, 2018 1:37 pm
Re: Convert NewGame menu to zscript
Absolutely incredible. Amazing.
You will live forever.
You will live forever.
Re: Convert NewGame menu to zscript
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 menuAFADoomer wrote:I've attached a .pk3
Not sure how future-proof this kind of stuff is supposed to be, but it's fun to mess with.