Skip to content
This repository was archived by the owner on Sep 8, 2023. It is now read-only.
This repository was archived by the owner on Sep 8, 2023. It is now read-only.

Modified Text not working. #17

@TehHyperGamer

Description

@TehHyperGamer

So I wanted to try my hand at scripting a scenario and I made a test script based off of the default script for all scenarios. The first two are the test I guess "Scenes" as I referenced them in my script, and the third one is the control. The modified text showed up at first but when I reloaded my script, it stopped displaying the modified text and just displays the input text.

This is my script:

const Scene1 = (text) => {
let modifiedText = text
const lowered = text.toLowerCase()

if(lowered.includes('you are not king') || lowered.includes('you are no longer king')) {
state.isKing = false

console.log('Player is no longer the king!')

modifiedText = text + '\nYou are no longer the king!'

}
return { text: modifiedText }
}

Scene1(text)

const Scene2 = (text) => {
let modifiedText = text
const lowered = text.toLowerCase()

if(lowered.includes('you are king') || lowered.includes('you become king')) {
state.isKing = true

console.log('Player is the king!')

modifiedText = text + '\nYou are the king!'

}
return { text: modifiedText }
}

Scene2(text)

const Scene3 = (text) => {
let modifiedText = text
const lowered = text.toLowerCase()

if(lowered.includes('control line') || lowered.includes('controlled line')) {
state.isKing = true

console.log('Control')

modifiedText = text + '\nControl.'

}
return { text: modifiedText }
}

Scene3(text)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions