docs(scripting): add custom value to node script example - #916
Open
lancesnider wants to merge 2 commits into
Open
docs(scripting): add custom value to node script example#916lancesnider wants to merge 2 commits into
lancesnider wants to merge 2 commits into
Conversation
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The example stops advancing after one frame, and the drawing annotations reference fields absent from MyNode.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds state to the Node Script example to address issue #869.
Changes:
- Adds and initializes
customValue. - Updates it during
advance. - Changes drawing callback type annotations.
File summaries
| File | Description |
|---|---|
scripting/protocols/node-scripts.mdx |
Demonstrates stateful Node scripts and updates drawing annotations. |
Review details
Suppressed comments (1)
scripting/protocols/node-scripts.mdx:85
- The
MyNodetype has nopathorpaintfields, so this changed annotation makes the draw example fail type checking. Restore the drawing example'sRectanglestate type.
function draw(self: MyNode, renderer: Renderer)
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+31
to
33
| self.customValue += seconds -- Access your properties through self. | ||
|
|
||
| return false |
|
|
||
| ```lua | ||
| function rectangle(self: Rectangle) | ||
| function rectangle(self: MyNode) |
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.
Resolves #869