TEN ‐ Node editor Tutorial - Tomb-Raider-Level-Editor/Tutorials GitHub Wiki

Written by Kubsy

What is node editor?

We will start of with an explanation of what is node editor.

Node Editor is a scripting graphical user interface which is supposed to be aimed for beginners with little to no programming knowledge. Kind of similar to Unreal Engine's blueprints or Unity's visual scripting interface.

Another benefit of Node editor is it was constructed similarly to TRNG's trigger window since each of the node is like a TRNG flipeffect trigger but the main difference is that many nodes can be spawned in the same event set and connected to eachother (more on that later) which can do a lot of stuff at the same time, pretty cool right?

All in all, an EventSet and the nodes you put in it are equivalent to TRNG's TriggerGroups and the triggers you put in it.

Node editor was released in Tomb Editor 1.6 and works for TEN version 1.0.2 and Tomb Editor 1.6 and up. If you use Tomb editor 1.5.9 and TEN 1.0.1 or below, you will need to update, the latest version can be found here: https://www.tombraiderforums.com/sho...=223846&page=4

There are several advantages and disadvantages to using node editor:

Advantages:

  • It's quick to implement something very easy without written lua.
  • very little programming needed.
  • everyone can implement nodes (link to guide in the initial post) but you need lua knowledge.
  • at the time of writing, there are a lot of action/conditional nodes provided.

Disadvantages

  • You can't use it to program complex gameplay and complex effects (written lua will be required).
  • can get messy if you have a lot of action nodes and don't "simplify".

However, despite the disadvantages, the beginner-friendliness and easy-to-use node editor still allows for making cool events and such!

next tutorials will focus on the interface and using the nodes.

Understanding Volume Trigger Window

This next chapter of the tutorial will focus on the Volume trigger window which is used for node editor (but also for lua function scripts)

The general layout of the volume trigger window looks like this (open the image on a new browser if you want to zoom in):

user59950_pic16270_1686501783

There are a lot of buttons so let's break down the window bit by bit and explain what they mean.

We shall start with the Event set column:

user59950_pic16272_1686501797

Event sets column is where all of your grouped events (or if you would like to call them: Trigger groups from TRNG) will reside, different sets will do something different depending on what you put.

1 - this button will add a new event set 2 - this button will copy the event set 3 - this button will delete the event set 4 - this button will let you search for an event set if you have many event sets already added 5 - this button will unassign the event set so you can have the volume trigger be inactive

The top bar of the trigger volume window:

user59950_pic16282_1686501841

1 - Textbox to allow you to name your event set 2 - Tabs to trigger volume trigger in different situations:

  • When entering = when Lara/moveable or any volume activator enters the volume trigger
  • When inside = when Lara/moveable or any volume activator is inside the volume trigger (this will trigger every game frame and stop when Volume activator is not in the volume anymore)
  • When Leaving = when Lara/moveable or any volume activator is leaving

3 - Switch between the modes, for now we will use node editor as this is the point of the tutorial. Level Script Functions are for functions written in lua in a file ( LevelFuncs.YourFuncName = function() ) 4 - unassign lua functions. 5 - Searches for nodes in your window.

The bottom bar of the window:

user59950_pic16279_1686501826

1 - adds an action node to the scene 2 - adds a conditional node to the scene 3 - Connects the nodes if they haven't been already 4 - renames the node 5 - change the colour of the node 6 - Deletes the selected node 7 - deletes all of the nodes 8 - copy the lua function to clipboard to be pasted to the file (more on that later) 9 - activators (checkboxes, multiple selection), who can activate the volume trigger

  • Lara - Wonderful Lara Croft herself
  • NPC - Enemies
  • Other objects - moveables such as animatings, pushables, traps etc (but not enemies). You can specify which moveable can trigger the volume trigger only - more on that later
  • Statics - static objects
  • Flyby cameras - Flybys (must have "Activate heavy" turned on in flyby properties!)

10 - Call count - how many times should the event set be called (triggered) since it is a property of the event set. If the call count is 0 then it will called (triggered) infinitely.

And last but not least! The scene itself:

user59950_pic16276_1686501813

This is where all of your nodes will reside. The scene can be moved with right-mouse and you can also selected multiple nodes with ctrl+click or by click and drag along the nodes.

Next tutorial will focus on nodes and creating a simple event.

Understanding Nodes

This tutorial will go over spawning nodes into our scene, understanding the difference between conditional and action node and some handy shortcuts/info.

First of all let's create a new event set. Go to the Event Set column and press the add sign which will create a new event set. It should look like this:

user59950_pic16264_1686501748

now you can name it if you'd like: go to the Event set name and rename it to something. I renamed mine to "Haha some event set". This will of course be reflected to the event set on the event set column

user59950_pic16281_1686501841

Now we can go explore the fun stuff and spawn our first nodes. Go to the bottom bar of the window and add an action node and a conditional node, the default action and conditional node will be spawned (if you spawn 2 of them then they will be linked already however if they are not then just link them by dragging from the bottom of the dotted grey area of the node).

user59950_pic16271_1686501797

As you can see we have a node called "Action 1" and conditional node called "if 1" what is the difference?

Well an action node is a node which will do some action in the above screenshot it is flash screen. In each action node you have a bunch of properties that you can manipulate so for flash screen you can change the colour and intensity of the flash. Hint: you can hover your mouse at the different properties and they will tell you what they customize!!

Conditional node is basically an "if statement" so in the above example, the flash screen would trigger if a player presses forward. Conditional nodes have "then else" connectors which means if that conditional node is true then trigger these action nodes. If not then trigger other action nodes.

Consider this:

user59950_pic16278_1686501826

if the key "forward" is hit, then flash the screen. If not then shake the camera. Of course this would work if you have these nodes on "when inside" volume event!

Of course you can access many different nodes by clicking at the dropdown tab.

However, in my opinion, a much better and clean way to choose nodes is by right-clicking at the dropdown list. Which would give you a detailed explanation of what this node does and split into sections:

In some of the nodes you may see a moveable called "volume activator" for example in the distance check node:

A volume activator is any moveable or static passing through the volume. This is particularly useful if you do not mind any moveable (for this distance check node) to pass through this volume and compare distance to eachother. But you must remember to check relevant activators at the bottom of the window!

However if you want specific moveables, cameras, statics to trigger volume. You can press the dropdown the menu and select specific moveables.

In this case, compare Lara against small scorpion.

user59950_pic16269_1686501783

What this conditional node means?

  • "Equal" - if the distance is equal to (there's many comparisons - less than, more than etc to select)
  • "0" - value to check the distance. Can be any number
  • "All dimensions" - check the distance from any direction (vertical, horizontal, diagonal etc. You can also select "horizontal only")
  • Moveables - compare distance Lara against small scorpion.

Very useful hint: You can click and drag moveables from 3D view of TE to the Node editor scene itself.

this video shows dragging SETH moveable from 3D view to node editor scene:

https://streamable.com/e2q386

you can also overwrite to an existing node (if applicable):

https://streamable.com/9i8kgp

Understanding nodes: Advanced

In the last section we discovered nodes. We learned what are action and conditional nodes where each have different properties. However we did not discover 2 useful functions that can be useful, and those are: Nested conditional nodes and exporting node scene to written Lua.

Nested Conditional nodes

Reminder: conditional nodes are nodes which act like an "If-statement" it will trigger depending on the condition.

Here, we can also nest them to create more complex events depending on what the player will do.

Consider this node scene:

user59950_pic16263_1686501748

we have 2 conditional nodes which control different nodes in a different scope (i.e, "key is held" is not able to trigger the health text because it can't really see, but the "moveable health check" can!)

note: for key stuff it is recommended to select "While inside" event as it checks each game frame!

What is happening is this:

  • if a player is holding forward, it will trigger the text with "You are pressing forward" with attributes like shadow, black colour etc.

  • It will then go to another conditional node to check Lara's health (note: I accidentally put "Volume activator which will check any moveable's health :P) if it's more than 500, it triggers the node on the left hand side, if not then it triggers the node on the right hand side.

  • however if the player is not holding forward then the nodes on the left hand side each game frame and triggers the right hand side node which is "you're not pressing forward at the moment".

Hopefully that gives you a clear idea of nodes in general, they can become really powerful and give a huge gameplay enhancement with some creativity 🙂

Some other useful stuff with conditional nodes

There are other things you can do with conditional nodes. In the previous example, the 2 conditional nodes are connected together, however you could have 2 unconnected conditional nodes so they work independently (in fact you can have as many conditional nodes as you can in the scene itself!)

consider this slightly modified example:

user59950_pic16262_1686501748

We now have split 2 conditional nodes so they work independently. This means that even if you don't press forward, then the health check conditional node will still trigger.

note: the conditional nodes will trigger in order of appearance, so the top most conditional node will trigger and then traverse downwards to check for conditional/action nodes

Independent action nodes

Consider this again modified example:

user59950_pic16284_1686501850

the conditional node exists for holding the key, however you also have an action node (Which I call an "independent action node") that is not connected to the conditional node and thus will always trigger no matter what.

Exporting node scene to written Lua

Even though you can do most of the stuff in the nodes itself, there are a few problems.

What if you would like to trigger stuff when the game starts? Or even on load?? when saving??? Or even on exit like you can with written lua???? Well thankfully you can do that

Remember this button?

CYSQIxd

well you can use it to export stuff from the scene into written lua and then paste it to your .lua file. Let's do that!

First put the node that you would like to be exported to the scene, In this case I chose the inventory node to provide the player with a crowbar at the start:

user59950_pic16283_1686501850

Hit the "export lua script to clipboard" and the following message should appear:

user59950_pic16275_1686501813

that means the written lua behind the node has been copied and saved to your clipboard on your computer great! We can now paste it to the .lua file so enter your level .lua script and paste this to the "OnStart" function.

user59950_pic16273_1686501797

now this may seem complicated at first however it is not! Let's look at each part.

"LevelFuncs.ExportedNodeFunction = function(activator)"

this basically means you are making a level function named "ExportedNodeFunction" (to indicate it was exported from node but you can rename and you shouldn't have problems).

activator means who can activate the function?

"LevelFuncs.Engine.Node.AddInventoryItem(TEN.Objec ts.ObjID.CROWBAR_TEM, 1)"

this accesses the node that you exported and inserted into lua. in this case the crowbar will be added to your inventory on start of the game (if you did put it in the OnStart function)

Note: the above example might be obsolete now, as the recent TEN version have now introduced global events which acts similarly to node editor but for events like: Onstart, OnSave etc. Covered later but if you want to have a play around then at the top navigation bar of Tomb Editor, go to Edit then select "Edit global event sets..." the rules from this tutorial apply to global event sets too.