Newgamechoices (DEF): Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
No edit summary
Add usercontent option that wasn't documented.
Line 1: Line 1:
<span {{code}}>'''newgamechoices''' { [...] }</span>
<span {{code}}>'''newgamechoices''' { [...] }</span>


When defined, overrides the standard Duke 3D episode selection menu with a customizable one. Note that the behavior upon selecting a menu entry needs to be defined inside the event [[EVENT_NEWGAMECUSTOM]].
When defined, overrides the standard Duke 3D episode selection menu with a customizable one.  


Note that this disables the '''Usermap''' selection menu entry. The menu itself can however still be accessed through clever use of [[EVENT_CHANGEMENU]] or the [[cmenu]] command.
Note that the behavior upon selecting a menu entry needs to be defined inside the event [[EVENT_NEWGAMECUSTOM]].


== Tokens ==
== Tokens ==
Line 22: Line 22:


:: Optional. Will make the menu entry invisible until the corresponding bit in [[newgamecustomopen]] for the top-layer menu, or [[newgamecustomsubopen]] for the submenu is set using CON scripts.
:: Optional. Will make the menu entry invisible until the corresponding bit in [[newgamecustomopen]] for the top-layer menu, or [[newgamecustomsubopen]] for the submenu is set using CON scripts.
:: <span {{code}}>'''usercontent'''</span>
:: Optional. Makes the menu option transition directly to the usermap menu. Can only be defined for the top layer.


== Examples ==
== Examples ==

Revision as of 10:52, 23 May 2020

newgamechoices { [...] }

When defined, overrides the standard Duke 3D episode selection menu with a customizable one.

Note that the behavior upon selecting a menu entry needs to be defined inside the event EVENT_NEWGAMECUSTOM.

Tokens

choice <value> { [...] }

Defines a menu entry, where <value> must start from 0 and indicates the display order. Can be nested to create submenus. A maximum of 7 display entries are allowed per submenu, and at most one submenu per top-level entry is allowed. Must be defined in a contiguous sequence (i.e. no gaps in the order). If no submenu is defined, will directly move on to the Skill Level Selection.

name <text>
Required. Defines the name of the menu entry. This is the text that will be displayed ingame.
locked
Optional. Will make the menu entry inaccessible until the corresponding bit in newgamecustomopen for the top-layer menu, or newgamecustomsubopen for the submenu is set using CON scripts.
hidden
Optional. Will make the menu entry invisible until the corresponding bit in newgamecustomopen for the top-layer menu, or newgamecustomsubopen for the submenu is set using CON scripts.
usercontent
Optional. Makes the menu option transition directly to the usermap menu. Can only be defined for the top layer.

Examples

The following example recreates the Duke 3D menu, with a submenu for Episode 1, and two additional top-level menu entries World Tour and Plug N' Pray, which are locked and invisible respectively.

Note that without defining the behavior of the new menu using EVENT_NEWGAMECUSTOM , each option will simply restart the current map, or enter E1L1 if no map is active.

newgamechoices
{
   choice 0
   {
       name "L.A. Meltdown"
       choice 0
       {
           name "Hollywood Holocaust"
       }
       choice 1
       {
           name "Red Light District"
       }
       choice 2
       {
           name "Death Row"
       }
       choice 3
       {
           name "Toxic Dump"
       }
       choice 4
       {
           name "The Abyss"
       }
   }
   choice 1
   {
       name "Lunar Apocalypse"
   }
   choice 2
   {
       name "Shrapnel City"
   }
   choice 3
   {
       name "The Birth"
   }
   choice 4
   {
       name "World Tour"
       locked
   }
   choice 5
   {
       name "Plug N' Pray"
       hidden
   }
}