theartofme

Veteran
Veteran
Joined
Feb 21, 2019
Messages
35
Reaction score
44
First Language
English
Primarily Uses
RMMV
About
This plugin integrates Ink with RPG Maker MZ/MV. This allows you to write all your dialogue in Ink and display it using a simple plugin command, which for me at least is much easier than managing message box events!

Features
  • Run Ink scripts starting from arbitrary knots/stitches
  • Start battles and run common events
  • Share variables between Ink and RMMZ/RMMV
  • Define a cast of characters to allow names and faces to be put automatically into message boxes
The combined RMMZ/RMMV version has a couple of new features from the old RMMV version, notably around defining cast. This allows you to define an Ink script like so:

Code:
== dramatis_personae ==

PRIS: actor(2)

GALE: actor(3)

NPC: name(White Witch) image(Actor3, 3)

- > DONE


== some_npc_dialogue ==

PRIS: Who's that?

GALE: It looks like the White Witch!

PRIS: Is that the good one or the evil one?

GALE: White is usually good, but I'm not sure if we're in Narnia fanfic or not...

NPC: Ahem. It's impolite to talk about people's alignment in front of them.

NPC: Fortunately, I'm good, for today at least, so I won't turn you both into frogs.

- > DONE

When the above is run with the plugin command ink some_npc_dialogue it will show the dialogue in message boxes, with the actors' names and images used when they're speaking and the name and images set up for the NPC in the cast section when the NPC speaks.

See the help in the plugin itself for more details!

Download
Download link: view on Github (the same script is compatible with both RPG Maker MV and RPG Maker MZ)
Terms of use: this plugin is released under the terms of the MIT license, which allows you to use and modify the plugin as you wish so long as the license is retained unmodified. This means it is free to use for both commercial and noncommercial projects.
 
Last edited:

FrozenNorseman

Shivering
Veteran
Joined
Mar 14, 2018
Messages
93
Reaction score
311
First Language
Danish
Primarily Uses
RMMV
This definitely looks interesting. I haven't used Ink before, but I may have to have a closer look at it if I can implement it with this plugin.

Thank you :)
 

JJ Sonick

Villager
Member
Joined
Feb 23, 2013
Messages
24
Reaction score
5
First Language
English
Thanks for this! I've dabbled with Ink before when exploring Unity - it's great to see it integrated with RMMZ. I'll be testing it out soon. :LZSsmile:
 

Speedvore

RPG Making since RM95!
Veteran
Joined
Oct 3, 2015
Messages
39
Reaction score
12
First Language
English
Primarily Uses
RMMZ
This is a really great plugin and I've actually been hoping to find one that does something like this for a while now, so thanks so much for making this possible in MZ!

Do you have an example demo project that you could share that has some of these features working in MZ? The code you shared in this post was super helpful for me to get something working and better understand how to use the plugin. Though I've been having some trouble with the common event hashtag particularly, so I'd love to see an example of that working in a demo project to better understand how to implement it.
 

theartofme

Veteran
Veteran
Joined
Feb 21, 2019
Messages
35
Reaction score
44
First Language
English
Primarily Uses
RMMV
Here's a pretty rough test project:
Though I've been having some trouble with the common event hashtag particularly

Although it turns out that there was a bug with the common_event hashtag that caused a crash, so that was probably the problem you were having. A new version with the bug fixed has been uploaded to the github link; please use that instead of the version in the test project, since the one in the test project has some random stuff not related to the plugin itself.
 

Speedvore

RPG Making since RM95!
Veteran
Joined
Oct 3, 2015
Messages
39
Reaction score
12
First Language
English
Primarily Uses
RMMZ
Although it turns out that there was a bug with the common_event hashtag that caused a crash, so that was probably the problem you were having. A new version with the bug fixed has been uploaded to the github link; please use that instead of the version in the test project, since the one in the test project has some random stuff not related to the plugin itself.

Awesome thank you so much! The common events work perfectly now, and this project will serve as a really helpful reference when learning how to use all of the features available. :)
 

theartofme

Veteran
Veteran
Joined
Feb 21, 2019
Messages
35
Reaction score
44
First Language
English
Primarily Uses
RMMV
Minor update: the exported ink file (by default inkscript.ink.json) should now be put in the "ink" subfolder, instead of the "data" subfolder. Unlike RMMV, when RMMZ detects changes to the "data" folder (like exporting a new inkscript.ink.json) it tries to reload data in the editor, which will be bad if you've made any unsaved changes in the editor! Having a separate folder for ink data fixes this.
 
  • Like
Reactions: DK

faolae

Villager
Member
Joined
Nov 2, 2014
Messages
8
Reaction score
3
Primarily Uses
holy crap i didn't realize that someone cracked the code!! it's been a blast working with this plugin, thanks a bunch for making it! :D

however, i'm having some trouble. i'm trying to set up a nameable player character in inky and making that work with your plugin, but for whatever reason i'm running into a particular issue.

i set up the player character in inky like this:

Code:
VAR player = "Nara"
~ cast_link(player, 1, "Actor1", 0)

and i have the external functions from the plugin and their fallback functions set up in inky as well.

but when i tried to set up the name change event by using the #interrupt tag to stop inky from running, it keeps running inky regardless. for example, if i wrote:

Code:
== test ==
hello #interrupt
will this show up in rmmv?
-> next_divert

both "hello" and "will this show up in rmmv" show up in RMMV and inky will move on to the next divert, even though the console log says that inky stopped running.

so i had to use the -> DONE tag after my "name_input" knot in inky to make inky stop altogether in order to actually run the name input processing event.

this raised another issue. running the name input processing event in RMMV works as intended in changing the actor's name, but the change in the actor's name does not actually reflect in the inky script.

i tried setting up the player name variable in RMMV as the same name as it is in inky (so the variable name is "player" in both RMMV and inky), and whenever i tried reflecting that with {rmmv_var(player)}, i get a "0" in response. i tried the variable's number to be sure, {rmmv_var(1)}, and the same result, "0", still pops up.

not sure what i'm doing wrong, but please let me know if there's a solution to this. thanks!
 

theartofme

Veteran
Veteran
Joined
Feb 21, 2019
Messages
35
Reaction score
44
First Language
English
Primarily Uses
RMMV
Glad you're liking the plugin!

#interrupt is broken! I don't use it much myself, and I broke it accidentally. I'll fix it soon.

I've mostly been focusing on having the name defined in Ink, not RMMV, so I haven't handled that case very well - there's no sync from RMMV back to Ink. However, I did come up with a workarond:

Code:
VAR player = "Nara"
~ link_var(player, 1) // use whichever RMMV variable number you have free
~ cast_link(player, 1, "Actor1", 0)

link_var adds the sync both ways, not just one way, so Ink can change the RMMV variable and RMMV can change the Ink variable. Now you just need to set up the RMMV variable so that it contains an actor's name; if you're using the "Name Input Processing" event, then immediately after the name input processing event add a "Control Variables" event with the "operand" set to "script", and use this script:
Code:
$gameActors.actor(1).name()
Change the number to the actor you want the name of.

With all this in place, the actor name will sync back to RMMV.

Hopefully that unblocks you for now, next time I have a chance to work on the script I'll fix the #interrupt bug and add two-way syncing for actor names.

Note: my Ink script doesn't know about RMMV variable's names. You can name them anything you want, it only works with numbers.
 

faolae

Villager
Member
Joined
Nov 2, 2014
Messages
8
Reaction score
3
Primarily Uses
thanks a bunch for the help!! will keep that note in mind.
 

lordakisho

Villager
Member
Joined
Dec 28, 2020
Messages
6
Reaction score
1
First Language
English
Primarily Uses
RMMV
Minor update: the exported ink file (by default inkscript.ink.json) should now be put in the "ink" subfolder, instead of the "data" subfolder. Unlike RMMV, when RMMZ detects changes to the "data" folder (like exporting a new inkscript.ink.json) it tries to reload data in the editor, which will be bad if you've made any unsaved changes in the editor! Having a separate folder for ink data fixes this.
I may be doing something wrong. I created a folder named ink inside of the root of my game folder and placed the inkscript.ink.json in there. When I tried to run I got an error and could not launch game. I placed the file into the games Data folder and it works perfectly, But it does as you say and forces a restart with every update. Is there a particular way I need to set up or place the subfolder so the plugin can find it?

Thank you very much! This plugin is a massive life saver!
 
Last edited:

theartofme

Veteran
Veteran
Joined
Feb 21, 2019
Messages
35
Reaction score
44
First Language
English
Primarily Uses
RMMV
I may be doing something wrong. I created a folder named ink inside of the root of my game folder and placed the inkscript.ink.json in there. When I tried to run I got an error and could not launch game. I placed the file into the games Data folder and it works perfectly, But it does as you say and forces a restart with every update. Is there a particular way I need to set up or place the subfolder so the plugin can find it?

Also can you explain how expression works? I have mine set up as
== dramatis_personae ==
name: image(imagename, index)

If I want to use the expression to change to a different face image how would I code that, and would all the images have to be within the same fileset or can they be different. (When was learning how to make face images I saved each expression as an individual file.)

Thank you very much! This plugin is a massive life saver!
If it works in the data folder and not in the ink folder, try to download the latest script again. It shouldn't be able to find it in the data folder anymore.

Your ==dramatis_personae== is fine! If you want to change expressions, then you can make use of the expression() function. There's a (small!) example in the test project above. For expressions to work, all your expressions for an actor must be in the same image/fileset - there's no way for an expression to change images - and the same expression should be in the same place for each actor. It's best to use expression() in your ==init== knot so it's guaranteed to be run.

Call expression like any other Ink function, e.g.:
Code:
~ expression("happy", 1)
~ expression("sad", 2)

The expression name comes first, followed by the image index (starting from 0, going left-to-right then down). You can then use that expression as a hashtag, and it will change the image index. For example, if you have:
Code:
==dramatis_personae==
Alice: image(alicefaces, 0)
-> DONE
==init==
~ expression("happy", 1)
-> DONE

Then the following will use the first face in alicefaces.png:
Code:
Alice: This is my neutral face.

And this will use the second face in alicefaces.png:
Code:
Alice: This is my happy face! #happy
 

lordakisho

Villager
Member
Joined
Dec 28, 2020
Messages
6
Reaction score
1
First Language
English
Primarily Uses
RMMV
If it works in the data folder and not in the ink folder, try to download the latest script again. It shouldn't be able to find it in the data folder anymore.

Your ==dramatis_personae== is fine! If you want to change expressions, then you can make use of the expression() function. There's a (small!) example in the test project above. For expressions to work, all your expressions for an actor must be in the same image/fileset - there's no way for an expression to change images - and the same expression should be in the same place for each actor. It's best to use expression() in your ==init== knot so it's guaranteed to be run.

Call expression like any other Ink function, e.g.:
Code:
~ expression("happy", 1)
~ expression("sad", 2)

The expression name comes first, followed by the image index (starting from 0, going left-to-right then down). You can then use that expression as a hashtag, and it will change the image index. For example, if you have:
Code:
==dramatis_personae==
Alice: image(alicefaces, 0)
-> DONE
==init==
~ expression("happy", 1)
-> DONE

Then the following will use the first face in alicefaces.png:
Code:
Alice: This is my neutral face.

And this will use the second face in alicefaces.png:
Code:
Alice: This is my happy face! #happy
Thank you soo soo much! I played around with it and figured out the expression thing. I missed the ~ and code being so specific it was like nope. I’ll download the plug-in again. Thanks again!!
 

lordakisho

Villager
Member
Joined
Dec 28, 2020
Messages
6
Reaction score
1
First Language
English
Primarily Uses
RMMV
Thank you soo soo much! I played around with it and figured out the expression thing. I missed the ~ and code being so specific it was like nope. I’ll download the plug-in again. Thanks again!!
The redownload worked perfectly and expressions are rolling. Thank you so much!!
 

theartofme

Veteran
Veteran
Joined
Feb 21, 2019
Messages
35
Reaction score
44
First Language
English
Primarily Uses
RMMV
Awesome, glad I could help!
 

Aeonhart

Villager
Member
Joined
Oct 11, 2016
Messages
14
Reaction score
0
First Language
Spanish
Primarily Uses
Amazing plugin Will definitely use this one.

One question, Is it possible to display the text on a custom window? Im using HUD maker ultra to display 2 different windows, one for information and one for character dialogs The windows text get pulled from variables so this is a much easier and clean solution if I can manage to somehow pull the text from your plugin on both windows.

If not, do you have any recommendations ? I suppose I could use Galvs messages to move the main text window to where I want but I would need at least one additional window.

Also just as a side note, the plugin doesn't work with the newest version of INK.
 

theartofme

Veteran
Veteran
Joined
Feb 21, 2019
Messages
35
Reaction score
44
First Language
English
Primarily Uses
RMMV
Also just as a side note, the plugin doesn't work with the newest version of INK.

I just checked here and the file doesn't seem to have changed for 2 years, so I don't think it's an Ink version issue. Can you give me more details about what doesn't work?

One question, Is it possible to display the text on a custom window? Im using HUD maker ultra to display 2 different windows, one for information and one for character dialogs The windows text get pulled from variables so this is a much easier and clean solution if I can manage to somehow pull the text from your plugin on both windows.

If not, do you have any recommendations ? I suppose I could use Galvs messages to move the main text window to where I want but I would need at least one additional window.

Right now there's no built-in functionality to use anything other than the standard message box for outputting the main "story". There is a workaround: if the text in your windows supports RPG Maker escape codes, then you can use Ink there! The plugin has support for putting Ink content in via an escape code (so you can use it in character profiles, for example).

There are some limitations, though: in order to make sure things don't break, if Ink is used via an escape code, no state will be changed - you can still check variables and things like that, but any changes made (knots visited, variables altered, current story "position", etc.) will be rolled back. This should be fine for an information window - if it's passive and the player can't interact with the text then it should be fine. The information window can update to reflect changes in the rest of the game as normal, but those updates aren't automatic as far as Ink is concerned - you may have to do some work to make sure the information window is updated when you need it to be.

The syntax is: {ink:knot.stitch}

So for example, if you have the following in Ink:
Code:
    == main_character ==
    = bio
    A simple farm girl, everything changed when she discovered she was the chosen one!

You can show that in another window with the code: {ink:main_character.bio}
 

Aeonhart

Villager
Member
Joined
Oct 11, 2016
Messages
14
Reaction score
0
First Language
Spanish
Primarily Uses
I just checked here and the file doesn't seem to have changed for 2 years, so I don't think it's an Ink version issue. Can you give me more details about what doesn't work?
My bad, I meant Inky itself. It had an update recently and the exported scripts are no longer compatible.

Thanks for the swift reply. I'll try your suggestion:rhappy:
 

theartofme

Veteran
Veteran
Joined
Feb 21, 2019
Messages
35
Reaction score
44
First Language
English
Primarily Uses
RMMV
My bad, I meant Inky itself. It had an update recently and the exported scripts are no longer compatible.
Cool, thanks for the heads up! They finally released version 1.0 of Ink, and it's not backwards compatible, so inkjs has to update. Looks like they 're working on it here, but it's stalled for a couple of months now.

Here's the link to the previous version of Inky for you and anyone else running into this problem!
 

theartofme

Veteran
Veteran
Joined
Feb 21, 2019
Messages
35
Reaction score
44
First Language
English
Primarily Uses
RMMV
Update: Inkjs supports Ink 1.0 now, and apparently has for several months now, but they haven't updated the distribution files, so you have to build it yourself. This is easy if you are already familiar with using Nodejs - clone the inkjs repository and run npm install ; npm run build. If you'd rather not, I updated the LWP_Ink repository to include a pre-built ink.js.

The LWP_Ink repository now also has a (WIP) demo project, which is using Ink 1.0.
 

Latest Threads

Latest Posts

Latest Profile Posts

Turning a specific vibe into reality is incredibly difficult. For instance, this song is one of the ones I listen to when working on my post apocalyptic project, and getting it's "feeling" into the game has been a real challenge.

I don't just wanna regurgitate the numbers I see, I wanna actually understand the calculations I'm making so I'm probably gonna make a post later with some calculations and what I THINK they mean to get some advice and corrections.

Edit: All (Most) of these will be tested in game prior. I just wanna make sure I understand what's going on under the hood if you will.
my girlfriend calls all my little chibi art cute lol... funny considering that wasn't the original art style of the game.
100 problems in RMMZ 100 more problems take one down pass it around 101 Problems in RMMZ
Made some progress on my game, mostly mapping. Learned quite a bit in the process!.

M6eUoTT.png

Forum statistics

Threads
113,769
Messages
1,077,318
Members
147,804
Latest member
Dracul_JOSHI
Top