Tomb Raider Forums  

Go Back   Tomb Raider Forums > Tomb Raider Level Editor and Modding > Tomb Raider Level Editor > Tutorials and Resources

Closed Thread
 
Thread Tools
Old 09-06-24, 10:24   #1
AkyV
Moderator
 
Joined: Dec 2011
Posts: 5,074
Default TEN - Game command types

Made using Tomb Editor 1.7.1. pack (including Tomb Engine 1.4.)
Last update to TE/TEN: 1.7.2./1.5.


When you start a level, then you are able to move with Lara in many well-known ways to reach the different parts of the level. Plus, you can see the texture tiles like the water surface to animate, and some effects like shining in the water. And, of course you can hear the initial background noise of the level, and the sounds caused by Lara's movements. Etc.
But that's all. Nothing else happens, only those "default happenings".
You need to set custom happenings, if you want other things to happen: to spawn a baddy, to fill an empty pool with water, to play some audio etc.

The custom happenings will be played when you activate them.
A custom happening can be activated in the game by different command types.

In this tutorial I will introduce the game command types to you - but this time only in a nutshell. (The legacy commands in a really tiny nutshell.)

CONTENTS:

1. Legacy triggers
2. Animation commands
3. Events and event sets
4. Global event sets
5. Local event sets and volume triggers
6. Node editor
7. Scripted events

----------

Notes:
  • As the title says, it is “only” a Tomb Engine (TEN) tutorial. Many aspects you need to know for this tutorial are specific Tomb Editor (TE), TombIDE (TIDE), WadTool (WT) etc. features.
    So non-TEN features are only referred now, if it is necessary. And as much as I found it necessary. You need to also meet these features in other tutorials, for further details about them.
  • Some related TEN features are only mentioned, but not discussed in this tutorial, because they belong better to (an)other tutorial(s).
    Find another info source or be patient till those other tutorials are made.
  • The default happenings are partially also controlled by game commands. Eg. a key command which makes Lara shoot, or the menu command which gives Lara some health if you select a medipack in the inventory etc. (But partially they are controlled by automatic game procedures - like the waving water surface etc.)
    However, this tutorial won't discuss the game commands of the default happenings. (But the default happenings can be changed by some custom happenings. Eg. key commands can be disabled temporarily.)
  • Some options or commands can be executed in several ways. I may not introduce all of the ways in the tutorial. (Using default keys are presumed.)

Last edited by AkyV; 04-11-24 at 19:18.
AkyV is online now  
Old 09-06-24, 10:43   #2
AkyV
Moderator
 
Joined: Dec 2011
Posts: 5,074
Default

1. Legacy triggers

The legacy (i.e. classic) trigger system nicely works even in TEN:
  1. Select (highlight) one or more sectors in a room, on the grid of the solid floor, in TE.
  2. Open the so-called "classic" trigger editor panel - the easiest way if you hit T shortcut key.
  3. Select the trigger parameters on the panel, and then close the panel.
  4. The selected area has been colored magenta, indicating a trigger with the selected contents has just been placed there.
Click image for larger version

Name:	35.jpg
Views:	62
Size:	65.6 KB
ID:	6408

The trigger zone is more than some flat floor part, it is an imaginary 3D shape, between this floor part and the solid ceiling above it (which will also be magenta). (So if there is a traversable portal above the floor of the trigger, then the 3D zone goes through it, looking for the solid ceiling above the portal.)
The activator of the trigger (Lara or else) depends on the selected trigger parameters.
If the activator enters the trigger zone (or is spending some time inside there), and the trigger conditions (set mostly by the the trigger types - see below) are also true, then the trigger will be activated, the happening selected in the trigger will happen.

Click image for larger version

Name:	36.jpg
Views:	55
Size:	76.9 KB
ID:	6421

TEN has a fancy new trigger system (see below). But, if that is so cool, then why is this "obsolete old legacy trigger system" implemented into TEN?
Because it is not obsolete, there are good reasons to keep it here:
  • When someone convert their TRLE/NGLE level into a TEN level, then the original level naturally only has these legacy triggers. These legacy triggers won't be converted into fancy new TEN triggers, so the freshly converted level will have exactly these legacy triggers.
    So you need the legacy trigger system in TEN, to have a backward compatibility to the legacy levels. At most later you will change some of them manually into fancy new triggers. (Which means you delete the legacy trigger, and then set a new TEN trigger, with the same parameters, where the legacy trigger was placed originally.)
  • You don't need a fancy new TEN trigger everyway, even if you are already building in TEN. Perhaps in a simple situation it is enough if you use a simple legacy trigger.
  • In some setups, things work in TEN in the same way as before. See eg. the classic way to use legacy triggers for switches. (However, later in TEN you can try some workarounds to solve these situations with fancy new TEN triggers.)
However, don't forget that TEN is based on TR5 engine (i.e. the best, the most modern legacy engine), so the legacy trigger structure in TEN is based on TR5 trigger structure basically - which means:
  • Familiar things:

    • These well-known trigger types are available: Antipad, Antitrigger, Combat, Dummy, Heavy, HeavyAntitrigger, HeavySwitch, Key, Pad, Pickup, Switch, Trigger.
    • These well-known trigger actions are available: Camera, FinishLevel, FlipEffect, FlipMap, FlipOff, FlipOn, FlyByCamera, Object, PlayAudio (aka CD), Secret, Sink, Target.
    • Monkey trigger type was removed from TRNG, because a Condition trigger was used instead. But Monkey is restored for TEN.

  • New things:

    • Climb, Crawl and TightRope are trigger types made for TR5, so they can't be familiar either from the vanilla TR4 or from TRNG. But TEN already has them. (Naturally they could work only when Lara does these movements. Or at least, when she is ready for that. Eg. for a Climb trigger it is enough if she grabs the edge, she doesn't need to stand on a ladder.)
    • GlobalEvent and VolumeEvent are trigger actions made directly for TEN. Later we'll discuss them in this tutorial.

  • Missing things:

    • Triggers made for TRNG are completely missing from TEN. Not only Timerfield or FMV, but even the more important ones, like Action or Condition. Moreover, only the classic FlipEffects work for TEN. (See the FlipEffects available for TEN here, probably the ones in the TR4 column.)
      So after converting a TRNG level into TEN, these triggers should be manually removed from the map, as useless ones.
    • Skeleton is a very specific TR5 trigger (see the X-ray situtation at VCI, with her body). It isn't implemented into TEN.
    • The ancient BodyBag and CutScene triggers haven't been restored for any engine in TE (including TEN).
--------

Note:
If you want to edit an existing legacy trigger in TE, then:
  1. First select (highlight) any sector of the magenta floor area of the trigger.
  2. See Classic Triggers window in the bottom left corner. All the legacy triggers of that floor sector are named there. Click on the trigger there you want to edit, to select it (i.e. to have a white rectangle around it, in the plan view grid of the top left corner).

    Click image for larger version

Name:	37.jpg
Views:	62
Size:	83.2 KB
ID:	6428
  3. And then:
  • If you want to delete that trigger, hit DELETE shortcut key.
  • If you want to modify the contents of that trigger, hit O shortcut key.
  • If you want to copy that trigger:

    1. Hit CTRL+C shortcut key, to copy the trigger contents.
    2. Select (highlight) one or more sectors on the grid of the solid floor, where you want to paste the copy. (If you want, first select another room.)
    3. Hit CTRL+V shortcut key, to paste the trigger contents on the selected area.
    4. Repeat Item 2 and 3 to paste further copies.

  • If you want to relocate that trigger:

    1. Hit CTRL+X shortcut key, to remove the trigger.
    2. Select (highlight) one or more sectors on the grid of the solid floor, where you want to paste the removed trigger. (If you want, first select another room.)
    3. Hit CTRL+V shortcut key, to paste the removed trigger on the selected area.
You can also split an existing legacy trigger area in TE into two or more new triggers (with the same contents for each new trigger), if you select an area in the selected trigger, and then hit ALT+O shortcut key.

Last edited by AkyV; 29-06-24 at 11:20.
AkyV is online now  
Old 09-06-24, 10:49   #3
AkyV
Moderator
 
Joined: Dec 2011
Posts: 5,074
Default

2. Animation commands

Nomen est omen. Animation commands naturally belong to animations.
Each animation command is attached to a specific frame of a specific animation of a specific Moveable object slot. If any object of that slot is just executing that animation, then the animation command will be executed in the moment when the animation just reaches that frame.

Animation commands are also legacy features, not new in TEN.
As I said above, TEN cannot handle TRNG triggers, so TEN cannot handle exported animation commands either. (Because exported animation commands are created by exporting a TRNG trigger.)
So only the classic animation commands exist in TEN (some of them with some new name): Set position, Set jump velocity, Empty hands, Kill entity, Play sound, Flipeffect. (Yes, these are the same Flipeffects like the legacy triggers.)

This is the way to add an animation command to an animation frame:
  1. In WT, double-click on the Moveable object (in Destination window) which you want to add the animation command to. Animation editor (AE) opens.
  2. In AE, click on the animation (in Animation List window) which you want to add the animation command to. The animation will be selected.
  3. Click on Anim commands button on the bottom left side. The Anim commands editor (ACE) opens.
  4. Click on + sign in the top right corner of ACE, to add a brand new command to the lists of commands in ACE window.
  5. Edit command parameters in the lower part of the ACE window, and then close the window, by clicking on OK.
See the animation strip, at the bottom of AE: where you can see a blue dot, that means an animation command belongs to that frame. Click on that dot, so the big window will show the object frozen at that animation frame, so you can examine it.

Click image for larger version

Name:	38.jpg
Views:	53
Size:	91.1 KB
ID:	6429

To edit the parameters of an existing animation command, just simply select (highlight) its row in the upper part of ACE window.

--------

Note:
See the icons at the right edge of ACE window, to copy or delete an existing (selected) animation command.

Last edited by AkyV; 29-06-24 at 11:30.
AkyV is online now  
Old 09-06-24, 11:11   #4
AkyV
Moderator
 
Joined: Dec 2011
Posts: 5,074
Default

3. Events and event sets

What we call events in TEN are custom happenings which are made directly for TEN. (Unlike custom happenings in legacy triggers and animation commands, which are heritage from the classic games.)
If you are sad, due to the many TRNG triggers which are missing from TEN, then be happy, because with TEN events you will be able to reach the same result, if necessary: many little or complex, but perhaps really peculiar happenings.

Events can be executed in two different ways:
  • Local events: just like legacy triggers in any level editor program, each local event can be activated only at a specific location of the level.
  • Global events: they work like TRNG GlobalTriggers. Which means when its condition becomes true, whatever Lara is just doing at any location of the level, then the event will be activated.
Events are organized in the form of the so-called "event sets".
"Set" means an event set can contain even more than one events. I.e. if you want, you can control not only one single event, but even more than one, when you execute an event set with one command.
So, as you can see, the connection between events and their event set is something similar than between TRNG legacy triggers (exported into the scrtipt) and their TriggerGroup.

When you start building a level, then the level has no event sets at all.
So you are the one who needs to add event sets to a level. You can add even tons of event sets. Luckily you don't need to memorize IDs, like in the case of eg. TriggerGroup 1. I.e. New event set 1 at most is a temporary name when you create the first new event set, you can rename it, so it will be fully clear that what the event set is for. (Eg. "Spawn baddy in big room".)
Each event set is naturally useless, without events added, when they are created. You need to add one or more events to each event set.
Events in each event set can be defined with two different methods (you can choose which one you want for a specific event set), both for local and global event sets:
  • with the so-called "nodes", or
  • with the good old scripted way. (Don't be so relieved that "it must be familiar": scripting in TEN is very different, compared to how you did that in TRNG.)
Keep in mind that local and global events have two different event set list. I.e. your first event set for local and global sets both get New event set 1 name, but the local New event set 1 is not the same as the global New event set 1. (Luckily their exact name is a bit different: New volume event set 1 and New global event set 1. Why is local called volume? You will understand later in the tutorial.)
It is more important than you could think at first, because they happen (almost) exactly the same way: both local and global event sets will be controlled in TE, and you can control them there (mostly) in the same way.
Because of this, the TE editors for local and global events look (mostly) the same way, so you need to be careful not to confuse the two event editors with each other in TE.

There are some different command types to activate the events of the event sets.

For more details about events and event sets, keep reading.

--------

Notes:
  • Each level has its own local and global event set lists.
    So when we say "global" that doesn't mean "anywhere in the game", that "only" means "anywhere in the level".
  • Local and global event sets are controlled via TE, but their contents are not always defined in TE. - I mean, that is why I said scripted events. In their case the event set contents are defined naturally in the script. (On the other hand, node type event sets are always defined in TE.)
    Moreover, if it is a global event set, then you have the possibility to both control and define it via scripting, i.e. skipping TE - as you will see later in the tutorial.
  • I suppose you are definitely happy that TEN gives you new peculiar happenings instead of TRNG triggers. But what if in a specific situation you don't want to use that new (TEN) command type (see "volume triggers" below) to control new (TEN) happenings?
    Luckily you are able to execute global or local event sets even with the good old legacy triggers as well: I mean, I have just mentioned above GlobalEvent/VolumeEvent legacy triggers. Their purpose is to execute global/local event sets, as if they were (local) legacy triggers.
    (Interesting, but GlobalEvent legacy triggers mean that you can execute global event sets even in a local way - which a TEN trigger cannot do, because volumes are only for local event sets.)

Last edited by AkyV; 31-07-24 at 11:35.
AkyV is online now  
Old 09-06-24, 11:12   #5
AkyV
Moderator
 
Joined: Dec 2011
Posts: 5,074
Default

4. Global event sets

Global event set editor

Global event sets can be handled with the global event set editor, in TE:
  • The event set is fully handled in the event set editor, if it is a node type event set.
  • The event set is only controlled in the event set editor, if it is a scripted event set. The contents (events) themselves are naturally defined in the script now.
    Moreover, in some cases the global event sets are both controlled and defined via scripting, ignoring TE and the global event set editor in TE. (Later, when you'll know more about scripted events, you will be able to decide that which one to choose. Technically you can choose any of them.)
The easiest way to open the panel of this editor is if you make a custom shortcut key for "Edit global event sets" option, and you use that.

Naturally the editor panel is totally empty now, when you have just started building a level:
  • The left big window lists all the global event sets of the level.
  • The right big window is about the contents (i.e. the events) of the actually selected (highlighted) event set.
A global event set

The entries of the left big (i.e. "Event sets") window can be identified even when that entry is empty. So the topmost entry is for ID 1, the entry just below it is for ID2, the entry just below it is for ID3 etc.
Click on + button in the top left corner of the panel, to add a new (i.e. empty) event set to the event set list. The new event set will be created always at the entry which is the uppermost empty entry, getting "New global event set" name, plus the ID that belongs to that entry.

Let's say, you create now nine brand new (empty) event sets now, from New global event set 1 to New global event set 9, one after the other, just to exercise a bit.
After that, also try these with those new event sets:
  • Click on an event set name in the left big window, to select (highlight) that event set.
    See the little "Event set name" window at the top of the panel. The name of the selected event set is repeated here. Modify the name in this window, and then click on some parts of the panel (probably the best is if you click on somewhere on the right big window): now the new name will be accepted. (Which means it will be modified even in the left big window.)
    Let's exercise a bit: rename "New global event set 2" to "Spawn baddy in big room", and "New global event set 4" to "Play creaking sound".
  • Select an entry, then click on the "recycling bin" button (in the top left corner of the panel) to delete that event set (with its full contents) from the list.
    Note that event sets below the deleted entry will jump into the empty position now. Let's see those nine entries now. Delete eg. event set 7 from the seventh row. Now event set 8 of the eighth row jumps into the empty seventh row (keeping ID8) and event set 9 of the ninth row jumps into the empty eighth row (keeping ID9).
    If you add a new event set now, that will be naturally created in the empty ninth row, with the usual ID9 - so now you'll have two event sets with the same ID9. (Which doesn't matter. I mean, as I said, these are just event set names which you can rename when you want. Though, the same name for different event sets is obviously disturbing, so I suggest to rename them, as soon as possible - but now we skip it.)
  • The third button in the top left corner of the panel is about copying an existing event set (with its full contents).
    Select eg. New global event set 5 now. Click on that button to copy this event set. The copied event set will be pasted right away, naturally in the uppermost empty entry, which is the tenth one now. The initial name of the pasted event set is the name of the copied event set, plus the "(copy)" tag, i.e "New global event set 5 (copy)" now - naturally this also could be renamed.
Click image for larger version

Name:	39.jpg
Views:	115
Size:	64.2 KB
ID:	6453

Game commands to control a global event set

Each global event set can be executed at six different game phases (named in the little window at the top right corner of the panel) - choosing the proper value, you selected the command that controls that global event set:
  • On Loop: executing the events of the event set will be started again and again at each game frame. (Except when a menu is open.)
  • On Load Game: executing the events of the event set will be started each time (but only once at that moment) when a savegame has just been loaded.
  • On Save Game: executing the events of the event set will be started each time (but only once at that moment) when the menus has just been closed after saving the game, so when the game starts continuing.
  • On Level Start: executing the events of the event set will be started each time (but only once at that moment) when the level starts. (Even when it restarts from LARA object or a LARA_START_POS object.)
  • On Level End: when you activate a Finish trigger or when Lara dies, then the level ends at once, there is no time to activate anything then. (And you won't see that thing activated even later, when Lara comes back to the level.) So using this phase is a bit more complicated which we will not discuss in this tutorial. (However, this event set should be also executed only once at that moment.)
  • On Use Item: executing the events of the event set will be started each time (but only once at that moment) when any item is selected in the inventory. (First naturally the inventory needs to be closed.)
    Please remember that it happens even if you selected the item unnecessarily. (Eg. you can't use the selected medipack, because Lara is fully healthy.)
Please note that there is a very important difference between Loop phase and the other four phases: Loop phase could be very long, but Load Game, Save Game, Level Start, Use Item and Level End phases last only for one moment.
This explains why Loop phase executes the event set infinite times in a row, and why the other phases execute the event set only once.
I mean, as I said above, a global event set will be executed when its condition becomes true. So eg. for "On Load Game" the condition is true only for a moment: when the savegame has just been loaded. And that is naturally also true for Save Game, Level Start, Level End, Use Item phases. But for "On Loop", the condition is continuously true, while the game is running on that level: at the first moment of the game, then again at the second moment of the game, then again at the third moment. Then again at the fourth, fifth, sixth, seventh etc. moment...
That is why the event set restarts at each moment (i.e. each frame) during the game, when it was activated in Loop phase.

However, simple executions at short phases and repeated executions at long phases sometimes are not so different than you could think at first:
  • Multipliable events will be executed only once at short phases, and will be executed infinite times at long phases.
    Eg. the event is: flashing blue light on the screen, for one moment. Load Game, Save Game, Level Start, Use Item and Level End will be flashing it once. But Loop will be flashing it infinite times. Why? Because the game restarts the effect in the next moment, i.e. in the moment when the light of the previous moment is just about to turn off. And naturally short light effects in a chain will look a long, continuous light effect.
  • Non-multipliable events will be executed always only once at any phases.
    Eg. the event is to activate a flame of a nullmesh. Naturally it simply happens once at Load Game, Save Game, Level Start, Use Item and Level End. But it also simply happens at Loop. Why? Because if the fire is burning then naturally you cannot ignite it again, that is why Loop ignites the fire at the first moment - then nothing happens, even if Loop naturally tries to ignite it even at the second, third, fourth etc. moments too.
Naturally non-multipliable events can also be multipliable, if you remove them in the meantime.
I mean, eg. if you want to antitrigger that fire of Loop phase, then you can do it, but only technically, because Loop re-ignites it immediately. So seemingly nothing happens, the fire keeps burning.
Simple events of Load Game, Save Game, Level Start, Use Item and Level End can also be multiplied, if you also multiply the phases themselves - with the flash/fire examples again:
  • Load Game: the blue light flashes only once, only for a moment, when you load the game. But when you load it the next time, then it flashes once again (for a moment). And the next time again...
  • Save Game: the nullmesh fire starts burning when you save the game. But if you antritrigger it later, then it will start burning again, at the next save after that. And the same could happen after another antitriggering...
  • Level Start: the blue light flashes only once, only for a moment, when the level starts. But Lara later will naturally leave the level. If she comes back after that to LARA object (or a LARA_START_POS), then it flashes once again (for a moment). And it could happen later, if Lara leaves again, and then comes back again...
  • Level End: as I said above, we will ignore this phase now.
  • Use Item: the blue light flashes only once, only for a moment, when you selected an item in the inventory. But when you select one (even another one) the next time, then it flashes once again (for a moment). And the next time again..
But "multiplied" doesn't always mean infinite occasions. I mean, see the little Call count window, at the bottom right corner of the event set editor panel. If the value is 0 here, then the event set can be activated infinite times. If it is 1, or 2, or 3,... or 100, then the event can be activated 1, or 2, or 3... or 100 times.
Till this moment, we have 0 in that little window, for infinite occasions. But now eg. type 2 there for two shots, and let's see those flash/fire examples again, to make it clear (except with Level End this time):
  • Load Game: the blue light flashes only once, only for a moment, when you load the game. But when you load it the next time, then it flashes once again (for a moment). But at the third, fourth etc. loading it won't be repeated ever again.
  • Save Game: the nullmesh fire starts burning when you save the game. But if you antritrigger it later, then it will start burning again, at the next save after that. But at the third, fourth etc. saving it won't be repeated ever again, even if you antitrigger it again before that.
  • Level Start: the blue light flashes only once, only for a moment, when the level starts. But Lara later will naturally leave the level. If she comes back after that to LARA object (or a LARA_START_POS), then it flashes once again (for a moment). But at the third, fourth etc. comeback it won't be repeated ever again.
  • Loop: 2 means the light will be flashes at the first and the second moments, united into a two moments' long light. Then it will be never flashing again in the game.
    Or the other example: the first moments ignites the flame. At the second moment Loop wants to ignite it again, but naturally nothing happens, the flame is still burning. Then it will never want to ignite the flame again in the game, so after these two moments you will be able to antritrigger it successfully.
  • Use Item: the blue light flashes only once, only for a moment, when you select an item. But when you select one the next time, then it flashes once again (for a moment). But at the third, fourth etc. selection it won't be repeated ever again.
As you can see, these possibilities are not the best under every circumstance.
I mean, what if eg. I want Save Game to start executing the events only at the sixth save of the level, and not at the first save?
But the biggest problem is the only long phase, the Loop. It usually wants to execute the events during the whole level. And if you narrow its possibilities by 1-100 shots, then the thing that only happens is it will want to execute the events in the first 1-100 moments of the level.
The solutions are (technical details are ignored in this tutorial):
  • Disable the global event set. You will enable it later, when you want to activate it. Naturally only enabled global events can be activated - when their condition is true.
    Not disabling the event set it is naturally enabled initially, when the level starts.
  • Add one or more additional conditions to the events in the event set, so the enabled global event set will be activated only if those additional conditions are also true. For example, "if jump key is hit" condition is also added to Loop event set. Which means the event set will be activated only each time when the player hits the jump key, during playing that level, to make Lara jump. (Unfortunately, if Call count is not infinite, but eg. 2, then it doesn't mean that it should be activated only at the first two jumps. I mean, it is still about the moments of Loop phase. I mean, counted from the moment when the event set is enabled, you have two moments now to jump, to execute the event set. Otherwise the global event set will be unavailable forever.)
In fact, you can use even all the six (!) phases at the same time to control that event set in the game. Which means that one event set could be actually even two, three, four, five, six "event subsets".
Why? Because if you add events in the right big window of the editor panel to the event set selected in the left big window, those events are only for the game phase which is just chosen. So if you choose another game phase now, then the right big window will be without added events again, which means you can add even totally different events to this new phase at that event set. (Which won't remove the events from the previous phase.) - So, for example, if events are added to Save Game and Load Game phases at an event set, but the right big window is without added events when you choose Loop, Level Start, Level End, Use Item phases at that event set, then this event set will execute events when you save the game, and also execute different events, when you load the game, not doing anything in the other four phases. (However, naturally you can add even the same events to two or more different phases, at the same global event set, or at different global event sets, if you want.)

Adding events

As I said above, events could be defined by the-so called nodes, or with a scripted way.
Above the right big window, there are two options, to choose nodes or scripting for that event set:
  • Choosing an option is only for a specific phase at that event set.
    So, for example you can choose node for Save Game, but script for Level Start, at the same event set. - Or even the opposite: you can choose scipt for Save Game, but node for Level Start, at another event set.
    However, don't forget: the option will be used in the game (when you play later), for all the six phases of that event set, which option is chosen when you close the editor window, by clicking on OK button. The other option will be ignored in the game.
  • When you choose an option, to use it in the game, then the events typed previously at the other option will be kept. So, if you change your mind, and change back to the other option at that event set phase, then the events you previously added there, are still there, ready to be used in the game.
If you temporarily don't want to activate one of the phases while you are playing, even if events are already added to that phase, then untick Enable option (next to Call count window), at that phase. Later you can enable this phase, if you want. (You cannot see this option in the screenshots of this tutorial, because they are made with a previous version of TE.)

More details about adding nodes/script to a global event are below, in this tutorial.

--------

Notes:
  • The order of the event sets usually doesn't matter in the left big window: when the game reaches start/end/load/save/loop/item phase, then it simply searches global event sets in the list, if that phase is used at that event set. If that is, then the events at that phase will be executed. (And naturally if the event set is not disabled and if its additional conditions are also just true). Then it searches the next event set like that. Etc.
    However, if more than one event sets have the same phase in the global event set editor, then they may disturb each other. (Eg. one event set with a blue flash at the level start, and another one with a red flash at the level start.) In these cases the event set in the lowest position (i.e. with the highest entry ID) will be chosen to be executed.
  • Be careful: an event set could show a different phase, when you select that event set in the left big window, compared to what the previously selected event set showed. Always the phase will be shown at an event set which was edited there the latest.
  • Loop phase naturally starts from the level start, and ends at the level end (ignored when menus are open), so Level Start phase always happens a moment before starting the Loop, and Level End phase always happens a moment after ending the Loop.
    It could be really important sometimes. Eg. when you want to disable a global event of Loop phase, then that disabling command should be placed before Loop starts to execute that global event. I.e. this command should be typed at Level Start phase. (And they could be even in any event set, after all, not only in the same. I mean, I never said that the events in the phases of an event set should be connected to each other.)
  • Please keep in mind that when you count the short game phases, then they should follow each other in the same playthrough.
    So eg. you set Call count 2 at a Load Game phase (never disabled or narrowed by additional conditions). You save SaveGame1, then later you load it. The event set happens. You keep playing, then later you save SaveGame2, then later you load it. The event set happens again. You keep playing, then later you save SaveGame3, then later you load it. The event set won't happen again. - Naturally this is how this should work.
    But what if SaveGame1 is saved at a hard trap, so you need to load it again and again, to get over that trap? In this case the event set will happen each time when you load the game, not only twice.
    Why? Because Lara will be loaded to the same saved moment and place, again and again. I.e. the calls are not following each other, these are not the first, second, third etc. call, only repeating the first call, again and again.
  • Naturally the Call count won't count when the global event is just disabled, even if that phase is just happening. (So eg. if Save Game is for 5 shots, but you already used 3 shots when you disable the event set, then the saves won't be counted after that. However, if you enable later the event set again, then the further 2 shots will be counted again.)
  • As you can see, "one shot GlobalTriggers" don't work if the global event set has additional conditions (eg. jumping), because Call count=1 is not a proper value for this. (I.e. it is not for the first jump.)
    And there are other problems, too: eg. how can you restart Call count counter? (I.e. how can you make a SINGLE_SHOT_RESUMED feature for TEN?)
    These questions are not parts of this tutorial, I cannot answer them now. I mean, you need higher "node-ing"/scripting skills to solve that - and later you will surely have them.
  • Don't be sad about missing exported animation commands. Loop phase is a nice workaround to simulate this situation. I mean, use a combined additional condition for a global event set, like "if the Moveable object is performing X frame of Y animation" - and the events in the set (so not a classic animation command) will be activated only if these conditions are also true.
    (A similar situation is also useable, if you want to activate something just when the level ends, instead of trying to make it work with Level End phase - at least if this level end is about Lara's death: if she is performing a frame of her death animation, then the event set will be activated.)
  • If you execute a global event set with a GlobalEvent legacy trigger, as I said above, then the six phases are mentioned amongst the trigger parameters.
    However, choosing a phase there means only the trigger will execute the events which are defined at that phase, not controlling how the trigger will work.
  • Triggering anything at Level Start phase is also possible with some well-known legacy methods, even in TEN, instead of using global events:

    • Placing Lara in the trigger zone. (In TEN it is true not only for legacy trigger zones, but even for the volume ones - see below.)
    • If it is a Moveable object to be activated, then tick all the codebit options at its settings panel.

Last edited by AkyV; 04-11-24 at 19:50.
AkyV is online now  
Old 09-06-24, 11:13   #6
AkyV
Moderator
 
Joined: Dec 2011
Posts: 5,074
Default

5. Local event sets and volume triggers

The similarity between legacy triggers and TEN triggers

As I said above, legacy trigger zones are imaginary 3D shapes, between the floor and the ceiling above it. And if the activator enters the trigger zone (or is spending some time there), and the trigger conditions are also true, then the trigger will be activated.
And, as I also said above, just like legacy triggers, each local event can be activated only at a specific location of the level.

That is why:
  • Commands to control TEN local events are also some kind of triggers.
  • TEN local event triggers also have a 3D shape.
  • Triggering something in a TEN trigger shape also depends on the position of the trigger activator.
Volume triggers: boxes and spheres

The zone of TEN triggers are not imaginary. Which means the 3D shape of TEN triggers are real, i.e. you can place and position a TEN trigger like a Moveable or a Static object.
The imaginary shape of a legacy trigger is always a box. But the real shape of a TEN trigger is not always a box, i.e. you can also choose a different (sphere) shape for a TEN trigger. - Choose the shape which is better for your purpose at that trigger.
If you want to place a new TEN trigger, then:
  • click on ALT+V shortcut key for a box shape, or
  • click on SHIFT+V shortcut key, for a sphere shape.
Now your arrow cursor transforms into a + shape.
Click on a floor sector to place that box or sphere shape on it (and to get back the arrow cursor shape):
  • Both the box and the sphere is called a "volume" in TEN.
  • The box is 1x1x1 sector (=4x4x4 clicks) sized. The diameter of the sphere is 1 sector (=4 clicks).
  • Both the box and the sphere is sunk halfly into the floor.
  • The center of both the box and the sphere is marked by a little icon. Click on it, if you want to select this volume:

    • You need to select a volume, if you want to edit it. (Or if you simply want to see which trigger parameters this volume has.)
    • The volume you have just created is automatically selected.
    • A volume is selected if a green, a blue and a red axis protrude from the center icon. (In the case of a box volume, there are also a green, a blue and a red circle around it.)
      And you can also see a black little message panel at the center icon, about the main parameters of this volume: the volume type (Box Volume or Sphere Volume), an auto-generated name ("volume_" tag and an auto-generated ID), the room name where this volume is placed, and some data about the trigger parameters of this volume. (Freshly placed brand new volumes naturally have no trigger data yet. So see more about it later in the tutorial.)

    Click image for larger version

Name:	40.jpg
Views:	43
Size:	86.4 KB
ID:	6575
Custom position and size for the selected volume

As the sphere shape already indicates, volume trigger zones are not stuck any more to the floor grid system. (And naturally you could already also see that even box volumes don't need to go from floor to ceiling.)
But you can do even more than that to be free from the grid for that (selected) volume:
  • Move the volume linearly, in X, Y or Z direction, horizontally or vertically:

    • This way you can easily relocate the volume horizontally, if that is not on the proper sector.
      Moreover, a volume shouldn't be exactly above one floor sector, it can be partially above one, and partially above another one. Or it can be above even more than that. (Partial triggers could be achieved even in TRNG, but with a really complicated way.)

      Click image for larger version

Name:	41.jpg
Views:	50
Size:	58.7 KB
ID:	6576
    • Vertical triggers are trigger zones not from floor to ceiling, but with a smaller size: not from the floor (but from somewhere above it) and/or not to the ceiling (but to somewhere below it).
      You only dreamt in TRLE to have a zone like that, and even TRNG can achieve it only by some user-unfriendly tricks. On the other hand, when you move a TEN trigger zone (i.e. a volume) vertically, then you can easily define the vertical position where that trigger can be activated.

      Click image for larger version

Name:	42.jpg
Views:	42
Size:	81.5 KB
ID:	6577

    The methods (based on the position of the volume center, after the moves):

    • Grab the top (the arrow) of the required axis, by the mouse, and push/pull it in the direction, which the arrow indicates to (or in the opposite direction):

      • Without hitting a key:

        • Horizontally: center moves to the middle axis of the sector or the sector edge.
        • Vertically: center moves to full click or half click coordinate of the coordinate system.

          Click image for larger version

Name:	43.jpg
Views:	43
Size:	41.0 KB
ID:	6578

      • With hitting SHIFT key:

        • Horizontally: imagine a 16x16 sized grid on the sector, so each little square in the grid is 64x64 units sized. (Because 1 sector is 1024x1024 units sized.) The center now jumps to the next grid line in the chosen direction.

          Click image for larger version

Name:	44.jpg
Views:	59
Size:	46.6 KB
ID:	6579
        • Vertically: center moves to full click or half click or quarter click coordinate of the coordinate system.

      • With hitting CTRL key: the movement will be continuous, either horizontally or vertically.
        So if you are really smart, then you will be able to move even only 1 unit.

    • Using only keys:

      • Horizontally:

        • CTRL+arrow keys move exactly 1 sector distance in the given direction. (Look at north, so each arrow key will move the volume in the proper direction. I.e. eg. surely to the right when you hit the right arrow.)

          Click image for larger version

Name:	45.jpg
Views:	34
Size:	33.5 KB
ID:	6580
        • Add a key to "Move object left/right/forward/back (8 units)" key command to move 8 units' distance in the given direction.

      • Vertically - see the "step height" value actually selected in TE:

        • Key Q moves exactly "step height" distance upwards, and Key A moves exactly "step height" distance downwards.
        • SHIFT+Q moves quadruple "step height" distance upwards, and SHIFT+A moves quadruple "step height" distance downwards.
        • CTRL+PAGE UP moves exactly 1 sector (4 clicks) distance upwards, and CTRL+PAGE DOWN moves exactly 1 sector (4 clicks) distance downwards.
        • Add a key to "Move object up/down (8 units)" key command to move 8 units' distance in the given direction.

  • Rotate the volume, horizontally or vertically (around red, green or blue axis):
    Sphere volumes are always sphere shaped, cannot be distorted, so it would be meaningless to rotate them.
    On the other hand, box volumes can be rotated (because they could be distorted). That is why their edges won't be everyway perpendicular/parallel to/with the lines of the floor sector grid in the room - so their activators can activate them even in really peculiar positions:

    • Grab any part of a colored circle, by the mouse, and move the cursor around that circle, in the required direction. Which makes the box rotating in that direction:

      • Without hitting a key:
        The box edge will be perpendicular/parallel to/with the lines of the floor sector grid, or halfway (45 degrees).

        Click image for larger version

Name:	46.jpg
Views:	55
Size:	58.4 KB
ID:	6581
      • With hitting SHIFT key:
        Like above, but you can stop the rotation not only at 45 degrees, but even at every 5 degrees.
      • With hitting CTRL key:
        Continuous rotating.

    • Using only keys:

      • Horizontal rotation:

        • SHIFT+left/right arrow: by 1 degree, clockwise or anti-clockwise.
        • CTRL+R: by 5 degrees, always in the same direction.
        • CTRL+SHIFT+R: by 45 degrees, always in the same direction.

          Click image for larger version

Name:	64.jpg
Views:	43
Size:	38.6 KB
ID:	6628

      • Vertical rotation:
        SHIFT+up/down arrow: by 1 degree, clockwise or anti-clockwise.

    Click image for larger version

Name:	47.jpg
Views:	41
Size:	55.7 KB
ID:	6582
Continued in the next post...

Last edited by AkyV; 30-06-24 at 15:34.
AkyV is online now  
Old 09-06-24, 11:14   #7
AkyV
Moderator
 
Joined: Dec 2011
Posts: 5,074
Default

5. Local event sets and volume triggers
Part 2

  • Scaling the volume, in X, Y or Z direction, horizontally or vertically:
    Which means the trigger zone can be bigger/smaller than box with 1x1x1 sector/sphere with 1 sector diameter, so the chance that the activator will reach and activate the trigger can be bigger/smaller (and the really tiny triggers, smaller even than 1 sector, will be the really partial triggers):

    • As I said above, sphere volumes cannot be distorted. Which means if you resize the sphere on any of the three (X, Y, Z) axes, then it will be also automatically resized with the same amount on all the axes.
    • With one resizing action, a box volume will be resized only on one axis, while it keep its size on the other two axes. It will naturally distort the box shape which the volume had before the scaling.

    The method:
    There is one little cube on each colored axis protruding from the volume center. Grab the cube of the required axis, by the mouse, and push/pull it in the direction, which the arrow indicates to (or in the opposite direction):

    • Without hitting a key:

      • Spheres: continuous scaling on all the axes, in both the directions on the axes. (It seems always recommended for tiny sizes.)
      • Boxes: the box size changes 1 click in that direction, and also 1 click in the opposite direction.

      Click image for larger version

Name:	48.jpg
Views:	43
Size:	74.7 KB
ID:	6586 Click image for larger version

Name:	49.jpg
Views:	42
Size:	62.4 KB
ID:	6587
    • With hitting SHIFT key:

      • Spheres: scaling on all the axes, in both the directions on the axes.
        The bigger the sphere is the bigger the size change is: 1 click, 2 clicks, 4 clicks etc.
      • Boxes: the box size changes 64 units (a quarter click) in that direction, and also 64 units in the opposite direction.

    • With hitting CTRL key:

      • Spheres: very similar to doing it with SHIFT. Here or there probably with the same sized jumps.
      • Boxes: continuous scaling in that direction, and also the same change in the other direction. (It seems always recommended for tiny sizes.)

    Click image for larger version

Name:	50.jpg
Views:	46
Size:	63.2 KB
ID:	6588
Editing the contents for local event sets and volumes

Local event sets can be handled with the local event set editor, in TE.
There are more ways to open the panel of this editor. But what is more important is the editor can be opened in different forms:
  • You will open only the editor itself, to edit all the local event sets and events of the level. The easiest way for it is if you make a custom shortcut key for "Edit volume event sets" option, and you use that.
  • When a box or a shape volume is selected, then hit Key O to open the editor.
    But be careful! In this version of the local event set editor you can edit not only the local event sets and events of the level, but here you can also add/remove an event set to/from this volume, with some additional settings.
    Naturally the main goal of the local event set editor at a volume is not handling all the local event sets of the level, but only handling the event set of this volume. - And only one event set is allowed to belong to a volume.
    (Please note that you cannot edit an event set specifically for a volume. I.e. when you edit the contents of an event set at a volume, then the event set will be edited generally - so even for all the other volumes too, which also have this event set attached.)
Click image for larger version

Name:	51.jpg
Views:	46
Size:	70.3 KB
ID:	6603

Naturally the editor panel is totally empty now, when you have just started building a level:
  • The left big window lists all the global event sets of the level.
  • The right big window is about the contents (i.e. the events) of the actually selected (highlighted) event set.
As I said above, you can see: the local event set editor look exactly the same way (almost...) as the global event set editor. - The differences are:
  • Usually:

    • The initial name of a local event set is naturally not "New global event set", but "New volume event set". (You can create/select/rename/delete/copy an event set in the same way, anyway. But be careful: do not delete an event set while it is attached to a volume.)
    • Naturally a local event set needs an activator, so you also have a list here for them. (See below.)
    • As I said above, controlling a local event set depends on the position of the trigger activator. That is why not game phases are listed here but these positions (see below).
      And that is why naturally Call count will be interpreted a bit differently than at global events.

  • Only at the editor version of volumes (and changing these things will be valid only at the selected volume):

    • You can add an event set to the actual volume, or you can remove it from there:

      • If you close the editor panel by clicking on OK button, when an event set is just selected in the left big window, then that will be the event set which is added to the volume.
        I.e. this event set will be executed when activating this volume in the game. (So be careful, if you meanwhile also select other event sets here to edit them, because the proper event set should be selected when you close the panel at this volume.)
      • Click on X button at the upper right corner of the left big window, if you temporarily don't want to attach any event set to this volume. (It won't make the game crash if the activator of this volume reaches this volume. Simply nothing will happen now.)
        I.e. when you want to keep this volume there, but temporarily you don't want it to make anything, then it is better than deleting it.

    • What if you don't want to detach its event set (with that X button) from a volume temporarily ignored? Because eg. it is tiresome to restore it, if you need to find it again in a very long event set list. (Mostly if you want to ignore/restore it many times in a row, for some reason.)
      Just untick "Enable volume" option now, at the bottom of the left big window. The volume now goes disabled. (I.e. grey. A volume is purple anyway in selected or Face Edit mode, and blue in Geometry mode.)

      Click image for larger version

Name:	58.jpg
Views:	42
Size:	51.7 KB
ID:	6610
    • If the volume is placed in the way that it goes through the floor/ceiling/wall/portal of the room where you placed it, then basically the volume is ignored in the room of the other side of that floor/ceiling/wall/portal.
      Just tick "Detect in adjacent rooms" option at the bottom of the left big window, if you don't want this volume to be ignored on the other side.

      Click image for larger version

Name:	57.jpg
Views:	32
Size:	57.7 KB
ID:	6609
But a very important similarity is that local event sets can also be both defined by nodes or by scripting, just as I said at global events:
  • The event set is fully handled in the event set editor, if it is a node type event set.
  • The event set is only controlled in the event set editor, if it is a scripted event set. The contents (events) themselves are naturally defined in the script now.
If an event set is added to the volume, then its little message panel also shows some trigger data about it: the event set name and the activator.

Volume activators

The legacy method when eg. HEAVY or HEAVYANTITRIGGER defined that the activator of the trigger is not Lara, not working for volumes. (I mean, volumes have no trigger types to define this.) You can specify the activator in a different way for volumes.
However, volumes cannot have a specified activator. I mean, activators always belong to an event set, so all the volumes that have that event set attached, will use the activator chosen for that event set.
At the bottom of the local event set editor panel you can choose the activator for the selected event set, ticking the proper option. Or you can tick even two, more or even all the activator type options, if you want more than one activator types for that event set:
  • Lara, and/or
  • any NPC (aka any creature), and/or
  • any other Moveable object, like a Rollingball, a pushblock etc., and/or
  • any (shattering) Static object, and/or
  • any flyby camera.
Trigger phases

As I said above, naturally activating a volume trigger does not depend on a game phase, but on the position the trigger activator. In fact: its position, compared to the position of that volume.
The game can examine three positions like that (I'll call them trigger phases), named in the little window at the top right corner of the editor panel. - Choose the proper condition, and the event set (whichever volume you add it to) will be executed that way:
  • On Volume Enter: the event set will be executed once in the moment when the activator is just entering the trigger zone (i.e just entering the volume).
    In fact: in the moment, when the first mesh of the activator (or, at least, its bounding box) at least slightly touches the volume, from outside. ("First" naturally is not an ID now, it means there is no other mesh touching yet, they are all fully outside.)

    Click image for larger version

Name:	52.jpg
Views:	46
Size:	83.4 KB
ID:	6604
  • On Volume Inside: the event set will be executed continuously while the activator is being in the trigger zone (i.e being inside the volume).
    In fact: while at least one mesh of the activator (or, at least, its bounding box) is at least partially being inside the volume.

    Click image for larger version

Name:	53.jpg
Views:	30
Size:	77.3 KB
ID:	6605
  • On Volume Leave: the event set will be executed once in the moment when the activator is just leaving the trigger zone (i.e just leaving the volume).
    In fact: in the moment when the last mesh of the activator (or, at least, its bounding box) has just fully left the volume. ("Last" naturally is not an ID now, it means there is no other mesh inside any more.)

    Click image for larger version

Name:	54.jpg
Views:	36
Size:	79.9 KB
ID:	6606
Please note that there is a very important difference between Inside phase and the other two phases: Inside phase could be very long (I mean, the activator could be inside the volume even for a long time), but Enter and Leave phases last only for one moment.
This explains why Inside phase executes the event set infinite times in a row (i.e. restarting the event set at each moment, each frame again and again, while the activator is inside the volume), and why the other two phases execute the event set only once (i.e only at that frame when entering or leaving happens).

However, simple executions at short phases and repeated executions at long phases sometimes are not so different than you could think at first:
  • Multipliable events will be executed only once at short phases, and will be executed infinite times at long phases.
    Eg. the event is: flashing blue light on the screen, for one moment. Enter and Leave will be flashing it once. But Inside will be flashing it infinite times. Why? Because the game restarts the effect in the next moment, i.e. in the moment when the light of the previous moment is just about to turn off. And naturally short light effects in a chain will look a long, continuous light effect.
  • Non-multipliable events will be executed always only once at any phases.
    Eg. the event is to activate a flame of a nullmesh. Naturally it simply happens once at Enter and Leave. But it also simply happens at Inside. Why? Because if the fire is burning then naturally you cannot ignite it again, that is why Inside ignites the fire at the first moment of the activator being inside the volume - then nothing happens, even if Inside naturally tries to ignite it even at the second, third, fourth etc. moments too.
Naturally non-multipliable events can also be multipliable, if you remove them in the meantime.
I mean, eg. if you want to antitrigger that fire of Inside phase, while the activator keeps being in the volume, then you can do it, but only technically, because Inside re-ignites it immediately. So seemingly nothing happens, the fire keeps burning.
Simple events of Enter and Leave can also be multiplied, if you also multiply the phases themselves - with the flash/fire examples again:
  • Enter: the blue light flashes only once, only for a moment, when the activator enters the volume. But when it leaves it and later re-enters it again, then it flashes once again (for a moment). And the next time again...
  • Leave: the nullmesh fire starts burning when the activator leaves the volume. But if you antritrigger it later, then it will start burning again, when it enters and leaves again the volume later. And the same could happen after another antitriggering...
But "multiplied" doesn't always mean infinite occasions. I mean, see the little Call count window, at the bottom right corner of the event set editor panel. If the value is 0 here, then the event set can be activated infinite times. If it is 1, or 2, or 3,... or 100, then the event can be activated 1, or 2, or 3... or 100 times.
Till this moment, we have 0 in that little window, for infinite occasions. But now eg. type 2 there for two shots, and let's see those flash/fire examples again, to make it clear:
  • Enter: the blue light flashes only once, only for a moment, when the activator enters the volume. But when it leaves and re-enters it the next time, then it flashes once again (for a moment). But at the third, fourth etc. entering it won't be repeated ever again.
  • Leave: the nullmesh fire starts burning when the activator leaves the volume. But if you antritrigger it later, then it will start burning again, at the next re-enter/leave after that. But at the third, fourth etc. re-enter/leave it won't be repeated ever again, even if you antitrigger it again before that.
  • Inside: 2 means the light will be flashes at the first and the second moments of the activator being inside the volume, united into a two moments' long light. Then it stops flashing, even if the activator is still being in the volume obviously. When the activator leaves the volume, but later comes back in, the light won't flash ever again.
    Or the other example: the first moment of the activator being inside the volume ignites the flame. At the second moment Inside wants to ignite it again, but naturally nothing happens, the flame is still burning. Then it will never want to ignite the flame again, so after these two moments you will be able to antritrigger it successfully (even if the activator is still inside this volume).
Please note that Call count is not for the volume, but the event set. Let'see eg. when that blue flash "Enter" event set is added to two different volumes, still having Call count=2. The activator enters the first volume, so the light flashes once. Then it enters the another one, the light flashes once again. Now, if it enters any of them later, the light won't flash ever again.

However, as you can see, these possibilities are not the best under every circumstance.
I mean, what if eg. I want Enter to start executing the events only at the sixth entering into the volume, and not at the first entering?
Or let's see the only long phase, the Inside. It usually wants to execute the events during the whole time while the activator is inside. And if you narrow its possibilities by 1-100 shots, then the thing that only happens is it will want to execute the events in the first 1-100 moments of the activator being inside.
The solutions are (technical details are ignored in this tutorial):
  • Disable the volume. You will enable it later, when you want to activate it. Naturally only enabled volumes can be activated. (So it works like a TRIGGER_TRIGGERER.)
    Not disabling the volume it is naturally enabled initially, when the level starts.
  • Add one or more additional conditions to the events in the event set, so the enabled local event set will be activated only if those additional conditions are also true. For example, "if jump key is hit" condition is also added to Inside event set. Which means the event set will be activated only each time when the player hits the jump key, during the activator being inside the volume, to make Lara jump. (Unfortunately, if Call count is not infinite, but eg. 2, then it doesn't mean that it should be activated only at the first two jumps. I mean, it is still about the moments of Inside phase. I mean, counted from the moment when the event set is enabled and the activator is inside, you have two moments now to jump, to execute the event set. Otherwise the local event set will be unavailable forever.)
In fact, you can use even all the three (!) phases at the same time to control that event set in the game. Which means that one event set could be actually even two, three "event subsets".
Why? Because if you add events in the right big window of the editor panel to the event set selected in the left big window, those events are only for the trigger phase which is just chosen. So if you choose another trigger phase now, then the right big window will be without added events again, which means you can add even totally different events to this new phase at that event set. (Which won't remove the events from the previous phase.) - So, for example, if events are added to Enter and Inside phases at an event set, but the right big window is without added events when you choose Leave phase at that event set, then this event set will execute events when the activator enters the volume, and also execute different events, when it is inside the volume, not doing anything when it leaves the volume. (However, naturally you can add even the same events to two or three different phases, at the same local event set, or at different local event sets, if you want.)

Adding events

As I said above, events could be defined by the-so called nodes, or with a scripted way.
Above the right big window, there are two options, to choose nodes or scripting for that event set:
  • Choosing an option is only for a specific phase at that event set.
    So, for example you can choose node for Enter, but script for Leave, at the same event set. - Or even the opposite: you can choose scipt for Leave, but node for Enter, at another event set.
    However, don't forget: the option will be used in the game (when you play later), for all the three phases of that event set, which option is chosen when you close the editor window, by clicking on OK button. The other option will be ignored in the game.
  • When you choose an option, to use it in the game, then the events typed previously at the other option will be kept. So, if you change your mind, and change back to the other option at that event set phase, then the events you previously added there, are still there, ready to be used in the game.
If you temporarily don't want to activate one of the phases while you are playing, even if events are already added to that phase, then untick Enable option (next to Call count window), at that phase. Later you can enable this phase, if you want. (You cannot see this option in the screenshots of this tutorial, because they are made with a previous version of TE.)

More details about adding nodes/script to a local event are below, in this tutorial.

Continued in the next post...

Last edited by AkyV; 04-11-24 at 19:13.
AkyV is online now  
Old 11-06-24, 07:07   #8
AkyV
Moderator
 
Joined: Dec 2011
Posts: 5,074
Default

5. Local event sets and volume triggers
Part 3


--------

Notes:
  • See Tools/Editor options dropdown menu in TE, to customize the axes (Gizmo page), the circles (Gizmo page) and the text (3D window page) when the volume (or an object, effect, camera) is selected.
  • In TEN, these things will have auto-generated names: box/sphere volumes, Moveable and Static objects, Cameras/Locked Cameras, Sinks, Sound sources. (Flyby cameras will be identified by their sequence ID and their specific ID in the sequence.)
    The auto-generated ID in these auto-generated names are continous. I.e. the first element placed of this volume/object/camera/sink/sound group (eg. a Movebale object) will have ID 1. The second one placed (eg. a volume) will have ID 2. The third one placed (eg. a sink) will have ID 3. Etc. Only naturally the name tag will be different: it is naturally volume at Volumes, lara at Lara, sink at Sinks etc. (Interesting, but if you delete any element of this group, from the map, then I am not sure its ID will be re-used later. Probably the counter just takes the next number, when you place the next element.)
    But you can add a unique name to any placed element of the group (including volumes): just click on it with the right button. (In the case of volumes, the "it" is naturally the volume center.) In the opened menu panel, choose "Rename object", and then type the unique name. (I highly recommend not to rename any element after you referred it anywhere - eg. in a trigger -, otherwise that reference point will be probably corrupted. You'll need to fix the references at that point.)

    Click image for larger version

Name:	55.jpg
Views:	27
Size:	10.6 KB
ID:	6607
  • Click on the volume object center, with the right button. In the opened menu panel, choose "Reset rotation", to restore the default rotation of the box volume.

    Click image for larger version

Name:	56.jpg
Views:	38
Size:	18.1 KB
ID:	6608
  • Click on the volume object center, with the right button. In the opened menu panel, choose "Reset scale", to restore the default size of the box volume. (In the case of sphere volumes, this action makes the sphere really tiny.)
  • The tools to move or rotate volumes is similar to how you can move or rotate objects, effects, cameras. (But it is a bit different here or there.)
  • If volumes are overlapped with each other, then they have no effect on each other at all.

    Click image for larger version

Name:	63.jpg
Views:	43
Size:	58.0 KB
ID:	6616
  • If the volume is really flat, that volume naturally will act as a "Pad trigger".

    Click image for larger version

Name:	59.jpg
Views:	39
Size:	55.9 KB
ID:	6612

    (Or, the volume could be bigger, if only a flat part is in this room, and the bigger part is out of this room, not being available. - See what I told above volumes inside in more than one room.)
  • You can select even more than one volume at the same time. (In fact, objects, effects and cameras can also be in the selection - but it usually doesn't really seem meaningful.) - The two best methods for this:

    • Select (highlight) a floor area, and then right-click on it to open a menu panel. Select "Select objects" there to select all the volumes, objects, effects, cameras on this area. (Only one of them will be marked by the axes and the circles.)
    • Keeping CTRL pushed, click on any volume (clicking on the volume center), object, effect, camera if you want that thing in the selection. (Only one of them will be marked by the axes and the circles.)

    Now you can do some action (eg. moving, rotating), which will be done at each selected thing. (Naturally eg. you can grab a circle only where it is seeable. But, yes, it will rotate all these things.) - But:

    • In fact, only one circle is seeable, indicating that the rotation is available now only in those clockwise/anti-clockwise directions.
    • An extra: keep ALT pushed while you rotate all of these items, and they will not be rotated around themselves, but the marked item.

    Click image for larger version

Name:	60.jpg
Views:	36
Size:	61.9 KB
ID:	6613
  • If you want the box volume to be not 1x1 sector sized horizontally, but bigger, then select (highlight) some floor sectors, and then hit Key V, and a box volume will be placed, exactly on those sectors. (Its height is still the default 4 clicks.)

    Click image for larger version

Name:	61.jpg
Views:	35
Size:	72.7 KB
ID:	6614
  • If you want to delete a selected volume, then hit DELETE shortcut key.
  • If you want to copy a selected volume (with its contents, size, rotation), then:

    • With the usual CTRL+C/CTRL+V way. (If you use CTRL+V later, then you can paste another copy - till something rewrites the volume stored in TE memory.)
    • With the so-called "cloning": start it with CTRL+B. Till you hit ESC, the cursor remains a + sign. Just click anywhere with it, to paste the first copy and further copies.

  • If you want to relocate the selected volume (because the room is too big to simply move it, or you want to place it in another room), then do it with the usual CTRL+X/CTRL+V way.
  • Flipped rooms have their own volumes.
  • The positions of volumes (and also objects, effects, cameras) are not locked to floor/ceiling sectors.
    So eg. if a volume is placed tightly on a floor sector, but then you lift that sector up, then the sector will go into the volume, covering, not lifting that up.

    Click image for larger version

Name:	62.jpg
Views:	33
Size:	64.6 KB
ID:	6615
  • Be careful: an event set could show a different phase, when you select that event set in the left big window, compared to what the previously selected event set showed. Always the phase will be shown at an event set which was edited there the latest.
  • Be careful: the short phases of Enter or Leave sometimes are seemingly unable to activate events. Probably if that event needs more than one moment to be activated.
  • Naturally the Call count won't count when the local event is just disabled, even if that phase is just happening. (So eg. if Enter is for 5 shots, but you already used 3 shots when you disable the event set, then the enters won't be counted after that. However, if you enable later the event set again, then the further 2 shots will be counted again.)
  • I told at global event sets that there are some technical problems you can solve only later, when you will have better skills, this tutorial won't discuss them.
    And that is also true for local event sets. I mean, eg. a Call count counter restart would be useful even here. Or, seemingly the Call count counter is not really useable when an Inside event set has additional conditions, too. Etc.
    Or something different: as you can see, you can say only that eg. the trigger activator should be any NPC. But if you want a specific NPC to be an activator, then you need to have further knowldege for that.
  • If you execute a local event set with a VolumeEvent legacy trigger, as I said above, then the three phases are mentioned amongst the trigger parameters.
    However, choosing a phase there means only the trigger will execute the events which are defined at that phase, not controlling how the trigger will work. (So eg. a one moment light flash at Enter phase will work, as legacy triggers work: a continuously executed, infinite light flash, while the activator - mostly probably Lara this time - is in the trigger zone.)

Last edited by AkyV; 19-11-24 at 20:08.
AkyV is online now  
Old 24-06-24, 23:23   #9
AkyV
Moderator
 
Joined: Dec 2011
Posts: 5,074
Default

6. Node editor

There are so many things we can talk about nodes.
That is why I'll do that mostly in tutorials dedicated to nodes. I.e. now I will be only very short about them.

As I said, there can be two methods to define events for event sets: by nodes or by scripting. Just choose the proper option:
  • in a global event editor, to define global events (for any game phase), or
  • in a local event editor (standalone, or in a box volume, or in a sphere volume), to define local events (for any trigger phase).
Both nodes and scripting are able to create simple events, or even complex events. But if you want to create really complex ones, then you need to do it with some scripting everyway.
Then why would you use nodes? Because scripting in TEN is not just typing values in command fields, as with TRNG. Scripting is like programming here - so TEN scripting is harder then triggerring with nodes.
Which means if you are a TEN noob, then it is highly recommended to start event-making with nodes. In the meantime, you can try scripting this or that, just for exercising.
So later, when you have better or even really good TEN scripting skills, then at last you can do event-making even with scripting.

So now, when you are only a TEN noob, forget scripting temporarily, but feel free to make local or global events by nodes.
So, in an event editor, select an event set (in the left big window) and a phase for it (in the top right corner), and you can try to create/edit the contents for that event set phase, if you click on Node editor option now (at the top of the editor panel).
"Contents" mean events and the connection amongst them (but naturally you can make a simple event set, where the event set phase has only one event):
  • Nodes are not easy only because they don't need programming skills. Nodes are also easy because nodes are not about reading boring and heavily understandable texts. Nodes are really user-friendly, they are based on graphical elements - which naturally easier to understand than long texts.
  • As you know, legacy triggers have a trigger panel where you can adjust the trigger parameters. It works similarly at nodes: each event has its own trigger panel, where you can adjust its trigger parameters. (Except like activator, Call count etc. - as you know, these should be adjusted not here in the event editor.)
    Each of these "event trigger panels" is called a "node".
  • You can have only one or even more events in an event set, so you can have only one or more nodes in the right big window of the event set editor panel.
    Nodes aren't existing initially. That is why the right big window is empty when you have just created a new event set. You are the one who will create/modify/delete each node, placing them in the big window where you want.
  • The placement of nodes are important in the right big window: a node placed in the upper part will be executed sooner than a node placed in the lower part.
  • Classic legacy triggers don't have too many conditions, just a few like "if you use this switch, then...". On the other hand, TRNG has many different condition triggers.
    TEN also has many different nodes which are not executable events after all, but conditions for the executable events.
    So there are two types of TEN events: conditions and executable ones. The executable ones are called "Actions" - though, they are not only for Moveable objects, like (mostly) TRNG Action triggers. I.e. they could work even for a "Flipeffect type" event.
  • Lines are the graphical elements between nodes. So eg. if you attach X Condition (upper) node to Y Action (lower) node, that means Y Action will happen only if X Condition is true.
    Or you can set it for the opposite: Y Action will happen only if X Condition is NOT true.
For example, see this image about the right big window of the local event set editor:

Click image for larger version

Name:	65.jpg
Views:	106
Size:	89.4 KB
ID:	6629

First of all, the values around the big window are clearly say this about the "event subset" of the actual trigger phase:
  • This set is for the moment when the activator entering this volume.
  • Nothing happens if anyone/anything else enters this volume than Lara.
  • The events happen all the time (but each time only once) when Lara enters this volume. (I.e. Call count = 0.)
In this set there are seemingly six nodes.
You can easily discriminate condition nodes from action nodes, because:
  • The frame of condition nodes are green, the frame of action nodes are blue.
  • The auto-generated name of condition nodes are "If" plus an ID, the auto-generated name of action nodes are "Action" plus an ID.
Let's identify the six nodes:
  • Condition nodes:

    • The topmost one is: "If current weapon is Pistols".
    • The middle one is: "If current hand status is Armed".
    • The lowest one is: "If current hand status is Free".

  • Action nodes: all the ones are to ignite ("enable") a flame emiter Moveable object: one is for flame_emitter_a, the next one is for flame_emitter_b, the last one is for flame_emitter_c.
And these things will happen each time once, when Lara enters this volume:
  1. The topmost node is the topmost condition. So, first of all, this condition will be examined (when Lara enters), that it is true or false.
    This condition will examine if Lara's actual weapon is the pistol pair.
    There is no line starting from the "else" part of the node, which means nothing will happen if the condition is false. (I.e. if Lara enters the volume, then nothing will happen, if her weapon selected is not the pistol pair.)
    But there is a line starting from the "then" part of the node, which means the event set will continue if the condition is true. (I.e. if Lara enters the volume, then the event set will jump to the next node, if her weapon selected is the pistol pair.)
  2. The line from the topmost node goes to the middle node. So if Lara's current weapons are the pistols, then the event set will examine If 2 node.
    This condition will examine if Lara's hands are "armed" - i.e. if the selected weapons, the pistols are just in her hands or not.
    This time there is a line even from "then" and "else" (notice their different color), so the event set will continue either this condition is true or not:

    • If the condition is true (so if the pistols are in her hands) then the event set will jump to Action 1 node.
    • If the condition is false (so if the pistols are not in her hands) then the event set will jump to the lowest (If 3) condition node.

  3. So:

    • Action 1 ignites flame_emitter_a if Lara has the pistols in her hands, the event set ends now.
    • If Lara has no the current weapons (pistols) in her hands, then If 3 condition examines if Lara's hands are free or not:

      • If Lara has empty hands, then the event set will jump to Action 2 node.
      • If Lara doesn't have empty hands, then the event set will jump to Action 3 node.
        But, even if her hands are not empty, that cannot mean that those can be engaged by holding pistols - because in that case the event set had already ignited flame_emitter_a.
        So "not empty" could mean only engaged in a different way: eg. she is just going on all four, leaning with her palms on the floor.

  4. So:

    • Action 2 ignites flame_emitter_b if Lara has empty hands, the event set ends now.
    • Action 3 ignites flame_emitter_c if Lara hands are engaged by eg. going on all four, the event set ends now.
Let's sum it up:
  • Nothing happens about the events of this "subset" here, if:

    • Lara doesn't touch this volume, or
    • Lara enters the volume when her current weapon is not the pistol pair, or
    • Lara is already inside the volume or just leaving it. (We don't check now if the other two phases of the volume have their own "event subset" or not. They are naturally not important to the events of the entering phase.)

  • The volume will activate the "event subset" each time once when Lara enters the volume:

    • if her pistols are in hands, then the volume will ignite flame_emitter_a now, or
    • if her hands are empty (but her selected weapon is the pistol pair), then the volume will ignite flame_emitter_b now, or
    • if her hands are engaged because eg. she is just on all four (but her selected weapon is the pistol pair), then the volume will ignite flame_emitter_c now.

    Naturally "each time once" is meaningful now only if the flame is antintriggered later, but before the next entering, so in that moment the volume can ignite it again.
And that's all about nodes in this tutorial.
See more details about nodes in other tutorials.

Last edited by AkyV; 30-06-24 at 11:47.
AkyV is online now  
Old 25-06-24, 18:50   #10
AkyV
Moderator
 
Joined: Dec 2011
Posts: 5,074
Default

7. Scripted events

Let's see once again:
  • Scripting is the harder way (kind of programming) to define local or global event sets in event set editors. However, if you want to make some really complex and exciting event set, then you should choose scripting. (Though, the examples I explain in this chapter are very easy, so you can easily understand them.)
  • Alternatively you can also make scripted global events without using the global event set editor.
    (But this kind of direct scripting doesn't work for local events, i.e. for volumes.)
Indirect scripting via event set editor

If you choose the scripting option in the local/global event set editor (instead of the node editor), that doesn't mean you need to make some script in the right big window of the event set editor.
It means you make some related script part in TIDE, where naturally all the scripts for a TEN level are made, then you will refer to that script part in the right big window of the event set editor.

See for example the two images below.

The first image is shot in TIDE, in the LUA script file which is made for that level. (Eg. if this level is Test1.prj2, then the level script file is probably Test1.lua.) The OnLoad/OnSave/OnStart/OnLoop/OnEnd/OnUseItem block in the upper part is an initial part of all the level script files - but now that block is unimportant to us.
Below the block you can see three little blocks. Each little block is called a function (but in this tutorial we won't explain exact script terms). Each function seemingly refers to a flame emitter object: a, b or c. The yellow "EnableMoveable" text says that each function is to activate that flame emitter. (I.e. each function is an event now.)
The white text in each function is the name of the function. It can be customized (just like now they are), so you can identify easily that what that function is for.

Click image for larger version

Name:	66.jpg
Views:	70
Size:	68.2 KB
ID:	6652

The second image shows the global event set editor. In this example it is just open at "Ignite flame at level start" event set, at its "On Level Start" phase.
As you can see, when the event set editor is chosen to script option (instead of node option), then the right big window lists the white function names of the level script file, what you could just see below that initial block. (Listed in the same order as they are placed below the block.) - Don't forget to restart the event set editor first, if you've made new functions, new function names.
The function for activating flame_emitter_b is just selected (highlighted) in the big window, which means if you click on OK button now to close the event set editor panel, then this function will be activated when the level starts - i.e. flame_emitter_b will be ignited at that moment.
(Don't forget that a specific event set is selected on the left side when you highlight this function, so if you change which one is highlighted, then that will be modified in all the cases when that event set is used.)

Click image for larger version

Name:	67.jpg
Views:	70
Size:	43.1 KB
ID:	6641

Direct scripting without event set editor

Let's see the version when you don't use the event set editor to activate a global event.
I mean, you have probably already noticed that the entries in that initial block of Test1.lua are pretty similar to the game phases of the global event set editor: OnLoad/OnSave/OnStart/OnLoop/OnEnd/OnUseItem.
Each of these entries is a function, too. If you do something in any of these functions, then that will work in the game the same way, as if you place it in the game phase with the similar name.
So this time we modify the example above: I remove the function for flame_emitter_b from Test1.lua (which naturally also remove its entry from the right big window of the global event set editor), and then do some modifications, which includes the OnStart function of the initial script block - see in this image (the white flame_emitter_b is not a Moveable object name but a variable name):

Click image for larger version

Name:	68.jpg
Views:	70
Size:	67.5 KB
ID:	6655

As you can see:
  • If I want to execute some global event by direct scripting, then I should place it between the "()" and "end" part of the initial function of the proper game phase.
  • Before executing the initial functions (yes, the order of entries are important!), a variable identify that object (why "local" - it is not important now) in this example, and then the initial function of the proper game phase will refer to the variable as something the proper phase will enable (activate). (I.e. the variable contents and the enabling procedure is the event now.)
  • I didn't touch the other two little custom functions below, they are unimportant to this flame_emitter_b setup.
And that's all about scripting in this tutorial.
See more details about scripting in other tutorials.

--------

Notes:
  • For any reason, when you don't want a phase of a local/global event to have a script function assigned in the event set editor, then click on X button in the upper right corner of the right big window.
  • LevelFuncs.OnUseItem line is missing from the screenshots of this tutorial, because those are made with a previous version of TE.

Last edited by AkyV; 20-11-24 at 20:29.
AkyV is online now  
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:13.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Tomb Raider Forums is not owned or operated by CDE Entertainment Ltd.
Lara Croft and Tomb Raider are trademarks of CDE Entertainment Ltd.