[SOLVED] A way to know how many words are in your game?

Hi, my main platform is MV. So far I've been working on our project for almost a year now, and nearing the next version release.

I've created many additional events, which contained lengthy dialogues.

Now I haven't manually kept track of it but is there a way to find out how many words are currently in your project?
Basically the words inside the show text command is what counts the most.

I want to inform people of how many words have been added to the updated version on the change log.

A plugin perhaps?
This should count every word on every event of every map in the "Show Text" command. Open the console during playtest by pressing F8 and paste this in:

Code:
let totalWordCount = 0
function countWordsOnMap(mapJson, mapId) {
    return new Promise((resolve, reject) => {
        let mapWordCount = 0
        mapJson.events.forEach(event => {
            if (event) {
                event.pages.forEach(page => {
                    page.list.forEach(listItem => {
                        if (listItem.code === 401) {
                            mapWordCount += listItem.parameters[0].split(' ').length
                        }
                    })
                })
            }
        })
        console.log(`Map ${mapId} ${mapJson.displayName} has ${mapWordCount} words.`)
        totalWordCount += mapWordCount
        resolve()
    })
}
async function countAllWords() {
    const mapInfosPromise = await fetch('data/MapInfos.json')
    const mapInfosJson = await mapInfosPromise.json()
    const promises = mapInfosJson.map(async info => {
        if (info) {
            const mapPromise = await fetch(`data/Map${info.id.toString().padStart(3, '0')}.json`)
            const mapJson = await mapPromise.json()
            return countWordsOnMap(mapJson, info.id)
        }
    })
    const values = await Promise.all(promises)
    console.log(`The total number of words is: ${totalWordCount}`)
}
countAllWords()
Mein Gott! It worked, and it tells me that our project currently has 46,821 words.
F0If9tf.png

And it even shows the Map ID and Name. that is awesome!
It's true, I really have typed so much in that Camping Site maps.
Moved to: JS Plugin Requests

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/solved-a-way-to-know-how-many-words-are-in-your-game.107302/