Page 1 of 1

[EOS Text Interpreter] Write teases as text

Posted: Sat Feb 26, 2022 9:58 am
by Domi-nation
Hey guys!

To make my tease creation process faster I'm creating a text parser and an interpreter to be able to write teases as text that would then be interpreted and rendered in eos.

It still relies on eos and thus is limited by the features eos offers (no access to the DOM, not being able to create notifications in javascript). But new features can be added with workarounds (for example: persistent notifications, loops, ...)

I'm in the early stages and quickly created a first version of both parser and interpreter. There are still bugs and non implemented feature.

I wanted to get an early idea if some of you would be interested and would use it if I made it publicly available. In that case we could discuss together what other interesting features could be added and how to improve the pseudocode.

Also this interpreter can be used for only parts of the tease (ex: 1 or 2 pages) while still having the rest of the tease written as usual.

Here are some advantages / disadvantages:

Advantages:
  • Quicker to write
  • Quickly change the default settings that get applied to the whole tease / page (ex: allowSkip, timerDuration, etc)
  • Possibility let the user change the default settings
  • Persistent notifications
  • Easy to create different routes
  • Easy to use random texts and alternative texts
  • In the future: Loops
Disadvantages:
  • Text disappears after each line
  • Need to add notifications manually and give them a unique Id
  • Need to learn the pseudocode
  • Boilerplate things to add (give images and id) => this might be automated in the future
This is what it looks like for now:
A text written like this:
Spoiler: show
[random-dialogs]
edge: Edge for me/Edge!/Would you edge for me?

[default]
allowSkip: true
persistantNotification: persistant
timerDuration: 10
timerMode: secret

[step]
image: caprice_1
text: Hey <name>!
eval: var edgeNumber = 5

[step]<mod:long-dialog>
I will explain to you how this would work
Each step would be a loop to the same page and the desired content would be rendered
Here in the long dialog you could write well ...
Long dialogs
Each line would be a say action in the tease
You could also add default settings for each page at the beginning
For example here the users can skip
And there is a persistant notification with the id "persistant" on the right

[step]
text: Notifications would be added manually to the tease and would be rendered by a unique id
notification: edge

[step]
image: caprice_2
text: <tease.getRandomDialog('edge')>

[step]
image: caprice_3
text: Text could be _styled_ in **Markdown**
text-alt-1: Alternative texts are chosen randomly

[step]
image: caprice_4
text: Choices would also need to be added manually to the tease and would be rendered by a unique id
choice: choice_1

[step-alt-1]<mod:if (edgeNumber > 10)>
image: caprice_5
text: Alternative routes could be added depending on conditions
choice: choice_1

[step-alt-1]
text: Once in the route it would follow its course

[step-alt-1]
text: Before going back to the main route on the next step

[step-alt-1]<mod:if (edgeNumber > 5)>
text: It would be also possible to add as many alternative routes as you want

[step-alt-1]
text: If checks with the same alt route id are treated as else if

[step-alt-1]<mod:else>
text: The conditions are evaluated in order and the first route that meets the conditions is selected

[step]
text: Timers could be added with the duration
timer: 5

[step]
text: If timer is set to true the default duration is selected
timer: true
timerMode: visible

[step]
text: You could use evals as usual
eval: edgeNumber++

[step]
text: And when this part is over you can change page
goToPage: EndDemo
[end-file]
Is parsed to this:
Spoiler: show

Code: Select all

var pageSettings = {
	defaultSettings: {
		allowSkip: true,
		persistantNotification: 'persistant',
		timerDuration: 10,
		timerMode: 'secret',
	},
	randomDialogs: { edge: ['Edge for me', 'Edge!', 'Would you edge for me?'] },
	steps: [
		{ image: 'caprice_1', text: 'Hey <name>!', eval: 'var edgeNumber = 5' },
		{ text: 'I will explain to you how this would work' },
		{
			text: 'Each step would be a loop to the same page and the desired content would be rendered',
		},
		{ text: 'Here in the long dialog you could write well ...' },
		{ text: 'Long dialogs' },
		{ text: 'Each line would be a say action in the tease' },
		{
			text: 'You could also add default settings for each page at the beginning',
		},
		{ text: 'For example here the users can skip' },
		{
			text: 'And there is a persistant notification with the id "persistant" on the right',
		},
		{
			text: 'Notifications would be added manually to the tease and would be rendered by a unique id',
			notification: 'edge',
		},
		{ image: 'caprice_2', text: "<tease.getRandomDialog('edge')>" },
		{
			image: 'caprice_3',
			text: [
				'Text could be _styled_ in **Markdown**',
				'Alternative texts are chosen randomly',
			],
		},
		{
			image: 'caprice_4',
			text: 'Choices would also need to be added manually to the tease and would be rendered by a unique id',
			choice: 'choice_1',
		},
		[
			{
				condition: 'edgeNumber > 10',
				steps: [
					{
						image: 'caprice_5',
						text: 'Alternative routes could be added depending on conditions',
						choice: 'choice_1',
					},
					{ text: 'Once in the route it would follow its course' },
					{
						text: 'Before going back to the main route on the next step',
					},
				],
			},
			{
				condition: 'edgeNumber > 5',
				steps: [
					{
						text: 'It would be also possible to add as many alternative routes as you want',
					},
					{
						text: 'If checks with the same alt route id are treated as else if',
					},
					{
						text: 'The conditions are evaluated in order and the first route that meets the conditions is selected',
					},
				],
			},
		],
		{ text: 'Timers could be added with the duration', timer: 5 },
		{
			text: 'If timer is set to true the default duration is selected',
			timer: true,
			timerMode: 'visible',
		},
		{ text: 'You could use evals as usual', eval: 'edgeNumber++' },
		{
			text: 'And when this part is over you can change page',
			goToPage: 'EndDemo',
		},
	],
}

And then the interpreted would render this: Eos Tease to the user for now

Re: [EOS Text Interpreter] Write teases as text

Posted: Sat Mar 05, 2022 2:12 pm
by JupyterKing
This is a great job! I personally think, this will save a lot time for a tease creator!

Re: [EOS Text Interpreter] Write teases as text

Posted: Mon May 16, 2022 6:59 pm
by mrtres
Cool! I was considering working in the JSON-export, as a kind of short cut - but I'm sure that would be rather error prone.