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

Modified Text not working. #17

Open
TehHyperGamer opened this issue Jan 15, 2021 · 0 comments
Open

Modified Text not working. #17

TehHyperGamer opened this issue Jan 15, 2021 · 0 comments

Comments

@TehHyperGamer
Copy link

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant