What is this game?
This is a really simple text-based story game.
This game makes use of the output/console of your executor as your game UI, and your only input is literally editing a line in the script.
What i’m trying to achieve
I am trying to simplify my game, by making each function modular, and somehow make everything more compact.
I also somehow wan’t an easier way to build linked paths from each option you pick, such a tree like-table.
This game is basically a single lua script game that can be ran on any Lua based executor, such as this website, or even Roblox Studio!
--------------------------------------------------------------------------------
--==| ▀▀█▀▀ █░░█ █▀▀ █▀▀█ █▀▀▄ ▀█░█▀ █▀▀ █▀▀▄ ▀▀█▀▀ █░░█ █▀▀█ █▀▀ █▀▀ |==--
--==| ░░█░░ █▀▀█ █▀▀ █▄▄█ █░░█ ░█▄█░ █▀▀ █░░█ ░░█░░ █░░█ █▄▄▀ █▀▀ ▀▀█ |==--
--==| ░░▀░░ ▀░░▀ ▀▀▀ ▀░░▀ ▀▀▀░ ░░▀░░ ▀▀▀ ▀░░▀ ░░▀░░ ░▀▀▀ ▀░▀▀ ▀▀▀ ▀▀▀ |==--
--==| █▀▀█ █▀▀ ▀▀█▀▀ █░░█ █▀▀ █░░ █▀▀█ █▀▀ ▀▀█▀▀ █▀▀▄ █▀▀█ █▀▀█ █▀▀▄ |==--
--==| █░░█ █▀▀ ░░█░░ █▀▀█ █▀▀ █░░ █░░█ ▀▀█ ░░█░░ █░░█ █░░█ █░░█ █▀▀▄ |==--
--==| ▀▀▀▀ ▀░░ ░░▀░░ ▀░░▀ ▀▀▀ ▀▀▀ ▀▀▀▀ ▀▀▀ ░░▀░░ ▀░░▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀░ |==--
--==| |==--
--==| By Ethanthegrand14 |==--
--------------------------------------------------------------------------------
----------==========[ PLAY ]==========----------
Action = "Blank"
-------------------------------------------------
-- Execute this code to play the game
----------==========[ SOURCE CODE ]==========----------
GameVersion = 0.1
ValidAction = false
print("--==[ The Adventures of The Lost Noob v" .. GameVersion .." by Ethanthegrand14 ]==--")
print(" ")
-- Default menu --
if Action == "Blank" or Input == "Restart" then
ValidAction = true
print("----------==========[ HOW TO PLAY ]==========----------")
print(" ")
print("This game is a text based adventure game and is very simple to play!")
print("To play, you will need to run this game/code, then if you look in your 'output or console' you will see some actions under the 'ACTIONS:' text.")
print("To use your actions, go to < Action =" .. ' "Blank" ' .. "> and change it to an action you wish to use.")
print("For example, i have four actions and one of them is 'GoNorth1' and i'd wan't to use it, i'd just simply change < Action ==" .. ' "Blank" ' .. "> to < Action ==" .. ' "GoNorth1" ' .. "> and then i'll run the script again to progress through the game.")
print("To start the adventure, please pick an action in the 'ACTIONS:' list.")
print("Enjoy!")
print(" ")
print("-------------------------------------------------------")
print(" ")
print("ACTIONS:")
print(" ")
print("- Play")
end
-- Game --
if Action == "Play" or Input == "GoBack1" then
ValidAction = true
print("You are in the middle of a forest you have never seen before.")
print("You have nothing but a an old compass that will hopefully guide you through your jounrey.")
print(" ")
print("Towards 'north' there is nothing but forest")
print("Towards 'east' there is even more forest")
print("Towards 'south' there is a small old shack")
print("Towards 'west' there is a tree with a note on it")
print(" ")
print("ACTIONS:")
print(" ")
print("- GoNorth1")
print("- GoEast1")
print("- GoSouth1")
print("- GoWest1")
end
-- Middle of the forest --
if Action == "GoNorth1" then
ValidAction = true
print("You walk towards more forest, the forest gets darker and thicker the more you travel through it.")
print("However, there is a small opening in the forest with what seems to looks like a path")
print(" ")
print("ACTIONS:")
print(" ")
print("- Continue1")
print("- GoBack1")
end
if Action == "GoEast1" then
ValidAction = true
print("This part of the forest is too thick to travel through. You no choice but to go back")
print(" ")
print("ACTIONS:")
print(" ")
print("- GoBack1")
end
if Action == "GoSouth1" then
ValidAction = true
print("You go towards the shack, it is surrounded by very thick forest.")
print("You walk up the the shack.")
print("The front door won't open")
print(" ")
print("You can either walk around the shack to see if there are any other ways to get in it, or you can 'go back'")
print(" ")
print("ACTIONS:")
print(" ")
print("- GoEast2")
print("- GoWest2")
print("- GoBack1")
end
if Action == "GoWest1" then
ValidAction = true
print("You walk to the tree with the note on it.")
print(" ")
print("You can either walk around the shack to see if there are any other ways to get in it, or you can 'go back'")
print(" ")
print("ACTIONS:")
print(" ")
print("- GoEast2")
print("- GoWest2")
print("- GoBack1")
end
if not ValidAction then
print("--<< ERROR: '" .. Input .. "' is not a valid action. Please choose an action lited below the 'ACTIONS:' text! >>--")
print(" ")
print("ACTIONS:")
print(" ")
print("- Play")
print("- Restart")
end
-- Middle of the forest --
print(" ")
print("-------------------------------------------------------------------")