Using TRNG plugin triggers - Tomb-Raider-Level-Editor/Tutorials GitHub Wiki

Written by AkyV

It seems still a general question that how to use TRNG plugin triggers in Tomb Editor, but I can help you here to find your way in this.

Triggers in TRNG engine

These days TRNG engine can be used by two types of editors:

  • Next Generation Level Editor (NGLE) – the original home of TRNG, and
  • Tomb Editor (TE).

If you use TRNG engine, in any editor, then you can use two main types of triggers:

  • Triggers originally used in the original official Tomb Raider Level Editor (also called as “winroomedit”). (They are called “TRLE triggers” from here.)
  • Triggers made for TRNG. (They are called “TRNG triggers” from here.)

Note: NGLE shows TRLE triggers more or less differently, and Tomb Editor shows TRLE and TRNG triggers more or less differently, comparing to what they looked like originally. Many times it is not only because of the different look of the trigger panel. Eg. CD TRLE trigger is called PlayAudio in Tomb Editor – which is logical, CD term being obsolete for now. But you can identify them easily.

TRNG trigger types

TRNG triggers have two main types (in "how it works" aspect):

  • Casual TRNG triggers: triggers belonging to the big groups of the so-called ACTION, FLIPEFFECT and CONDITION triggers. All of the groups contain many subtypes of triggers, for many different tasks.
  • Special TRNG triggers: these are single triggers, each having a different task. There are only two of them:

a, TIMER_FIELD: not an independent trigger, used only as a special timer when triggering objects. b, FMV: to play FMV video files during the game.

The big groups of casual TRNG triggers are:

  • ACTION triggers: these triggers use the items actually placed in the map as one of the trigger parameters. These items are mostly Moveable objects, but sometimes they can be other items, like cameras, sinks, or even Static objects. The purpose of the trigger is doing some action on that item.
  • FLIPEFFECT triggers: these triggers make some special effects. Many times there is not such a big difference between Action and Flipeffect triggers, because eg. Flipeffects also make actions on Statics or Lara (who is apparently also a Moveable object). Or even on Moveable objects – though, via script this time. But also many flipeffects can be really called a “special effect”, because their subjects are not map items, but some other things, like eg. diaries, flipmaps, FMVs, keyboard keys, audio files, images, texts etc.
  • CONDITION triggers: Action or Flipeffect triggers are executing an event, but Condition triggers won’t execute anything. As the name says, they make a condition for executable TRNG or TRLE triggers. Like Actions or Flipeffects, Condition triggers also use map items or other things as trigger subjects.

Notes:

  • FMV trigger and TRLE triggers are all have a second version in TRNG, in a form of casual (mostly a FLIPEFFECT) TRNG triggers. There are two reasons for that:

a, Only casual TRNG triggers can be exported (see below what that means), which could be an important feature sometimes. b, The two versions of the trigger differ from each other more or less, so you can decide which version is better for your purpose.

  • Not all the Flipeffects are TRNG triggers, some of them are coming from TRLE – which is signed by the “OldFlip” tag in their trigger names. In TRNG engine they exactly act like any TRNG Flipeffect trigger – so for TRNG I keep calling all the Flipeffect triggers TRNG triggers.
  • Monkey trigger of TRLE has been removed from TRNG. There is a Condition trigger in TRNG to check if Lara is monkey swinging, if you need that function.

Exporting triggers

TRLE triggers and special TRNG triggers cannot be exported in TRNG. Only casual TRNG triggers can be exported there. “Exported” means you can convert the actual parameters of the actual trigger into a row of numbers, which can be called “trigger code” or “export values”. Export values are important if you want to use the trigger for one of these purposes:

  • Mostly: using it in the script. Now the code will be pasted into a script command, so when that command is called in the game, then the trigger will also do its own function.
  • Sometimes the trigger should be used as an animation command. So when that animation just performs that frame, then the trigger code will do its job.
  • Plugin makers will also use a third export type whose purpose is to embed the trigger in a feature of that plugin. (Casual level builders will naturally never use this type, they never make, only use a plugin, so it should be a really rare export type.)

The plugin triggers

The two main types of TRNG triggers are (in "origin" aspect):

  • Original TRNG triggers – they are always parts of TRNG, because they are made by Paolone, the author of NGLE and TRNG. (And naturally “OldFlip” Flipeffects also belong to here.)
  • Plugin TRNG triggers – they are parts of TRNG only if you install that plugin for your TRNG, because they are made by other people. So if you don’t need those triggers (any more), then simply don’t install that plugin, or uninstall it.

Notes:

  • Plugin TRNG triggers can be only casual TRNG triggers: Action, Flipeffect, Condition. So a plugin maker can never make a trigger with a special name, like TIMER_FIELD or FMV.
  • Paolone also made a few plugins anyway, so they won’t increase the size of your TRNG if you don’t need them.

The difference between how NGLE and Tomb Editor handle TRNG triggers

This difference is the most important in the aspect that if you choose TRNG engine for TE, then you can install TRNG plugins for Tomb Editor (via TombIDE), but Tomb Editor trigger panel won’t show any plugin TRNG triggers, only original TRNG triggers.

And there is another difference as well, a minor one, only for plugin makers: Tomb Editor trigger panel has no function for exporting any original TRNG trigger code either to embed it in a plugin feature.

Let’s sum up these differences:

  • Original (casual or special) TRNG triggers in the map:

a, Choose the trigger in NGLE trigger panel to place it in an NGLE map. b, Choose the trigger in TE trigger panel to place it in a TE map.

  • Plugin (always casual) TRNG triggers in the map:

a, Choose the trigger in NGLE trigger panel to place it in an NGLE map. b, The only way to place a trigger like that in a TE map, if you do this:

  1. First make a TriggerGroup script command in TombIDE, which will host that trigger.
  2. Export that trigger from NGLE trigger panel, for scripting. (See below what if you don’t have a working NGLE installed.)
  3. Copy that trigger code and paste it in that TombIDE TriggerGroup command.
  4. Place an F118 or F371 or F372 or F373 trigger (for that TriggerGroup) in that TE map, where you originally wanted to place that plugin trigger.
  • Original (always casual) TRNG trigger export for scripting:

a, Exporting from NGLE trigger panel, pasting it into NG Center of NGLE. b, Exporting from NGLE trigger panel, pasting it into TombIDE of TE. c, Exporting from TE trigger panel, pasting it into NG Center of NGLE. d, Exporting from TE trigger panel, pasting it into TombIDE of TE.

  • Plugin (always casual) TRNG trigger export for scripting:

a, Exporting from NGLE trigger panel, pasting it into NG Center of NGLE. b, Exporting from NGLE trigger panel, pasting it into TombIDE of TE – so even if you want that trigger initially in the script, not placing it in the map. (See below what if you don’t have a working NGLE installed.)

  • Original (always casual) TRNG trigger export for an animcommand:

a, Exporting from NGLE trigger panel, pasting it into WadMerger (WAD), for NGLE or TE. b, Exporting from NGLE trigger panel, pasting it into WadTool (WAD2), for TE. c, Exporting from TE trigger panel, pasting it into WadMerger (WAD), for NGLE or TE. d, Exporting from TE trigger panel, pasting it into WadTool (WAD2), for TE.

  • Plugin (always casual) TRNG trigger export for an animcommand: There is a limitation that you cannot export plugin trigger animcommands. But it is not a TE limitation, but already a TRNG limitation! (Which means you cannot do an export like that for NGLE either.) The only way is to solve the problem:

a, for NGLE:

  1. First make a TriggerGroup script command in NG Center, which will host that trigger.
  2. Then export a Flipeffect hosting that TriggerGroup (again: F118 or F371 or F372 or F373) as an animcommand:

a, Exporting from NGLE trigger panel, pasting it into WadMerger (WAD). b, Exporting from TE trigger panel, pasting it into WadMerger (WAD).

  1. Export that plugin trigger from NGLE trigger panel, for scripting.
  2. Copy that script trigger code and paste it in that NG Center TriggerGroup command.

b, for TE:

  1. First make a TriggerGroup script command in TombIDE, which will host that trigger.
  2. Then export a Flipeffect hosting that TriggerGroup (again: F118 or F371 or F372 or F373) as an animcommand:

a, Exporting from NGLE trigger panel, pasting it into WadMerger (WAD). b, Exporting from NGLE trigger panel, pasting it into WadTool (WAD2). c, Exporting from TE trigger panel, pasting it into WadMerger (WAD). d, Exporting from TE trigger panel, pasting it into WadTool (WAD2).

  1. Export that plugin trigger from NGLE trigger panel, for scripting. (See below what if you don’t have a working NGLE installed.)
  2. Copy that script trigger code and paste it in that TombIDE TriggerGroup command.
  • Either original or plugin (but always casual) TRNG trigger export for embedding it in the Visual Express program (called “exporting a function”) as a plugin code part:

a, Using NGLE: Exporting from NGLE trigger panel. b, Using TE: Exporting from NGLE trigger panel. (See below what if you don’t have a working NGLE installed.)

Notes:

  • The difference between NGLE and TE exported script forms are tiny, and doesn’t matter. I.e. TE form can have zeros without any task, eg. when 01 and 1 are the same value.
  • Don’t forget that exported animcommands must be used both in WadMerger and WadTool if they were Set Position animcommands. (But they are naturally not.)

Trigger descriptions in NGLE

As you know, both TRLE and TRNG script commands and constants have nice descriptions both in NG Center and TombIDE. On the other hand, for a long time, triggers didn’t have similar descriptions at all. But later Paolone added a function to NGLE trigger panel, which shows some information for the actual trigger:

  • There is a single row in the bottom of the panel (“Trigger’s Remark”). So if a very short description (only in one row) is enough for that trigger, then you can read it there.
  • If a bigger description is needed, then that single row is mostly used only to call your attention to that. (Eg. “Click on [Trigger's Help] button for more infos”.) Now you can click on a button (“Trigger’s Help”), which opens a TXT about that bigger description.

Paolone started filling informations for the triggers which only he can reach in NGLE (TRLE triggers and original TRNG triggers), but – like everything else in that world since then – it has been interrupted since years, only a very few descriptions like that is existing. Fortunately Trigger’s Remark and Trigger’s Help are plugin features as well, so plugin makers also have the possibility to create trigger descriptions for their triggers.

Though, “only” TRNG plugin triggers are missing from TE trigger panel, this info feature isn’t added to TE, that is why “Paolone’s triggers” doesn’t have descriptions either in TE. But it doesn’t matter, even if you are a TE user, feel free to enter NGLE if you’d like to read some information about some trigger (either plugin trigger or not), adjust that trigger on NGLE trigger panel, and read that info – at least, if there is a description added to that trigger at all.

If you don’t have a working NGLE installed on your computer any more, when you are editing with TE, then unfortunately you cannot read those few “Paolone’s triggers” descriptions any more – but you still have the possibility to read plugin trigger descriptions (moreover, you can do more now – i.e. even to identify fully the plugin triggers themselves which you cannot discover now in NGLE): In these cases all you need is the TRG file coming with the plugin. Simply open it as a TXT.

What a TRG file is

(All examples from TRG files below are coming from my Plugin_AkyvMix01 plugin.)

Each TRG files have three main sections. Plugin triggers are all casual TRNG triggers, so each section like that host one group of those triggers: one section for FLIPEFFECT plugin triggers, one section for ACTION plugin triggers, and one section for CONDITION plugin triggers.

  1. The first section is for Flipeffects. It starts naturally on the top of that TRG, where you can read this:

;------------------ Section for flipeffect trigger: description of the trigger -------------------------------

  1. The second section is for Actions. It starts where the first section ends, signaling by this line:

;------------------- Section for Action triggers: description of the trigger -------------------------------------

  1. The third and last section is for Conditions. It starts where the second section ends, signaling by this line:

;------------------- Section for Condition triggers: description of the trigger -------------------------------------

Each section has two main parts:

  1. First you can read the trigger descriptions.
  2. Then you can see the trigger parameters, which are identified from the TRG file as #, & or E parameters of the trigger name.

Flipeffect section main parts:

  • The descriptions start from the <START_TRIGGERWHAT_9_O_H> line. It lasts to the next line.
  • After that, tiny parts are coming. Each of them starts with a <START…> line and each of them ends with an line. Each of these tiny parts contain a trigger parameter (& or E).

Action section main parts:

  • The descriptions start from the <START_TRIGGERWHAT_11_T_H> line. It lasts to the next line.
  • After that, tiny parts are coming. Each of them starts with a <START…> line and each of them ends with an line. Each of these tiny parts contain a trigger parameter (# or E).

Condition section main parts:

  • The descriptions start from the <START_TRIGGERTYPE_12_T_H> line. It lasts to the next line.
  • After that, tiny parts are coming. Each of them starts with a <START…> line and each of them ends with an line. Each of these tiny parts contain a trigger parameter (# or E).

Note: Personally I found buggy if an ACTION plugin trigger contains an E (“Extra”) parameter. That is why I have never made an ACTION with that parameter, and later in this tutorial I will also skip that parameter for plugin Actions. When I needed an Action with E in my plugin to be made, then I made it in a form of a Flipeffect trigger. The price for it was that you cannot choose the item for that Action from the item list (the “#” window) of the trigger panel, but you need to define that item via script for that Flipeffect.

Trigger descriptions in TRG files

You can easily identify where the part for a new trigger starts in a TRG file description part. For example, Plugin_AkyvMix01 TRG starts with this line, in Flipeffect section:

500:Inventory-Item. Set infinite amount for <&> inventory-item #REMARK#Click on [Trigger's Help] button for more infos#START_DOC#

It means we start the descriptions with F500 trigger of the plugin, which has “Inventory-Item. Set infinite amount for <&> inventory-item“ name in the trigger panel. The description of this trigger lasts to the next trigger ID, which should be obviously F501 this time:

501:Inventory-Item. Set (E) big number of <&> inventory-item #REMARK#Click on [Trigger's Help] button for more infos#START_DOC#

If the line of the trigger name has no #REMARK# or #START_DOC# tag either, that means that plugin trigger has no either Trigger’s Remark or Trigger’s Help description – just like here:

518:Lara. (Move) <&> Enable/disable infinite dash power (for foot and nitro+motorbike)

#REMARK# tag on the trigger name means that that trigger has a Trigger’s Remark description. This description is always typed just after the #REMARK# tag:

  • If the text after the #REMARK# tag ends without the closing #START_DOC# tag, that means that trigger doesn’t have a Trigger’s Help description – just like here:

524:Weather. Sun. Move the sun in direction in <&> way #REMARK# See more in NG Center/Reference/Mnemonic Constants/PARAM_SPEED_PARAMETER.

  • But if the text after the #REMARK# tag ends with the closing #START_DOC# tag, that means that trigger also has a Trigger’s Help description – see the examples F500 or F501 just above.

Between each #START_DOC# tag and the next #END_DOC# tag you can find the Trigger’s Help description of that trigger – just like in the case of F572:

#START_DOC# "Single" grenade means this grenade is placed in the map, not shot by a weapon. If you trigger a "single" grenade with a common trigger, then the grenade will perform even a more spectacular explosion effect than a super grenade shot by Lara. F572 will customize the time for this explosion effect.

You also need to place a Mine object (with OCB=1) on the grenade! (But the mine doesn't need to be triggered.)

See more in NG Center/Reference/Mnemonic Constants/PARAM_OBJECT_ADDITIONAL.

---------- Notes: ----------

  • For technical reasons, F572 must be One Shot.
  • You can have maximum 1 grenade having an infinite time now, at the same time!
  • The trigger also activates the grenade if that is still not active. So feel free to use an F572 instead of the common grenade trigger.
  • In fact, the effect is a bit longer than the timer, because after the last explosion happens, that needs to fade away.
  • Here is a nice example for the exploding effect of single grenades:

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


#END_DOC#

Trigger parameters in TRG files

  • Parts with the name “effect” and “T” sign are “Timer” (&) parameters for the actual Flipeffect trigger. – For example, these are the & parameters for the trigger of “F500: Inventory-Item. Set infinite amount for <&> inventory-item”:

<START_EFFECT_500_T_H> 61:Pistol ammo 62:Uzi ammo 64:Shotgun normal ammo 65:Shotgun wideshot ammo 69:Crossbow normal ammo 70:Crossbow poisoned ammo 71:Crossbow explosive ammo 66:Normal grenade 67:Super grenade 68:Flash grenade 63:Revolver ammo 59:Big medipack 58:Small medipack 60:Flare

  • Parts with the name “effect” and “E” sign are “Extra” (E) parameters for the actual Flipeffect trigger. – For example, these are the E parameters for the trigger of “526: Weather. Sun. (E) Start/stop pulsing of sun in <&> way, between the original color and the required one”:

<START_EFFECT_526_E_H> 1:Start pulsing 2:Start pulsing for the required time, keeping the actual color when stopped (cannot be aborted) 3:Start pulsing for the required phases, keeping the color (original/required) which belongs to the last phase end (cannot be aborted) 4:Abort pulsing (just now, keeping the actual color) 5:Abort pulsing (just now, restoring the original color) 6:Abort pulsing (just now, setting the color you required in the script) 7:Abort pulsing (when the color cycle reaches the original color the next time) 8:Abort pulsing (when the color cycle reaches the required color the next time)

  • Parts with the name “action” and “O” sign are “Object” (#) parameters for the actual Action trigger. – For example, these are the # parameters for the trigger of “A150: Enemy. Force GUARD property on <#> enemy”:

<START_ACTION_150_O_H> #MOVEABLES#

  • As I told above, there won’t be parts with the name of “action” and “E” sign, because there are no “Extra” (E) parameters for plugin Actions (at least, in my plugins).
  • Parts with the name “condition” and “O” sign are “Object” (#) parameters for the actual Condition trigger. – For example, these are the # parameters for the trigger of “C153: Lara. (Weapons) Shotgun has <#> inventory status”:

<START_CONDITION_153_O_H> 1:The shotgun has not been picked up yet 2:The shotgun has been removed 3:The shotgun is picked up, loaded with normal ammo 4:The shotgun is picked up, loaded with wideshot ammo

  • Parts with the name “condition” and “B” sign (yes, not E!) are “Extra” (E) parameters for the actual Condition trigger. – For example, these are the E parameters for the trigger of “C216: Statics. <#> Object has a (E) wholeness status”:

<START_CONDITION_216_B_H> 0:Static (in CUST_SHATTER_RANGE) /Shatter is shattered by bullet, sword 1:Static/Shatter is visible/whole 2:Static/Shatter is invisible/shattered/exploded by a flipeffect 3:Static/Shatter is invisible/shattered/exploded by any way

As you can see, there are some special parameters, like that #MOVEABLES#. # signs always signal a series of things. Naturally “Moveables” means these parameters now are all the Moveable objects actually placed on the map. Some other examples for series of things:

  • “Same of” means now that Timer parameters of F501 are the same as Timer parameters of F500:

<START_EFFECT_501_T_H> #SAME_OF#=EFFECT_500_T

  • “Repeat” means now that rows with PARAM_BIG_NUMBERS name will be repeated in the parameter list, from PARAM_BIG_NUMBERS 0 to PARAM_BIG_NUMBERS 127.

<START_EFFECT_501_E_H> #REPEAT#Value of Parameters=PARAM_BIG_NUMBERS at index=#0#127

Trigger parameter ID values are coming from these tiny parts - for example:

  • For F500 “Timer (&)” trigger parameters, the ID value for the revolver ammo is seemingly 63, that is written there.
  • For C153 “Object (#)” trigger parameters, the ID value for “The shotgun has been removed” event is seemingly 2, that is written there.
  • In the list of Moveables, the trigger parameter IDs are the IDs of those Moveables which you can read even from the map. (Eg. CROCODILE with object ID54 chosen as the Moveable for that trigger means the ID of that parameter now is 54 for that trigger.)
  • “Repeat” list parameter values are also easy. It is the list actual ID itself. Eg. for PARAM_BIG_NUMBERS 17 the ID of the trigger parameter is 17.

Identifying plugin trigger for the script, from TRG files (i.e. if you don’t have a working NGLE installed)

In your script, in a TriggerGroup you can always find the exported triggers in a form separated into three parts, like this:

$2000, 355, $A00

The second and third part can be shorter or longer, depending on the amount of number digits. But the length of the first part is always four digits, except in the case of plugin triggers, when that is a bit longer with two digits – for example:

$015000, 3, $96

So the general formula for that should be:

$AABBBB, C, $D

AA – always two digits, only in the case of plugin triggers. BBBB – always four digits. C, D – different amount of digits.

Knowing all of the things I said above, you can easily find the trigger export value for scripting, even without NGLE:

AA: this is the plugin ID, which you can find in Options script section, as the ID of the relevant Plugin script command there. (This ID has no unnecessary digits, so eg. ID 1 is always ID 1 there. But AA says you need two digits there, so type that 1 as 01. – But that is only official. I mean I tried that AA only with one digit, like 1, and it worked seemingly nicely for me.)

BBBB: 2000 means the trigger is a FLIPEFFECT, 4000 means the trigger is an ACTION where the “Object” (#) parameter of the trigger is a list about Static objects actually placed in the map, 5000 means the trigger is every other ACTION, 8000 means the trigger is a CONDITION where the “Object” (#) parameter of the trigger is NOT a list about Moveable objects actually placed in the map, 9000 means the trigger is every other CONDITION.

C:

  • For Flipeffects: trigger ID. (Eg. if it is F60 trigger, then the value is 60 now.)
  • For Actions and Conditions: the “Object” (#) parameter ID value of that trigger.

D – never forget to turn this decimal value first into hexadecimal, before typing it into the script: There are two versions:

  1. If there is no “Extra” (E) parameter for the trigger:
  • For Flipeffects: the “Timer” (&) parameter ID value of that trigger.
  • For Actions and Conditions: trigger ID. (Eg. if it is A100 trigger, then the value is 100 now, or if it is C15 trigger, then the value is 15 now.)
  1. If there is an “Extra” (E) parameter for the trigger: First do exactly like at #1 case just above, then: Add that value to „E parameter value multiplied by 256”.

Notes:

  • For any reason, if “Timer” (&) parameter of Flipeffect, or “Object” (#) parameter of Action or Condition is missing, then type 0 for that field. (See something similar than eg. “F368: Camera. Fade. Stop black screen and open curtain” original TRNG trigger.)
  • You may think that flags like TGROUP_ELSE can make this formula more complicated, eg.:

$2000+ TGROUP_ELSE, 355, $A00

But that is only a flag added in the script, it doesn’t change the export value at all, which is still the same:

$2000, 355, $A00

  • Older TEs may not make a Plugin script command in Options section when you install that plugin, so you need to type that command manually there.
  • I am not sure what if the “Object” (#) parameter of the CONDITION is any camera or a sink. There have not been created triggers like that yet actually. Perhaps in their case BBBB would be 9000, not 8000.

Identifying plugin trigger as an animcommand, from TRG files (i.e. if you don’t have a working NGLE installed)

As you can see above, you don’t need a procedure like that. (Though, technically it would be available.) I.e. it is always solved by exporting an original TRNG trigger for a TriggerGroup as an animcommand, and by exporting the “real trigger” you want, for the script, executed by that TriggerGroup.

Only for plugin makers - identifying plugin trigger as a function to be embedded in the plugin code, from TRG files (i.e. if you don’t have a working NGLE installed)

The formula is not $AABBBB, C, $D as above, but a bit different – here are two examples, why:

PerformFlipeffect(NULL, 355, 0, 10); PerformConditionTrigger("Plugin_AkyVMix01", 132, 501 | NGLE_INDEX, 0);

So this time the formula should be:

Text1(Text2, A, B, C);

Text1: It refers to the trigger type which will be exported:

PerformFlipeffect PerformActionTrigger PerformConditionTrigger

Text2: It refers to the source:

NULL – it is an original TRNG trigger “plugin name” – it is a plugin trigger of this plugin (eg. "Plugin_AkyVMix01")

A – any digits: Trigger ID. (Eg. if it is F60 trigger, then the value is 60 now.)

B – any digits:

  • For Flipeffects: “Timer” (&) parameter value.
  • For Actions and Conditions, where the “Object” (#) parameter of the trigger is a list about the Moveable objects/any cameras/sinks actually placed in the map: the # value, with a “| NGLE_INDEX” tag. (See the example just above: “501 | NGLE_INDEX”, when the object index in the map is 501.)
  • For other Actions and Conditions: “Object” (#) parameter value.

C – any digits:

  • 0, if there is no E value for the trigger.
  • If there is E value for the trigger: “Export” (E) parameter value.

Note:

  • For missing & or # parameters, see what I said just above for exporting to script.
  • If it is not a plugin trigger, but an original one, then you can’t find them in TRG, but you can identify the parameter values in TE trigger panel: just adjust the trigger there and tick there the “Raw mode (show numeric values)” option.
⚠️ **GitHub.com Fallback** ⚠️