Forum rules - please read before posting.

Ink Integration

I've made a Unity package that lets you integrate Ink and Adventure Creator. As well as using Ink for your dialogue, it also lets you call actions from your Ink script like character movement, animation and playing sounds. It's still a work in progress, so might be a little rough around the edges.

https://github.com/Graham-Hayes/AC-Ink-Integration

«1

Comments

  • Thank you, this looks great. I was actually considering writing a tool which would allow me to write speech and dialogue in a simple text form, but of course Ink solves that problem better than I ever could. Having access to this in Adventure Creator helps me a lot!

  • Thank you for making this! It is so nice to be able write and edit in ink. :smile:

  • Thanks. This looks great.

  • I've started development of my next game so I've started adding features and squashing bugs to this package.

    You can now add/remove inventory items, switch cameras and change scenes. You can also query if the player has a particular item in their inventory from your Ink script. And I added a new action which lets you check the visit count for a particular knot/stitch.

  • Wow that looks really interesting! I'll be monitoring this for sure...

  • edited March 2020

    I just used this package.. worked in 2019, but not 2018. Unity 2018 it Generated lots of namespace errors. Got the example to run. Now what? I like AC's dialog, I just noticed this in the example. It's not bad. I'm not sure where to go. I think I'll go back to watching Chris' YouTube videos.

  • I'm wondering what to do now? How to add some Ink to the Demo scene as I following along with the tutorial? Example: Player hits a hotspot like sword, and a INK file plays?

  • The package gives you a new action called Ink Script which is under Third Party, use that instead of AC's normal dialogue action as per the readme on git. If you're new to AC you might want to stick with vanilla AC for a bit, at least until you have a reasonable understanding of how it works.

  • thanks Graham that's what I'll do! I always get sidetracked, and never finish..and think if I buy this system, oh this way is so much better! I get like a pup chasing his tail.

  • First of all, thank you for creating this. I've learning Ink and being able to use it in a current project like this is very exciting.

    Unfortunately, I recently tried using this plugin with Unity 2019.3.10f1 and it returned around 12 or so errors I've no clue how to fix.

    Most of them boil down to a variation of:

    Assets\AdventureCreator\Scripts\Actions\ActionInkRunScript.cs(995,39): error CS0122: 'GVar.val' is inaccessible due to its protection level

    The others are:

    Assets\AdventureCreator\Scripts\Actions\ActionInkRunScript.cs(1098,54): error CS7036: There is no argument given that corresponds to the required formal parameter '_filename' of 'SceneInfo.SceneInfo(int, string)'

    Assets\AdventureCreator\Scripts\Actions\ActionInkRunScript.cs(247,66): error CS1061: 'Conversation' does not contain a definition for 'IsActive' and no accessible extension method 'IsActive' accepting a first argument of type 'Conversation' could be found (are you missing a using directive or an assembly reference?)

    I wondered if attaching the script to the persistent engine would help, but it isn't allowing me to do so because of the errors.

  • Welcome to the community, @thatguynm.

    I'm not the author of the Ink integration, but the errors you're reporting are because of an incompatibility with the latest AC release.

    Improvements made to AC in v1.71 meant that the API got changed a bit. You can get API references to things like the GVar class in the scripting guide.

    Try this:

    https://pasteall.org/7Unw/raw

  • Thanks @ChrisIceBox!

    @thatguynm, sorry about that, I was aware the latest release broke the integration, it is in need of updating so I should probably get right on that!

  • @thatguynm The integration is now working with AC v1.71, can confirm the API got changed a bit!

  • Wow, thank you both for the quick reply.

  • @GrahamHayes Got the integration up and running and it works perfectly, thank you for all your work on it.

    My only issue so far is that I'm having trouble wrapping my head around how variables are handled between ink and AC, specifically using global boolean variables between the two.

    I see there is the 'EXTERNAL getValue(a)' but the instructions say that a stands in for the variable ID number. However, inputting that in inky throws an error and refuses to let me export. Or is a meant to the the string variable name?

    Also once I get the variable set up, do I need to set the value within ink before I can use it (using the #set tag)? Can I just use it like a regular ink variable, or is there a specific way I need to use them?

    Sorry if this ends up being more of an ink question than an ink integration question.

  • Assuming you have 'EXTERNAL getValue(a)' at the top of your ink file, put an empty function declaration below that:

        == function getValue(a) ==
        ~ return true
    

    That should really be in the readme shouldn't it?

    getValue and #set are for AC variables only. So they need to be set up in AC first, I don't recommend having a corresponding variable in ink, otherwise they may end up as different values.

  • Updated this again to work with the latest version of AC v1.74.5. This was a large overhaul and now uses the various static methods in AC's Actions to create an Action List.

  • Great work, thanks for the update!

  • @GrahamHayes

    Thanks for this!

    I've been integrating this into an AC project. When running the Ink Script Action, instead of using my INK UI canvas, it continues to just use ACs subtitle UI and does not present ink options (but still shows text from the Ink story). Not sure what is going on there.

    I will try this out again in a fresh project to see if this is just an issue I've caused.

  • @myq sorry for the late reply. Using AC's subtitles is the expected behaviour, you'll have to tinker with the code to use something different. You also have to set up a separate menu for choices and assign it to the ACInkIntegrationScript attached to your PersistantEngine.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.