AI and pathfinding nodes#1231
Open
Stranger1992 wants to merge 13 commits into
Open
Conversation
And guarding against moveables not being active.
Accidently deleted on branch.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds TEN node catalog support for creature AI/pathfinding controls and queries, expanding scripting options for level designers.
Changes:
- Adds new Creature AI nodes for mood, target, friendliness, poison, hurt-by-player, jumping, monkey-swinging, goal, and AI location state.
- Adds a
_System.luahelper to map mood enumeration indices to TEN mood constants. - Updates installer changelog with the new creature AI node category.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
TombLib/TombLib/Catalogs/TEN Node Catalogs/Creature Mood.lua |
Adds new Creature AI node definitions and Lua implementations. |
TombLib/TombLib/Catalogs/TEN Node Catalogs/_System.lua |
Adds helper mapping UI mood enum values to TEN mood constants. |
Installer/Changes.txt |
Documents the new creature AI nodes. |
Comments suppressed due to low confidence (2)
TombLib/TombLib/Catalogs/TEN Node Catalogs/Creature Mood.lua:286
- This log message says "location status" even though the node is setting the creature's goal-reached status. That makes failures from this node harder to diagnose in scripts that also use the location node.
if mov:GetStatus() ~= 1 then
TEN.Util.PrintLog("moveable [ " .. moveable .. " ] is not active. Cannot set location status.",TEN.Util.LogLevel.ERROR)
TombLib/TombLib/Catalogs/TEN Node Catalogs/Creature Mood.lua:97
- This inactive-object error says "No target set" even though this node is checking the current target. The message should match the check operation so users can distinguish it from failures in the set-target node.
if mov:GetStatus() ~= 1 then
TEN.Util.PrintLog("moveable [ " .. moveable .. " ] is not active. No target set.",TEN.Util.LogLevel.ERROR)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| local mov = TEN.Objects.GetMoveableByName(moveable) | ||
|
|
||
| if mov:GetStatus() ~= 1 then | ||
| TEN.Util.PrintLog("moveable [ " .. moveable .. " ] is not active. No mood set.",TEN.Util.LogLevel.ERROR) |
| local mov = TEN.Objects.GetMoveableByName(moveable) | ||
|
|
||
| if mov:GetStatus() ~= 1 then | ||
| TEN.Util.PrintLog("moveable [ " .. moveable .. " ] is not active. No target set.",TEN.Util.LogLevel.ERROR) |
Comment on lines
+81
to
+82
| local targetMovAI = Objects.Creature(targetMov) | ||
| targetMovAI:SetTarget(mov) |
| -- !Section "Creature AI" | ||
| -- !Description "Checks if the creature is currently jumping. Only works for creatures that can jump." | ||
| -- !Conditional "True" | ||
| -- !Arguments "Newline, Moveables, [ baddy | enemy_jeep | mafia | raptor | scientist | skeleton | swat_ | von_croy ], Moveable to check jumping status for." |
TrainWrack
requested changes
May 21, 2026
| -- !Arguments "Boolean, 20, {false}, Debug to console." | ||
| LevelFuncs.Engine.Node.SetCreatureLocation = function(objectId, location, debug) | ||
| local moveables = TEN.Objects.GetMoveableByName(objectId) | ||
| if moveables:GetStatus() ~= 1 then |
Collaborator
There was a problem hiding this comment.
Add enum here rather than magic number of 1. For all nodes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a comprehensive set of new nodes for controlling and querying various aspects of creature AI in the TombEngine Node system. These additions allow level designers to set and check creature moods, targets, friendliness, poison status, "hurt by player" status, jumping/monkey-swinging state, and goal-reaching status, as well as to set intelligent creature locations. The changes significantly expand the scripting capabilities for creature behavior in custom levels.
New Creature AI Node Functionality:
TombLib/TombLib/Catalogs/TEN Node Catalogs/Creature Mood.lua)TombLib/TombLib/Catalogs/TEN Node Catalogs/_System.lua)Documentation and Catalog Updates:
Installer/Changes.txtto document the addition of nodes for checking and setting various aspects of creature AI.