UevKF8zjRV_WEtpJsXhr
We use cookies on this site to enhance your user experience

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.
  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 "