Giter VIP home page Giter VIP logo

unrealink's Introduction

Unreal Ink

This is a plugin allowing you to use the excellent dynamic narrative scripting system, Ink, in Unreal Engine. Visit the Ink repository for more information on it. The plugin still isn't quite done and is lacking a lot of polish and a few features from the original Ink system, but otherwise it's quite usable as is. Please don't hesistate to contact me for any problems or help you need. I live at @dave_colson on twitter and you can email me at [email protected].

Example Project

How to use

To compile, simply open up the Build.bat and fill in the UE4DIR var with the path to your 4.25 installation. Once you've compiled it and loaded it into your project, you can use the plugin either through C++ or more easily through blueprints. First though we need to go over importing Ink assets.

Load module

Load the module using this line at an appropriate location: FModuleManager::Get().LoadModule("Ink");

Importing Ink Assets

The plugin provides a new asset that represents ink stories (UStoryAsset). You can import plain .ink files and the plugin will automatically compile them for you. This way you can set up auto-reimporting of the ink files which will be recompiled on import. Simply import the .ink file as you would any other file.

Use through blueprints

After importing your .ink file, you can create a new story node and select your story asset in the dropdown.

New Story

This will return a story instance, which can then be used just like as is shown in the inkle documentation files. The idea is that there's a node for every function available in the Ink API, though a few are missing.

I have provided an example project demonstrating a basic usage of the system, which only uses blueprints, so go check that out.

Use through C++

It's very similar to the blueprints here as well. Load a story asset file, call UStory::NewStory(); and then all existing function calls are basically the same as in the Inkle library, with a couple of exceptions (variadic functions). I will provide an example of this soon. For now take a look at the Story.h file for a list of possible function calls.

Notable Problems

This plugin isn't complete and there are some lacking features and/or problems, so be aware of them

  • Variable Observers are not implemented yet These are now implemented
  • Execute Function and Bind Function calls are not implemented yet
  • The Profiler and profile node stuff isn't implemented yet
  • The plugin does not automatically package the mono and ink assemblies when you package your game, you have to do this by youself
  • There's probably bugs I haven't yet found
  • I haven't tested on other platforms yet, but I would like to ensure it works

How does it work?

It works by embedding the Mono runtime directly into the plugin in Unreal, and then has a special C# assembly called InkGlue, which marshalls data and function calls between C# and C++ to lessen the amount of complicated binding code present in C++. This does however come with some complications for your projects. The Binaries found in the ThirdParty folder need to be packaged alongside your game otherwise it will not run. They mostly consist of mono assemblies, which should be fine on most platforms. Though it does contain the windows Mono library. I've included the windows mono binaries, since I work on Windows, but you will need to source those libraries yourself if you want it to work on Mac or Linux. Hopefully I can get around to doing that properly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.