Pointers for where to start studying code used in Quest

Silver
It's annoying me that none of it makes sense. Where's the best place to start? A noob JS book?

Such as this:

http://www.amazon.co.uk/JavaScript-Begi ... 0071632956


HegemonKhan
(moderators: it might be a good idea to make a new category~forum on this site and~or the doc webpages, for ~ 'quest code learning', as I think this could be really useful for people to learn quest coding (and hopefully more people will write learning guides, which will be much better than my poor attempt at it with this post contents, lol).

------------------

help is free thanks to internet... don't buy books, lol

you should learn quest's coding (see further below), if you're using quest to make your games, as you don't want to be doing multiple programming languages at the same time... it gets really messy and confusing for you...

here's a good site for learning to code (non-quest code though):

http://www.codecademy.com/

and all of the videos you can find too, such as (non-quest code though):

https://www.youtube.com/watch?v=k6U-i4gXkLM

(though these professors do a really horribly job in my opinion of explaining the basics, Attribute Types, of coding. I've only watched ~ maybe up to the 5 video though, so maybe their instruction gets better later on, lol)

------------

YESSSSS !!!! you're asking for learning code, hehe :D HK is excited to try to teach code, hehe :D

quest uses its own language, so you got to use quest's websites' webpages' resources to learn its coding. You can look at the other coding languages out there, to learn coding's basic structure and coding logic~mindset, but you're really just creating more work and confusion for yourself, because you'll have to switch over anyways to learning quest's language, and knowing another code language will cause you a lot of confusion, as you'll mix up stuff.

1. Introduction to Quest and if~coding logic~mindset~thinking, object + attribute usage, and etc:

tutorial ( http://docs.textadventures.co.uk/quest/tutorial/ ), to get used to quest's basics in general. Once you've gone through the entire tutorial, understanding quest's basics of how to do things in general, being able to work with the GUI~Editor, then go to #2

2. Introduction to Quest's Coding and Coding in general:

A. In the GUI~Editor, at the top bar, click on the notepaper-like button, between the 'play' and '?-help' buttons. This notepaper button is a toggle between the GUI~Editor mode and the Code View mode.

AND~OR

B. download and install ( http://notepad-plus-plus.org/ ), open up any (for now just your own game quest files) quest file (*.aslx), then at the top, click on 'languages' and then choose 'XML'

you can also use any text program~software too (but notepad++ is very useful, but it's not the only good one for coders, but I like it, as it's good enough for noobs like me with coding, hehe), such as: notepad, wordpad, (apple's equivalents), etc to open up your quest files in code.

these two (A and B) means~methods allows you to start getting familiar with quest's code, especially the GUI~Editor to Code View mode, as it's a 'rosetta stone' for you: do something in the GUI~Editor, then switch to the Code View mode, to see how it translates or converts into code, seeing how to do the same thing in code. slowly try to build up your knowledge of how to do the same things in code as you do in the GUI~Editor.

for an example:

create a new game, go into code view mode, see and match up the default new game code with the GUI~Editor's default new game stuff.

now, in the GUI~Editor, give your room a description, then go into Code View mode, ro see how to give a room a description in code.

etc etc etc, slowly build up your code knowledge: as you see more and more code lines (especially matched up with how it is in the GUI~Editor), you start to learn the coding's structure~form~syntax~patterns

3. Learning Quest's Code Training, Step by Step (let's use notepad++ for this):

in a new notepad++ file, we need to save it as a quest game file, which is simply done by giving it the extension of: .aslx (let's name our file: code training.aslx)

now... as for the code itself (within the file)... hehe:

quest reads code just as you read a book: (upper left to lower right: left to right, go down a line, left to right, etc etc etc), and also, it uses the same order as that of an outline format.

let's first tell quest that this is going to be a quest file, which is done by this game file 'tag' block:

http://docs.textadventures.co.uk/quest/elements/
http://docs.textadventures.co.uk/quest/ ... s/asl.html

ELEMENTS are your main things in quest (you should recognize these from the GUI~Editor): Game, Verbs, Commands, Functions, Objects, Exits, Turnscripts, Timers, Types (Object Types), etc etc etc

Coding has the same structure as the real world: we've got our reality split into physical things (matter) and actions~movement (energy~waves~forces), well so does coding too: physical things (ELEMENTS, Attributes, etc. Any thing that has the tags on it basically, lol) and actions~movement (scripting such as the code lines inside Verbs, Functions, Script Attributes, Turnscripts, Timers, and etc. Any thing that does NOT have the tags on it, basically, lol).

horizontally written: <asl>entire game code content</asl>

OR

vertically written:

<asl>
// entire game game content. notice how this is indented, as the indenting tells quest that this stuff is held within the <asl></asl> tag block, which it must be so as our game code must be within our game file, lol
</asl>


we're going to use vertical format as it's much easier for us noobs to work with, though for simple code lines, we use horizontal format (such as attribute code lines and etc). Programmers~Hackers use horizontal format, but we're not at that level yet, lol.

------

quiz time hehe:

question: how do you tell quest that this is going to be a library file instead of a game file ???

http://docs.textadventures.co.uk/quest/elements/
http://docs.textadventures.co.uk/quest/ ... brary.html

answer:

<library>
</library>


as for the library file's extension, it's the same as a game files: .aslx (such as: my library file.aslx)

-----

http://docs.textadventures.co.uk/quest/ ... ripts.html

by the way, the ' // ' is the command for writing comments (notes to yourself or others reading your code) in your code (though they need to be within a script block, otherwise they'll be erased by quest, but let's ignore this for now, as you need to learn to code first, to know what~where is a script block, lol)

------

'tags' in quest use the symbols~characters: ' <> ' (start of the tag block) and ' </> ' (end of the tag block)

http://docs.textadventures.co.uk/quest/elements/
http://docs.textadventures.co.uk/quest/ ... s/asl.html

<asl> (start of the game file tag block)
</asl> (end of the game file tag block)

think of a tag block as a bucket, which has a limit of containment (the top of the bucket and the bottom of the bucket, lol), but with code, we instead use a start tag ' <> ' and an end tag ' </> ', to tell quest where, using the bucket anology, the top of the bucket is and where the bottom of the bucket is, so that it can hold our code content within the bucket.

so, right now we've got it telling quest that this file is a game file in code:

<asl>
</asl>


---------

next, we've got to match up our game file quest version with the quest version of the quest engine that you downloaded and installed (quest.exe), which is done by adding an attribute INTO the game file tag ' <asl></as> ' itself, which is done by this (using the current quest version of '550' ):

http://docs.textadventures.co.uk/quest/elements/
http://docs.textadventures.co.uk/quest/ ... s/asl.html

<asl version="550">
</asl>


game file tag string attribute name: version
game file tag string attribute value: "550"

the equals sets the connection of version to "550" : version="550"

the quotes surrounding the 550 is required as this tells quest that this value is indeed a string value, which it must be as this is to be a string attribute.

-------

however, right now we've got no game engine core code, nor even what language (english, spanish, chinese, etc) will be used, so let's add these to our game file:

(we need to add the language first, then the core code, as quest needs to know the language it is to use, before it can then read the core code in that specific language. Remember, computers are very stupid, the secret and curse of programming, lol)

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
</asl>


http://docs.textadventures.co.uk/quest/elements/
http://docs.textadventures.co.uk/quest/ ... clude.html

the ' <include ref=" *.aslx " /> ' code line gets the file (which is already in the proper folder location, but if you want to use library files, you got to make sure your library file is in the same location as your quest.exe or is it the core.aslx files, meh), which means it gets the contents of the file that it gets, thus automatically adding that content into your game (during game play it is loaded up, have you played games with mods for them? you click~add the mods you want, and they get loaded up, 'initialized', when you start a game).

also, this ' include ref ' code line has slightly different (shortened) start and end tags: ' < ' (start) and ' /> ' (end), than the normal: ' <> ' (start) and ' </> ' (end)

the ' <include ref="English.aslx" /> ' is written above the ' <include ref="Core.aslx" /> ' because it will be read~used first, which it needs to be, before the ' <include ref="Core.aslx" /> ' is read~used.

also, remember to indent your ' include ref ' code lines, as we need them to be held WITHIN~INSIDE the game file: <asl></asl>

also, the ' <include ref="Core.aslx" /> ' needs to be at the SAME indenting as the ' <include ref="English.aslx" /> ' as you can't have it be within the ' <include ref="English.aslx" />, they (English.aslx and Core.aslx) both must be within the game file: <asl></asl>

--------

now, we need our special ' game ' Game Object, which holds your game's settings, so to add the tags for it:

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

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="code training">
</game>
</asl>


you should recognize+understand this game tag block now, as instead of adding the 'version="550" attribute within the tag, we are instead adding a 'name' string attribute to the game block tag.

again, we want the 'game' Game Object to be WITHIN the game file, so have it at the SAME indenting as your 'include ref', and it must be below (after) your 'include ref' (below~after the ' <include ref="core.aslx" /> ' ).

-------

now, let's add some of those game settings:

(create a new game using quest.exe, and look at it's code, do you understand those code lines attribute settings for the game tag block?)

let's first add our 'gameid' string attribute (this is why we needed to create a new game using the quest.exe to generate a game id which we'll copy and paste into your code training game file):

(my game id is pasted from an old game file of mine, to use for an example here)

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="code training">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
</game>
</asl>


notice how the 'gameid' is indented further, as we want~need it to be WITHIN our 'game' settings tag block, as the 'gameid' is a setting of our 'game' Game Object's settings, lol.

we'll get back to explaining its syntax later when we talk about Attributes, so for now, just remember its pattern~syntax. (not the value, as that's just a uniquely algorithm generated string pattern by the quest engine), but if interested:

<attr name="XXX" type="Attribute Type">Value</attr>

examples (using my naming system, lol):

<attr name="strength_string" type="string">strong</attr>
<attr name="strength_integer" type="int">100</attr>
<attr name="strength_double" type="double">100.0</attr>
<attr name="dead_boolean" type="boolean">false</attr>
<attr name="primary_colors_stringlist" type="simplestringlist">red;blue;yellow</attr>
<attr name="toys_objectlist" type="objectlist">ball;doll;squirt gun</attr>

<attr name="fight" type="script">
// scripting code lines
</attr>

etc etc etc

I don't think we really need to add the other attribute setting ' <version>1.0</version> ' that you see in your default new game (created from quest.exe) code, as it's just your own organization of~for your edited versions of your game creation, but maybe we do, so let's jsut add it too, to be safe:

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="code training">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
</game>
</asl>


--------

now let's add our default objects too:

http://docs.textadventures.co.uk/quest/elements/
http://docs.textadventures.co.uk/quest/ ... bject.html

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="code training">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
</game>
<object name="room">
<object name="player">
</object>
</object>
</asl>


you should understand this stuff now, without me explaining it, hopefully.... lol

a few things I do have to explain still though:

the ' include ref ' have to come first (above), then the (special) ' game ' Game Object (which holds your game's settings), but after (below) the 'game' Game Object, the order (up-down placement) of things don't matter, but the indenting ALWAYS does.

the ' <inherit name="editor_object" /> ', ' <inherit name="editor_player" /> ', and ' inherit name="editor_room" /> ' are for the GUI~Editor, so you can work with these Objects in the GUI~Editor, hehe:

http://docs.textadventures.co.uk/quest/ ... ditor.html

These are Object Types ' <type></type> ', though this is a bit more advanced for learning right now, but if you're interested in this stuff:

http://docs.textadventures.co.uk/quest/elements/
http://docs.textadventures.co.uk/quest/ ... /type.html

http://docs.textadventures.co.uk/quest/tutorial/
http://docs.textadventures.co.uk/quest/ ... types.html

-------

now that you hopefully are understanding quest's code, take a look at whatever code you can find, copy and paste it into a new game file, and then: study it directly, test it by playing the game, study it by switching between the GUI~Editor mode and Code View mode, and etc methods to study.

Probably the simpliest code to learn is the 'character creation' code, and once you learn that, pick some other code, rinse and repeat, slowly building up your coding knowledge, code piece by code pierce, it's been about 2 years for me now... it's a very slow process... argh... unless you're a genuis, lol.

http://docs.textadventures.co.uk/quest/ ... ation.html

then try learning these other code guides:

http://docs.textadventures.co.uk/quest/guides/

then, find other code in the libraries (or the quest forum itself too has code in its posts as well of course), and work on those:

viewforum.php?f=10
viewforum.php?f=18

---------------------

okay, I'm tired for now, let's see if this guide so far has worked for you... were you able to understand and follow this guide? is code starting to now make sense to you?

------

next guide content will be on Attributes, but see if you can now make sense of them on your own, but if not, then wait for my guide on them.

HegemonKhan
Here's the coding on this very webpage:

(you can view webpage code, via your browser's 'view~open source' option, though finding its location in each browser is a bit different)

(most of it is horizontal... good luck reading it... Programmers~Hackers can, but we can't yet... laughs)

(and also, it'll be in hexadecimal too, and further still be encrypted, non-publically viewable, obviously... intellectual property)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />


<title>textadventures.co.uk Forums &bull; View topic - Pointers for where to start studying code used in Quest</title>

<link href="./styles/we_clearblue/theme/print.css" rel="stylesheet" type="text/css" media="print" title="printonly" />
<link href="./style.php?id=2&amp;lang=en" rel="stylesheet" type="text/css" media="screen, projection" />
<link rel="alternate" type="application/atom+xml" title="Feed - textadventures.co.uk Forums" href="http://forum.textadventures.co.uk/feed.php" /><link rel="alternate" type="application/atom+xml" title="Feed - All forums" href="http://forum.textadventures.co.uk/feed.php?mode=forums" /><link rel="alternate" type="application/atom+xml" title="Feed - New Topics" href="http://forum.textadventures.co.uk/feed.php?mode=topics" /><link rel="alternate" type="application/atom+xml" title="Feed - Active Topics" href="http://forum.textadventures.co.uk/feed.php?mode=topics_active" /><link rel="alternate" type="application/atom+xml" title="Feed - Forum - General Discussion" href="http://forum.textadventures.co.uk/feed.php?f=3" /><link rel="alternate" type="application/atom+xml" title="Feed - Topic - Pointers for where to start studying code used in Quest" href="http://forum.textadventures.co.uk/feed.php?f=3&amp;t=4632" />

<!--
phpBB style name: we_clearblue
Based on style: prosilver (this is the default phpBB3 style)
Original author: Tom Beddard (http://www.subBlue.com/)
Modified by: weeb (http://weeb.pl)

NOTE: This page was generated by phpBB, the free open-source bulletin board package.
The phpBB Group is not responsible for the content of this page and forum. For more information
about phpBB please visit http://www.phpbb.com
-->

<script type="text/javascript">
// <![CDATA[
var jump_page = 'Enter the page number you wish to go to:';
var on_page = '1';
var per_page = '';
var base_url = '';
var style_cookie = 'phpBBstyle';
var style_cookie_settings = '; path=/; domain=.textadventures.co.uk';
var onload_functions = new Array();
var onunload_functions = new Array();



/**
* Find a member
*/
function find_username(url)
{
popup(url, 960, 570, '_usersearch');
return false;
}

/**
* New function for handling multiple calls to window.onload and window.unload by pentapenguin
*/
window.onload = function()
{
for (var i = 0; i < onload_functions.length; i++)
{
eval(onload_functions[i]);
}
}

window.onunload = function()
{
for (var i = 0; i < onunload_functions.length; i++)
{
eval(onunload_functions[i]);
}
}

// ]]>
</script>

<script type="text/javascript" src="./styles/we_clearblue/template/forum_fn.js"></script>
</head>
<body id="phpbb" class="section-viewtopic ltr">

<div id="wrapper">

<div id="header">
<div id="account">
<ul class="leftside">
<li>Last visit was: Thu Oct 02, 2014 11:43 am</li>
</ul>


<ul class="rightside">

<li><a href="./ucp.php" title="User Control Panel" accesskey="u">User Control Panel</a></li>
<li><a href="./ucp.php?i=pm&amp;folder=inbox" title="Private messages"><strong>0</strong> new messages</a></li> <li><a href="./search.php?search_id=egosearch" title="View your posts">View your posts</a></li>
<li><a href="./ucp.php?mode=logout&amp;sid=2bbd94c4461b71a0c391afab3d9edca8" title="Logout [ HegemonKhan ]" accesskey="l">Logout [ HegemonKhan ]</a></li>

</ul>

</div>

<div id="illustration">
<div id="site-description">
<h1><a href="./index.php" title="Board index">textadventures.co.uk Forums</a></h1>
<p></p>
</div>
</div>

<div id="main-navigation">
<ul id="primary-navigation" class="leftside">
<li><a href="./index.php" title="Board index">Board index</a></li>
<li><a href="./faq.php" title="Frequently Asked Questions">FAQ</a></li>

<li><a href="./search.php" title="View the advanced search options">Search</a></li>
<li><a href="./memberlist.php" title="View complete list of members">Members</a></li><li><a href="./memberlist.php?mode=leaders" title="The team">The team</a></li>
</ul>


<ul class="rightside linklist icons">
<li><a href="./memberlist.php?mode=email&amp;t=4632" title="E-mail friend" class="sendemail">E-mail friend</a></li><li><a href="./viewtopic.php?f=3&amp;t=4632&amp;view=print" title="Print view" accesskey="p" class="print">Print view</a></li>
</ul>

</div>
</div>

<div id="container">



<h2><a href="./viewtopic.php?f=3&amp;t=4632">Pointers for where to start studying code used in Quest</a></h2>
<!-- NOTE: remove the style="display: none" when you want to have the forum description on the topic body --><div style="display: none !important;">For general chat about anything else<br /></div>
<p>

<strong>Moderators:</strong> <a href="./memberlist.php?mode=viewprofile&amp;u=5940">Pertex</a>, <a href="./memberlist.php?mode=viewprofile&amp;u=39">Cryophile</a>, <a href="./memberlist.php?mode=viewprofile&amp;u=2" style="color: #AA0000;" class="username-coloured">Alex</a>, <a href="./memberlist.php?mode=viewprofile&amp;u=6393">sgreig</a>


</p>


<div class="topic-actions">

<div class="buttons">

<div class="reply-icon"><a href="./posting.php?mode=reply&amp;f=3&amp;t=4632" title="Post a reply"><span></span>Post a reply</a></div>

</div>


<div class="search-box">
<form method="post" id="topic-search" action="./search.php">
<fieldset>
<input class="inputbox search tiny" type="text" name="keywords" id="search_keywords" size="20" value="Search this topic…" onclick="if(this.value=='Search this topic…')this.value='';" onblur="if(this.value=='')this.value='Search this topic…';" />
<input class="button2" type="submit" value="Search" />
<input type="hidden" value="4632" name="t" />
<input type="hidden" value="msgonly" name="sf" />
</fieldset>
</form>
</div>

<div class="pagination">
2 posts
&bull; Page <strong>1</strong> of <strong>1</strong>
</div>


</div>
<div class="clear"></div>


<div id="p30420" class="post bg2">
<div class="inner"><span class="corners-top"><span></span></span>

<div class="postbody">

<ul class="profile-icons">
<li class="report-icon"><a href="./report.php?f=3&amp;p=30420" title="Report this post"><span>Report this post</span></a></li><li class="quote-icon"><a href="./posting.php?mode=quote&amp;f=3&amp;p=30420" title="Reply with quote"><span>Reply with quote</span></a></li>
</ul>


<h3 class="first"><a href="#p30420">Pointers for where to start studying code used in Quest</a></h3>
<p class="author"><a href="./viewtopic.php?p=30420#p30420"><img src="./styles/we_clearblue/imageset/icon_post_target.gif" width="11" height="9" alt="Post" title="Post" /></a>by <strong><a href="./memberlist.php?mode=viewprofile&amp;u=6931">Silver</a></strong> &raquo; Thu Oct 02, 2014 1:39 pm </p>



<div class="content">It's annoying me that none of it makes sense. Where's the best place to start? A noob JS book? <br /><br />Such as this:<br /><br /><!-- m --><a class="postlink" href="http://www.amazon.co.uk/JavaScript-Beginners-Guide-Third-Edition/dp/0071632956">http://www.amazon.co.uk/JavaScript-Begi ... 0071632956</a><!-- m --><br /><br />?</div>



</div>


<dl class="postprofile" id="profile30420">
<dt>
<a href="./memberlist.php?mode=viewprofile&amp;u=6931">Silver</a>
</dt>

<dd></dd>

<dd>&nbsp;</dd>

<dd><strong>Posts:</strong> 153</dd><dd><strong>Joined:</strong> Tue Jul 30, 2013 1:57 pm</dd><dd><strong>Location:</strong> Teesside &amp; London</dd>
<dd>
<ul class="profile-icons">
<li class="pm-icon"><a href="./ucp.php?i=pm&amp;mode=compose&amp;action=quotepost&amp;p=30420" title="Private message"><span>Private message</span></a></li>
</ul>
</dd>


</dl>


<div class="back2top"><a href="#wrapper" class="top" title="Top">Top</a></div>

<span class="corners-bottom"><span></span></span></div>
</div>

<hr class="divider" />

<div id="p30423" class="post bg1">
<div class="inner"><span class="corners-top"><span></span></span>

<div class="postbody">

<ul class="profile-icons">
<li class="edit-icon"><a href="./posting.php?mode=edit&amp;f=3&amp;p=30423" title="Edit post"><span>Edit post</span></a></li><li class="delete-icon"><a href="./posting.php?mode=delete&amp;f=3&amp;p=30423" title="Delete post"><span>Delete post</span></a></li><li class="report-icon"><a href="./report.php?f=3&amp;p=30423" title="Report this post"><span>Report this post</span></a></li><li class="quote-icon"><a href="./posting.php?mode=quote&amp;f=3&amp;p=30423" title="Reply with quote"><span>Reply with quote</span></a></li>
</ul>


<h3 ><a href="#p30423">Re: Pointers for where to start studying code used in Quest</a></h3>
<p class="author"><a href="./viewtopic.php?p=30423#p30423"><img src="./styles/we_clearblue/imageset/icon_post_target.gif" width="11" height="9" alt="Post" title="Post" /></a>by <strong><a href="./memberlist.php?mode=viewprofile&amp;u=6717">HegemonKhan</a></strong> &raquo; Thu Oct 02, 2014 8:23 pm </p>



<div class="content">(moderators: it might be a good idea to make a new category~forum on this site and~or the doc webpages, for ~ 'quest code learning', as I think this could be really useful for people to learn quest coding (and hopefully more people will write learning guides, which will be much better than my poor attempt at it with this post contents, lol).<br /><br />------------------<br /><br />help is free thanks to internet... don't buy books, lol<br /><br />you should learn quest's coding (see further below), if you're using quest to make your games, as you don't want to be doing multiple programming languages at the same time... it gets really messy and confusing for you...<br /><br />here's a good site for learning to code (non-quest code though):<br /><br /><!-- m --><a class="postlink" href="http://www.codecademy.com/">http://www.codecademy.com/</a><!-- m --><br /><br />and all of the videos you can find too, such as (non-quest code though):<br /><br /><!-- m --><a class="postlink" href="https://www.youtube.com/watch?v=k6U-i4gXkLM">https://www.youtube.com/watch?v=k6U-i4gXkLM</a><!-- m --><br /><br />(though these professors do a really horribly job in my opinion of explaining the basics, Attribute Types, of coding. I've only watched ~ maybe up to the 5 video though, so maybe their instruction gets better later on, lol)<br /><br />------------<br /><br />YESSSSS !!!! you're asking for learning code, hehe <img src="./images/smilies/icon_biggrin.gif" alt=":D" title="Very Happy" /> HK is excited to try to teach code, hehe <img src="./images/smilies/icon_biggrin.gif" alt=":D" title="Very Happy" /><br /><br />quest uses its own language, so you got to use quest's websites' webpages' resources to learn its coding. You can look at the other coding languages out there, to learn coding's basic structure and coding logic~mindset, but you're really just creating more work and confusion for yourself, because you'll have to switch over anyways to learning quest's language, and knowing another code language will cause you a lot of confusion, as you'll mix up stuff.<br /><br />1. Introduction to Quest and if~coding logic~mindset~thinking, object + attribute usage, and etc:<br /><br />tutorial ( <!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/tutorial/">http://docs.textadventures.co.uk/quest/tutorial/</a><!-- m --> ), to get used to quest's basics in general. Once you've gone through the entire tutorial, understanding quest's basics of how to do things in general, being able to work with the GUI~Editor, then go to #2<br /><br />2. Introduction to Quest's Coding and Coding in general:<br /><br />A. In the GUI~Editor, at the top bar, click on the notepaper-like button, between the 'play' and '?-help' buttons. This notepaper button is a toggle between the GUI~Editor mode and the Code View mode.<br /><br />AND~OR<br /><br />B. download and install ( <!-- m --><a class="postlink" href="http://notepad-plus-plus.org/">http://notepad-plus-plus.org/</a><!-- m --> ), open up any (for now just your own game quest files) quest file (*.aslx), then at the top, click on 'languages' and then choose 'XML'<br /><br />you can also use any text program~software too (but notepad++ is very useful, but it's not the only good one for coders, but I like it, as it's good enough for noobs like me with coding, hehe), such as: notepad, wordpad, (apple's equivalents), etc to open up your quest files in code.<br /><br />these two (A and B) means~methods allows you to start getting familiar with quest's code, especially the GUI~Editor to Code View mode, as it's a 'rosetta stone' for you: do something in the GUI~Editor, then switch to the Code View mode, to see how it translates or converts into code, seeing how to do the same thing in code. slowly try to build up your knowledge of how to do the same things in code as you do in the GUI~Editor.<br /><br />for an example:<br /><br />create a new game, go into code view mode, see and match up the default new game code with the GUI~Editor's default new game stuff.<br /><br />now, in the GUI~Editor, give your room a description, then go into Code View mode, ro see how to give a room a description in code.<br /><br />etc etc etc, slowly build up your code knowledge: as you see more and more code lines (especially matched up with how it is in the GUI~Editor), you start to learn the coding's structure~form~syntax~patterns<br /><br />3. Learning Quest's Code Training, Step by Step (let's use notepad++ for this):<br /><br />in a new notepad++ file, we need to save it as a quest game file, which is simply done by giving it the extension of: .aslx (let's name our file: code training.aslx)<br /><br />now... as for the code itself (within the file)... hehe:<br /><br />quest reads code just as you read a book: (upper left to lower right: left to right, go down a line, left to right, etc etc etc), and also, it uses the same order as that of an outline format.<br /><br />let's first tell quest that this is going to be a quest file, which is done by this game file 'tag' block:<br /><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/">http://docs.textadventures.co.uk/quest/elements/</a><!-- m --><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/asl.html">http://docs.textadventures.co.uk/quest/ ... s/asl.html</a><!-- m --><br /><br />ELEMENTS are your main things in quest (you should recognize these from the GUI~Editor): Game, Verbs, Commands, Functions, Objects, Exits, Turnscripts, Timers, Types (Object Types), etc etc etc<br /><br />Coding has the same structure as the real world: we've got our reality split into physical things (matter) and actions~movement (energy~waves~forces), well so does coding too: physical things (ELEMENTS, Attributes, etc. Any thing that has the tags on it basically, lol) and actions~movement (scripting such as the code lines inside Verbs, Functions, Script Attributes, Turnscripts, Timers, and etc. Any thing that does NOT have the tags on it, basically, lol).<br /><br />horizontally written: &lt;asl&gt;entire game code content&lt;/asl&gt;<br /><br />OR<br /><br />vertically written:<br /><br /><dl class="codebox"><dt>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd><code>&lt;asl&gt;<br />&nbsp; // entire game game content. notice how this is indented, as the indenting tells quest that this stuff is held within the &lt;asl&gt;&lt;/asl&gt; tag block, which it must be so as our game code must be within our game file, lol<br />&lt;/asl&gt;</code></dd></dl><br /><br />we're going to use vertical format as it's much easier for us noobs to work with, though for simple code lines, we use horizontal format (such as attribute code lines and etc). Programmers~Hackers use horizontal format, but we're not at that level yet, lol.<br /><br />------<br /><br />quiz time hehe:<br /><br />question: how do you tell quest that this is going to be a library file instead of a game file ???<br /><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/">http://docs.textadventures.co.uk/quest/elements/</a><!-- m --><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/library.html">http://docs.textadventures.co.uk/quest/ ... brary.html</a><!-- m --><br /><br />answer:<br /><br /><dl class="codebox"><dt>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd><code>&lt;library&gt;<br />&lt;/library&gt;</code></dd></dl><br /><br />as for the library file's extension, it's the same as a game files: .aslx (such as: my library file.aslx)<br /><br />-----<br /><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/scripts/scripts.html">http://docs.textadventures.co.uk/quest/ ... ripts.html</a><!-- m --><br /><br />by the way, the ' // ' is the command for writing comments (notes to yourself or others reading your code) in your code (though they need to be within a script block, otherwise they'll be erased by quest, but let's ignore this for now, as you need to learn to code first, to know what~where is a script block, lol)<br /><br />------<br /><br />'tags' in quest use the symbols~characters: ' &lt;&gt; ' (start of the tag block) and ' &lt;/&gt; ' (end of the tag block)<br /><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/">http://docs.textadventures.co.uk/quest/elements/</a><!-- m --><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/asl.html">http://docs.textadventures.co.uk/quest/ ... s/asl.html</a><!-- m --><br /><br />&lt;asl&gt; (start of the game file tag block)<br />&lt;/asl&gt; (end of the game file tag block)<br /><br />think of a tag block as a bucket, which has a limit of containment (the top of the bucket and the bottom of the bucket, lol), but with code, we instead use a start tag ' &lt;&gt; ' and an end tag ' &lt;/&gt; ', to tell quest where, using the bucket anology, the top of the bucket is and where the bottom of the bucket is, so that it can hold our code content within the bucket.<br /><br />so, right now we've got it telling quest that this file is a game file in code:<br /><br /><dl class="codebox"><dt>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd><code>&lt;asl&gt;<br />&lt;/asl&gt;</code></dd></dl><br /><br />---------<br /><br />next, we've got to match up our game file quest version with the quest version of the quest engine that you downloaded and installed (quest.exe), which is done by adding an attribute INTO the game file tag ' &lt;asl&gt;&lt;/as&gt; ' itself, which is done by this (using the current quest version of '550' ):<br /><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/">http://docs.textadventures.co.uk/quest/elements/</a><!-- m --><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/asl.html">http://docs.textadventures.co.uk/quest/ ... s/asl.html</a><!-- m --><br /><br /><dl class="codebox"><dt>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd><code>&lt;asl version=&quot;550&quot;&gt;<br />&lt;/asl&gt;</code></dd></dl><br /><br />game file tag string attribute name: version<br />game file tag string attribute value: &quot;550&quot;<br /><br />the equals sets the connection of version to &quot;550&quot; : version=&quot;550&quot;<br /><br />the quotes surrounding the 550 is required as this tells quest that this value is indeed a string value, which it must be as this is to be a string attribute.<br /><br />-------<br /><br />however, right now we've got no game engine core code, nor even what language (english, spanish, chinese, etc) will be used, so let's add these to our game file:<br /><br />(we need to add the language first, then the core code, as quest needs to know the language it is to use, before it can then read the core code in that specific language. Remember, computers are very stupid, the secret and curse of programming, lol)<br /><br /><dl class="codebox"><dt>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd><code>&lt;asl version=&quot;550&quot;&gt;<br />&nbsp; &lt;include ref=&quot;English.aslx&quot; /&gt;<br />&nbsp; &lt;include ref=&quot;Core.aslx&quot; /&gt;<br />&lt;/asl&gt;</code></dd></dl><br /><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/">http://docs.textadventures.co.uk/quest/elements/</a><!-- m --><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/include.html">http://docs.textadventures.co.uk/quest/ ... clude.html</a><!-- m --><br /><br />the ' &lt;include ref=&quot; *.aslx &quot; /&gt; ' code line gets the file (which is already in the proper folder location, but if you want to use library files, you got to make sure your library file is in the same location as your quest.exe or is it the core.aslx files, meh), which means it gets the contents of the file that it gets, thus automatically adding that content into your game (during game play it is loaded up, have you played games with mods for them? you click~add the mods you want, and they get loaded up, 'initialized', when you start a game).<br /><br />also, this ' include ref ' code line has slightly different (shortened) start and end tags: ' &lt; ' (start) and ' /&gt; ' (end), than the normal: ' &lt;&gt; ' (start) and ' &lt;/&gt; ' (end)<br /><br />the ' &lt;include ref=&quot;English.aslx&quot; /&gt; ' is written above the ' &lt;include ref=&quot;Core.aslx&quot; /&gt; ' because it will be read~used first, which it needs to be, before the ' &lt;include ref=&quot;Core.aslx&quot; /&gt; ' is read~used.<br /><br />also, remember to indent your ' include ref ' code lines, as we need them to be held WITHIN~INSIDE the game file: &lt;asl&gt;&lt;/asl&gt;<br /><br />also, the ' &lt;include ref=&quot;Core.aslx&quot; /&gt; ' needs to be at the SAME indenting as the ' &lt;include ref=&quot;English.aslx&quot; /&gt; ' as you can't have it be within the ' &lt;include ref=&quot;English.aslx&quot; /&gt;, they (English.aslx and Core.aslx) both must be within the game file: &lt;asl&gt;&lt;/asl&gt;<br /><br />--------<br /><br />now, we need our special ' game ' Game Object, which holds your game's settings, so to add the tags for it:<br /><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/">http://docs.textadventures.co.uk/quest/elements/</a><!-- m --><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/game.html">http://docs.textadventures.co.uk/quest/ ... /game.html</a><!-- m --><br /><br /><dl class="codebox"><dt>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd><code>&lt;asl version=&quot;550&quot;&gt;<br />&nbsp; &lt;include ref=&quot;English.aslx&quot; /&gt;<br />&nbsp; &lt;include ref=&quot;Core.aslx&quot; /&gt;<br />&nbsp; &lt;game name=&quot;code training&quot;&gt;<br />&nbsp; &lt;/game&gt;<br />&lt;/asl&gt;</code></dd></dl><br /><br />you should recognize+understand this game tag block now, as instead of adding the 'version=&quot;550&quot; attribute within the tag, we are instead adding a 'name' string attribute to the game block tag.<br /><br />again, we want the 'game' Game Object to be WITHIN the game file, so have it at the SAME indenting as your 'include ref', and it must be below (after) your 'include ref' (below~after the ' &lt;include ref=&quot;core.aslx&quot; /&gt; ' ).<br /><br />-------<br /><br />now, let's add some of those game settings:<br /><br />(create a new game using quest.exe, and look at it's code, do you understand those code lines attribute settings for the game tag block?)<br /><br />let's first add our 'gameid' string attribute (this is why we needed to create a new game using the quest.exe to generate a game id which we'll copy and paste into your code training game file):<br /><br />(my game id is pasted from an old game file of mine, to use for an example here)<br /><br /><dl class="codebox"><dt>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd><code>&lt;asl version=&quot;550&quot;&gt;<br />&nbsp; &lt;include ref=&quot;English.aslx&quot; /&gt;<br />&nbsp; &lt;include ref=&quot;Core.aslx&quot; /&gt;<br />&nbsp; &lt;game name=&quot;code training&quot;&gt;<br />&nbsp; &nbsp; &lt;gameid&gt;d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c&lt;/gameid&gt;<br />&nbsp; &lt;/game&gt;<br />&lt;/asl&gt;</code></dd></dl><br /><br />notice how the 'gameid' is indented further, as we want~need it to be WITHIN our 'game' settings tag block, as the 'gameid' is a setting of our 'game' Game Object's settings, lol.<br /><br />we'll get back to explaining its syntax later when we talk about Attributes, so for now, just remember its pattern~syntax. (not the value, as that's just a uniquely algorithm generated string pattern by the quest engine), but if interested:<br /><br />&lt;attr name=&quot;XXX&quot; type=&quot;Attribute Type&quot;&gt;Value&lt;/attr&gt;<br /><br />examples (using my naming system, lol):<br /><br />&lt;attr name=&quot;strength_string&quot; type=&quot;string&quot;&gt;strong&lt;/attr&gt;<br />&lt;attr name=&quot;strength_integer&quot; type=&quot;int&quot;&gt;100&lt;/attr&gt;<br />&lt;attr name=&quot;strength_double&quot; type=&quot;double&quot;&gt;100.0&lt;/attr&gt;<br />&lt;attr name=&quot;dead_boolean&quot; type=&quot;boolean&quot;&gt;false&lt;/attr&gt;<br />&lt;attr name=&quot;primary_colors_stringlist&quot; type=&quot;simplestringlist&quot;&gt;red;blue;yellow&lt;/attr&gt;<br />&lt;attr name=&quot;toys_objectlist&quot; type=&quot;objectlist&quot;&gt;ball;doll;squirt gun&lt;/attr&gt;<br /><br />&lt;attr name=&quot;fight&quot; type=&quot;script&quot;&gt;<br />// scripting code lines<br />&lt;/attr&gt;<br /><br />etc etc etc<br /><br />I don't think we really need to add the other attribute setting ' &lt;version&gt;1.0&lt;/version&gt; ' that you see in your default new game (created from quest.exe) code, as it's just your own organization of~for your edited versions of your game creation, but maybe we do, so let's jsut add it too, to be safe:<br /><br /><dl class="codebox"><dt>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd><code>&lt;asl version=&quot;550&quot;&gt;<br />&nbsp; &lt;include ref=&quot;English.aslx&quot; /&gt;<br />&nbsp; &lt;include ref=&quot;Core.aslx&quot; /&gt;<br />&nbsp; &lt;game name=&quot;code training&quot;&gt;<br />&nbsp; &nbsp; &lt;gameid&gt;d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c&lt;/gameid&gt;<br />&nbsp; &nbsp; &lt;version&gt;1.0&lt;/version&gt;<br />&nbsp; &lt;/game&gt;<br />&lt;/asl&gt;</code></dd></dl><br /><br />--------<br /><br />now let's add our default objects too:<br /><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/">http://docs.textadventures.co.uk/quest/elements/</a><!-- m --><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/object.html">http://docs.textadventures.co.uk/quest/ ... bject.html</a><!-- m --><br /><br /><dl class="codebox"><dt>Code: <a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd><code>&lt;asl version=&quot;550&quot;&gt;<br />&nbsp; &lt;include ref=&quot;English.aslx&quot; /&gt;<br />&nbsp; &lt;include ref=&quot;Core.aslx&quot; /&gt;<br />&nbsp; &lt;game name=&quot;code training&quot;&gt;<br />&nbsp; &nbsp; &lt;gameid&gt;d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c&lt;/gameid&gt;<br />&nbsp; &nbsp; &lt;version&gt;1.0&lt;/version&gt;<br />&nbsp; &lt;/game&gt;<br />&nbsp; &lt;object name=&quot;room&quot;&gt;<br />&nbsp; &nbsp; &lt;object name=&quot;player&quot;&gt;<br />&nbsp; &nbsp; &lt;/object&gt;<br />&nbsp; &lt;/object&gt;<br />&lt;/asl&gt;</code></dd></dl><br /><br />you should understand this stuff now, without me explaining it, hopefully.... lol<br /><br />a few things I do have to explain still though:<br /><br />the ' include ref ' have to come first (above), then the (special) ' game ' Game Object (which holds your game's settings), but after (below) the 'game' Game Object, the order (up-down placement) of things don't matter, but the indenting ALWAYS does.<br /><br />the ' &lt;inherit name=&quot;editor_object&quot; /&gt; ', ' &lt;inherit name=&quot;editor_player&quot; /&gt; ', and ' inherit name=&quot;editor_room&quot; /&gt; ' are for the GUI~Editor, so you can work with these Objects in the GUI~Editor, hehe:<br /><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/editor.html">http://docs.textadventures.co.uk/quest/ ... ditor.html</a><!-- m --><br /><br />These are Object Types ' &lt;type&gt;&lt;/type&gt; ', though this is a bit more advanced for learning right now, but if you're interested in this stuff:<br /><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/">http://docs.textadventures.co.uk/quest/elements/</a><!-- m --><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/elements/type.html">http://docs.textadventures.co.uk/quest/ ... /type.html</a><!-- m --><br /><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/tutorial/">http://docs.textadventures.co.uk/quest/tutorial/</a><!-- m --><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/tutorial/using_inherited_types.html">http://docs.textadventures.co.uk/quest/ ... types.html</a><!-- m --><br /><br />-------<br /><br />now that you hopefully are understanding quest's code, take a look at whatever code you can find, copy and paste it into a new game file, and then: study it directly, test it by playing the game, study it by switching between the GUI~Editor mode and Code View mode, and etc methods to study.<br /><br />Probably the simpliest code to learn is the 'character creation' code, and once you learn that, pick some other code, rinse and repeat, slowly building up your coding knowledge, code piece by code pierce, it's been about 2 years for me now... it's a very slow process... argh... unless you're a genuis, lol.<br /><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/guides/character_creation.html">http://docs.textadventures.co.uk/quest/ ... ation.html</a><!-- m --><br /><br />then try learning these other code guides:<br /><br /><!-- m --><a class="postlink" href="http://docs.textadventures.co.uk/quest/guides/">http://docs.textadventures.co.uk/quest/guides/</a><!-- m --><br /><br />then, find other code in the libraries (or the quest forum itself too has code in its posts as well of course), and work on those:<br /><br /><!-- l --><a class="postlink-local" href="http://forum.textadventures.co.uk/viewforum.php?f=10">viewforum.php?f=10</a><!-- l --><br /><!-- l --><a class="postlink-local" href="http://forum.textadventures.co.uk/viewforum.php?f=18">viewforum.php?f=18</a><!-- l --><br /><br />---------------------<br /><br />okay, I'm tired for now, let's see if this guide so far has worked for you... were you able to understand and follow this guide? is code starting to now make sense to you?<br /><br />------<br /><br />next guide content will be on Attributes, but see if you can now make sense of them on your own, but if not, then wait for my guide on them.</div>



</div>


<dl class="postprofile online" id="profile30423">
<dt>
<a href="./memberlist.php?mode=viewprofile&amp;u=6717">HegemonKhan</a>
</dt>

<dd></dd>

<dd>&nbsp;</dd>

<dd><strong>Posts:</strong> 996</dd><dd><strong>Joined:</strong> Thu Dec 06, 2012 12:11 am</dd><dd><strong>Location:</strong> CA, U.S.</dd>
<dd>
<ul class="profile-icons">
<li class="pm-icon"><a href="./ucp.php?i=pm&amp;mode=compose&amp;action=quotepost&amp;p=30423" title="Private message"><span>Private message</span></a></li><li class="email-icon"><a href="mailto:hegemonkhan@gmail.com" title="E-mail HegemonKhan"><span>E-mail HegemonKhan</span></a></li>
</ul>
</dd>


</dl>


<div class="back2top"><a href="#wrapper" class="top" title="Top">Top</a></div>

<span class="corners-bottom"><span></span></span></div>
</div>

<hr class="divider" />

<form id="viewtopic" method="post" action="./viewtopic.php?f=3&amp;t=4632">

<fieldset class="display-options" style="margin-top: 0; ">

<label>Display posts from previous: <select name="st" id="st"><option value="0" selected="selected">All posts</option><option value="1">1 day</option><option value="7">7 days</option><option value="14">2 weeks</option><option value="30">1 month</option><option value="90">3 months</option><option value="180">6 months</option><option value="365">1 year</option></select></label>
<label>Sort by <select name="sk" id="sk"><option value="a">Author</option><option value="t" selected="selected">Post time</option><option value="s">Subject</option></select></label> <label><select name="sd" id="sd"><option value="a" selected="selected">Ascending</option><option value="d">Descending</option></select> <input type="submit" name="sort" value="Go" class="button2" /></label>

</fieldset>

</form>
<hr />


<div class="topic-actions">
<div class="buttons">

<div class="reply-icon"><a href="./posting.php?mode=reply&amp;f=3&amp;t=4632" title="Post a reply"><span></span>Post a reply</a></div>

</div>


<div class="pagination">
2 posts
&bull; Page <strong>1</strong> of <strong>1</strong>
</div>

</div>


<p></p><p><a href="./viewforum.php?f=3" class="left-box left" accesskey="r">Return to General Discussion</a></p>

<form method="post" id="jumpbox" action="./viewforum.php" onsubmit="if(document.jumpbox.f.value == -1){return false;}">


<fieldset class="jumpbox">

<label for="f" accesskey="j">Jump to:</label>
<select name="f" id="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }">

<option value="-1">Select a forum</option>
<option value="-1">------------------</option>
<option value="19">Quest</option>

<option value="10">&nbsp; &nbsp;Quest Forum</option>

<option value="18">&nbsp; &nbsp;Libraries and Code Samples</option>

<option value="15">&nbsp; &nbsp;Developer Forum</option>

<option value="23">Squiffy</option>

<option value="24">&nbsp; &nbsp;Squiffy Forum</option>

<option value="8">Text Adventures</option>

<option value="5">&nbsp; &nbsp;Game Announcements and Feedback</option>

<option value="20">&nbsp; &nbsp;Interactive Fiction and Game Design</option>

<option value="3" selected="selected">&nbsp; &nbsp;General Discussion</option>

<option value="16">&nbsp; &nbsp;Site Announcements and Feedback</option>

<option value="12">Links</option>

<option value="13">&nbsp; &nbsp;Home</option>

<option value="22">&nbsp; &nbsp;Issue Tracker</option>

<option value="21">&nbsp; &nbsp;intfiction.org</option>

</select>
<input type="submit" value="Go" class="button2" />
</fieldset>
</form>


<h3><a href="./viewonline.php">Who is online</a></h3>
<p>Users browsing this forum: <a href="./memberlist.php?mode=viewprofile&amp;u=6717">HegemonKhan</a> and 0 guests</p>
</div>

<!--
We request you retain the full copyright notice below including the link to www.phpbb.com.
This not only gives respect to the large amount of time given freely by the developers
but also helps build interest, traffic and use of phpBB3. If you (honestly) cannot retain
the full copyright we ask you at least leave in place the "Powered by phpBB" line, with
"phpBB" linked to www.phpbb.com. If you refuse to include even this then support on our
forums may be affected.

The phpBB Group : 2006
//-->

<div id="footer">
<div id="footer-inner">
<div style="float: left;">
<p class="breadcrumbs">Jump to: <a href="./index.php" title="textadventures.co.uk Forums" accesskey="h">Board index</a> &rsaquo; <a href="./viewforum.php?f=8" title="Text Adventures">Text Adventures</a> &rsaquo; <a href="./viewforum.php?f=3" title="General Discussion">General Discussion</a></p>
<p>Powered by <a href="http://www.phpbb.com/">phpBB</a> &copy; 2000, 2002, 2005, 2007 phpBB Group.</p>

<p>Style <em>we_clearblue</em> created by <a href="http://weeb.pl/" title="/dev/weeb">weeb</a>.</p>
</div>


<ul class="rightside">
<li class="feed"><a href="http://forum.textadventures.co.uk/feed.php" title="Feed - textadventures.co.uk Forums">Feed</a></li><li class="feed"><a href="http://forum.textadventures.co.uk/feed.php?mode=forums" title="Feed - All forums">All forums</a></li><li class="feed"><a href="http://forum.textadventures.co.uk/feed.php?mode=topics" title="Feed - New Topics">New Topics</a></li><li class="feed"><a href="http://forum.textadventures.co.uk/feed.php?mode=topics_active" title="Feed - Active Topics">Active Topics</a></li>
</ul>

<ul class="rightside" style="margin-right: 50px;">
<li class="feed"><a href="http://forum.textadventures.co.uk/feed.php?f=3" title="Feed - Forum - General Discussion">General Discussion</a></li><li class="feed"><a href="http://forum.textadventures.co.uk/feed.php?f=3&amp;t=4632" title="Feed - Topic - Pointers for where to start studying code used in Quest">Pointers for where to start studying code used in Quest</a></li><li class="topic-link icon-subscribe"><a href="./viewtopic.php?uid=6717&amp;f=3&amp;t=4632&amp;watch=topic&amp;start=0&amp;hash=3f948a3a" title="Subscribe topic">Subscribe topic</a></li><li class="topic-link icon-bookmark"><a href="./viewtopic.php?f=3&amp;t=4632&amp;bookmark=1&amp;hash=3f948a3a" title="Bookmark topic">Bookmark topic</a></li>
</ul>

</div>

<div id="footer-fixed"></div>
</div>

</div>

<div>
<a id="bottom" name="bottom" accesskey="z"></a>

</div>

</body>
</html>

jaynabonne
Studying JS will help if you wish to dive "under the covers" to do more UI customization. The core Quest code is not written in JS, so JS would be a bit much. The Quest language is actually much simpler than JS.

If you know any programming at all, one approach I'd recommend is to look through the libraries that come with Quest. They're all the ASLX files in the Core folder where Quest is installed.

If not, then the tutorial (and asking specific "how to" questions) is a good start.

And most of all... experiment! Try it out and see what happens. :)

Silver
In the multiple sounds thread Pertex has posted up some code that plays multiple sounds upon commands. I dont know enough about code to tell you what code it is let alone edit it to suit my own circumstances. I guessed it was a javascript function so if that's the case then it's javascript I need to understand. Is it javascript or Quest's own code?

HegemonKhan
I don't know anything of the coding languages, so wait for jay to answer accurately on this question, but in what I hope I understand, laughs, here it is:

the JS (javascript) seems for when you need to bypass any limitations with quest's code, enabling you to directly code-connect with the computer, to use it within quest, such as for media files and~or UI (user interface).

Quest's coding is its own unique coding, though it's syntax at least is very similar to XML (eXtensible Markup Language).

---------

HTML (Hyper Text Markup Language) for for webpages

--------

I think JS and Python are suppose to be some of the languages that you start with, but I've no idea what I'm talking about, Jay and others programmers can better guide you with what language to start with and etc.

I think you can get a free software to practice with python... but I'm not sure.

C++ is a very useful language, I see it mentioned a lot with games, but I think it's quite a bit more advanced to try to learn.

jaynabonne
Pertex's post uses a combination of Quest language and Javascript.

The loadMusic function creates an "audio" HTML element with the desired file(s). The Javascript is then used just to play and pause that element.

One thing that will help with Quest is to understand HTML. Quest outputs HTML, and you typically use Javascript to manipulate that HTML. When you're playing a Quest game in the desktop editor/runner, click the HTML Tools button, and you'll be able to look at all the HTML elements. The actual game output is written to the "divOutput" element, which lives under "gameContent" under "gameBorder" within the "body" element. The "msg" (Output text) command creates div elements for the stuff you output.

You don't really have to know all that, but if you want to get down to the Javascript level at all, that's how it works: generally, output HTML text using the Quest output commands, and then use JS to manipulate it.

Not sure if that helps, but it's a starting point!

Silver
I do understand HTML on a very basic level. I should probably study that and style sheets too.

Thanks for the explanation of what that line of code was doing! I thought it was just loading the files from an external server and I was at a complete loss as to when the html5 tags came into the equation. I tried experimenting the other night. I watched a YouTube vid on using audio on web pages. I figured that if HTML works on text in the print message box of a script, the same might be true for audio. So I created a toilet and on the command "flush toilet" pasted the code and pointed to flush.mp3 in the game directory. In theory it should work. But, of course, it didn't. :D (I tested it online using chrome so know it isn't a browser issue).

But at least now I know it doesn't... :?

jaynabonne
If you could share it, I'd be happy to help you get it working, if it can be done. :)

One thing to do is to open the Javascript console in Chrome (Ctrl-Shift-J or under Tools in the menu) and see if you have any JS errors.

Silver
I'll upload it once I'm back in London which will be Tuesday. I didn't use any JS, I just typed in html5 audio code as you would on a web page. It brought up the console (which I didn't want) and didn't play any audio (which I did want). I was going out on a limb really, I bet it's totally the wrong place to put the code and/or the wrong code entirely.

Silver
jaynabonne wrote:If you could share it, I'd be happy to help you get it working, if it can be done. :)

One thing to do is to open the Javascript console in Chrome (Ctrl-Shift-J or under Tools in the menu) and see if you have any JS errors.


I haven't used JS (although I'm looking into that now as I think html5 will just bring more problems). In my mind this should work when uploaded and played using chrome but it doesn't. I'm assuming that the output is like html body. I'm complete noob at code so probably got it entirely wrong.

I have a background track run the traditional way, and additionally nested html5 code in a print message script within an action (flush toilet). :?

Um, the file size seems a bit too big for the forum's liking (I haven't really done much in the way of reducing file sizes beyond converting to mp3) So I've stuck it all in dropbox.

https://www.dropbox.com/sh/ila5cc5jga82 ... dV40a?dl=0

jaynabonne
Here's the link:

http://textadventures.co.uk/games/view/ ... sound-demo

It seems to work for me now. See if it does for you. I've attached the changed file as well.

I did two things:

1) Put a closing "</audio>" tag on the audio element. I'm not sure if that was needed or not, but I feel better with it there. :)

2) Added a call to GetFileURL around the sound file name so that it will resolve to an actual URL (the base name alone wouldn't match anything).

Hope that helps!

Silver
jaynabonne wrote:Here's the link:

http://textadventures.co.uk/games/view/ ... sound-demo

It seems to work for me now. See if it does for you. I've attached the changed file as well.

I did two things:

1) Put a closing "</audio>" tag on the audio element. I'm not sure if that was needed or not, but I feel better with it there. :)

2) Added a call to GetFileURL around the sound file name so that it will resolve to an actual URL (the base name alone wouldn't match anything).

Hope that helps!


Wow. I've been sitting with a smile on my face repeatedly flushing the toilet. I did initially have </audio> but a later tutorial (I've watched a few now) omitted it. I guess it's the GetFileURL which was the missing bit of the jigsaw. I'm pleased it didn't cancel out the ambience .mp3 played with vanilla Quest as that means that if there's a html5 issue (and there's many) people will still get the background sound and will have to settle for the descriptors alone for the foreground ones.

Thanks! :D

I should link to this from the thread where people are asking about it.

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

Support

Forums