返回 Skill 列表
extension
分类: 开发与工程无需 API Key

unreal-verse

使用Epic官方语言文档编写、审查和调试适用于Fortnite的Unreal Editor (UEFN) Verse代码的指南。在实现Verse设备、类、函数、控制流、容器、失败上下文、说明符/属性、模块/导入、效果、并发,或将逻辑转换为有效的Verse时使用。

person作者: jakexiaohubgithub

Unreal Verse

Overview

Use Epic documentation as the source of truth for Verse syntax and behavior. Route each task to the right doc first, then implement with minimal, valid patterns.

Workflow

  1. Classify the task.
  2. Open the matching section in references/verse-doc-index.md.
  3. Draft the smallest valid Verse solution first.
  4. Verify effects (<suspends>, <transacts>, <decides>), failure contexts, and container access.
  5. Return code plus a short rationale tied to the referenced docs.

Minimal Common Patterns

Use these as copy-start snippets, then adapt names and imports to the target project.

Class With Mutable State

counter := class:
    var total:int = 0

    Add(value:int):void =
        set total += value

Failable Lookup (Option/Failure Context)

if (first := numbers[0]):
    Print("{first}")

Map Insert + Read

scores:[string]int = map{}
set scores["alice"] = 10

if (score := scores["alice"]):
    Print("{score}")

Basic Loop

for (n := 0..2):
    Print("{n}")

Suspending Function

DoLater()<suspends>:void =
    Sleep(1.0)

Race Two Tasks

winner := race:
    TaskA()
    TaskB()

Execution Rules

  • Prefer explicit parameter and return types.
  • Keep functions small and compose behavior from small helpers.
  • Treat indexing and map reads as failable operations.
  • Use specifiers/attributes only when needed and verify exact syntax in docs.
  • Use race, sync, and branch deliberately; always reason about cancellation and lifetime.
  • Check language-version notes before using newer syntax in older projects.

Output Expectations

  • Produce code that compiles conceptually against current Verse docs.
  • Cite the specific Epic page used for non-trivial constructs.
  • Keep examples minimal unless the user asks for full architecture.