www.tombraiderforums.com

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Tomb Raider Level Editor Tutorials

Closed Thread
 
Thread Tools
Old 13-08-14, 18:30   #1
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,376
Default TRNG – Using triggers only once

Note:
Sometimes you need this function due to technical reasons.
For example, if a wraith dies, then you will be able to activate it again, unless the trigger that activates it has One Shot function.

If you want a trigger to be able to be activated only once, then these are your possibilities:

- The classic, TRLE method: press One Shot button in Set Trigger Type panel (STT) when adjusting the trigger.
- The new, TRNG method: export the trigger into a TriggerGroup, then attach a TGROUP_SINGLE_SHOT flag to the first number of the first (either condition or executable) trigger of the TriggerGroup in the Script.
For example:

TriggerGroup= 1, $2000+TGROUP_SINGLE_SHOT, 91, $214, $5000, 8, $21F

All the triggers in the TriggerGroup will be activated only once.

Note:
Don’t use the flag if the TriggerGroup doesn’t contain at least one executable trigger. (However, the flag is useless everyway if the last trigger of the TriggerGroup is a condition trigger.)

Usually you can choose any methods but there are differences between the classic and the new methods:

a, One Shot triggers can be activated only in the map. Because One Shot function cannot be exported into Script or WADMerger.
(But it doesn’t mean One Shot is useless for exported triggers, because eg. you can use One Shot even for an F118 placed in the map. And, as we know, F118 is the trigger that controls TriggerGroups.)

TriggerGroups with TGROUP_SINGLE_SHOT can be activated in two ways:

- in the map: using F118 local triggers for that TriggerGroup, or
- via Script, using commands (eg. GlobalTrigger, Switch or StandBy commands etc., when any of the TriggerGroups in the command has this flag).

Note:
Technically you can merge the two methods (F118 has One Shot in the map, plus its TriggerGroup has TGROUP_SINGLE_SHOT in the Script), but that is absolutely meaningless.

b, One Shot is not always useful/useable:

- One Shot is useless with these triggers:

= SINK, FLIPON/FLIPOFF, FINISH, FLYBY, DUMMY or standalone TARGET,
= “Collision” FLIPEFFECT’s for room collision.

- You don’t need One Shot with these triggers, because they can be activated automatically only once:

= CD or PICKUP,
= SECRET or FMV (or the exportable – FLIPEFFECT – versions of them, placed in the map, except with secret ID above 15).

- Theoretically you don’t need One Shot with KEY triggers (because key holes can be used only once automatically) but if the TRIGGER overlapped with the KEY can be triggered more than once theoretically (eg. because it is to open a timed door) then I recommend using One Shot, due to technical reasons. (Because if Lara steps to the key hole later then the door will open again automatically, though she hasn’t just used a key there again.)

TGROUP_SINGLE_SHOT is useful only with (any) CONDITION, FLIPEFFECT, ACTION triggers, because only those triggers can be exported into the Script.

Notes:

- Any method is useless sometimes. For example, A46 for a sink is useful only activated with a “multiple” F118. But if you use “only once effect” for that F118, then that will work like a “single” F118.
- Standalone TARGET triggers will work only once unintentionally everyway (which will also disable similar triggers for the same target), but that will be reset each time when you load a savegame. Fix the “unwanted only once situation” for another activation, with forcing Value 32 in “Flags of Item (Long)” Item Memory Zone field with F255, after you naming the target object with an A54.
- TARGET triggers with camera will always work together with the CAMERA trigger overlapped with it, CAMERA trigger either has “only once function” or not.
- TIMER_FIELD will always work together with the OBJECT trigger overlapped with it, OBJECT trigger either has “only once function” or not.

c, One Shot triggers disable all the same triggers, in the case of CAMERA, OBJECT, FLIPMAP triggers.
For example, if you use an OBJECT trigger with One Shot to activate an object only once, then not only that OBJECT trigger but any other OBJECT trigger won’t be able to activate that object again, if you deactivated the object meanwhile.

But that rule is not true with ACTION or FLIPEFFECT triggers.
For example, if an ACTION has One Shot to activate X thing only once, then, after that activation, another ACTION will be able to activate X thing later. (So only the first trigger becomes useless now.)
On the other hand, TriggerGroups with TGROUP_SINGLE_SHOT flag:

- will never affect other triggers to activate the same thing, but
- this TriggerGroup won’t be able to be activated again.

So if you want to activate an ACTION/FLIPEFFECT only once, and never again, even with other, similar triggers, then export that ACTION/FLIPEFFECT into a TriggerGroup, using that flag, instead of placing that ACTION/FLIPEFFECT in the map with One Shot pressed.

Notes:

- If you mix the classic (OBJECT) and the new (A43) methods for object activation, then the “disabling all the same triggers” property is the stronger.
I mean, eg. if you activate an OBJECT trigger with One Shot to activate an object, that also disables other OBJECTs or a placed/exported A43 to activate that object.
- Though, FMV triggers (or its exportable FLIPEFFECT version) don’t need One Shot pressed, the “disable all the same triggers” rule also works with them: i.e. if an FMV trigger has activated a movie file, then this or another FMV trigger is also unable to activate the same movie file later.

d, If you don’t want the “only once” property of the trigger to be adopted for the other triggers in the overlap, then use TGROUP_SINGLE_SHOT for the trigger, instead of One Shot.
See more here about overlaps:

http://www.tombraiderforums.com/showthread.php?t=205393

e, One Shot will disable (physically) the further usages of the switches.
TGROUP_SINGLE_SHOT will not: you can use the switches at the second, third etc. times – though, nothing will happen about that executable trigger.

f,
If you activate an F345 trigger anywhere, then the TriggerGroup with TGROUP_SINGLE_SHOT flag will be able to be activated again, once more. (And, after that, once more again with another F345 activation etc.)
But you can’t remove the effect of the One Shot button. (Except: using memory zones, in a bit complicated way you can read in the Hidden Triggers tutorial on TRF.)

g, See just below how One Shot or TGROUP_SINGLE_SHOT affects the trigger working methods.
See more here about trigger working methods:

http://www.tombraiderforums.com/showthread.php?t=205371

h, TGROUP_SINGLE_SHOT is able to fix the problem of multi-squared trigger zones. One Shot is not.
See below.

The effects of “only once” function on the trigger working method

These are the possibilities:

a, If the local executable trigger doesn’t have condition triggers:

- The “single” or “multiple” trigger, with One Shot pressed or (if it is an F118) with TGROUP_SINGLE_SHOT flag, will be activated, as a usual single method, but only for the first time, when the trigger becomes true. (Eg. if it is a PAD trigger and Lara touches the floor) If it becomes true for the second, third etc. time, then the trigger is useless.
- The “continuous” trigger, with One Shot pressed, will be activated, as a usual continuous method, but only for the first time, when the trigger becomes true. If you stopped the continuous activation and then it becomes true for the second, third etc. time, then the trigger is useless.

Note:
The “continuous” trigger with TGROUP_SINGLE_SHOT has a buggy control, don’t use it.

b, If the local executable trigger has its local condition trigger (KEY, SWITCH, PICKUP, CONDITION), overlapped with it:
See almost the same as in Case “a”. – Except:
The event in the overlapped executable trigger can be activated only at the first time when the condition and the executable trigger both become true. (For example, a TRIGGER executable trigger becomes true if Lara gets into the “from floor to ceiling” trigger zone.)

Notes:
- If a local condition trigger is overlapped with a local executable trigger then naturally you need to adjust One Shot at the condition trigger, if you want One Shot.
- “The condition and the executable trigger both become true” is true at a given moment even if one of them is already true at that moment when the other one becomes true.

c, If the local executable trigger is an F118, having its exported condition trigger in its TriggerGroup:
See almost the same as in Case “a”. – Except:
The exported condition will be examined only at the first moment, when the executable F118 trigger (and a possible local condition trigger overlapped with it) become true.

For example, you have this TriggerGroup with TGROUP_SINGLE_SHOT flag, activated by a TRIGGER F118: “if Lara holds the pistols (exported condition trigger), then activate a scorpion (exported executable trigger)”. If Lara gets into the trigger zone at the first time, without pistols in the hand, then the trigger won’t be activated. But, she won’t be able to activate the trigger, either she extracts the pistols now, or if she comes back later into the trigger zone with the pistols in the hand.
So the trigger will be “dead” everyway forever, if you can’t activate it at the first time.

d, If the TriggerGroup, having TGROUP_SINGLE_SHOT flag is controlled by a Script command (GlobalTrigger, Switch, StandBy etc.) or an AnimCommand.
See almost the same as in Case “c”. – Except:

The exported condition will be examined only at the first moment,

- when the condition presented by that Script command is true, or
- when the animations of the object reach the animation/frame of the AnimCommand.

Multi-squared trigger zones

Let’s see eg. a PAD F129 to play an audio track. That must be a single trigger, as I said in the working methods tutorial.
What if that trigger has a 2×1 square sized location? – Well, then the location will be treated as if that were two 1×1 sized locations for the working methods, i.e. two PAD F129 triggers for that audio track, next to each other.
For example:
Lara steps into the trigger zone, on one square of the trigger. The audio starts playing. When some seconds have been played, then Lara (not leaving the trigger zone) steps on the other square of the trigger. As I said, each square is treated as an independent trigger, so the track starts playing again, from the beginning. When some seconds have been played, then Lara (not leaving the trigger zone) steps back on the first square of the trigger, starting the track again from the beginning etc. – But you probably thought that the track would start from the beginning only each time when Lara steps into the trigger zone, so you probably thought nothing would happen if Lara walks from square to square inside the trigger zone.

So the problem now is the F129 multi-squared trigger performs single activations even when you don’t expect that.
If you want to fix that problem, then do this:
Don’t place that F129 in the map. Instead, export the F129 in the Script, then activate it with a single F118 (still as PAD), placing F118 on the same squares where you originally wanted to place that F129. Use only one of these flags for the TriggerGroup (attaching them to the first number of the first trigger):

- TGROUP_SINGLE_SHOT or
- TGROUP_SINGLE_SHOT_RESUMED.

TGROUP_SINGLE_SHOT says the TriggerGroup can be activated only once:

- So if Lara steps on any square of that PAD, then the track will start. After that, if she walks back and forth between the squares of the trigger, inside the trigger zone, then nothing will happen, because that TriggerGroup has been activated yet.
If she walks out of the trigger zone and then walks back, then still nothing will happen.
- And, if there are other triggers placed in the map to activate the same TriggerGroup, then those triggers will also be disabled when that PAD is activated.

Note:
One Shot would be useless now. I mean, I said the 2×1 sized zone is treated as two 1×1 size zones, so One Shot for that trigger will result each square is able to activate the track, each of them once.

TGROUP_SINGLE_SHOT_RESUMED says at least one of the circumstances (executable triggers, conditions) needs to be false after each activation, or else that TriggerGroup cannot be activated again.

- So if Lara steps on any square of that PAD, then the track will start. Then, if she steps on the other square, or then steps back on the first square (not leaving the trigger zone), nothing will happen, because the PAD is still true (“Lara is still touching the floor”). If she walks out of the squares or jumps up, then the trigger goes false, so the trigger will be activated again if she walks back on one of the squares again or falls back, making the trigger true again. But after that, the trigger is useless again till the next false status etc.
- And, if there are other triggers placed in the map to activate the same TriggerGroup, and Lara gets into the trigger zone of any of them, that other trigger will be activated now, because Lara naturally left the squares of that PAD F118 (making PAD false) before coming to this other trigger. (TGROUP_SINGLE_SHOT_RESUMED will naturally affect this other trigger too, if the “other” trigger also has more than one square.)

I usually recommend TGROUP_SINGLE_SHOT_RESUMED, because this flag is made to solve this problem of multi-squared triggers.
I mean, TGROUP_SINGLE_SHOT has an effect which is a side-effect now that you perhaps don’t want: it will disable this trigger and the same triggers as well, forever, after the first activation.

However, the problem exists only if it is a single trigger, whose event can be reproduced in the further moments.
(Because eg. if an F231 adds 1 to a variable, then it is able to add 1 again and again to the variable any time in the next moments. Or: eg. an A43 timer can be restarted even in the further moments.)
But the problem doesn’t exist if these cases use multi-squared trigger zones:

- If it is a single trigger, and it couldn’t do anything in the further moments. (See eg. F220: if you clear the diary contents in a moment, then the diary goes empty, so the trigger can’t do anything in the further moments.)
- If it is a multiple or continuous trigger.

Note:
I told above what causes TGROUP_SINGLE_SHOT attached to multiple/continuous TriggerGroups.
If you use TGROUP_SINGLE_SHOT_RESUMED for multiple/continuous TriggerGroups that will cause malfunctions for that TriggerGroup.

About other activators:

If the activator is not Lara but somebody/something else, then two cases are possible (it depends on the type of the activator: rollingball, motorbike, pushblock etc.):

- the problem is the same. – However, don’t forget: TGROUP_SINGLE_SHOT_RESUMED is useless now. Or
- both the flags are useful. But the problem works in a bit different way if you don’t use the flags: if the activator is moving inside a multi-squared zone, from square to square, then the single trigger can be activated only once on each square – till the activator leaves the trigger zone. If that comes back, then each square can be activated once again etc.

Made using TRNG 1.2.2.7.
AkyV is offline  
Closed Thread

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 17:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.