Andersfc

Visual Novel System

May 11th, 2022 (edited)
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.35 KB | None | 0 0
  1. UserInputInterfaceChoice = {...}
  2. --UserInputInterfaceChoice is a click for the player to chose between a screen of options going from CharacterCount 1-10 or other, CharacterCount 11-20 or other if other is pressed, progressing until CharacterCount 51-52 to represent genesis characters
  3.  
  4. StoryBranchCharacterCount = readTxtFileInFolder(Branches)
  5. -- Folder 'Branches' is used to pull txt file data on number of starting point characters available to be chosen
  6.  
  7. StoryTrackCount = readTxtFileInFolder(Story Tracks)
  8. --Folder 'Story Tracks' is used to know max value of main story tracks (of which base value might be 1-3) based on a principle of a scale of a personality list from evil to indifferent to nice to where visual novel outcomes will differ.
  9.  
  10. CharacterCount = 0
  11. --CharacterCount is a value that tracks specific character chosen to be played in the story
  12.  
  13. CharacterFolderIntroduction = readTxtFileInFolder(CharacterCount)
  14. --Is the value of the amount of characters needed to go through
  15.  
  16. UserInputInterfaceWipeValue = 0
  17. --Tracks a count going up to 10 and keeps resetting position where text is placed on screen
  18.  
  19. Function UserInputInterfaceWipe
  20.    if UserInputInterfaceWipeValue == 1 then
  21.       term.setCursorPos(1, 1)
  22.    elseif UserInputInterfaceWipeValue == 2 then
  23.       term.setCursorPos(2, 2)
  24.    elseif UserInputInterfaceWipeValue == 3 then
  25.       term.setCursorPos(3, 3)
  26.    elseif UserInputInterfaceWipeValue == 4 then
  27.       term.setCursorPos(4, 4)
  28.    elseif UserInputInterfaceWipeValue == 5 then
  29.       term.setCursorPos(5, 5)
  30.    elseif UserInputInterfaceWipeValue == 6 then
  31.       term.setCursorPos(6, 6)
  32.    elseif UserInputInterfaceWipeValue == 7 then
  33.       term.setCursorPos(7, 7)
  34.    elseif UserInputInterfaceWipeValue == 8 then
  35.       term.setCursorPos(8, 8)
  36.    elseif UserInputInterfaceWipeValue == 9 then
  37.       term.setCursorPos(9, 9)
  38.    else term.setCursorPos(10, 10)
  39.    end
  40. end
  41.  
  42. Function PullCharacterIntroduction()
  43. UserInputInterfaceWipe()
  44. Print(CharacterFolderIntroduction)
  45. end
  46.  
  47. Function PullDataFromCharacterCount()
  48. end
  49. --Choose story folder based on CharacterCount value
  50.  
  51. Function pullCharacterCountValueBasedOnClick()
  52. end
  53. --Based on what was clicked on the screen, a value is assigned corresponding to the character
  54.  
  55. For i = 1, StoryBranchCharacterCount do
  56.    if CharacterCount values == 11,21,31,41 or 51 then
  57.       if UserInputInterfaceChoice == other then continue running the program through
  58.          term.setCursorPos(1, 1)
  59.          shell.run("clear")
  60.          else terminate current running program and continue in the process of visual novel game
  61.       end
  62.    end
  63.    CharacterCount = CharacterCount+1
  64.    UserInputInterfaceWipeValue = UserInputInterfaceWipeValue+1
  65.    if UserInputInterfaceWipeValue == 11 then
  66.       UserInputInterfaceWipeValue = 1
  67.    end
  68.    PullCharacterIntroduction(CharacterCount)  
  69. end
  70. --For x amount of StoryBranchCharacterCount value program resets user-input screen at specific values of 10, runs function PullCharacterIntroduction for all characters, which takes values from all characters' txt files and the program does so in an ordered manner. For each 10 characters it will wait on a user-interface choice, if choice is other, then program will keep running if not it terminates and moves onwards in the process.
  71.  
  72.  
  73.  
  74. If previous UserInputInterface == true and not other then pullCharacterCountValueBasedOnClick() then
  75.    pullCharacterCountValueBasedOnClick = CharacterCount
  76. end
  77. -- Assigns value to CharacterCount based on clicking on a character from the user-interface. This value is important because it will then be used to pull the appropriate data for the assigned character's story-line in the game.
  78.  
  79. PullDataFromCharacterCount()
  80. --Choose story folder based on CharacterCount value assigned on user-interface input
  81. --For example if user input corresponds to character 52, now the program will start to pull data like txt files, images etc.
  82.  
  83. CategorizeAllFilesFromLowestToHighestNumberAndAlphabeticalOrder = createTableOfContentsOfFolder
  84.  
  85. TakeCategorizationAndGoThroughOrder
  86.  
  87. PullImageForBackground = readFromLowestNumberToHighestAndAToZ
  88. PullImageForCharacter = readFromLowestNumberToHighestAndAToZ
  89. PullDialogueTxtFile = readFromLowestNumberToHighestAndAToZ
  90. PullMp3Music = readFromLowestNumberToHighestAndAToZ
  91.  
  92. DetermineIfDialogueFitsOrAnotherSlideIsNeededForTxtFileAndHowManyAreNeeded = createSlideCountReferenceForTxtFileOfDialogue
  93.  
  94. SceneCountOfCharacterStory = readBasedOnCharacterCountValueAndDetermineFolderThenFindSceneCountBasedOnTxtFileOf(SceneCount)Folder
  95.  
  96. ChoiceOption = 0
  97.  
  98. EvilScore = 0
  99. IndifferentScore = 0
  100. GoodScore = 0
  101.  
  102. SceneCountOfCharacterStoryValue = 0
  103.  
  104. For i = 1, SceneCountOfCharacterStory do
  105. SceneCountOfCharacterStoryValue = SceneCountOfCharacterStoryValue+1
  106.  
  107.    PullImageForBackGround
  108.    PullImageForCharacter
  109.    PullDialogueTxtFile
  110.    PullMp3Music
  111.    DetermineIfDialogueFitsOrAnotherSlideIsNeededForTxtFileAndHowManyAreNeeded
  112.    Print(PullImageForBackGround, PullImageForCharacter)
  113.    Print(PullDialogueTxtFile(BasedOnAmountOfSlidesNeeded))
  114.    
  115.    if [BracketedTxtInFile] = Choice then
  116.       for i = 1, (ParanthesizedValueInTxtFile) do
  117.          ChoiceOption = ChoiceOption+1
  118.          term.setCursorPos(DependingOnChoiceOptionValue)
  119.          print({SquigglyBracketedChoiceInTxtFileBasedOnValueOfChoiceOption})
  120.          
  121.          if UserInputInterFaceChoice = 1, then
  122.             PullDataFromTxtFileInThisFolderCalled(ChoiceOne)
  123.          elseif UserInputInterFaceChoice = 2 then
  124.             PullDataFromTxtFileInThisFolderCalled(ChoiceTwo)
  125.          else
  126.             PullDataFromTxtFileInThisFolderCalled(ChoiceThree)
  127.       end
  128.       if "TxtPutBetweenQuotationMarks" = Evil then
  129.          EvilScore = EvilScore+1
  130.       elseif "TxtPutBetweenQuotationMarks" = Indifferent then
  131.          IndifferentScore = IndifferentScore+1
  132.       elseif "TxtPutBetweenQuotationMarks" = Good then
  133.          GoodScore = GoodScore+1
  134.      
  135.       end  
  136.    shell.run("clear")
  137.  
  138. end
  139. If EvilScore => IndifferentScore and GoodScore then
  140.    PullLastFileOfTxtDialogueFromEvilFolder
  141.    Elseif Indifferentscore => Evilscore and Goodscore then
  142.    PullLastFileOfTxtDialogueFromIndifferentFolder
  143.    Elseif GoodScore => IndifferentScore and Evilscore then
  144.    PullLastFileOfTxtDialogueFromGoodFolder
  145.    Else PullLastFileOfTxtDialogueFromNeutralFolder
  146. end
  147.  
  148. --Program Goes through one dialogue, then clears
Add Comment
Please, Sign In to add comment