Package: inkcpp-py
inkcppInkle Ink C++ Runtime with JSON -> Binary Compiler.Ink Proofing Test Results:https://jbenda.github.io/inkcpp/proofDoxygen Documentation:https://jbenda.github.io/inkcpp/htmlProject GoalsFast, simple, clean syntaxNo heap allocations during execution (unless in emergencies)No external dependencies, but extensions available forUnrealandSTLby opt-in preprocessor definesSupport for multiple "runners" (not ink threads) running in parallel on a single story that can optionally share a global variable/state store (but with their own callstack, temporaries, etc.)Multi-thread safeCurrent StatusRuninkcpp_cl.exe -p myfile.jsonto execute a compiled Ink JSON file in play mode. It can also operate on.inkfiles butinklecate.exemust be in the same folder or in the PATH.inklecatecan be downloaded from theofficial release pageand will be downloaded from CMake at  configure time (located atbuild/unreal/inkcpp/Resources/inklecate).Without the-pflag, it'll just compile the JSON/Ink file into InkCPP's binary format (see the Wiki on GitHub).All features of ink 1.1 are supported, and checked withink-proof.In addition a UE Plugin inclusive BluePrints are provided and python bindings based onpybind11.KeyFeatures: snapshots, observers, binding ink functions, support inkfunction fallbackUnreal PluginThe current version of the UE plugin can be downloaded from therelease pagewith te corresponding name of the OS (e.g. win64-unreal).
Place the content of this file at your plugin folder of your UE project and at the next start up it will be intigrated.A example project can be foundhere.Code for the Unreal plugin is located in theunrealdirectory. In order to install it, runcmake --install . --component unreal --prefix Path/To/Unreal/Plugins/which will add aninkcppfolder there with the.uplugin, the code for the UClasses, and all the inkcpp source files required.config.hwill automatically detect it is being built in an Unreal plugin environment and disable STL and enable Unreal extensions (FString support, Unreal asserts, CityHash, etc.).If you compile the UE Plugin by your self feel free to visit thewiki pagefor a more debug oriented build process.Use standaloneGrep the current version from therelease pagedepending on your OS (e.g. macos-cl).unpack it to a location found by your pathrun your story:inkcpp-cl -p story.jsonif you want to compile.inkflies directly make sureinklecateis in your path. If you not have it you can grep it from theofficial pageNice features for testing:predefined choice selectionecho 1 2 1  | inkpp-cl -p story.(ink|json|bin)create snapshots to shorten testing:create snapshot by entering-1as choiceecho 1 2 -1 | inkcpp-cl -p story.inkload snapshot as an additional argumentecho 1 | inkcpp-cl -p story.snap story.inkIncluding in C++ CodeInstructions:Download the for your OS macthing lib archive from therelease page(e.g. linux-lib).The following must be linked into your build solution for your C++ to compile correctly:include/ink: contains important shared headers.For a Visual Studio project, link this directory as an Include Directory in VC++ Directories.lib/inkcpp.libandlib/inkcpp_compiler.lib: contains the library code for the InkCPP runner and compiler, respectively.For a Visual Studio project, link these files as Additional Dependencies in Linker->Input.You don't need to link the compiler if you're not using it within your program.Reference the headers in your code like so:#include<ink/story.h>#include<ink/runner.h>#include<ink/choice.h>if you use cmake checkout the (wiki)[https://github.com/brwarner/inkcpp/wiki/building#cmake-example] for including the library via cmakeExample#include<ink/story.h>#include<ink/runner.h>#include<ink/choice.h>usingnamespaceink::runtime;intMyInkFunction(inta,intb){returna+b;}...// Load ink binary story, generated from the inkCPP compilerstory*myInk=story::from_file("test.bin");// Create a new threadrunnerthread=myInk->new_runner();// Register external functions (glue automatically generated via templates)thread->bind("my_ink_function",&MyInkFunction);// Write to coutwhile(thread->can_continue())std::cout<<thread->getline();// Iterate choicesfor(constchoice&c:*thread){std::cout<<"* "<<c.text()<<std::endl;}// Pick the first choicethread->choose(0);Configuring and Building (CMake)To configure the project...Install CMakeCreate a folder calledbuildFrom the build folder, runcmake ..CMake will then generate the necessary build files for your environment. By default, it generates Visual Studio projects and solutions on Windows and Makefiles on Mac and Linux. You can change this using CMake's command line options (seecmake --help). It supports pretty much anything.The documentation can be build iff Doxygen is installed withcmake --build . --target doc. The documentation can then be found in athtml/index.html.To build, either run the generated buildfiles OR you can usecmake --build . --config <Release|Debug>from the build folder to automatically execute the relevant toolchain.To install the different components usecmake --install . --component <lib|cl|unreal>libC++ library to link againstclcommand line applicationunrealUE-pluginFor a more in depth installation description please checkout thewiki.TroubleshootingIf you recieve an error like "Mismatch Detected for Runtime Library," it means you are probably using the Release version of the.libfiles, but are running under a Debug configuration. To fix this, you can manually copy the.liband.pdbfiles frombuild/inkcpp/Debugand/orbuild/inkcpp_compiler/Debugafter running the build process again with--config Debug(see above). Then, you can add separate Debug and Release directories in the installed package folder, and change the paths based on your selected configuration in Visual Studio or otherwise, so that it links the Debug.libfor the Debug build, and the Release.libfor the Release build.Running TestsRunctestfrom the build folder to execute unit tests configured with CMake. Usectest -Vfor more verbose error output.Right now this only executes the internal unit tests which test the functions of particular classes. Soon it'll run more complex tests on .ink files using ink-proof.Python BindingsThe easy way to start is installing it with pip:pip install inkcpp_py.
An example can be found atexample.py.
To build it from source use:gitclone--recurse-submoduleshttps://github.com/JBenda/inkcpp.git
pipinstallinkcppThe python bindnigs are defined ininkcpp_pysubfolder.A downloadable version of theinkcpp_pylib can be found at therelease pagewith the name<os>_pyeglinux_py.DependenciesThe compiler depends on Nlohmann's JSON library and the C++ STL.The runtime does not depend on either. IfINK_ENABLE_STLis defined then STL extensions are added such as stream operators andstd::stringsupport. IfINK_ENABLE_UNREAL, then FStrings, Delegates and other Unreal classes will be supported.NOTE: There is still some lingering C standard library calls in the runtime. I will be guarding them with anINK_ENABLE_CSTDor something soon.