View Single Post
Old 11-11-16, 16:26   #3
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,412
Default More than one proper code

(by poster)

If you would like to use more than one good code with the keypad (at the same time), then these are the methods:

Method#1

This time you need a Switch Script command.
This method is useful for codes maximum with one digit.
First of all, type in the OCB panel any number which is out of the useable range. It is “from 0 to 9999” range usually, but you also need to calculate the elevator range: “from 10001 to 10010”. As you know, you also need to add 16384. 16384+10010 is 26394. I choose a number a bit above it. I mean, I tested it with 27000, successfully.

You need a SWITCH trigger and a TRIGGER as well on the square of the keypad, as usual. But this time the TRIGGER is an F289, to activate a Switch Script command. The variable you use in the command must be Last Input Number.
Switch Script commands are useful instead of complicated GlobalTriggers, if your purpose is something like this: “if Variable A value is B then TriggerGroup C will be executed, if Variable D value is E then TriggerGroup F will be executed etc”.

So, for example:

Switch= 1, #0200, IGNORE, 15, 17, IGNORE, 22

1 is Switch command ID. #0200 is the ID of Last Input Number. The first IGNORE for flags (unused now).
The other numbers are TriggerGrup codes, in order for 1, 2, 3, 4 numbers typed in the keypad. So, if you type 1, then TriggerGroup#15 will be executed, if you type 2, then TriggerGroup#17 will be executed, if you type 3, then no TriggerGroup will be executed, if you type 4, then TriggerGroup#22 will be executed.

Method#2

This time you need GlobalTrigger Script commands, without ANY triggers placed under the switch object.
This method is useful for codes maximum with three digits. (Be careful if you use the same code with another keypad of the level, because the solution will be the same. Or disable the GlobalTrigger of the first keypad when Lara is near the other keypad.)
First of all, type in the OCB panel any wrong code of the “from 0 to 9999” range. Eg. you don’t need the code of 102, so you type 102+16384=16486.

For example:

GlobalTrigger= 1, IGNORE, GT_ALWAYS, IGNORE, IGNORE, 1, IGNORE
TriggerGroup= 1, $8000, 123, $13, > ; C19: if last number type in a keypad=123
$5000, 416, $2B, > ; A43: activate flame ID#416
$8000+TGROUP_ELSE, 456, $13, > ; C19: if last number type in a keypad=456
$5000, 415, $2B ; A43: activate flame ID#415

Don’t use it for timed setups!
Or for features that can be activated more than once, now and even in the next moment (like an audio file).


Method#3

This time you need GlobalTrigger Script commands, without ANY triggers placed under the switch object.
This method is useful for codes even with four digits. (Be careful if you use the same code with another keypad of the level, because the solution will be the same. Or disable the GlobalTrigger of the first keypad when Lara is near the other keypad.)
First of all, type in the OCB panel any wrong code of the “from 0 to 9999” range. Eg. you don’t need the code of 102, so you type 102+16384=16486.

For example:

GlobalTrigger= 1, IGNORE, GT_ALWAYS, IGNORE, IGNORE, 1, IGNORE
TriggerGroup= 1, $8000, 53, $28, > ; C40: if Last Input Number variable=number at PARAM_BIG_NUMBERS#0
$5000, 416, $2B, > ; A43: activate flame ID#416
$8000+TGROUP_ELSE, 53, $128, > ; C40: if Last Input Number variable=number at PARAM_BIG_NUMBERS#1
$5000, 415, $2B ; A43: activate flame ID#415
Parameters= PARAM_BIG_NUMBERS, 1234, 5678

If the setup is timed (or see eg. even that audio thing I said above), then modify the setup this way:

GlobalTrigger= 2, FGT_SINGLE_SHOT_RESUMED, GT_CONDITION_GROUP, IGNORE, 3, 4, IGNORE
TriggerGroup= 3, $8000, 53, $28 ; C40: if Last Input Number variable=number at PARAM_BIG_NUMBERS#0
TriggerGroup= 4, $5000, 416, $52B, > ; A43: activate flame ID#416, for 5 seconds
$2000, 232, $35 ; F232: turn Last Input Number variable into 0
GlobalTrigger= 3, FGT_SINGLE_SHOT_RESUMED, GT_CONDITION_GROUP, IGNORE, 5, 6, IGNORE
TriggerGroup= 5, $8000, 53, $128 ; C40: if Last Input Number variable=number at PARAM_BIG_NUMBERS#1
TriggerGroup= 6, $5000, 415, $52B, > ; A43: activate flame ID#415, for 5 seconds
$2000, 232, $35 ; F232: turn Last Input Number variable into 0
Parameters= PARAM_BIG_NUMBERS, 1234, 5678

Note:
If you'd like to change the code (so if you want more good codes, but after each other), then probably "timed" Method#3 is the best (not timed everyway now), but in this way:
- GlobalTrigger for code#1 is enabled and the one for code#2 is disabled, then
- GlobalTrigger for code#1 is disabled and the one for code#2 is enabled.
But "resumed" flag is necessary now only if the setup is timed or that audio type or something similar.

Last edited by AkyV; 11-11-16 at 21:18.
AkyV is offline