GSmGpE6CwX2y9JjB25B8
Wir verwenden auf dieser Website Cookies, um die Benutzerfreundlichkeit zu verbessern.

Write the Story

5 Min.

Write the Story

After the player answers all of the questions, they’ll get to see their answers combined with the story. The story will also be stored in a variable using strings and then be combined with the strings holding the player’s answers.

Code the First String

  1. Make sure the playtest is stopped.
  2. Go back to the script by clicking on the StoryManager script tab above the game editor.
Reopening the Script

If you don’t see the script editor tab, you can re-open it by double-clicking on StoryManager in the Explorer window.


  1. Beneath where you typed the question, create a new variable named story. Make sure the variable name is lowercase.
-- Code story between the dashes	
-- =============================================
   
local name1 = storyMaker:GetInput("What is your favorite name?")
   
local story
  1. To find the first string, go back to the original story. Circle or highlight everything before the first placeholder. If your variable happens to be in the middle of a sentence, no problem - the rest can be added later.
Original Placeholder
In a tree on a hill, lives the great wizard name1.
  1. Have the story variable store the string like below:
-- Code story between the dashes	
-- =============================================
   
local name1 = storyMaker:GetInput("What is your favorite name?")
   
local story = "In a tree on a hill lives the great wizard "
Tipps zur Problemlösung
  • Remember that local story needs to be lowercase because other parts of the game are looking for a variable with that exact name.
  • The code will only show what you tell it to, so include a space at the end so the strings don’t run together like below:
"In a tree on a hill lives the great wizard "