defold-scripts-editing

Create and edit Defold script files and Lua modules with correct lifecycle patterns.

93|9|Updated Feb 17, 2018
One-click install
npx skills add https://github.com/selimanac/defold-daabbcc --skill defold-scripts-editing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: defold-scripts-editing
Source: https://github.com/selimanac/defold-daabbcc/tree/main/.agents/skills/defold-scripts-editing
Command: npx skills add https://github.com/selimanac/defold-daabbcc --skill defold-scripts-editing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defold projects often require consistent structure and updates across multiple script types. This skill provides a focused guide for creating, editing, and configuring Defold script files (.script, .gui_script, .render_script, .editor_script) and Lua modules (.lua), ensuring correct patterns and usage.

Core Features & Use Cases

  • Create, modify, and organize Defold script files with correct lifecycle callbacks and property usage.
  • Use templates and references to align with editor, GUI, render, and module scripting conventions.
  • Real-world use: refactor a game's AI controller by converting logic into reusable Lua modules and per-type scripts.

Quick Start

Ask me to edit a script to add a new go.property or refactor a shared Lua module for reuse.

Frequently Asked Questions about defold-scripts-editing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Defold script files with the correct lifecycle callbacks?

To structure Defold script files correctly, you apply per-type lifecycle patterns for .script, .gui_script, .render_script, and .editor_script files. This ensures proper callback usage and property management across your game project.

What is the best way to refactor game logic into reusable Lua modules in Defold?

The best way to refactor game logic into reusable Lua modules is to extract shared logic into .lua files and enforce proper module usage patterns. This allows per-type scripts to reference and execute the modular logic efficiently.

Can I use templates for different Defold script types like gui_script and render_script?

Yes, you can use templates for different Defold script types. Templates enforce correct conventions and structural patterns for editor_script, gui_script, render_script, and script files, streamlining the creation of new game elements.

How do I add a new go.property to an existing Defold script?

To add a new go.property to a Defold script, you edit the script file structure and insert the property declaration using the correct lifecycle pattern. This updates the script configuration while maintaining proper property usage.

Does this approach work for organizing both .lua modules and .script files in a Defold project?

Yes, this approach works for organizing both .lua modules and .script files in a Defold project. It manages and edits script structures across all Defold file types, ensuring consistent module usage and project organization.

When should I use a .gui_script versus a standard .script file in Defold?

You should use a .gui_script versus a standard .script file based on per-type script structure constraints. Gui scripts handle GUI-specific lifecycle callbacks, while standard scripts manage general game object behavior and properties.