Nucleus handler tools › Docs › Checks

Code in the wrong place

Errorcallback-only-globalA Nucleus check · Nucleus fails: the handler doesn't load, or the session ends.

Why it matters

Context, Player, PlayerList, Handler and ProtoInput only exist while Nucleus runs a callback such as Game.Play. Used at the top of the handler, they make it fail to load.

Example

✗ Wrong

var width = Context.Width;

✓ Right

Game.Play = function () {
  var width = Context.Width;
};

How to fix it

Move the line into Game.Play (or the callback it belongs to).

Turn it off, or change how it shows

Each check can be shown as an error, warning, info or hint, or turned off. VS Code: "splitscreenme.lint.rules": { "callback-only-global": "off" } in your settings. Notepad++: Plugins › Nucleus Co-op handlers › Settings. Command line: ncdev lint --rule callback-only-global=off. Other editors: the lint.rules setting of ncdev lsp.

Is this right? Tell us what's wrong
Stuck, or not sure? Ask other handler authors: Discordr/nucleuscoop