NightCoop SDK
Make your Cyberpunk 2077 mod work in a co-op session. It talks to the same mod on the partners’ machines, keeps shared state through the host and puts its own data on the players, cars and NPCs everyone sees.
The SDK and its documentation are in English.
Version 1 · 31 files · SHA-256 of the archive 52993842cf342c8a…
What your mod gets
One core, three ways in: a RED4ext plugin, redscript or Cyber Engine Tweaks, and a mod may mix them. Without NightCoop, or with its SDK switched off, the calls do nothing and your mod runs as before.
Messages to your mod on other machines
Reliable or not, to one player, to the host or to everyone who has your mod.
ChannelsFacts the host keeps
Keys and values, the same for everyone, late joiners included. A guest’s write is a request the host may refuse.
Shared stateYour data on what everyone sees
Attached to a player, a car or an NPC by its owner and delivered to every copy of it, on every machine.
Entity stateYour spawns, for everyone
Entities your mod spawns appear for the partners too; NightCoop says who leads each one and hands it over.
Shared spawnsEffects on NPCs a partner leads
Statuses, damage and pushes reach the machine where the NPC really lives, instead of a copy that only follows it.
Effects on NPCsA body from VR or motion capture
Feed a pose and the partners see it on your body; call NightCoop’s own actions by name.
Pose, actionsContent a partner does not have
A car, a weapon, a radio station or a pose from your mod: what NightCoop shows a partner without it, and how you pick it.
Content fallbacksThe co-op menu and votes
Your items in NightCoop’s menu, your questions in its voting window, and what each partner is doing right now.
Menu, votes, partnersA mod made only of data
A car, clothes, a tweak or a quest phase: a small *.nightcoop file tells NightCoop what it needs in a session.
From a single-player mod to a co-op one
The order the guides are written for. The concepts take ten minutes and save you the usual bugs.
- Read the conceptsSessions, the host’s authority, who owns what: Concepts.
- Pick your languageConnect and register, and keep working without NightCoop: C / RED4ext, redscript or Cyber Engine Tweaks.
- Sort what your mod doesWhat stays local, what goes through the host, what goes on an entity: Make your mod co-op.
- Run an exampleA shared counter in C++, redscript and Lua: Examples.
- Test with two playersWhen something does not arrive: Troubleshooting.
- Before you replace a game function
@replaceMethod, a CETOverrideor a detour: read What not to hook first.
Every page of the SDK
- StartConceptsSession, host and guests, authority, ownership, "in the host's world", the mod passport
- StartStart: C / RED4extRED4ext plugin: find NightCoop, register, hooks, unregister, shutdown
- StartStart: redscript
@if(ModuleExists("NightCoop")), registering in aScriptableSystem, events - StartStart: Cyber Engine TweaksThe same class from Lua, polling in
onUpdate, the helpersdk/cet/nightcoop_sdk.lua - GuideMake your mod co-opStep by step: turning a single-player mod into a co-op one; a checklist by kind of mod; common mistakes
- CodeExamplesA shared counter in C++, redscript and Lua: registering, shared state, a channel message
- ReferenceAPI referenceEvery function: C name, script name, what it does, return codes
- ReferenceLimits and versionsSizes, rates, queues,
NCSDK_VERSION, how the interface grows, the mod'sprotocol - GuideShared spawnsEntities your mod spawns: share, keep local, who leads (handoff to the nearest player, vehicles led by the driver), CET spawns
- GuideEffects on NPCsEffects on NPCs a partner leads (statuses, damage, pushes, time, sides, kills, roles), your own logic on the owner's machine, slowing your world
- GuideContent fallbacksContent a partner may not have: what NightCoop shows instead (cars, weapons, radio, weather, poses), how your mod names a fallback
- GuideManifestA mod without code (TweakXL, ArchiveXL, quest phases): the
*.nightcoopfile next to it - ReferenceWhat not to hookFunctions co-op relies on (script, native), its keys, data; what NightCoop finds itself and what it cannot find;
hookDeclare - GuideTroubleshootingLog lines,
NightCoopSdkStatus(), switches - ReferenceSecurityThreat model, what a partner can and cannot do through the SDK, checklists for port authors and reviewers
- CodePortsLet There Be Flight in co-op: a full mod built only on this SDK
Examples and ports
The examples show the core in a few dozen lines. The ports are full mods made co-op on the public SDK alone: each is installed next to the mod it bridges, and neither mod is changed.
RED4ext plugin
Finds NightCoop, registers, counts on the host, checks a guest’s request in a hook.
counter.cppA scriptable system
Registers in OnAttach, listens to events, compiles without NightCoop.
Cyber Engine Tweaks
The helper nightcoop_sdk.lua, a hotkey and polling in onUpdate.
Let There Be Flight
A full mod in co-op, built only on this SDK: the driver’s flight on the partners’ mirrors, thrusters and sound included; passengers in a flying car.
Flight portWhat is in the archive
The same files one by one. NightCoop installs its own .reds and adds them to the redscript compilation itself: read them here, never ship them with your mod. Ship only your own files and guard your NightCoop code with @if(ModuleExists("NightCoop")).
| File | What | Size | |
|---|---|---|---|
| LICENSE | MIT: the SDK and the port's own code | 1.0 KB | Download |
| README.md | What the SDK is: its layout, the port, shipping, the license | 2.6 KB | Download |
| SECURITY.md | Threat model: what a partner can and cannot do through the SDK, checklists | 15.9 KB | Download |
| cet/nightcoop_sdk.lua | Lua helper for Cyber Engine Tweaks mods: registration, polling in onUpdate | 37.4 KB | Download |
| docs/README.md | The contents of the guides | 3.3 KB | Download |
| docs/api.md | Guide: API reference | 47.1 KB | Download |
| docs/concepts.md | Guide: Concepts | 9.6 KB | Download |
| docs/content-fallbacks.md | Guide: Content a partner may not have | 8.8 KB | Download |
| docs/do-not-hook.md | Guide: What not to hook: functions co-op relies on | 46.0 KB | Download |
| docs/getting-started-c.md | Guide: Getting started: C / C++ (RED4ext plugin) | 6.8 KB | Download |
| docs/getting-started-cet.md | Guide: Getting started: Cyber Engine Tweaks (Lua) | 5.6 KB | Download |
| docs/getting-started-redscript.md | Guide: Getting started: redscript | 5.6 KB | Download |
| docs/limits-and-versions.md | Guide: Limits and versions | 5.1 KB | Download |
| docs/make-your-mod-coop.md | Guide: Make your mod co-op | 11.2 KB | Download |
| docs/manifest.md | Guide: The manifest: a mod without code | 3.2 KB | Download |
| docs/npc-effects.md | Guide: Effects on NPCs a partner leads | 17.3 KB | Download |
| docs/shared-spawns.md | Guide: Shared spawns | 11.8 KB | Download |
| docs/troubleshooting.md | Guide: Troubleshooting | 7.1 KB | Download |
| examples/c-counter/README.md | The C++ example: what it does, building, what you should see | 2.6 KB | Download |
| examples/c-counter/build.ps1 | Builds the plugin with MSVC | 2.8 KB | Download |
| examples/c-counter/counter.cpp | A RED4ext plugin with a shared counter | 10.2 KB | Download |
| examples/lua-counter/README.md | The Lua example: what it does, installing, what you should see | 2.0 KB | Download |
| examples/lua-counter/init.lua | A Cyber Engine Tweaks mod with a shared counter | 3.0 KB | Download |
| examples/redscript-counter/CoopCounter.reds | A redscript mod with a shared counter | 4.4 KB | Download |
| examples/redscript-counter/README.md | The redscript example: what it does, installing, using | 1.9 KB | Download |
| include/nightcoop_sdk.h | The C interface for RED4ext plugins, the source of truth for names and signatures | 72.6 KB | Download |
| ports/flight/README.md | The Let There Be Flight port: the driver's flight on the partners' screens | 2.5 KB | Download |
| ports/flight/THIRD_PARTY.md | Notice of Let There Be Flight (MIT) | 1.4 KB | Download |
| ports/flight/r6/scripts/NightCoopFlight/NightCoopFlight.reds | The port: one redscript file | 30.0 KB | Download |
| redscript/NightCoop/NightCoopSdk.reds | module NightCoop with the enums | 11.1 KB | Download |
| redscript/NightCoop/NightCoopSdkNative.reds | The class NightCoopSdk and the event class, for redscript; CET reaches the same class | 22.4 KB | Download |
Versions, license, security
- Version
- This is the first version of the SDK, and everything on these pages belongs to it. NightCoop installs its own
.redswith the build; ask at run time whether the SDK is there:NightCoopSdkGetreturns NULL in C andNightCoopSdk.Version()returns 0 in scripts when there is no SDK or the player switched it off. How the interface grows without breaking your mod: Limits and versions. - License
- The SDK (the header, the
.reds, the Lua helper, the guides, the examples and the port’s own code) is MIT: use it in any mod, open or closed. The port keeps the notice of the mod it bridges.