Commands Help URGENT

Hambo325
23 Jan 2017, 21:53

I can't seem to run any commands by typing them in. Well, the player can't. For example, when I use the msg command and say "where do you want to go?", there is no box to even type. I can't figure out how to get the stupid UI to show up. Help please.


hegemonkhan
23 Jan 2017, 22:01

there's two ways of getting typed-in input:

  1. the 'Command' Element ( http://docs.textadventures.co.uk/quest/elements/command.html )
  2. the 'get input' Script/Function ( http://docs.textadventures.co.uk/quest/scripts/get_input.html )

note that 'get input' does this automatically (hidden from you): result = YOUR_INPUT, which you can then use that 'result' Variable VARIABLE for whatever you want to do.

as for the UI not showing up... based on your other post, I presume you're still missing some needed quest files.


Hambo325
23 Jan 2017, 22:03

where exactly do I put that command element code thing...( I'm sorry, the only coding I've done has been minecraft command blocks and those use loops and even then it was a year ago.)I'm on the online version btw


Hambo325
23 Jan 2017, 22:05

nah, i'm on the online version, I would prefer to download it but I have no way to use the installer, unless it's already unpacked.


hegemonkhan
23 Jan 2017, 22:30

if you're working in code directly:

anywhere below 'game' Game Settings Object tag block, to be safe, and at the indent/nesting level/layer of within the 'asl' tag block (the 'asl' tag contains your entire game code, thus it is your game/game code)

<asl version="550">
  // your game / your game content-code / your entire game code/content must go here (within this 'asl' tag block)
</asl>

// the default library files for quest:

// (you can add more or different library files, but do note that the order of them: top-bottom, matters, as this is the initialization, "building up", of the game)

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

to make a library file (it has the same extension of 'xxx.aslx' for its file name, as do game files having 'xxx.aslx' for their file names):

<library>
  // you content/code goes here
</library>

hopefully you can see that quest is just a bunch of library files, if you're a good programmer, you can create your own engine, instead of using Quest's (default: 'English.aslx', and 'Core.aslx')

(the 'Core.aslx' is mostly just a manager/hub file for including all of the individual core files, which you can see if you download quest, in its quest folder)


// this is a special Object, which controls game information (author, version, firstpublished, etc), game settings/options/features, the 'start' Script Attribute (this is run/executed at the start of the game, for example, good for character creation and/or intro dialogue/stuff), and/or other various global-like stuff, too

<game name="xxx">
  // various game settings and etc Attributes: 'author', 'version', 'firstpublished', 'start', etc etc etc
</game>

so, now you can put your Elements anywhere (below the 'game' Game Settings+Etc Object tag block), for examples (using the default new game code as template):

(I'm line spacing it --- which does NOT effect it from working: no line spacing vs line spacing makes no difference for quest, so you can see its structure/format easier)

<asl version="550">

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

  <game name="xxx">
    <attr name="gameid" type="string">AN_ALGORITHM_GENERATED_HASH/STRING</attr>
    <attr name="version" type="string">1.0</attr>
    <attr name="firstpublished" type="string">2017</attr> // maybe it's type is 'int', meh (not sure which it is)
  </game>

  <command name="xxx">
    // content/code/Attributes
  </command>

  <object name="room">
    <inherit name="editor_room" />
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
  </object>

</asl>

or

<asl version="550">

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

  <game name="xxx">
    <attr name="gameid" type="string">AN_ALGORITHM_GENERATED_HASH/STRING</attr>
    <attr name="version" type="string">1.0</attr>
    <attr name="firstpublished" type="string">2017</attr> // maybe it's type is 'int', meh (not sure which it is)
  </game>

  <object name="room">
    <inherit name="editor_room" />
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
  </object>

  <command name="xxx">
    // content/code/Attributes
  </command>

</asl>

see how for both examples, that the indenting (nesting) of the 'Command' Element lines up with the 'game' Game Settings+Etc Object tag's indenting, the 'include' (library files) tags' indenting, and the 'room' Room Object's indenting. They are all direct children of the 'asl' tag


I've never used the online/web version, so I'm not sure what its GUI/Editor/UI looks like, but if it's like the desktop/offline version, on the left side, should be a "tree of stuff":

Objects
-> Game
->-> Verbs
->-> Commands
-> the default 'room' Room Object
->-> the default 'player' Player Object
Functions
Timers
Object Types

click on the 'Commands', these are global Commands (meaning that they're direct children of the 'asl' tag block: they are NOT within an Object, as that would make them be local Commands), which quest will place them in your game code for you, so you don't have to worry about where/how to put them.


Hambo325
23 Jan 2017, 22:35

thanks so much, I really appreciate the help


hegemonkhan
23 Jan 2017, 22:38

I added in a bit more content to my previous post, refresh and take a look at the bottom extra part of it


HK edit:

here's some helpful guides/links:

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

and this specifically really helps learning these important things:

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