一键导入
resource-access
Correct patterns for accessing game resources via ModLoader registry. Use when loading characters, items, abilities, or any mod content.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Correct patterns for accessing game resources via ModLoader registry. Use when loading characters, items, abilities, or any mod content.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | resource-access |
| description | Correct patterns for accessing game resources via ModLoader registry. Use when loading characters, items, abilities, or any mod content. |
The Sparkling Farce uses a registry system for all game content access. This enables mod overrides and prevents hardcoded dependencies.
# CORRECT - Uses registry, supports mod overrides
ModLoader.registry.get_resource("character", "max")
# WRONG - Bypasses mod system, breaks overrides
load("res://mods/_base_game/data/characters/max.tres")
# Generic access
ModLoader.registry.get_resource(type: String, id: String) -> Resource
# Type-safe getters (preferred)
ModLoader.registry.get_character(id: String) -> CharacterData
ModLoader.registry.get_item(id: String) -> ItemData
ModLoader.registry.get_ability(id: String) -> AbilityData
ModLoader.registry.get_class(id: String) -> ClassData
ModLoader.registry.get_battle(id: String) -> BattleData
ModLoader.registry.get_map(id: String) -> MapMetadata
ModLoader.registry.get_cinematic(id: String) -> CinematicData
ModLoader.registry.get_dialogue(id: String) -> DialogueData
ModLoader.registry.get_npc(id: String) -> NPCData
ModLoader.registry.get_shop(id: String) -> ShopData
For type definitions (not content), use type registries:
ModLoader.equipment_registry.get_slot(slot_id: String)
ModLoader.terrain_registry.get_terrain(terrain_id: String)
ModLoader.status_effect_registry.get_effect(effect_id: String)
ModLoader.ai_brain_registry.get_brain(brain_id: String)
Only for core platform resources that mods should never override:
# OK - Core platform scripts/resources
const CharacterDataScript = preload("res://core/resources/character_data.gd")
# OK - Platform UI components
var scene = load("res://scenes/ui/components/modal_base.tscn")
| Type | Location |
|---|---|
| Game content | mods/*/data/ |
| Platform code | core/ |
| Never | Game content in core/ |
# Check before access
if ModLoader.registry.has_resource("character", character_id):
var char_data: CharacterData = ModLoader.registry.get_character(character_id)
GDScript coding standards for The Sparkling Farce. Use when writing or reviewing code for style compliance.
Where to place game content vs platform code. Use when creating new files or moving existing code.
Run the project test suite. Use when user mentions "diagnostics", "run level 1 diagnostics", or asks to run tests.
Core development philosophy - fix platform code, not mod content. Load when making decisions about what to fix or implement.
View the newest screenshot(s) from the user's Screenshots folder. Use when user says SNS, SNS2, SNS3, or asks to see a screenshot.
Reference for preferred UNIX tools over LLM processing. Use when processing JSON, text, searching files, or doing batch operations.