[XP] [SOLVED!] Lambchop's Journal Script, Display a Variable?

Hello all!

I'm using Lambchop's Super Simple Journal Script, and I would like to be able to display a variable in the quest journal text, a bit like the \V[n] command in the Show Text boxes--for example, "Slay 5 spiders" would count down to "Slay 4 spiders," "Slay 3 spiders," etc.

I could do this in the events, using conditional branches and approximately a million switches, but is there a more elegant way to do it right from the script?

(I hope this belongs in Support and not Requests, please move it if necessary!)
In Window_Journal, find this line:

Code:
item = @data[index]

and add this line after it:
Code:
item.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }

I haven't tested it, but this is pulling in the variable substitution logic that's used in messages.
It worked like a charm! Thank you so much, Shaz!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/xp-solved-lambchops-journal-script-display-a-variable.141899/