Code Editor Guide - The Results Page - Playstyles

Hello Tales Wordsmiths! Whether you are brand-spankin’ new or just need a refresher, I hope you find these guides helpful. Everything is interconnected, so if you don’t find what you’re looking for here, check out the other guides coming soon!

This guide is for those that are using the Code Editor option, and is mostly for those that include choices or branching in their stories.

The Results Page

Every time a player comes to the end of an episode, the app will take them to the results page, where they are always given the option to continue to the next episode and view any comments made on that story. There are a few more things you can add to your results page to give your reader a more game-like experience.

Endings - Default

No matter what kind of story you are writing, every episode needs an end code to tell the system when to end. Each new episode you create should already have the Default end code inserted, (end) , but if it is not there, you need to add it in. Your script will not play if you do not have an end code.

This is what the results page will look like if all you have is (end) .

The series cover will be shown in place of the Tales Logo, and the reader is given the options to like, replay, or share the episode, and they are given the option to go on to the next available episode.

Directly below is the comments window.

Readers can view all comments made on your story, and even leave a comment of their own.

Endings - Playstyles

A playstyle end acts similarly to (end) - when the script plays through it, the episode will end. But it also adds a new section to the results page. There are a few different ways you can use playstyles, let me show you.

Basic Example

(Note: (location: BLACKOUT is not needed.)

 | Ends | PLAY | Playstyle | | This is a Playstyle
  This story is only one line.

  (playstyle: PLAY)

In this example, I have the playstyle information in the header:

  | Ends | PLAY | Playstyle | | This is a Playstyle

And the playstyle end at the bottom of the script:

  (playstyle: PLAY)

Ends is first; this lets the system know what kind of header asset it is. Next the end code PLAY, which must be included in the paired playstyle end at the bottom of the script, (playstyle: PLAY).

Next is the title Playstyle, then an empty section (as of now this doesn’t do anything, so just leave it blank), and lastly the info section, This is a Playstyle.
The only thing that can’t be customized in this header type is Ends. The end code, playstyle title, and info sections can be whatever you want them to be. Keep in mind that the end code must always be in caps, PLAY, and you need to separate each section with vertical lines, | | .

This is how the results page will look with a playstyle.

The title Playstyle is visible, as well as the info section, This is a Playstyle.

The gold circle is what the player ended up getting as their playstyle, and it shows the percentage of players that received that particular playstyle.

Single Playstyle

This is a single playstyle example:

  | Ends | END | End of Episode One | | Will our Hero prevail against the  
  forces of Evil? Find out in the next episode!

Paired with the playstyle end:

  (playstyle: END)

The end code, the title, and the info section have all been customized, while Ends and (playstyle: ) remain the same. You can use a single playstyle to give a message to the player, such as what to expect in the next episode.

Single Playstyle Example on the Results Page

Multiple Playstyles - Simple Choices

In this example I have two playstyles:

  | Ends | ONE | Playstyle One | | This is Playstyle One
  | Ends | TWO | Playstyle Two | | This is Playstyle Two

The outcome is decided by a choice given to the player, which then takes them to the decided end:

  This story is only one line.
  *<#act> Ending One -> ending_one
  *<#act> Ending Two -> ending_two


  (playstyle: ONE)


  (playstyle: TWO)

If the player chooses Ending One, that is the playstyle given.
However, playstyles usually aren’t specifically chosen by the player. They are decided by the player’s choices within the story.

(Note: The example above uses the jump - > label : method of branching. If you want to learn more about it, keep a lookout for the Branching Methods guide. This example also uses <#act> in the choice lines, which will also be explained in the Branching Methods guide.

In this example the choice given to the player has more to do with how they want to play the story. Will they lie, or will they tell the truth?

  | Ends | LIE | Lie | | You told a lie.
  | Ends | TRUE | Truth | | You told the truth.

  Will you lie or tell the truth?
  * <#act> Lie

  You lied, and now nobody trusts you.

  (playstyle: LIE)

  * <#act> Truth

  You told the truth, now everybody likes you.

  (playstyle: TRUE)


If the player chose to lie, that is the playstyle they get.

However, most of the time the playstyle will not be determined by a single choice, and the playstyle won’t always be given right after that choice is made in the story. This is when variables become useful for keeping track of playstyles.

(Note: This example uses the [join] method of branching. If you want to learn more about it, keep an eye out for the Branching Methods guide.

Multiple Playstyles - Variables & Conditionals

Conditionals use variables to branch the story based on specific or overall choices made by the player. Here I’ll talk about how to use them for playstyles.

In this example, I give variables based on the choice made, which is called up later to decide which playstyle the player receives on the results page.

  | Ends | LIE | Lie | | You told a lie.
  | Ends | TRUE | Truth | | You told the Truth.

  Will you lie or tell the truth?
  * <#act> Lie [give: LIE]

  You lied, and now nobody trusts you.

  * <#act> Truth [give: TRUE]

  You told the truth, now everybody likes you.


  The story continues.

  For a very long time.

  And now the episode is over.

  * [if: LIE]

  (playstyle: LIE)

  * [else]

  (playstyle: TRUE)


If the player chooses to tell the truth, the variable is given as [give: TRUE]. (Note that variables must be in all caps.)

Variables can be whatever you want them to be, and I recommend keeping track of any variables you give. The system on the app remembers all variables given, and they carry over to all following episodes (unless you take them away). They do not carry over in the Tales Creator emulator though.

In the example above I call up the variables by coding a conditional, which is also known as an if/else code. A conditional branches the story according to variables given earlier in the script.

  *  [ if: LIE] 

This is the first conditional the system will try to fulfill. Because the player did not choose to lie, they did not collect the LIE variable. The conditional was not met, so it goes to the next option.

  *  [else] 

This means that if the player does not meet the conditionals above, this is the branch that the player will be taken to. In this example, [else] will be chosen because the player collected TRUE, not LIE.

You may be thinking, why didn’t I just put [if: TRUE] for this conditional? Now, you can do that to make sure it doesn’t get skipped, but every choice needs what is called a non-gated option, meaning that if the player has no variables (or doesn’t have enough), they can still play the story without getting stuck. [else] should always be the last option in a conditional to make sure that all other conditions can be met first.

You may also ask, if I don’t need the variable TRUE for this conditional, why do I give it at all? There may be some choices where you only give one variable to remember that choice, but sometimes there will be multiple options in choices, or you’ll want to call up that variable to use later on.

For example, let’s say this choice is in episode 1, whether to lie or tell the truth. In episode 3, this choice may have consequences, so I would script different reactions based on the choice: The player chose to lie, so another character refuses to help with a problem because they do not trust the player anymore. Or, the player chose to tell the truth, so the other character is more than happy to help with the problem.

(Note: If you want to learn about coding a conditional based on multiple or accumulative variables, keep a lookout for another guide that I haven’t named yet :rofl:)

That’s all for the Playstyles guide, if you have any questions or comments, feel free to post below!