Where should I start?

Hello all, I've created a simple game, yet I wish to build it into an rpg and I was wondering where to start learning code and what everything means instead of simply copying and pasting blocks of text that I don't really understand, or simply following along mindlessly to a YouTube video.
I am new to all of this - - wtf is a library, what is its purpose? To contain a certain set of actions or principles in the game which require huge chunks of text/code?
How should I go about learning what the heck I'm doing to create a simple game first, and then build my way up to understanding more code and what things mean?
I'm sorry for my ignorance.
There's so many things I don't understand - - where should I learn the basics from? Thank you in advance for your patience with me, and for your time.


So, how have you created your "simple game"? Using what tool? Is it available for us to look at / play/ critique/ suggest better?

Have you read through the docs yet? (see link below in Resources) Then after you have tried all that, start asking specific questions here in the forums . There are myriad places on the WWW for learning. Look for JavaScript to start with after you have got your game up and running using the Quest IDE.
And in order to be good at it, patience & persistence work wonders. Also don't forget to save your work as you go and create additional backups. Don't be afraid to try things and keep trying until they are right.


(filler for getting my edited post, updated/posted)


I'd be glad to help out!

I found quest like 7 years ago (geez, where has the time gone, sighs), knowing absolutely nothing about programming/coding, and through quest (and its very helpful community, the site mods and the users), I'm now taking programming classes in college towards a degree in computer science (programming/coding)

the very first thing that you experience:

OVERWHELMED

as your post demonstrates, this is very normal

you can see me, trying to learn quest and its programming for my first time here:

https://textadventures.co.uk/forum/quest/topic/3348/noobie-hks-help-me-thread


I would personally start out with the very basics of learning to work directly in quest's code, as it'll make things so much easier and faster (the GUI/Editor is much more clunky, especially in trying to explain/walkthrough using it, as it's a lot more work for us/me, than in being able to use code directly to help out you)

so... let's get started...

(hopefully, you're using a PC, if you're using an Apple computer... hopefully you can figure out how to do the same stuff with it)


  1. first and foremost for coding, we need a good text editor software, for reading/writing/editing/fixing-troubleshooting/etc your coding, for a PC (I don't think this text editor software works for Apple computers), I highly recommend downloading and installing this advanced and totally free text editor software: https://notepad-plus-plus.org

for notepad++, once its downloaded and installed, and when it's opened up, at the top menu bar, under 'languages', select 'XML' as this works fine for quest's own unique 'aslx' language, all the color coding will match up correctly for you, when writing code for your quest game files and/or library files

if you're using an Apple computer, maybe you know of a free advanced text editor software you can get/use

but if worse comes to worse, you can always use the built-in text editor softwares that all computers have, but they don't have as fancy useful tools to use, so it'll be a bit more work in using them, but the built-in text editor programs/software:

PC: notepad, wordpad, etc?
Apple: text editor / textedit.app / whatever it is, meh, lol, etc?


  1. just for a "fun" start, let's code in your own default new game!

(hopefully, you won't have any issues... as I'm using an older version of quest... hopefully everything I tell you to do, will still work with the current version of quest)

open up your text editor, and start a new/blank text editor page

and while you can just copy and paste, it'd be good practice to get used to typing/writing it in yourself, to get a feel for how you write/type/code in code! As it takes a bit of time-practice to get used to it.. so, instead of copy and pasting the below, type/write it in yourself to your new/blank text editor page, okay? (as, another reason, is to get you used to having to go back and check and fix it for typos/spelling/etc-mistakes... this is actually like 90% of a programmer's time, even professionals, laughs. As a single typo means that the code/program doesn't work, has errors, and/or crashes, lol. Programmers/Coders quickly become spelling/typo/mistake checking nazis, we can write stuff with usually ZERO typos, spelling, etc mistakes, we can write/type usually 100% free of any typos/spelling/etc-mistakes, lol)

I just checked, okay the current version is '580' (so hopefully my code below will work for you, lol)

so in your text edit new/blank page, type in the below:

<asl version="580">
</asl>

and name it as 'example_game_file' with the extension of: .aslx

(if you need help with how to work with the extensions, let me know, as they can be hidden, the computer settings can toggle showing/hiding the extensions, so you may not realize you got something like this, for an example: example_game_file.aslx.txt)

so the file should be:

example_game_file.aslx

if everything was done right, you created your 'asl' GAME OBJECT within your 'example_game_file.aslx' game file


about the coding:

for both human languages and computer languages, we need 'markers/tags' for when a line-sentence/block-paragraph begins and ends, so:

// IMPORTANT: programing's/coding's syntax (form/format/pattern) is confusing... it just takes time... so don't worry if it confuses you and screws you up (we can easily fix it up for you, so don't worry about any "scary" errors or you game not even opening up, it's just a matter of fixing up the bad syntax, lol), so if the below confuses you, don't worry about it

// usually code is done vertically ("as a block"), as it is human-friendly (human readable/understandable), but if its just a simple/small/short piece of coding, then it's done horizontally ("as a line")

// so, for example, we could do it all horizontal, which the computer has no problem with at all, but WE do... so we don't do this... as WE are part of coding... lol (if not already happening, computers will write their own code all by themselves... which is quite scary...):

<asl version="580"></asl>

// but we like this better (as there's a lot that we're going to put inside of it):

// start of the 'asl' tag block, which is known as the HEADER/SIGNATURE, as it has special required parameters in it (version="580"), see the line directly below:

<asl version="580">

  // MASS OF CODE (you entire game content), as this 'asl' tag block is your GAME OBJECT, everything must be here, inside of it

</asl>

// end of the 'asl' tab block (see the line directly above)

so, lets now continue... (open back up your 'example_game_file.aslx' game file, via for a pc, right click on it and choose 'open' and then select the text editor software you used, if using an Apple, hopefully you know how to do the same thing with it, lol)

(you can NOT just double click on it to open it, as its a quest file, due to the '.aslx' extension on it, well, it may try to open up using your quest GUI/Editor software... which might work... but I think you'll get an error/failure... as we still got more to add into it to make it a working quest game file that the quest software GUI/Editor can open up... meh whatever, just don't try to open it via double clicking on it right now, lol, as we want to open it up into the text editor that we were using right now anyways)

(I'm assuming you use the 'english' language... lol)

<asl version="580">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

</asl>

notice how the 'include refs' are horizontal lines of code, as they're small/short, we're writing them horizontally (as a line), and we probably have to as well, as quest might not be set up to understand them as vertical blocks, lol

// IMPORTANT: programing's/coding's syntax (form/format/pattern) is confusing... it just takes time... so don't worry if it confuses you and screws you up (we can easily fix it up for you, so don't worry about any "scary" errors or you game not even opening up, it's just a matter of fixing up the bad syntax, lol), so if the below confuses you, don't worry about it

beginning of line and its beginning tag: <
ending of line and its ending tag: />

[beginning of line and its beginning tag]<include ref="English.aslx" />[ending of line and its ending tag]

but there's some other forms too, so there's jsut some differences that you got to memorize, for example, an String Attribute tag line:

<attr name="shape" type="string">circle</attr> 
VS
<include ref="English.aslx" />

see how this is a bit different in its form/pattern/"syntax" than the 'include ref' tag line? it just takes time to get used to the differences and which goes to which, lol

beginning line and its begin and end tags: <attr name="shape" type="string">
ending line and its begin and end tags: </attr>

VS

beginning line and its begin tag:<include ref="English.aslx"
ending line and its end tag: />

now, we've just added in the quest engine library files: the 'English.aslx' and the 'Core.aslx' library files (they have the same '.aslx' extension as game files, as they're just both (game files and library files) just quest files, which is the '.aslx' extension that the quest software uses)

what these two code lines do:

('include ref'): quest will search for these (quest engine) library files, open them up, and copy and paste their contents into the game file (your 'example_game_file.aslx' for this example/case)

that's all that a library file is, it hold code, which gets copy and pasted into the game or whatever software/program (.exe)

also, a game file, just holds code too, but usually it has some required specific coding that is needed for it to work as a game file, lol

you don't have to use library files at all, you can just have all of your code within the game or whatever software/program (.exe), but as your game/software gets bigger and bigger, you use library files to organize/compartmentalize it, making it much easier to work with and control, and/or edit/fix up.

I'll explain more directly an detailedly about library files usage later on... so don't worry...


anyways... let's keep going... (continuing to add in more required coding for our game file to work)

<asl version="580">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="NAME_OF_GAME">
  </game>

</asl>

the 'game' Object is a special and required Object, which holds the game-wide settings, the publishing info (author, firstpublished, 'gameid' for quest online servers, version, difficulty, cruelty, description, category, etc), the special 'start' Script, the 'pov' feature stuff, and maybe a few more types of stuff too, meh

this is the same 'game' Object that you see in the GUI/Editor's "tree of stuff" on the left side:

Objects
-> game <------------------ HERE
->-> verbs
->-> Commands
-> room
->-> player
Functions
Timers
Walkthrough
Advanced
-> Included Libraries
->-> English.aslx <-------------------- ALSO, DO THESE LOOK FAMILIAR? (WINK)
->-> Core.aslx <-------------------- ALSO, DO THESE LOOK FAMILIAR? (WINK)
-> Templates
-> Dynamic Templates
-> Object Types
-> JavaScript

I've been lazy, as I've still never tested if even if not working online... if you still need to put in a 'gameid' or not...

but, let's just do so, to be safe... along with a few other of the settings (Attributes) within the 'game' Object, okay?

the 'gameid' is just a randomly generated (if using the quest GUI/editor) hash-string (as it needs to be unique, hence the random generation), to ID one person's game from another person's game, mainly for the online servers, when you publish/upload your game to them

(I just take a randomly generated 'gameid' from a game I've created through the GUI/Editor and retype them, very carefully, here, lol, just to be safe, as I'm not sure if they have any types of requirements, like length, pattern type, and whatever else, so that's why I just don't type in some random hash-string on my own)

<asl version="580">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="NAME_OF_GAME">

    <attr name="gameid" type="string">2e475718-3650-42b4-8c7e-9f847834149d</attr>

    <attr name="author" type="string">NAME_OF_AUTHOR</attr>

    <attr name="version" type="string">1.0</attr>

    <attr name="firstpublished" type="string">2019</attr>

  </game>

</asl>

guess what, you just added in some Attributes ("settings/controls/options") for the 'game' Object, which is the same thing as done through the GUI/Editor:

'game' Object -> 'setup' Tab -> "game name", author, version, firstpublished, and gameid

for a challenge, see if you can code in the 'subtitle' Attribute yourself!

answer:

(you can write it in, anywhere within the 'game' tag block)

<asl version="580">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="NAME_OF_GAME">

    <attr name="gameid" type="string">2e475718-3650-42b4-8c7e-9f847834149d</attr>

    <attr name="author" type="string">NAME_OF_AUTHOR</attr>

    <attr name="version" type="string">1.0</attr>

    <attr name="firstpublished" type="string">2019</attr>

    <attr name="subtitle" type="string">SUBTITLE</attr>

  </game>

</asl>

(for example)

<asl version="580">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="NAME_OF_GAME">

    <attr name="subtitle" type="string">SUBTITLE</attr>

    <attr name="gameid" type="string">2e475718-3650-42b4-8c7e-9f847834149d</attr>

    <attr name="author" type="string">NAME_OF_AUTHOR</attr>

    <attr name="version" type="string">1.0</attr>

    <attr name="firstpublished" type="string">2019</attr>

  </game>

</asl>

(another example)

<asl version="580">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="NAME_OF_GAME">

    <attr name="gameid" type="string">2e475718-3650-42b4-8c7e-9f847834149d</attr>

    <attr name="author" type="string">NAME_OF_AUTHOR</attr>

    <attr name="subtitle" type="string">SUBTITLE</attr>

    <attr name="version" type="string">1.0</attr>

    <attr name="firstpublished" type="string">2019</attr>

  </game>

</asl>

anyways... let's finish it up (as I'm getting tired... lol), the last remaining required stuff, for the default (well, nearly default, as we added in some Attributes already, lol) new game we're coding in directly ourselves:

(no explanations, but hopefully you'll understand now a bit what we're doing, without me having to explain it)

<asl version="580">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="NAME_OF_GAME">

    <attr name="gameid" type="string">2e475718-3650-42b4-8c7e-9f847834149d</attr>

    <attr name="author" type="string">NAME_OF_AUTHOR</attr>

    <attr name="subtitle" type="string">SUBTITLE</attr>

    <attr name="version" type="string">1.0</attr>

    <attr name="firstpublished" type="string">2019</attr>

  </game>

  <object name="room">

    <inherit name="editor_room" />

  </object>

  <object name="player">

    <inherit name="editor_object" />
    <inherit name="editor_player" />

    <attr name="parent" type="object">room</attr>

  </object>

</asl>

and finally to wrap it up:

  1. save it

  2. close out of it

  3. double click on it (and hopefully, it will open up with/into quest and its GUI/Editor... if not, let me know, as there might be a mistake in your code, or might be other outside issues that I can see if I can figure out for you, for an example, the quest software may not be able to find your game file on the desktop and/or is blocked from doing so... we can try to move your game file into the same folder as your 'quest.exe' quest program/software as a fix to this issue)

  4. study what you've done in coding through the GUI/Editor, and see if you can learn and match up the coding to the GUI/Editor's controls/tabs/features/options/settings/etc

  5. try to play/run your game file too (not anything really to see/do though, aside from seeing some of the Attributes being displayed: game name, the subtitle, and whatever else might be displayed, meh)

  6. play around... go back and try to code in more stuff on your own, then check it in the GUI/Editor (assuming hopefully it'll open up... if not... see if you can find your mistake in coding... or let me/us know, and we'll find/fix your code up for you), or, do something in the GUI/Editor, and then see what it looks like in code (at the top menu bar, between the 'player' and '?-help' buttons, there should be a notepaper like button, this is a toggle between the GUI/Editor mode and the Code View mode (this is the full game code view), hopefully the current version hasn't changed any of this (unlikely, lol, I hope)

  7. don't worry if you get errors, if it won't play, if it won't even open into the GUI/Editor, if it crashes, etc etc etc. BECAUSE: you can ALWAYS open up your game file with a text editor software, and fix the code (usually it's some stupid small typos, spelling-mistakes, etc mess ups, lol), which is the cause of all of these "scary" things, lol

see if you can learn/research some stuff on your own through the quest doc resource page(s):

https://docs.textadventures.co.uk/quest/

https://docs.textadventures.co.uk/quest/elements/

https://docs.textadventures.co.uk/quest/types/

https://docs.textadventures.co.uk/quest/elements/game.html

https://docs.textadventures.co.uk/quest/elements/object.html

https://docs.textadventures.co.uk/quest/attributes.html

https://docs.textadventures.co.uk/quest/scripts/

https://docs.textadventures.co.uk/quest/functions/ (categorical order)
https://docs.textadventures.co.uk/quest/functions/index_allfunctions.html (alphabetical order)


then you can move on to learning the next most important stuff:

("scripting"):

  1. Attribute usage
  2. the 'if' Script

as when especially combined together, these two things enable 90% of EVERYTHING that you could/might-want to do for/within your game!

as can be seen, we have very diminishing returns, after learning how to do scripting (Attribute usage and the 'if' Script)

learning the more advanced Attributes (Lists and Dictionaries) only gets us 5% more ability for game content, moving us to now 95% of being able to do for whatever within your game, lol

learning even more advanced coding stuff... has even more diminishing returns... on what it adds to what can be done with your game

once, you've learned how to do the lists and dictionaries (which are very important/useful/powerful, despite that I said that they only add 5% more, lol), you have everything you need to make a full on RPG of your own (excluding the graphics/etc, lol -- quest does have some capabilities for even graphics as well, but that's beyond my own coding ability, but others can help with that stuff, and there's lots of resources on it too, I've just not gotten around yet to learning it myself, laziness.. lol)


here's some more resources of others and my own (you can try using them, but I'm not the best at explaining stuff... this entire post, might very well have just confused you more, lol... I try though to help... meh, so if you try any of my resources/guides below and they don't have at all, then just get help from others, as they can explain and help much better than usually I can/do, lol, or you can ask me for help or explaining anything in my resources/guides below, but you're probably better off just getting others to help you, lol):

http://textadventures.co.uk/forum/general/topic/ljjm32av4e2t9ot49k478g/help#710be61e-eae1-4af1-8363-520cc718ba1c

http://textadventures.co.uk/forum/quest/topic/mu7itzjqv0yxrkdwgsbmzg/how-to-make-npc-confront-you-with-chioces#46cdb25b-4767-40a6-8bf4-3cd84e805781 (this goes into more detail of all this stuff we just did now in this post, along with going into library usage detail, so if you want to learn about libraries you can try this link of mine, or use the quest doc guide on using libraries, or get help on them from otehrs)

http://textadventures.co.uk/forum/samples/topic/5559/attributes-and-if-script-guide-by-hk (this is my guide on "scripting": Attribute usage and the 'if' script, but I got a lot of more general stuff at the top... scroll down a bit to get to the scripting stuff: Attribute usage and the 'if' Script, again not the best at explaining, so if too confusing/convoluted, use the quest docs, as it covers this stuff, and/or get help from others)

http://textadventures.co.uk/forum/samples/topic/5137/list-and-dictionary-extensive-guide-by-hk (and/if when you're ready, here's my guide on lists and dictionaries that you can try, again not the best at explaining stuff... or use the quest doc resources/guides on using lists/dictionaries, or get help from others)

anyways, hope you keep at it, and learn to use quest and its coding... and maybe even going on to learning more coding... hehe :D


oops... forgot one thing...

here's what it would look like horizontally:

<asl version="580"><include ref="English.aslx" /><include ref="Core.aslx" /><game name="NAME_OF_GAME"><attr name="gameid" type="string">2e475718-3650-42b4-8c7e-9f847834149d</attr><attr name="author" type="string">NAME_OF_AUTHOR</attr><attr name="subtitle" type="string">SUBTITLE</attr><attr name="version" type="string">1.0</attr><attr name="firstpublished" type="string">2019</attr></game><object name="room"><inherit name="editor_room" /></object><object name="player"><inherit name="editor_object" /><inherit name="editor_player" /><attr name="parent" type="object">room</attr></object></asl>

this should work fine... the computer has absolutely no problem with this... BUT WE HUMANS DO! YUCK! lol

we much prefer vertical blocks/lines of code like this:

<asl version="580">

  <include ref="English.aslx" />

  <include ref="Core.aslx" />

  <game name="NAME_OF_GAME">

    <attr name="gameid" type="string">2e475718-3650-42b4-8c7e-9f847834149d</attr>

    <attr name="author" type="string">NAME_OF_AUTHOR</attr>

    <attr name="subtitle" type="string">SUBTITLE</attr>

    <attr name="version" type="string">1.0</attr>

    <attr name="firstpublished" type="string">2019</attr>

  </game>

  <object name="room">

    <inherit name="editor_room" />

  </object>

  <object name="player">

    <inherit name="editor_object" />

    <inherit name="editor_player" />

    <attr name="parent" type="object">room</attr>

  </object>

</asl>

A library is simply a group of code, or a file you download for the desktop/computer version of Quest.

There are a few combat libraries, and a few tutorials.

For a quick example:
At game - script - start script.

player.hp = 100
monster.hp = 50
player.changedhitpoints => {
  if (player.hp > 0) {
    msg ("Hits points now " + player.hp)
  }
  else {
    msg ("You are dead!")
    finish
  }
}

When the monster is getting attacked.

this.hp = this.hp - 10

When the player is getting attacked.

player.hp = player.hp - 10

This is The Pixie's zombie apocalypse tutorial:
https://github.com/ThePix/quest/wiki/The-Zombie-Apocalypse-(on-the-web-version)
This is The Pixie's other combat library:
http://textadventures.co.uk/forum/samples/topic/4886/rpg-style-combat-library
This is Pertex's combat code.
http://textadventures.co.uk/forum/samples/topic/2660/library-rpg-elements
These are my tutorials.
This is my RPG tutorial, based on The Pixie's zombie tutorial.
https://textadventures.co.uk/forum/samples/topic/qzqe52enhuuacpdrljnffq/simple-turn-based-rpg-combat-for-the-quest-website#e27e61b1-4658-4a0f-bea4-2d01f7f325c0
This is my update to my RPG tutorial.
http://textadventures.co.uk/forum/samples/topic/vg6jtjrayesr4e5kqqytig/simple-turn-based-rpg-combat-code-update-working-on-a-new-system#700b753e-07e5-40dc-9fff-6c7cfa19ab28
This is "How to Get the Name, Gender, and Pronouns of the Player, RPG style."
http://textadventures.co.uk/forum/samples/topic/dzenkpsg8k6elyk12bdvpq/how-to-get-the-name-gender-and-pronouns-of-the-player-rpg-style

Good luck, and have fun on your game! :)


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums