Text-Based-Adventure-Game

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By creativesteve

hey everyone I had a fun idea for a beginner level project to work on to help me get used to GDscript which is to make a Text Based Adventure game. Like I used to play good old games like the Zork series and would love to create something similar but with my own twist. How can I get started on this projcet using GDscript. helping me get my start would be highly appreciative. Thanks in Advance.

Sincerly a newb but excited to learn.

:bust_in_silhouette: Reply From: Mi1k

I’m not sure if you can make a console based text game. So I would say your best bet would be to make use of the control nodes such as button, texture button and the texture label. And i guess you could make use of sprites for the background. Each “event” could be made a different scene and various functions could connect the scenes.

Thanks so much for the help Mi1K. i will defently give your suggestion a shot. Much appreiccated.

creativesteve | 2020-05-01 23:28

:bust_in_silhouette: Reply From: njamster

If you want to keep it fully text-based, you can stick to Control-nodes (everything with a green icon). The LineEdit-node will allow the player to enter text-based commands, that you can process in a callback connected to it’s text_entered-signal. Restricting the input length is easily done by setting its max_length-property in the inspector. If you want to restrict which characters you consider as valid inputs, you’ll need to code this yourself by hooking up a callback to the text_changed-signal as well. The Label-node will probably be enough for displaying text. You’ll likely want to add the Labels as children of a VBoxContainer and wrap that up in a ScrollContainer though. If you want to have clickable text, you can use a Button with the flat-property set to true.

:bust_in_silhouette: Reply From: Traumaticbean

You will require two things Input and Output

Giving Input: You can give input by using a LineEdit node at the bottom. You can use its text property for reading the input.

Getting Output: A RichTextLabel/Label can be used to get output (by altering text property).