19-09-16, 22:53 | #1 |
Moderator
Joined: Dec 2011
Posts: 4,881
|
TRNG – Disabling switches
Made using TRNG 1.2.2.7.+
Some segments of this tutorial are based on Titak’s ideas. Notes:
It disables the switch temporarily or permanently. Tested successfully with these switches:
For example, open a LEVER_SWITCH in WADMerger Animation Editor. As you see, StateID 0, 1 and 2 are used in the setup. So, if you force StateID 3, the lever will be useless (either being in ON or OFF position) while you forcing that state. The setup is: Step1 Place an F118 (in “continuous” mode) or an F373 trigger anywhere in the map, to start TriggerGroup#1 in “continuous” mode. If you activate this trigger, then the switch will be disabled in the actual (ON or OFF) position. TriggerGroup#1 has only one (A90) trigger: ; Set Trigger Type - ACTION 90 ; Exporting: TRIGGER(858:0) for ACTION(X) ; <#> : LEVER_SWITCH ID X ; <&> : Creature. Force for <#>Moveable the (E)State-id ; (E) : State Id 3 ; Values to add in script command: $5000, X, $35A Yes, there is only one trigger in the TriggerGroup, but we need the TriggerGroup for the continuous activation, because an A90 trigger just placed in the map would be activated only in “single” mode. “Single” A90 triggers will lose their effect if you save the game and then load it. Step2 Place an F118 (in “single” mode) or an F371 trigger anywhere in the map, to start TriggerGroup#2. If you activate this trigger, then the switch will be enabled again, restoring the original StateIDs. TriggerGroup= 2, $2000, 192, $1, > ; F192: to stop the continuous activation of TriggerGroup#1 (so the disablement can be aborted now) $9000, X, $15, > ; C21: if the switch actual animation is Animation0 (“being in OFF position”, one framed loop animation) $5000, X, $5A, > ; A90: forces StateID 0 (the original StateID of Animation0) $9000+TGROUP_ELSE, X, $215, > ; C21: or else if the switch actual animation is Animation2 (“being in ON position”, one framed loop animation) $5000, X, $15A; A90: forces StateID 1 (the original StateID of Animation2) Notes:
It disables the switch permanently. Tested successfully with these switches:
TRIGGER (0:0) for SWITCH_TYPE1 (X) Or with a similar ACTION trigger: ; Set Trigger Type - ACTION 43 ; Exporting: TRIGGER(43:0) for ACTION(X) ; <#> : SWITCH_TYPE1 ID X ; <&> : Trigger. (Moveable) Activate <#>Object with (E)Timer value ; (E) : Timer= +00 ; Values to add in script command: $5000, X, $2B Now the lever will be useless either being in ON or OFF position, Notes:
It disables the switch temporarily or permanently. Tested successfully with these switches:
If you type -1, then that will refer to a non-existing animation, so Lara can’t use the switch. The proper OCB codes:
Step1 Type the proper code in the OCB window, then place an F118 (in “continuous” mode) or an F373 trigger anywhere in the map, to start TriggerGroup#1 in “continuous” mode. If you activate this trigger, then the switch will be disabled in the actual (ON or OFF) position. TriggerGroup#1 has only one (A79) trigger: ; Set Trigger Type - ACTION 79 ; Exporting: TRIGGER(79:0) for ACTION(X) ; <#> : SWITCH_TYPE1 ID X ; <&> : Enemy. (OCB) Change the OCB value of <#>Moveable with (E)Big Number value ; (E) : Value of Parameters=PARAM_BIG_NUMBERS at index= 0 ; Values to add in script command: $5000, X, $4F Yes, there is only one trigger in the TriggerGroup, but we need the TriggerGroup for the continuous activation, because an A79 trigger just placed in the map would be activated only in “single” mode. “Single” A79 triggers will lose their effect if you save the game and then load it. As you see in the trigger, we refer to PARAM_BIG_NUMBERS#0, but you can naturally refer to another PARAM_BIG_NUMBERS ID, if you want. What matters is you need to type -1 in that ID in the Script. Step2 Place an F118 (in “single” mode) or an F371 trigger anywhere in the map, to start TriggerGroup#2. If you activate this trigger, then the switch will be enabled again, restoring the proper OCB code. TriggerGroup= 2, $2000, 192, $1, > ; F192: to stop the continuous activation of TriggerGroup#1 (so the disablement can be aborted now) $5000, X, $14F ; A79: just like the A79 above, it also forces a PARAM_BIG_NUMBERS into the OCB code of object X, but this time it is PARAM_BIG_NUMBERS#1, where the proper code is typed Notes:
It disables the switch temporarily or permanently. Tested successfully with these switches:
Step1 Place an F118 (in “continuous” mode) or an F373 trigger anywhere in the map, to start TriggerGroup#1 in “continuous” mode. (I have already explained above why we need a continuous TriggerGroup.) If you activate this trigger, then the switch will be disabled in the actual (ON or OFF) position. TriggerGroup= 1, $5000, X, $36, > ; A54: define object with ID X, for item memory zone $2000, 255, $11Y ; disable object Y values are: 5 – crowbar switch 6 - pulley Step2 Place an F118 (in “single” mode) or an F371 trigger anywhere in the map, to start TriggerGroup#2. If you activate this trigger, then the switch will be enabled again. TriggerGroup= 2, $2000, 192, $1, > ; F192: to stop the continuous activation of TriggerGroup#1 (so the disablement can be aborted now) $5000, X, $36, > ; A54: define object with ID X, for item memory zone $2000, 255, $1Y ; enable object Y values are: 5 – crowbar switch 6 - pulley 5. Method of forcing a fake object slot It disables the switch temporarily or permanently. Tested successfully with these switches:
Then force that “fake” object slot instead of the switch slot, so the “switch” won’t detect if Lara’s bullet hits it. The setup is: Step1 Place an F118 (in “continuous” mode) or an F373 trigger anywhere in the map, to start TriggerGroup#1 in “continuous” mode. If you activate this trigger, then the switch will be disabled. TriggerGroup= 1, $5000, X, $36, > ; A54: define switch object with ID X $2000, 261, $3 ; F261: forces fake object slot ID, typed at Parameters=PARAM_BIG_NUMBERS#0 In this F261 trigger, we refer to PARAM_BIG_NUMBERS#0, but you can naturally refer to another PARAM_BIG_NUMBERS ID, if you want. What matters is you need to type the fake slot ID there in the Script. Step2 Place an F118 (in “single” mode) or an F371 trigger anywhere in the map, to start TriggerGroup#2. If you activate this trigger, then the switch will be enabled again, restoring the original object slot. TriggerGroup= 2, $2000, 192, $1, > ; F192: to stop the continuous activation of TriggerGroup#1 (so the disablement can be aborted now) $5000, X, $36, > ; A54: define switch object with ID X $2000, 261, $103 ; F261: forces switch object slot ID, typed at Parameters=PARAM_BIG_NUMBERS#1 Notes:
It disables the switch temporarily or permanently. Tested successfully with cog switch (COG_SWITCH of Chambers of Tulun). Lara can’t use Key Action (to use the switch) when she is in the required position to the switch. The setup is: Step1 Place an F109 or F374 trigger anywhere in the map, to enable GlobalTrigger#1. If you activate this trigger, then the switch will be disabled in the actual (ON or OFF) position. This is what you need to type in the Script: GlobalTrigger= 1, FGT_DISABLED, > ; so the GlobalTrigger is disabled initially GT_CONDITION_GROUP, IGNORE, 1, 2, 3 ; so the condition for the GlobalTrigger is in TriggerGroup#1, if it is true then TriggerGroup#2 will be executed, or if it is false, then TriggerGroup#3 will be executed TriggerGroup= 1, $8000, 1, $10, > ; C16: if MultEnvCondition#1 is true $8000+TGROUP_NOT, 4, $F ; C15: and if TriggerGroup#4 is not true TriggerGroup= 2, $2000, 51, $9 ; F51: disable CTRL TriggerGroup= 3, $2000, 52, $9 ; F52: enable CTRL again TriggerGroup= 4, $8000, 1, $23, $8000+TGROUP_OR, 2, $23, $8000+TGROUP_OR, 3, $23, > $8000+TGROUP_OR, 4, $23, $8000+TGROUP_OR, 5, $23, $8000+TGROUP_OR, 6, $23, $8000+TGROUP_OR, 16, $23 ; C35: if Lara is holding any weapon or torch TestPosition= 1, TPOS_TEST_ITEM_INDEX+TPOS_FOUR_HORIENT, X, > ; Position condition for Object ID X, on all the four sides -540, 540, -100, 100, -1600, -600, -5400, 5400, -100, 100, -100, 100 ; coordinates MultEnvCondition= 1, ENV_ITEM_TEST_POSITION, 1, IGNORE ; TestPosition#1=MultEnvCondition#1 Notes:
However, you need to calculate TestPosition coordinates yourself everyway if you rotate the switch, but not with 90, 180 or 270 degrees. Step2 Place an F109 or F375 trigger anywhere in the map, to disable GlobalTrigger#1 again. If you activate this trigger, then the switch will be enabled again. 7. Using switches a limited times For example you want this setup: Lara moves a lever switch to activate a flame. Then she moves the lever again to deactivate the flame. Then she moves the lever again to activate the flame again. If she tries to move the switch fourthly, then she can’t, because the switch is disabled. So you need a condition (“it was used three times”) to start the “disable the switch” setup. We need an A90 in TriggerGroup#1 to force StateID 3 to disable a lever switch, I said above. So we need this GlobalTrigger now: GlobalTrigger= 1, IGNORE, GT_CONDITION_GROUP, IGNORE, 3, 4, IGNORE TriggerGroup= 3, $8000, 64, $32B ; C43: if Local Byte Alfa1 (LBA1) variable is 3 TriggerGroup= 4, $2000, 118, $201; F118: to start TriggerGroup#1 in “continuous” mode First use (=switch moves to ON position): it adds 1 to LBA1 (LBA1=1) Second use (=switch moves to OFF position): it adds 1 to LBA1 (LBA1=2) Third use (=switch moves to ON position): it adds 1 to LBA1 (LBA1=3) So you need one more GlobalTrigger: GlobalTrigger= 2, FGT_SINGLE_SHOT_RESUMED, GT_CONDITION_GROUP, IGNORE, 5, 6, IGNORE TriggerGroup= 5, $9000, X, $115, > ; C21: if the switch actual animation is Animation1 (“moving to ON position”) $9000+TGROUP_OR, X, $315 ; C21: or if the switch actual animation is Animation3 (“moving to OFF position”) TriggerGroup= 6, $2000, 231, $140 ; F231: it adds 1 to LBA1 Note: FGT_SINGLE_SHOT_RESUMED is necessary or else 1 will be added to the variable all the time while the switch moves to ON/OFF position. |
Thread Tools | |
|
|