ink-unity-integration icon indicating copy to clipboard operation
ink-unity-integration copied to clipboard

PlayMaker integration

Open ladyisidore opened this issue 8 years ago • 11 comments

How difficult would it be to integrate ink with something like PlayMaker? I'm assuming it wouldn't be impossible, but is this something I could do myself with some Unity scripting or would it be more complicated than that?

ladyisidore avatar Sep 25 '16 19:09 ladyisidore

I'm actually not sure! I've never used it myself, but I've seen that a lot of popular plugins have PlayMaker integration, so maybe it's something we should look at, if there was enough interest. If you ever did make anything for it let us know!

tomkail avatar Nov 23 '16 10:11 tomkail

Hi. I'm trying to achieve this same thing. In my studio we are using Ink language to write the dialogs, but the support of Ink run time it's not enough for us. We want the dialog system to trigger animations and perform many other actions in the game. So Playmaker is a good choice so far. As there are no integrations available, I'm interest in writing this integration. Should I read the json file to generate the playmaker FSM or is there a class that will provide the specifications of the ink file without need to consider the version of the file?

joaobsneto avatar Feb 22 '17 17:02 joaobsneto

Has anyone made any progress with Playmaker integration? I'm doing simple things, like interacting with Ink variables -> Playmaker FSM variables, but would be awesome to be able to use Playmaker to manage the game content, line by line -- i.e. while(_story.canContinue), the story.currentChoices list and loop back, etc.

Not a very experienced C# developer (hence Playmaker) but I started with passing canContinue into an FSM variable, then using that to instantiate a text prefab.

At this point might just be better continuing to learn C# :)

robbiew avatar Apr 26 '17 17:04 robbiew

I did, but in a very specific way. We have a conversation system in Playmaker that is very tedious to set up. I code a tool that generate Playermaker FSM from a Ink file. I made a sub language and I did not implemented all the functions from Ink in it. The result is pretty good, but it works only for my game. In your case, you mean to create Custom Playermaker Actions that interact with some Ink runtime object?

joaobsneto avatar Apr 27 '17 02:04 joaobsneto

I've yet to write custom Playmaker actions, but I'm just using some functions to deal with text/choice prefab instantiation that work well, and then I'm just using Ink tags > FSM variables to trigger changes at game runtime. Simple, but works OK.

robbiew avatar Apr 27 '17 20:04 robbiew

Hello!

I made some simple playmaker actions that could be a bit buggy (and there's almost no error handling yet), but they work in the testing I've done. In any case, here they are if anyone else would like to try them out. With a bit more work, could be something to add here or to the Playmaker Ecosystem.

I've not quite figured out how to bind an external function to a playmaker event or deal with variables that aren't typed correctly when someone tries to set the wrong thing. I would also still like to add the save/load stuff and variable observers to it.

How it works: Stick the PlaymakerInkProxy script on some game object in the scene, and give it the JSON file as usual. All the Actions need to access the proxy to work. Both InkStoryContinue and InkGetNextChoice work with the usual Loop-Finished mechanic that Playmaker uses for arrays and other stuff.

What works: Get/Set Variables as long as you know what you're doing and aren't trying to get the wrong type (not sure if bool is working though) Get Tags (global or all) StoryContinue & Choices Go to Story Path

Still to do: Load / Save Read / Visit Counts Variable Observers (The syntax of the delegate function in the example file is a bit over my head) External Function Binding to an event

InkPlaymaker.zip

rvilgalys avatar May 25 '17 16:05 rvilgalys

@rvilgalys , thank you for sharing your Playmaker actions!

wetcircuit avatar Apr 10 '18 13:04 wetcircuit

If the playmaker package is still getting worked on, we should probably link to it from the front page, since I'd imagine there are lots of devs who'd love this!

tomkail avatar May 07 '18 07:05 tomkail

I picked up Playmaker and am hoping to figure out how to use it with ink... sounds like it’s a challenge?

chrysoula avatar May 10 '18 21:05 chrysoula

@chrysoula If you grab those actions, they will work for the basics of running through Ink and getting the input / output.

@tomkail -- I'll see if I can make some time and improve these a bit -- since writing these I've gotten much better at C#, but that also means I don't use Playmaker nearly as often. Would love to contribute something useful though! Ink is absolutely fantastic to work with.

rvilgalys avatar May 12 '18 14:05 rvilgalys

Hi, I assume @rvilgalys has moved on from Playmaker, but maybe someone could help out with actions for Load / Save?

I can't see any way to Load/Save through Playmaker's Call Method on the proxy component (or the Basic Ink Example Script).

I can save individual variables externally via Playmaker, but it would be great to have the option to load and save the actual ink….

wetcircuit avatar Jul 18 '18 16:07 wetcircuit

Does anybody have anything to share with the community RE playmaker? Else I'll close this out :)

tomkail avatar Oct 23 '22 22:10 tomkail