FC 26 HUB/LUA/EVENTS + HOTKEYS

ARTICLE 65API V2 / OBSERVE / PROVE / REMOVE

HOOK THE
RIGHT MOMENT.

An event script is a football trigger plus a callback—not a magic loop. Register one observer, perform one Career action, preserve the handler ID and remove it before the next experiment.

EXECUTE FILEREGISTER HANDLERTRIGGER ONE ACTIONCAPTURE TAGGED LOGREMOVE EXACT IDRESTART CLEAN

01 / DIRECT ANSWER

Run the file once; let the event call it later

FC 26 Live Editor Lua events have two documented families: initialization and Career Mode. A Career callback must take `events_manager`, `event_id` and `event`; `pre__` runs before the original game function and `post__` after it. Use `AddEventHandler` once, identify the new handler through `GetEventHandlers`, prove one tagged `LOGGER:LogInfo` line, then remove that exact ID. A v26.3.6 hotkey is different: it executes the assigned Lua file directly.

01 / REGISTERFile runs now

It creates a callback and attaches it to one named event.

02 / TRIGGERFootball acts later

Day, load, prematch or another Career action supplies the event ID.

03 / REMOVEID ends policy

Target one handler; do not clear other scripts.

02 / TWO CLOCKS

Execution time is not event time

The registration file and its callback run at different moments. Confusing them causes silent tests, duplicate handlers and hotkeys that only add more listeners.

00LUA ENGINEExecute file

Imports load and registration code runs once.

→
01EVENT APIAttach callback

AddEventHandler stores a function reference.

→
02FC 26Cross trigger

The relevant original game function is reached.

→
03LOGGERCallback proves

The tag, event and phase become evidence.

PRESSING EXECUTE≠CAREER EVENT FIRED≠CHANGE PERSISTED

03 / ORIGINAL REPRODUCIBILITY TOOL

Generate the listener and its exit together

This browser-only desk creates observation scripts from documented API calls. The idempotency wrapper is our derived safeguard: it discovers the handler added by this run, stores its ID in the current Lua global state and removes its own previous ID on re-execution.

LOCAL / BROWSER-ONLY

EVENT SCRIPT WORKBENCH

Build a tagged observer, keep its exact removal script and prove one football action in the log.

01 / CHOOSE ONE JOB

02 / LOCK THE CONTRACT

CALLBACK PHASE
EVENT
pre__CareerModeEvent
SIGNATURE
3 args
TRIGGER
Every CareerModeEvent
PROOF
A numbered event and resolved name in the Live Editor log.
LIMIT

High log volume: reproduce one short action, then remove the handler.

-- FC 26 Live Editor event probe
-- Generated locally by fc26liveeditor.com; observation only
require 'imports/career_mode/helpers'

local EVENT_NAME = "pre__CareerModeEvent"
local STATE_KEY = "__FCLG_EVENT_TEST_PROBE_HANDLER_ID"

-- Re-running this file removes its previous handler first.
local previous_id = rawget(_G, STATE_KEY)
if previous_id then
    RemoveEventHandler(EVENT_NAME, previous_id)
    rawset(_G, STATE_KEY, nil)
end

local known_ids = {}
for _, handler in ipairs(GetEventHandlers(EVENT_NAME)) do
    known_ids[handler.id] = true
end

local function on_career_event(events_manager, event_id, event)
    LOGGER:LogInfo(string.format(
        "[FCLG_EVENT_TEST] Career event %d (%s)",
        event_id, GetCMEventNameByID(event_id)
    ))
end

AddEventHandler(EVENT_NAME, on_career_event)

-- Discover and retain only the ID added by this run.
local attached_id = nil
for _, handler in ipairs(GetEventHandlers(EVENT_NAME)) do
    if not known_ids[handler.id] then
        attached_id = handler.id
        rawset(_G, STATE_KEY, handler.id)
        break
    end
end

LOGGER:LogInfo(string.format(
    "[FCLG_EVENT_TEST] attached %s as handler %s",
    EVENT_NAME, tostring(attached_id)
))
HASH / 672A7973SAVE AS .LUA

03 / BUILD THE RUN RECEIPT

SCOPE: the generated probes log only. They do not dereference the event pointer, write the database, touch memory, call HTTP or modify a save.

04 / DOCUMENTED EVENT FAMILIES

Two hooks, different lifecycle ownership

INITIALIZATION0 PARAMETERS
post__LEInitDoneEventLive Editor boundary

Runs after initialization, just before the UI appears. Manual UI execution happens after this moment; public autoload timing is not documented.

CAREER MODE3 PARAMETERS
pre__CareerModeEventFrequent Career bus

Many Career actions pass through it. Filter by `ENUM_CM_EVENT_MSG_*` instead of treating every event as the desired trigger.

PRE__Observe before

Callback precedes the original game function.

VS
POST__Observe after

Callback follows the original game function.

05 / CALLBACK CONTRACT

Match the original parameter count exactly

The creator makes this a hard rule. Career event data is heterogeneous, so a correct signature still does not authorize guessing what the opaque `event` pointer contains.

EVENTS MANAGER*events_manager

Pointer to the FC EventsManager instance.

EVENT MESSAGE IDevent_id

The enum value used for a safe equality filter.

VOID*event

Event-specific data; no complete typed layout is published.

function on_career_event(events_manager, event_id, event)
    if event_id == ENUM_CM_EVENT_MSG_DAY_PASSED then
        LOGGER:LogInfo("[FCLG] DAY_PASSED")
    end
end

AddEventHandler("pre__CareerModeEvent", on_career_event)

STOP: the Wiki-linked raw `enums.lua` currently returns 404. Current first-party scripts prove several constant names, but no complete browsable enum inventory should be promised from that broken URL.

06 / HANDLER MANAGEMENT

Registration returns nothing; the ID is the receipt

Because `AddEventHandler` has no return value, reproducible cleanup starts by comparing handler IDs before and after registration.

FUNCTIONINPUTACCOUNTABLE EFFECT
AddEventHandlerevent_name, function

Registers a callback; returns nothing

GetEventHandlersevent_name

Returns Event[] with name and unique id

RemoveEventHandlerevent_name, event_id

Removes one exact handler ID

ClearEventHandlersForEventevent_name

Removes every handler on that event—too broad for routine rollback

BLAST-RADIUS RULEREMOVE ONE ID≠CLEAR EVERY HANDLER

`ClearEventHandlersForEvent` is documented, but it can erase listeners owned by other scripts.

07 / CURRENT FIRST-PARTY CODE

The repository shows four event policies

These files establish real trigger vocabulary and callback shape. Only the tracker is observation-only; the other three write state and are evidence patterns, not generic starter scripts.

01
TRACKERpre__CareerModeEvent

Every Career event

Log ID + GetCMEventNameByID(event_id)track_cm_events.lua
02
FORM / MORALEpost__CareerModeEvent

Day · prematch · post-load

Reapply user-team valuesauto_max_user_team_form_morale_sharpness.lua
03
VPRO FITNESSpost__CareerModeEvent

Day · prematch · post-load

Resolve PAP ID; set fitness 99auto_max_vpro_fitness.lua
04
PAP PLAYSTYLESpost__CareerModeEvent

Six reset boundaries

Resolve PAP ID; reapply maskspap_all_playstyles.lua
MINIMAL OFFICIAL BASELINE9 lines of executable tracker codeOPEN SOURCE ↗

08 / VERSION-GATED DIRECT EXECUTION

A hotkey runs a file; it is not a Career event

The v26.3.6 changelog confirms an option to assign a Lua script to a hotkey. It does not publish the exact settings path, key-conflict behavior or persistence file, so the first defensible test is a direct one-line logger—not a listener registration.

MEMBER / SILVERv26.3.6LUA HOTKEY AVAILABLE

Current manifest tier with the documented addition.

PUBLICv26.3.5NO CHANGELOG CLAIM

Do not expect the v26.3.6 hotkey option here.

GAME PAIRv1.6.6BUILD 1.0.139.20381

Manifest maps both current editor versions to this executable.

KEY PRESSRUN ASSIGNED FILE
→
DIRECT CODELOG ONCE
→
PROOFONE TAGGED LINE

INFERENCE BOUNDARY: assigning the Workbench hotkey smoke-test file is supported by the changelog claim. The exact UI clicks must be verified in the installed v26.3.6 build because the creator has not published them.

09 / CONTROLLED RUN

One trigger, one tag, one log window

  1. 01
    PAIRRecord FC build and LE_VERSION

    Hotkeys require v26.3.6; every script still depends on a compatible game pair.

  2. 02
    BASELINEPreserve the log start time

    Close unrelated experiments and note existing handler counts.

  3. 03
    REGISTERExecute the listener once

    Keep its generated receipt hash and removal file.

  4. 04
    TRIGGERPerform one named football action

    Advance one day, load once or enter one prematch.

  5. 05
    PROVEFind the exact receipt tag

    Record timestamp, event name/ID and callback phase.

  6. 06
    REMOVERun the matching removal script

    Repeat the trigger once; the tagged line must not return.

10 / THREE DIFFERENT EXITS

Removal, restart and save recovery solve different problems

LISTENER STATERemove exact ID

Stops one callback in the current Lua state.

UNKNOWN REGISTRATIONRestart clean

Use when the stored ID is lost; verify handler counts after restart.

GAME DATARestore before-state

Removing code cannot undo values already written.

DO NOT USE AS ROUTINE CLEANUPClearEventHandlersForEvent("post__CareerModeEvent")

It has no ownership filter and can remove unrelated listeners.

11 / FAILURE MAP

Silence and noise point to different lifecycle faults

NO ATTACH LOGRegistration failed

Check syntax, import availability and the exact event name.

ATTACHED / NO TRIGGERWrong action or phase

Confirm the Career context and cross the named event once.

MULTIPLE IDENTICAL LINESDuplicate handlers

Remove stored IDs or restart; do not keep re-executing blindly.

HOTKEY / NO LINEVersion or assignment

Confirm v26.3.6 and test a direct logger without event registration.

UNKNOWN EVENT DATAPointer boundary

Log ID/name only; do not dereference an undocumented structure.

VALUE STILL CHANGEDRollback mismatch

Listener removal stops future work; use a recovery save for prior writes.

12 / VIDEO & INTENT AUDIT

Video teaches “execute”; source code teaches lifecycle

Five searches returned 75 slots and 45 unique videos. The relevant results concentrate on loading face/realism scripts; none established current handler IDs, targeted removal or the v26.3.6 hotkey settings contract.

75SEARCH SLOTS
45UNIQUE VIDEOS

2026 RUSSIAN GUIDE relevant title; captions throttled with HTTP 429.

FC26 REALFACES description confirms F9/open/execute only.

FC25 GUIDE no caption track; cannot control current API claims.

FIFA 21 TRANSCRIPT uses Cheat Engine and was rejected.

NO VIDEO PROVEDREGISTER → IDENTIFY ID → TRIGGER → LOG → REMOVE → NEGATIVE CONTROL

Creator API docs and current repository scripts control the technical answer.

13 / FAQ

Lua event questions answered by lifecycle

01What Lua version does FC 26 Live Editor use?

The current Lua API v2 Wiki identifies Lua 5.4.6 as the embedded scripting language.

02How do I run a Lua file manually?

The official Lua v2 page says to open Features → Lua Engine and execute the code. Current third-party videos show the same F9/open/execute mental model, but official documentation controls the route.

03What is the difference between pre and post events?

A pre__ handler runs before the original game function; a post__ handler runs after it. For observation-only logging, choose one phase and record it in the receipt.

04How many arguments must CareerModeEvent callbacks take?

Three: events_manager, event_id and event. The creator explicitly says callback parameter count must match the original function.

05Does LEInitDoneEvent use the same three arguments?

No. Its documented original declaration has zero parameters, so the callback shown on this page also takes zero.

06Why does my listener fire twice?

The API allows multiple handlers. Re-executing a registration file can therefore add another callback; the Workbench stores the newly discovered handler ID and removes its own previous ID before registering again. This idempotency wrapper is this site’s derived safeguard, not creator code.

07Can I remove only my own handler?

Yes, if you retained its unique ID. Use RemoveEventHandler(event_name, id). Avoid ClearEventHandlersForEvent for ordinary cleanup because it deletes every handler registered to that event.

08Where are Lua logs written?

The LOGGER Wiki says output appears in the Live Editor console and in the logs folder beside Live Editor. LogDebug also depends on DEBUG log level; the Workbench uses LogInfo for a visible smoke test.

09Can I assign a Lua script to a hotkey?

Yes in v26.3.6: the official changelog confirms the option. The current public manifest still lists v26.3.5, and the public docs do not publish the exact settings path, so this guide does not invent one.

10Should a hotkey script register an event handler?

Not for the first smoke test. A hotkey executes the assigned script directly; registering another handler on every key press would create unnecessary listener state. Use the direct LogInfo recipe first.

11Can I use the event pointer without knowing its structure?

Do not guess. The Wiki says event data differs by event_id and gives only examples, not a complete typed layout. The safe discovery script logs event ID/name without dereferencing the pointer.

12Does removing a listener reverse edits already made by its callback?

No. Removal stops future callbacks; it does not undo earlier database, resource or memory changes. Restore the before value or load the untouched recovery slot.

14 / EVIDENCE LEDGER

Sources, roles and explicit limits

Creator docs define API behavior; current repository code proves real patterns; the manifest and changelog gate versions. Videos contribute workflow vocabulary only.

01
LUA API v2 Events

Primary contract for the two event families, callback signatures and four handler-management functions.

↗
02
Event class

Primary definition of Event.name and the unique Event.id used for targeted removal.

↗
03
LUA API v2

Lua 5.4.6, Features → Lua Engine execution and global LE_VERSION.

↗
04
LOGGER

Console/log-folder output and the published log-level methods.

↗
05
Official Career event tracker

Current minimal pre-event recorder using helpers and GetCMEventNameByID.

↗
06
Official form/morale/sharpness script

Current three-event post-handler and immediate-in-Career pattern.

↗
07
Official VPRO fitness script

Current day/prematch/post-load event constants and active PAP identity pattern.

↗
08
Official PAP PlayStyles script

Current six-boundary post-event policy.

↗
09
Official changelog

v26.3.6 hotkey settings and Lua-script assignment claim.

↗
10
Current version manifest

v26.3.6 member version, v26.3.5 public version and current compatible game pair.

↗
11
Wiki-linked enums path

Current HTTP 404 audit: do not promise a browsable complete enum list at this URL.

↗
12
Video: FC25/26 Lua guide

Current 2026 demand signal; captions returned HTTP 429, so metadata supports no event claim.

↗
13
Video: FC26 realfaces Lua

Description documents F9 → Features → Lua Engine → open → execute; feature-specific and not event authority.

↗
14
Video: FC25 Lua script

Relevant title but no caption track; retained as a visual-workflow candidate only.

↗
15
Rejected legacy transcript

Normalized transcript targets FIFA 21 Cheat Engine, not FC 26 Live Editor; excluded from procedure.

↗