######################################################### # # # ADVANCED CONSOLE INTERACTION SCRIPT - README FILE # # # ######################################################### ######################################## # # What is the Advanced console interaction script? # ================================================ # This script adds a richer interface possibilities to a console interaction. # Generally in Oni, consoles are used as simple triggers. # However, since the game is in hi-tech close future, it wouldn't hurt to have a possibility # of deeper interaction with selected terminals. # # # Examples of use # =============== # 1.) This advanced console script can be used for example to create multiple choice console menus such as: # Bank01 Item01: Open door 01 # Bank02 Item02: Disable security # Bank03 Item03: Read encrypted file 10a # Bank04 Item04: Log off # # 2.) Another example is a prompt to enter a multi-part password. An example with all four banks used: # Bank01: AA, BB, CC, DD # Bank02: EE, FF, GG, HH # Bank03: II, JJ, KK, LL # Bank04: MM, NN, OO, PP # # Scripter then makes a custom script in level logic which: # - randomly assigns one combination as the correct one at the level load # - scatters bits of information about the correct sequence in the pre-designated level area # # If all four banks are used, then player has 1:256 chance of blindly guessing the password. # Combined with the possibility of locking away the console if too many attempts are failed, # it is better for the player to not try to cheat-guess the password but go look for info. # ######################################## # # How to use the script - player perspective # ========================================== # When interacting with the designated console, player's avatar keeps locked in # its idle console entry animation and DMSG strings appear. # These DMSG strings can contain a text provided by the level scripter. # # Player chooses an item in the currently selected bank by pressing UP or DOWN. # # If the particular console session utilizes multiple item banks, # player can select between item banks by pressing LEFT or RIGHT. # # By pressing CROUCH, player enters the selected input into the terminal. # What happens next is based on the entered sequence and on the logic provided by the level scripter. # # By pressing JUMP, player exits the advanced console mode. # # If hit by a melee attack, avatar exits the console mode immediately. # # ######################################## # # How to use the script - scripter perspective # ============================================ # # Put the file "glb_adco_script.bsl" into your "global" folder. # # # DUMMY CHARACTER # ############### # Prepare a dummy character in the level. It can be any character as long as it can provide following animTypes: # - run start fw/bk :commands UP and DOWN used to pick an item from currently selected bank # - run start lt/rt :commands LEFT and RIGHT used to switch between banks # - crouch :Command CROUCH used to enter the code into the terminal # - jump :command JUMP exit the console mode # # # CONSOLE ANIMATIONS # ################## # Prepare console animations which will be used by the interacting character. # These animations should have animType "Special1" # Vanilla Oni comes with such animations for Konoko and other Konoko-derived characters: # - KONOKOlev11_cnsl_idle, length 13 (designed to be looped) # - KONOKOlev11_cnsl_type, length 113 # - KONOKOlev11_cnsl_stop, length 30 # # For non-Konoko derived characters, custom animations are advised to be made. # Of course there is a possibility to recycle Konoko's animations as well, # however they for example don't look good when applied on male characters. # # # # LEVELSIDE FUNCTION "glb_adco_f_external_input_function(void)" # ################## # Create the function "glb_adco_f_external_input_function(void)" in the level script. # This function is called by advanced console interaction script when player "enters" into the terminal (CROUCH command). # Within this function you can write the decision logic, based on the variable "glb_adco_vn_inputcode". # Please refrain from using "sleep" inside this function. If something has to be delayed, consider "forking" the delay instead. # Example how the function could look inside the level script: # ------------------------------------------------------------ # func void glb_adco_f_external_input_function(void) # { # # if(glb_adco_vn_inputcode eq 11) # { # door_unlock 1 # } # if(glb_adco_vn_inputcode eq 12) # { # text_console level_1a # } # else # { # fork do_alarm_with_delays # } # } # # If there are more consoles in the level which are designed to use the advanced console interaction, # they will all share this function. # Thus it is neccessary to introduce switching based on some levelside variable. # Each separated console function then provides decision based on "glb_adco_vn_inputcode" variable. # It is up to the level scripter to design the "glb_adco_f_external_input_function" in a way it suits the level needs. # Example how could the function look inside the level script if more consoles are utilized: # ------------------------------------------------------------------------------------------ # func void glb_adco_f_external_input_function(void) # { # if(vn_levelside_console_ID eq 0) # { # f_console_1_decision_logic() # } # if(vn_levelside_console_ID eq 1) # { # f_console_2_decision_logic() # } # if(vn_levelside_console_ID eq 2) # { # f_console_2_decision_logic() # } # } # # # # EVALUATING THE VARIABLE "glb_adco_vn_inputcode" # ####################### # Variable "glb_adco_vn_inputcode" contains sum of all used banks at the time of code entry. # # Generally, the advanced console interaction script gives a scripter an ability to use 1 up to 4 item banks. # Bank count can be changed within the 1~4 boundaries via variable "glb_adco_vn_numberofbanks". # However, it is recommended to use the function "glb_adco_f_setup_general(-||-)" # If the scripter selects zero banks, the advanced console interaction script will operate with allowed minimum of 1. # If the scripter selects more than 4 banks, the script will operate with allowed maximum of 4. # # An item bank always consists of 4 items. This amount is hardcoded. # Items in a bank can be assigned customary display-text. # Item text is a DMSG string. # Item text is set via corresponding "glb_adco_f_setup_bank0x()" function ("x" ranges from 0 to 3). # These functions always take four parameters and set texts for all 4 items in a bank. # # Each bank is assigned its own numeric variable. Variables are called "glb_adco_vn_bank0x". # Each bank has assigned its place value. # When listing through items in the bank, the value of the bank numeric variable changes accoring to the selected item. # ----------- # Bank01 has a variable "glb_adco_vn_bank01". # Bank01 has a place value of "thousands". # Item01 of the Bank01 has value 1000 # Item02 of the Bank01 has value 2000 # Item03 of the Bank01 has value 3000 # Item04 of the Bank01 has value 4000 # # Bank02 has a variable "glb_adco_vn_bank02". # Bank02 has a place value of "hundreds". # Item01 of the Bank02 has value 100 # Item02 of the Bank02 has value 200 # Item03 of the Bank02 has value 300 # Item04 of the Bank02 has value 400 # # Bank03 has a variable "glb_adco_vn_bank03". # Bank03 has a place value of "tens". # Item01 of the Bank03 has value 10 # Item02 of the Bank03 has value 20 # Item03 of the Bank03 has value 30 # Item04 of the Bank03 has value 40 # # Bank04 has a variable "glb_adco_vn_bank04". # Bank04 has a place value of "ones". # Item01 of the Bank04 has value 1 # Item02 of the Bank04 has value 2 # Item03 of the Bank04 has value 3 # Item04 of the Bank04 has value 4 # # When player performs the CROUCH command ("input code sequence"), values of bank variables are summed into the variable # "glb_adco_vn_inputcode". # The variable can be then checked in an "if" statement inside the function "glb_adco_f_external_input_function(void)" or # any other function (since it is a global variable). # example of the variable value and its meaning: # ---------------------------------------------- # glb_adco_vn_inputcode = 1000 : only one bank used, first item is selected # glb_adco_vn_inputcode = 4300 : two banks used, fourth item was selected in the first bank # third item was selected in the second bank # glb_adco_vn_inputcode = 2413 : four banks used, second item was selected in the first bank # fourth item in the second bank, # first item in the third bank # third item in the fourth bank # # # # AUXILIARY LEVELSIDE USEABLE FUNCTIONS # ##################################### # Function "glb_adco_f_resetvariables()" can be used to reset values of these variables (X represents number 1~4): # - glb_adco_vn_inputcode : is set to zero # - glb_adco_vn_bank0X : zeroed, then checked against the variable "vn_numberofbanks" # to see how many bank variables are used in the session. # Bank variables used in the session are set their lowest valid value. # # Function "glb_adco_f_refreshstrings(string s_extramessage01, string s_extramessage02)" can be used to refresh visible DMSG strings. # The function refreshes DMSG strings to show currently selected bank name and item. # - vs_extramessage01 : DMSG string, the first extra message which can be shown above standard bank/item strings. # - vs_extramessage02 : DMSG string, the second extra message which can be shown above standard bank/item strings. # # # # ADVANCED CONSOLE INTERACTION SCRIPT INITIALIZATION # ################################################## # At the beginning of the level load, call the fuction # "glb_adco_f_init(string vs_dummyname, int vn_dummyindex, int vn_dummyteleport)" # - Be sure you know the name of the dummy character and its chr_index. # - The best way to know the chr_index is to make sure the dummy is the first spawned NPC character at the level load. # Then its chr_index will be 1. # - If chr_teleport is not desired, simpyl fill in nonexisting flag. # For example flag 9999 is usually not present in levels. # # # # ADVANCED CONSOLE INTERACTION SESSION SETUP # ########################################## # When the time comes and the console script should start, setup the session parameters first. # Following functions should be called just before the session start function is called. # First use the function # "glb_adco_f_setup_general(int vn_numberofbanks, string vs_inputsequencetext, string vs_animcons_idle, int vn_animcons_idlelength, string vs_animcons_type, int vn_animcons_typelength, string vs_animcons_end, int vn_animcons_endlength)" # to set up general parameters of the session. # - vn_numberofbanks : determines how much banks will the session use. Valid are numbers 1,2,3,4. # - vs_inputsequencetext : a DMSG string which is displayed when the player inputs the code (CROUCH key pressed). # - vs_animcons_idle : a name of the animation which will be looped when character is standing idle with hands on the console. # - vn_animcons_idlelength : length for how long should the console idle anim play. Set it high number, like 216000 (one hour). # - vs_animcons_type : a name of the animation used when character inputs the password (typing on the keyboard). # - vn_animcons_typelength : length for how long should the console idle anim play. Set it one frame less than the actual animation length. # - vs_animcons_end : a name of the animation used when character ends the advanced console session (puts hands down from the terminal). # - vn_animcons_endlength : length for how long should the console end anim play. Set it one frame less than the actual animation length. # # # Then setup those banks you will be using. Use function # "glb_adco_f_setup_bank01(string vs_bank01name, string vs_bank01_01, string vs_bank01_02, string vs_bank01_03, string vs_bank01_04)" for Bank01 # "glb_adco_f_setup_bank02(-||-)" for Bank02 # "glb_adco_f_setup_bank03(-||-)" for Bank03 # "glb_adco_f_setup_bank04(-||-)" for Bank04 # # Each function of these four provides (big X means number 1 to 4): # - vs_bank0Xname : DMSG string, a bank name which will be always displayed above currently selected item. # - vs_bank0X_01 : DMSG string, which will be displayed a name of the item 01 from the Bank 0X. # - vs_bank0X_02 : DMSG string, which will be displayed a name of the item 02 from the Bank 0X. # - vs_bank0X_03 : DMSG string, which will be displayed a name of the item 03 from the Bank 0X. # - vs_bank0X_04 : DMSG string, which will be displayed a name of the item 04 from the Bank 0X. # # # # ADVANCED CONSOLE INTERACTION SESSION START # ########################################## # When everything is prepared, call the advance console session start via the function # "glb_adco_f_session_start(string vs_username, int vn_userindex, string vs_initialmessage01, string vs_initialmessage02)" # - vs_username : name of the character which uses the console. It doesn't have to be always default avatar, # player can be "chr_focus"ed on some other character. # # - vn_userindex : chr_index of the console user # - vs_initialmessage0X : DMSG strings, initial message(s) displayed when the console session starts. # For example "Welcome. Please enter the registration code to proceed." # # # # ADVANCED CONSOLE INTERACTION SESSION END # ######################################## # Session can be ended: # - voluntarily by user (pressing JUMP key) # - from the BSL code: via function "glb_adco_f_exitconsolemode_BSL(string vs_endmessage, int vn_endmessagetimer)" # - by console user avatar being hit by melee or some projectiles # # Function "glb_adco_f_exitconsolemode_BSL(string vs_endmessage01, string vs_endmessage02, int vn_endmessagetimer)" # - vs_endmessage01 : DMSG string, the first optional message displayed when ending the session. # - vs_endmessage02 : DMSG string, the second optional message displayed when ending the session. # - vn_endmessagetimer : time for how long should the ending message(s) be displayed; in frames (60 frames = 1 second). # # # # MISCELLANEOUS # ############# # The "advanced interaction" is carried as a multiple choice menu switched by making characters perform certain TRAMs. # Credit for the idea of multichoice animType switched menu goes to Gumby, Geyser, Script10k and others involved, # who pioneered the feature for OniMenu and for OTA scripts. # # The Advanced console interaction script is considered released. # Users are welcome to alter contents of the script in any way it suits their needs. # # Troubleshooting and/or help may be provided (no guarantee, tough): # - publicly on the Oni Central Forum, where members will be most certainly more than willing to help # - privately via E-mail address "exloser@seznam.cz" # # # This README reflects "glb_adco_script.bsl" script revision 1.0 # ########################################