ZVSE ERMS_ScriptName=Adventure Menu ERMS_ScriptAuthor=SergRoj ERMS_ScriptVersion=1.0.0 ERMS_ScriptDate=01.12.2004 ERMS_ScriptERMVersion=2.80 ERMS_ScriptLanguage=English ERMS_ScriptUsedVariables=v1;v4140-4151;z891-z901 ERMS_ScriptUsedFlags=1 ERMS_ScriptUsedFunctions=FU64;FU65 _WARNING_#1=IMPORTANT! This file is not in a plain text format. NEVER use any editor except ERM_S for making any kind of changes! ERMS_PoweredBy=ERM Scripter v. 2003.5.19.2212 sergroj@hotbox.ru * There's not much buttons left in the adventure screen. That's the reason why * this script is designed. This script shows a menu with up to 11 actions when * user click the "Adventure Options" button. The actions are to be added by * other scripts. * (If there is only one item the menu wouldn't be shown) To add an item to the menu do the following steps: - Make a function that should be executed - Set z1 to the name of your option - Execute FU64 to add your function to the menu. The first parameter must be the number of the function. You can use get syntax with the second parameter to get the result. It will be 1 if the function succeeds, 0 otherwise. Example: ! ?FU666; ! !IF:^The function has been executed^; ... ! #VRz1:S^Example function^; ! #FU64:P666/?v1; ! #IF&v1=1:M^Successfully added^; You can remove items from the menu using FU65. As with FU64 x1 is the number of function and x2 is the result. The only difference is that you don't have to change z1 before executing this function. Example: ! !FU65:P666/?v1; ! #IF&v1=1:M^Successfully removed^; * v4140-4151 z891-z901 * v4140 - number of items * v4140-v4151 - functions * z891-z901 - names _DECLARATION_CM0 Right Click on the "Adventure Options" button= !?CM0&v4140>0/v4140<12; !!CM:I=9; !!FU&-1:E; !!CM:R0; !!FUv4141&v4140=1:P; [If only one event] !!FU&v4140=1:E; !!VRz1:S^Cancel^; !!VRy-5&v4140>=2:S892; [Numbers of z-variables] !!VRy-6&v4140>=3:S893; !!VRy-7&v4140>=4:S894; !!VRy-8&v4140>=5:S895; !!VRy-9&v4140>=6:S896; !!VRy-10&v4140>=7:S897; !!VRy-11&v4140>=8:S898; !!VRy-12&v4140>=9:S899; !!VRy-13&v4140>=10:S900; !!VRy-14&v4140=11:S901; !!IF:G1/1/2048/0/891/y-5/y-6/y-7/y-8/y-9/y-10/y-11/y-12/y-13/y-14/1; !!FU&v1=2048:E; [Cancel clicked] !!VRy-2&v1=1024:S11; [y-2 - Dialogue result] !!VRy-2&v1=512:S10; !!VRy-2&v1=256:S9; !!VRy-2&v1=128:S8; !!VRy-2&v1=64:S7; !!VRy-2&v1=32:S6; !!VRy-2&v1=16:S5; !!VRy-2&v1=8:S4; !!VRy-2&v1=4:S3; !!VRy-2&v1=2:S2; !!VRy-2&v1=1:S1; !!VRy-1:S4140+y-2; [Execute the chosen function] !!FUvy-1:P; _DECLARATION_FU64 Add event (x1 - function number, z1 - string):x2=1 if successfully added !?FU64; !!VRx2:S0; !!FU&x1=0:E; !!FU|v4140>=11/v4140<0:E; !!FU&v4141=x1:E; [Check for Duplicated functions] !!FU&v4142=x1:E; !!FU&v4143=x1:E; !!FU&v4144=x1:E; !!FU&v4145=x1:E; !!FU&v4146=x1:E; !!FU&v4147=x1:E; !!FU&v4148=x1:E; !!FU&v4149=x1:E; !!FU&v4150=x1:E; !!FU&v4151=x1:E; !!VRx2:S1; [OK] !!VRv4140:+1; !!VRy1:S4140+v4140; !!VRy2:S890+v4140; !!VRvy1:Sx1; !!VRzy2:Sz1; _DECLARATION_FU65 Remove event (x1 - function number):x2=1 if successfully removed !?FU65; !!VRx2:S0; !!FU&x1=0:E; !!FU|v4140>11/v4140<1:E; !!VRy-1:S0; !!VRy-1&v4151=x1:S11; [Seek the function] !!VRy-1&v4150=x1:S10; !!VRy-1&v4149=x1:S9; !!VRy-1&v4148=x1:S8; !!VRy-1&v4147=x1:S7; !!VRy-1&v4146=x1:S6; !!VRy-1&v4145=x1:S5; !!VRy-1&v4144=x1:S4; !!VRy-1&v4143=x1:S3; !!VRy-1&v4142=x1:S2; !!VRy-1&v4141=x1:S1; !!FU&y-1=0:E; !!FU&y-1>v4140:E; !!VRx2:S1; [OK] !!VRv4140:-1; !!VRv4141&y-1=1:Sv4142; [Move functions] !!VRv4142&y-1<=2:Sv4143; !!VRv4143&y-1<=3:Sv4144; !!VRv4144&y-1<=4:Sv4145; !!VRv4145&y-1<=5:Sv4146; !!VRv4146&y-1<=6:Sv4147; !!VRv4147&y-1<=7:Sv4148; !!VRv4148&y-1<=8:Sv4149; !!VRv4149&y-1<=9:Sv4150; !!VRv4150&y-1<=10:Sv4151; !!VRv4151:S0; !!VRz891&y-1=1:Sz892; [Move names] !!VRz892&y-1<=2:Sz893; !!VRz893&y-1<=3:Sz894; !!VRz894&y-1<=4:Sz895; !!VRz895&y-1<=5:Sz896; !!VRz896&y-1<=6:Sz897; !!VRz897&y-1<=7:Sz898; !!VRz898&y-1<=8:Sz899; !!VRz899&y-1<=9:Sz900; !!VRz900&y-1<=10:Sz901; !!VRz901:S^^;