Abrir menu principal

UESPWiki β

Alterações

Oblivion Mod:Cobl/Modding/Options Menu

1 874 bytes adicionados, 22h23min de 6 de março de 2008
m
{{Cobl Modding Trail}}
===Overview===
Cobl provides a standard options menu that modders can use to provide easy access to options settings for their mods. The menus is accessed by equipping the "+[Options]" misc. item in the player's inventory. Doing so activates a remote container containing option tokens. Option commands (typically a menu display) are activated simply by selecting an item from the options container.

To add a command to the Options Box:
* Define a command token misc. object and its script.
* Use a quest script or similar to add a copy of the command token to cobOptChestRef.

===Complications===
* The command token should be scripted to perform its action and then remove itself from the player's inventory. (Use removeMe.)
* In order to keep the player from using the Options Box as a general storage container, all items in the storage container are removed to the player after the options command has run. Hence there are two ways the token can be added to the user:
*# by the user selecting the command token (cobOptChestRef.state == 20; command should execute);
*# after the Options Box power has completed (cobOptChestRef.state != 20; command should '''not''' execute).
* After the token is selected by/removed to the player, the options box needs to be refilled. This is best done by the command token itself. While the command token could just remove itself back to the chest, this can leave the command token in a triggered state. Hence it is better to add a new copy of the token to the chest and have the token delete itself via removeMe.

===Examples===
* Cobl Main.esm
** cobOptAboutOptions: A simple command that doesn't require a menu.
** cobOptTimeScale: A fairly simple command that shows a menu and then handles the user's choice.
* OOO 1.32-Cobl.esp
** Has several options for activating/deactivating various features of OOO.
3 117
edições