Skip to content

docs(scripting): add custom value to node script example - #916

Open
lancesnider wants to merge 2 commits into
mainfrom
node-script-example
Open

docs(scripting): add custom value to node script example#916
lancesnider wants to merge 2 commits into
mainfrom
node-script-example

Conversation

@lancesnider

@lancesnider lancesnider commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Resolves #869

@lancesnider
lancesnider requested a review from a team as a code owner September 2, 2026 09:39
@mintlify

mintlify Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
rive 🟢 Ready View Preview Sep 2, 2026, 9:41 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 MyNode type has no path or paint fields, so this changed annotation makes the draw example fail type checking. Restore the drawing example's Rectangle state 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node script example breaks as soon as the script has state

2 participants