![]() |
|
[Plugin] FCNPC for open.mp - the classic FCNPC API, ported - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Releases (https://forum.open.mp/forumdisplay.php?fid=13) ---- Forum: Plugins (https://forum.open.mp/forumdisplay.php?fid=32) ---- Thread: [Plugin] FCNPC for open.mp - the classic FCNPC API, ported (/showthread.php?tid=4265) |
FCNPC for open.mp - the classic FCNPC API, ported - Xyranaut - 2026-05-26 FCNPC for open.mp - the classic FCNPC API, ported Repo: https://github.com/Mac-Andreas/open.mp-FCNPC Download (DLL + SO + INC + test script): releases/latest What is this Fully Controllable NPC - the classic FCNPC FCNPC_* Pawn API, re-implemented for open.mp. The original FCNPC is a SA-MP plugin: it drives NPCs by patching the samp03svr binary at fixed memory addresses and injecting raw RakNet packets. That cannot work on open.mp - a different, open-source binary with a proper component SDK. open.mp instead ships a built-in NPC engine (INPCComponent). This component is a compatibility layer: it re-exposes the FCNPC_* natives on top of INPCComponent, plus the remaining ~5% of FCNPC that open.mp's NPC engine does not provide. Existing FCNPC gamemodes run largely unmodified. Status All 182 FCNPC_* natives are declared in FCNPC.inc and implemented: 180 ported, 2 pending. Most call open.mp's INPC / INPCComponent / IPlayer directly; the features open.mp lacks are hand-rolled in this component. Full per-native breakdown is in port-status.md. A couple of the gaps it fills (things bare INPCComponent does not do):
Install
Code: #include <open.mp>Test it in-game (and see exactly what is ported) The release ships fcnpc_test.pwn (also in the repo under test/). It is two things at once: a feature test that drives every category of the API live, and a showcase of what this port adds over the bare open.mp engine - so you can verify, in-game, the parts of FCNPC that INPCComponent never implemented. Load it as a filterscript and type /fcnpc for a dialog menu:
Companion plugins The collision / heightmap / surfing natives call the standalone plugins at runtime (the same companion-plugin model the original FCNPC used) - install the open.mp builds:
Build from sourceopen.mp's Windows server is x86 and components must use the Microsoft C++ ABI. The repo includes a no-Visual-Studio cross-build (clang-cl + lld against the MSVC SDK via msvc-wine), a Windows CMake path, and a Linux .so path. CI builds FCNPC.dll + FCNPC.so and attaches them with FCNPC.inc to every tagged release. Credits
Bug reports / PRs welcome on the repo. Tested against open.mp 1.5.x. |