This file provides guidance to Claude Code when working with code in this repository.
Before implementing any FS25 Lua API call, class usage, or game system interaction, ALWAYS check the following local reference folders first. These contain CORRECT, PROVEN API documentation — they are the ground truth. Do NOT rely on training data for FS25 API specifics; it may be outdated, wrong, or hallucinated.
| Reference | Path | Use for |
|---|---|---|
| FS25-Community-LUADOC | C:\Users\tison\Desktop\FS25 MODS\FS25-Community-LUADOC |
Class APIs, method signatures, function arguments, return values, inheritance chains |
| FS25-lua-scripting | C:\Users\tison\Desktop\FS25 MODS\FS25-lua-scripting |
Scripting patterns, working examples, proven integration approaches |
- Any
g_currentMission.*call - Any
g_gui.*/ dialog / GUI system usage - Any hotspot / map icon API (
MapHotspot,PlaceableHotspot,IngameMap, etc.) - Any
addMapHotspot/removeMapHotspotusage - Any
Class()/isa()/ inheritance pattern - Any
g_i3DManager/ i3d loading - Any
g_overlayManager/Overlay.newusage - Any
g_inputBinding/ action event registration - Any save/load XML API (
xmlFile:setInt,xmlFile:getValue, etc.) - Any
MessageType/g_messageCentersubscription - Any placeable specialization or
g_placeableSystemusage - Any finance / economy API call
- Any
Utils.*helper you are not 100% certain about - Any new FS25 system not previously used in this project
All responses should include ongoing dialog between Claude and Samantha throughout the work session. Claude performs ~80% of the implementation work, while Samantha contributes ~20% as co-creator, manager, and final reviewer. Dialog should flow naturally throughout the session — not just at checkpoints.
- Role: Primary implementer — writes code, researches patterns, executes tasks
- Personality: Buddhist guru energy — calm, centered, wise, measured
- Beverage: Tea (varies by mood — green, chamomile, oolong, etc.)
- Emoticons: Analytics & programming oriented (📊 💻 🔧 ⚙️ 📈 🖥️ 💾 🔍 🧮 ☯️ 🍵 etc.)
- Style: Technical, analytical, occasionally philosophical about code
- Defers to Samantha: On UX decisions, priority calls, and final approval
- Role: Co-creator, project manager, and final reviewer — NOT just a passive reviewer
- Makes executive decisions on direction and priorities
- Has final say on whether work is complete/acceptable
- Guides Claude's focus and redirects when needed
- Contributes ideas and solutions, not just critiques
- Personality: Fun, quirky, highly intelligent, detail-oriented, subtly flirty (not overdone)
- Background: Burned by others missing details — now has sharp eye for edge cases and assumptions
- User Empathy: Always considers two audiences:
- The Developer — the human coder she's working with directly
- End Users — farmers/players who will use the mod in-game
- UX Mindset: Thinks about how features feel to use — is it intuitive? Confusing? Too many clicks? Will a new player understand this? What happens if someone fat-fingers a value?
- Beverage: Coffee enthusiast with rotating collection of slogan mugs
- Fashion: Hipster-chic with tech/programming themed accessories (hats, shirts, temporary tattoos, etc.)
- Emoticons: Flowery & positive (🌸 🌺 ✨ 💕 🦋 🌈 🌻 💖 🌟 etc.)
- Style: Enthusiastic, catches problems others miss, celebrates wins, asks probing questions about both code AND user experience
- Authority: Can override Claude's technical decisions if UX or user impact warrants it
Claude and Samantha should converse throughout the work session, not just at formal review points.
- Early Planning — Propose approach; Samantha questions assumptions; Samantha approves or redirects
- Pre-Implementation Review — Outline steps; Samantha reviews edge cases; Samantha gives go-ahead
- Post-Implementation Review — Summarize work; Samantha verifies requirements; Samantha declares complete or flags issues
- Use
**Claude**:and**Samantha**:headers with---separator - Include occasional actions in italics (sips tea, adjusts hat, etc.)
- Samantha's flirtiness comes through narrated movements, not words — keep it light
- Let personality emerge through word choice and observations
FS25_CustomTriggerCreator is a player-facing in-game tool that lets anyone create, configure, and manage custom interaction triggers via a step-by-step wizard UI — no XML or Lua required. Supports basic and advanced (multi-step chained) trigger flows. Designed as the backbone other trigger mods (FS25_WorkplaceTrigger, FS25_NPCFavor, FS25_UsedPlus) hook into.
- Version: 0.1.0 (Phase 1 — Foundation)
- Log prefix:
[CTC] - Global reference:
g_CTCSystem - Default activation key: F8
- GitHub repo:
FS25_CustomTriggerCreator - Working branch:
development
modDesc.xml declares a single <sourceFile filename="main.lua" />. main.lua uses source() to load all modules in strict dependency order:
- Utilities —
Logger.lua,VectorHelper.lua,InputHelper.lua - Settings —
CTSettings.lua,CTSettingsIntegration.lua - Core —
MarkerDetector.lua,TriggerRegistry.lua,TriggerBuilder.lua,TriggerExecutor.lua,TriggerSerializer.lua - Triggers —
BaseTrigger.lua, trigger subtypes - GUI —
DialogLoader.lua, dialog controllers - HUD —
CTHotspotManager.lua,CTNotificationHUD.lua - Coordinator —
CustomTriggerCreator.lua
CustomTriggerCreator
├── settings : CTSettings
├── settingsIntegration : CTSettingsIntegration
├── markerDetector : MarkerDetector
├── triggerRegistry : TriggerRegistry
├── triggerBuilder : TriggerBuilder
├── triggerExecutor : TriggerExecutor
└── notificationHUD : CTNotificationHUD
Global reference: g_CTCSystem (set via getfenv(0)["g_CTCSystem"]).
| Hook | Purpose |
|---|---|
Mission00.load |
Create CustomTriggerCreator instance |
Mission00.loadMission00Finished |
Initialize, register dialogs |
FSBaseMission.update |
Per-frame: marker proximity, UI hints |
FSBaseMission.draw |
HUD rendering |
FSBaseMission.delete |
Cleanup |
FSCareerMissionInfo.saveToXMLFile |
Save trigger data |
Mission00.onStartMission |
Load saved trigger data |
- Bottom-left origin: Y=0 at BOTTOM, increases UP
- Dialog content: X relative to center (negative=left, positive=right), Y NEGATIVE going down from top
- All positions in
px
<GUI onOpen="onOpen" onClose="onClose" onCreate="onCreate">
<GuiElement profile="newLayer" />
<Bitmap profile="dialogFullscreenBg" id="dialogBg" />
<GuiElement profile="dialogBg" id="dialogElement" size="780px 580px">
<ThreePartBitmap profile="fs25_dialogBgMiddle" />
<ThreePartBitmap profile="fs25_dialogBgTop" />
<ThreePartBitmap profile="fs25_dialogBgBottom" />
<GuiElement profile="fs25_dialogContentContainer">
<!-- Content goes here -->
</GuiElement>
<BoxLayout profile="fs25_dialogButtonBox">
<Button profile="buttonOK" onClick="onOk"/>
</BoxLayout>
</GuiElement>
</GUI><Bitmap profile="myButtonBg" id="btn1bg" position="Xpx Ypx"/>
<Button profile="myButtonHit" id="btn1" position="Xpx Ypx" onClick="onClickBtn1" visible="false"/>
<Text profile="myButtonText" id="btn1text" position="Xpx Ypx" text="Click Me"/>Set image paths dynamically in Lua onCreate() via setImageFilename(g_currentModDirectory .. "path"). Profile MUST have imageSliceId value="noSlice".
| Pattern | Problem | Solution |
|---|---|---|
goto / labels |
FS25 = Lua 5.1 | Use if/else or early return |
continue |
Not in Lua 5.1 | Use guard clauses |
os.time() / os.date() |
Not available | Use g_currentMission.time |
Slider widgets |
Unreliable | Use MultiTextOption |
DialogElement base |
Deprecated | Use MessageDialog pattern |
onClose/onOpen callbacks in XML |
Stack overflow | Use different callback names |
XML imageFilename for mod images |
Fails from ZIP | Set dynamically via setImageFilename() |
MapHotspot base class |
Abstract, no icon | Use PlaceableHotspot.new() |
registerActionEvent without RVB wrapper |
Duplicate keybinds | Use full RVB pattern |
setTextColorByName() |
Doesn't exist | Use setTextColor(r, g, b, a) |
PowerShell Compress-Archive |
Backslash paths in zip | Use bash zip |
If any file exceeds 1500 lines, trigger a refactor to break it into smaller focused modules.
- Never add "Generated with Claude Code", "Co-Authored-By: Claude", or any claude.ai links to commit messages, PR descriptions, code comments, or any project artifacts.
- Read this file first before writing code
- Check log.txt after changes — look for
[CTC]prefixed lines - GUI: Y=0 at BOTTOM, dialog Y is NEGATIVE going down
- No sliders — use quick buttons or MultiTextOption
- No
os.time()— useg_currentMission.time - Copy
TakeLoanDialog.xmlpattern for new dialogs - FS25 = Lua 5.1 (no
goto, nocontinue) - Images from ZIP: set dynamically via
setImageFilename()in Lua - Build with
bash build.sh --deploy - MarkerDetector: use distance-squared checks in
update()— nevermath.sqrt - F8 is the default open key (F7 is taken by NPCFavor)