09-06-24, 10:24 | #1 |
Moderator
Joined: Dec 2011
Posts: 5,074
|
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:
Last edited by AkyV; 04-11-24 at 19:18. |
09-06-24, 10:43 | #2 |
Moderator
Joined: Dec 2011
Posts: 5,074
|
1. Legacy triggers
The legacy (i.e. classic) trigger system nicely works even in TEN:
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. 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:
Note: If you want to edit an existing legacy trigger in TE, then:
Last edited by AkyV; 29-06-24 at 11:20. |
09-06-24, 10:49 | #3 |
Moderator
Joined: Dec 2011
Posts: 5,074
|
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:
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. |
09-06-24, 11:11 | #4 |
Moderator
Joined: Dec 2011
Posts: 5,074
|
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:
"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:
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:
Last edited by AkyV; 31-07-24 at 11:35. |
09-06-24, 11:12 | #5 |
Moderator
Joined: Dec 2011
Posts: 5,074
|
4. Global event sets
Global event set editor Global event sets can be handled with the global event set editor, in TE:
Naturally the editor panel is totally empty now, when you have just started building a level:
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:
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:
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:
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:
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):
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):
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:
More details about adding nodes/script to a global event are below, in this tutorial. -------- Notes:
Last edited by AkyV; 04-11-24 at 19:50. |
09-06-24, 11:13 | #6 |
Moderator
Joined: Dec 2011
Posts: 5,074
|
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:
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 a floor sector to place that box or sphere shape on it (and to get back the arrow cursor shape):
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:
Last edited by AkyV; 30-06-24 at 15:34. |
09-06-24, 11:14 | #7 |
Moderator
Joined: Dec 2011
Posts: 5,074
|
5. Local event sets and volume triggers
Part 2
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:
Naturally the editor panel is totally empty now, when you have just started building a level:
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:
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:
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:
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:
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:
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):
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:
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. |
11-06-24, 07:07 | #8 |
Moderator
Joined: Dec 2011
Posts: 5,074
|
5. Local event sets and volume triggers
Part 3 -------- Notes:
Last edited by AkyV; 19-11-24 at 20:08. |
24-06-24, 23:23 | #9 |
Moderator
Joined: Dec 2011
Posts: 5,074
|
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:
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):
First of all, the values around the big window are clearly say this about the "event subset" of the actual trigger phase:
You can easily discriminate condition nodes from action nodes, because:
See more details about nodes in other tutorials. Last edited by AkyV; 30-06-24 at 11:47. |
25-06-24, 18:50 | #10 |
Moderator
Joined: Dec 2011
Posts: 5,074
|
7. Scripted events
Let's see once again:
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. 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.) 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): As you can see:
See more details about scripting in other tutorials. -------- Notes:
Last edited by AkyV; 20-11-24 at 20:29. |
Bookmarks |
Thread Tools | |
|
|