This is an Metamod plugin for integrating Node.js directly into Half-Life 1 engine. Plugin is intended as a more functional and convenient replacement for AMX Mod X or LuaMod. Also, it is compatible with Xash3D FWGS too.
|-- /
|-- deps # 3rdparty dependencies
|-- scripts # auxiliary scripts (generating the autocode)
|-- src # nodemod source files
| |-- auto # auto-generated code
| | |-- dll_events.cpp # events from gamedll
| | |-- engine_events.cpp # events from engine
| | |-- engine_functions.cpp # bindings to engine methods
| |-- lib # nodemod library external api to metamod
| |-- node # v8 and nodejs internal code and api
| |-- structures # structures between engine and jscode
| |-- bindings # util methods and core functional, passed to JS
Disclaimer: for now, Nodemod locked for only x86 architecture. In future we plans to support other architectures too.
Pre-installing dependencies
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install gcc-multilib g++-multilib cmake ninja-build
Building instruction
git clone --recursive https://github.com/TheEVolk/xash3d-nodemod.git
cd xash3d-nodemod
cmake -E make_directory build
cd build
cmake .. --preset linux-x86-debug
cmake --build . --config Debug
⚠️ We are planning to move examples to another repository
nodemod
directory in addons
/example
to addons/nodemod
addons/nodemod/dlls
directoryaddons/nodemod/dlls
directorylinux addons/nodemod/dlls/libnodemod.so
npm i
for npm or yarn
for yarn in the addons/nodemod
directoryaddons/nodemod/src
directory.You can run your TypeScript code using the ts-node library.
npm i ts-node
export NODE_OPTIONS="--loader ts-node/esm"
@types/gs-nodemod
library, for easy coding on typescript.