Feature not working at completely - say #text#
Asyranok
13 Feb 2013, 22:08Hi.
I am using the tutorial, and have proceeded to this section, http://quest5.net/wiki/Custom_commands
I have followed the page to the letter, copying and pasting commands etc. I have taken an hour to check this over and over, and the only two result when testing this in-game is "You say " + text + ", but nobody replies."
This returned string is identical to the command except for the two ' that appear in the expression. Also, there tutorial mentions a version with backslashes. That completely breaks the return string in-game when attempting to use that, saying that the backslashes are incorrect syntax.
Finally, I have continued checking this over and over, and suddenly, without editing the code, I get a response of "I do not understand your command" - Again, I have changed absolutely nothing since getting the previous message returned. Has something changed with the newer version that makes the tutorial no longer accurate? Is this a bug?
What could be going on here? Again, I have done everything identically to what the tutorial instructs me to do, and done it several time over, starting from scratch.
I am using the tutorial, and have proceeded to this section, http://quest5.net/wiki/Custom_commands
I have followed the page to the letter, copying and pasting commands etc. I have taken an hour to check this over and over, and the only two result when testing this in-game is "You say " + text + ", but nobody replies."
This returned string is identical to the command except for the two ' that appear in the expression. Also, there tutorial mentions a version with backslashes. That completely breaks the return string in-game when attempting to use that, saying that the backslashes are incorrect syntax.
Finally, I have continued checking this over and over, and suddenly, without editing the code, I get a response of "I do not understand your command" - Again, I have changed absolutely nothing since getting the previous message returned. Has something changed with the newer version that makes the tutorial no longer accurate? Is this a bug?
What could be going on here? Again, I have done everything identically to what the tutorial instructs me to do, and done it several time over, starting from scratch.
sgreig
13 Feb 2013, 23:10You need to either paste your code or attach your game file so we can take a look.
Asyranok
13 Feb 2013, 23:40The code is copied and pasted from the tutorial.
So that would be the code to use.
I can try attaching the game file, but I didn't attach it because it is identical to the tutorial, so I didn't think it could possibly help. Ok here is the game file.
Thanks!
Edit* of note, I somehow changed it to "message" instead of expression. I changed it back but that had no effect.
So that would be the code to use.
I can try attaching the game file, but I didn't attach it because it is identical to the tutorial, so I didn't think it could possibly help. Ok here is the game file.
Thanks!
Edit* of note, I somehow changed it to "message" instead of expression. I changed it back but that had no effect.
HegemonKhan
14 Feb 2013, 00:32first, could you copy and past your game code here, using this:
[code.]your game code[/code.]
but remove the dots in the [ code ] 's
it'll look like this:
-----
you can get to the game code either by:
1. from your GUI (noob friendly with buttons and drop downs) mode, click on the button at the top bar, that looks like a note paper, and it's between the play and the ? (help) buttons. This notepaper button toggles between the GUI mode and the Code View mode.
~or~
2. simply opening your game file in note, note++, or word pad
-------
as, I'm not exactly able to figure out what you're asking for and~or what your problems are with, if you could re-explain it, I'd be appreciative.
-------
but, I'll (try to) do what I can in the meantime, lol.
I think this section has been slightly changed due to my own question about getting the orc part to work, which was quite a while ago (you can see this, by looking at the first few pages of my "Noob HK's Help Thread", hehe), so I'll go back over this section myself to help you.
getting the syntax correct within a msg (Print A Message), is really annoying... I still have trouble getting it right too, sighs
------
okay, the first part: Adding A Simple Command
this involves creating a "say" command.
if you make the command correctly, when you (as a game player) type in: say ???, the say triggers the command, and what it does is to return what you type in after ' say '.
so,
if you type in say hi, it will output back: hi
if you type in say what is your name, it will output back: what is your name
if you type in say say, have you seen my jacket?, it will output back: say, have you seen my jacket?
as it's example shows:
----
for the next part, since the above isn't really useful (lol), we're going to show some basic ways of making it more useful.
now for your "say" command, you want to: Add A Script (see the picture on the wiki) ->
Print A Message -> Print [expression] (make sure you change this to *EXPRESSION*, as using the MESSAGE choice will prevent this from working, this might be your problem that you're having) "You say " + text + ", but nobody replies."
ah, the tutorial has this instead (I think this syntax will still work fine too, but let me test it, brb in a minute after posting this post, lol):
"You say "" + text + "", but nobody replies."
the rules of getting the syntax correct are way too confusing~complex for me to try to explain, so I'm not going to do so, lol.
well, I'll give it a partial go at it:
if you're just typing in a message you wanna say, then you just select the [MESSAGE] choice, and then just type in your message.
the problem lies when you want to have your message along with game coding. As first, you got to remember to switch it to [EXPRESSION], but here's where it gets complex~confusing:
prose = your message
code = game code
you need to separate the prose and code, and code and code too, with + signs, so it would look like this (for an example):
Print [EXPRESSION] "Prose1 + code1 + prose2 + code2"
but, you also got to get the " marks correct too... this is the confusing part...
Print [EXPRESSION] "Prose1 " + code1 + " prose1 " + code2 + "."
this is my method for getting it correct:
" + code + " and then you need quotes for the beginning and the end of the entire line.
so, it breaks down into parts (represented by the brackets) like this:
[ " ] [ prose1 ] [ " + code1 + " ] [ prose2 ] [ " + code2 + " ] [ ." ]
so, here is what it would look like (using my version of~from the tutorial's example):
prose1 = You say
code1 = text
prose2 = , but nobody replies
[ " ] [ prose1 ] [ " + code1 + " ] [ prose2 ] [ ." ]
[ " ] [ You say ] [ " + text + " ] [ , but nobody replies ] [ ." ]
"You say " + text + ", but nobody replies."
you (as a game player) type in:
say I have fallen and I cannot get up!
the game outputs:
You say I have fallen and cannot get up!, but nobody replies.
---------
the part about the use of the [ \" ] or [ ' ] is for putting in either a " or a ' as a part of your message.
due to the coding, for the " mark, you need to the \ sign with it, to tell the game coding that this is not a coding sign, it is just a quatation mark, as otherwise, the " mark is a code, telling the game to do some coding thing.
or, if you'd rather, you can just use the single quatation mark ( ' ), as this isn't a code of the game, so it works fine as is.
for example:
[ " ] [ prose1 ] [ \" ] [ " + code1 + " ] [ \" ] [ prose2 ] [ ." ]
[ " ] [ You say, ] [ \" ] [ " + text + " ] [ \" ] [ , but nobody replies ] [ ." ]
"You say, /" " + text + " \", but nobody replies."
you (as a game player) type in:
say I have fallen and I cannot get up!
the game outputs:
You say, " I have fallen and cannot get up! ", but nobody replies.
~OR~
[ " ] [ prose1 ] [ ' ] [ " + code1 + " ] [ ' ] [ prose2 ] [ ." ]
[ " ] [ You say, ] [ ' ] [ " + text + " ] [ ' ] [ , but nobody replies ] [ ." ]
"You say, ' " + text + " ', but nobody replies."
you (as a game player) type in:
say I have fallen and I cannot get up!
the game outputs:
You say, ' I have fallen and cannot get up! ', but nobody replies.
---------
next part of wiki: Alternative Command Patterns
in your command setting window, you can add more code words in by using a semicolon:
say #text#;shout #text#;yell #text#
so, you can use any of these words:
say #text#
game player types in: say hi
game outputs: hi
shout #text#
game player types in: shout hi
game outputs: hi
yell #text#
game player types in: yell hi
game outputs: hi
this is useful for helping the player out, as he may think of typing in talk, whereas if you only use "say", then he's stuck, as he doesn't realize to try using the word "say". This way, you give more code words for him to be able to hopefully guess at, using one of them, lol. this same thing applies for verbs, the person may not think of using the word "equip", so add in other words for the same verb code too, such as "put on" and~or "wear" and~or "clothe".
--------
let me know if you need help with the weighing section or the talk to troll section.
[code.]your game code[/code.]
but remove the dots in the [ code ] 's
it'll look like this:
your game code
-----
you can get to the game code either by:
1. from your GUI (noob friendly with buttons and drop downs) mode, click on the button at the top bar, that looks like a note paper, and it's between the play and the ? (help) buttons. This notepaper button toggles between the GUI mode and the Code View mode.
~or~
2. simply opening your game file in note, note++, or word pad
-------
as, I'm not exactly able to figure out what you're asking for and~or what your problems are with, if you could re-explain it, I'd be appreciative.
-------
but, I'll (try to) do what I can in the meantime, lol.
I think this section has been slightly changed due to my own question about getting the orc part to work, which was quite a while ago (you can see this, by looking at the first few pages of my "Noob HK's Help Thread", hehe), so I'll go back over this section myself to help you.
getting the syntax correct within a msg (Print A Message), is really annoying... I still have trouble getting it right too, sighs
------
okay, the first part: Adding A Simple Command
this involves creating a "say" command.
if you make the command correctly, when you (as a game player) type in: say ???, the say triggers the command, and what it does is to return what you type in after ' say '.
so,
if you type in say hi, it will output back: hi
if you type in say what is your name, it will output back: what is your name
if you type in say say, have you seen my jacket?, it will output back: say, have you seen my jacket?
as it's example shows:
wiki wrote:For example:
If the player types "say hello", the "text" string variable will contain "hello"
If the player types "say what a lovely day", the "text" string variable will contain "what a lovely day"
----
for the next part, since the above isn't really useful (lol), we're going to show some basic ways of making it more useful.
now for your "say" command, you want to: Add A Script (see the picture on the wiki) ->
Print A Message -> Print [expression] (make sure you change this to *EXPRESSION*, as using the MESSAGE choice will prevent this from working, this might be your problem that you're having) "You say " + text + ", but nobody replies."
ah, the tutorial has this instead (I think this syntax will still work fine too, but let me test it, brb in a minute after posting this post, lol):
"You say "" + text + "", but nobody replies."
the rules of getting the syntax correct are way too confusing~complex for me to try to explain, so I'm not going to do so, lol.
well, I'll give it a partial go at it:
if you're just typing in a message you wanna say, then you just select the [MESSAGE] choice, and then just type in your message.
the problem lies when you want to have your message along with game coding. As first, you got to remember to switch it to [EXPRESSION], but here's where it gets complex~confusing:
prose = your message
code = game code
you need to separate the prose and code, and code and code too, with + signs, so it would look like this (for an example):
Print [EXPRESSION] "Prose1 + code1 + prose2 + code2"
but, you also got to get the " marks correct too... this is the confusing part...
Print [EXPRESSION] "Prose1 " + code1 + " prose1 " + code2 + "."
this is my method for getting it correct:
" + code + " and then you need quotes for the beginning and the end of the entire line.
so, it breaks down into parts (represented by the brackets) like this:
[ " ] [ prose1 ] [ " + code1 + " ] [ prose2 ] [ " + code2 + " ] [ ." ]
so, here is what it would look like (using my version of~from the tutorial's example):
prose1 = You say
code1 = text
prose2 = , but nobody replies
[ " ] [ prose1 ] [ " + code1 + " ] [ prose2 ] [ ." ]
[ " ] [ You say ] [ " + text + " ] [ , but nobody replies ] [ ." ]
"You say " + text + ", but nobody replies."
you (as a game player) type in:
say I have fallen and I cannot get up!
the game outputs:
You say I have fallen and cannot get up!, but nobody replies.
---------
the part about the use of the [ \" ] or [ ' ] is for putting in either a " or a ' as a part of your message.
due to the coding, for the " mark, you need to the \ sign with it, to tell the game coding that this is not a coding sign, it is just a quatation mark, as otherwise, the " mark is a code, telling the game to do some coding thing.
or, if you'd rather, you can just use the single quatation mark ( ' ), as this isn't a code of the game, so it works fine as is.
for example:
[ " ] [ prose1 ] [ \" ] [ " + code1 + " ] [ \" ] [ prose2 ] [ ." ]
[ " ] [ You say, ] [ \" ] [ " + text + " ] [ \" ] [ , but nobody replies ] [ ." ]
"You say, /" " + text + " \", but nobody replies."
you (as a game player) type in:
say I have fallen and I cannot get up!
the game outputs:
You say, " I have fallen and cannot get up! ", but nobody replies.
~OR~
[ " ] [ prose1 ] [ ' ] [ " + code1 + " ] [ ' ] [ prose2 ] [ ." ]
[ " ] [ You say, ] [ ' ] [ " + text + " ] [ ' ] [ , but nobody replies ] [ ." ]
"You say, ' " + text + " ', but nobody replies."
you (as a game player) type in:
say I have fallen and I cannot get up!
the game outputs:
You say, ' I have fallen and cannot get up! ', but nobody replies.
---------
next part of wiki: Alternative Command Patterns
in your command setting window, you can add more code words in by using a semicolon:
say #text#;shout #text#;yell #text#
so, you can use any of these words:
say #text#
game player types in: say hi
game outputs: hi
shout #text#
game player types in: shout hi
game outputs: hi
yell #text#
game player types in: yell hi
game outputs: hi
this is useful for helping the player out, as he may think of typing in talk, whereas if you only use "say", then he's stuck, as he doesn't realize to try using the word "say". This way, you give more code words for him to be able to hopefully guess at, using one of them, lol. this same thing applies for verbs, the person may not think of using the word "equip", so add in other words for the same verb code too, such as "put on" and~or "wear" and~or "clothe".
--------
let me know if you need help with the weighing section or the talk to troll section.
HegemonKhan
14 Feb 2013, 00:48.
.
the wiki's code is *INcorrect* syntax of:
"You say "" + text + "", but nobody replies."
the problem, error: ~"literal", is that the "" + text + "" causes this to be read literally (as prose) by the game as: + text +
so, that prevents the " text " command code from working as code, so that it wants to replace text with (for example): hi, but it can't do so, and thus the error.
---------
here's the correct syntax:
Print [EXPRESSION] "You say " + text + ", but nobody replies."
let me know if you still have other problems, or a problem with this specific part of the wiki.
---------
P.S.
I'm looking over your game code, for any other problems, you might have just in case, and in doing so, notice your game code lines:
do you see any incorrect "" + code + "" here? NOPE, all you see is correct: " + code + ", as seen:
" + eggs.weight + "
" + object.article + "
so, the incorrect wiki's line, was incorrect, so it wasn't your fault, hehe.
note: if you use two codes next to each other, then you'll have "", but it's a bit different:
" + code1 + " " + code2 + "
such as with character creation (after you finish the tutorial, hehe):
Print [EXPRESSION] "player.alias + " is a " + player.gender + " " + player.race + " " + player.class +"."
get input script: type in your name, and with the Set Variable or Attribute script, the game will define it to: player.alias
gender choices: male or female
race choices: human, dwarf, or elf
class choices: warrior, cleric, mage, or thief
if you typed in: HK
and if you chose: male (gender), human (race), and warrior (class)
[ " ] [ player.alias + ] [ " is a " ] [ " + player.gender + " ] [ " + player.race + " ] [ " + player.class +" ] [ ." ]
HK is a male human warrior.
-----
in your game code, you've got this:
change it to this:
or, if you prefer the single quatation marks instead:
or, if you don't want the double or single quatation marks in it (not grammically correct, but it's in its base form):
----------
P.S.S.
someone should fix the wiki, so not to cause any other noobs to "pull out their hair" in frustration, hehe.
.
the wiki's code is *INcorrect* syntax of:
"You say "" + text + "", but nobody replies."
the problem, error: ~"literal", is that the "" + text + "" causes this to be read literally (as prose) by the game as: + text +
so, that prevents the " text " command code from working as code, so that it wants to replace text with (for example): hi, but it can't do so, and thus the error.
---------
here's the correct syntax:
Print [EXPRESSION] "You say " + text + ", but nobody replies."
let me know if you still have other problems, or a problem with this specific part of the wiki.
---------
P.S.
I'm looking over your game code, for any other problems, you might have just in case, and in doing so, notice your game code lines:
msg ("A box of eggs, weighing " + eggs.weight + " grams.")
<defaultexpression>"You can't watch " + object.article + "."</defaultexpression>
do you see any incorrect "" + code + "" here? NOPE, all you see is correct: " + code + ", as seen:
" + eggs.weight + "
" + object.article + "
so, the incorrect wiki's line, was incorrect, so it wasn't your fault, hehe.
note: if you use two codes next to each other, then you'll have "", but it's a bit different:
" + code1 + " " + code2 + "
such as with character creation (after you finish the tutorial, hehe):
Print [EXPRESSION] "player.alias + " is a " + player.gender + " " + player.race + " " + player.class +"."
get input script: type in your name, and with the Set Variable or Attribute script, the game will define it to: player.alias
gender choices: male or female
race choices: human, dwarf, or elf
class choices: warrior, cleric, mage, or thief
if you typed in: HK
and if you chose: male (gender), human (race), and warrior (class)
[ " ] [ player.alias + ] [ " is a " ] [ " + player.gender + " ] [ " + player.race + " ] [ " + player.class +" ] [ ." ]
HK is a male human warrior.
-----
in your game code, you've got this:
<command>
<pattern>say #text# </pattern>
<script>
msg ("\"You say '\" + text + \"', but nobody replies.\"")
</script>
</command>
change it to this:
<command>
<pattern>say #text#</pattern>
<script>
msg ( " You say, \" " + text + " \", but nobody replies. " )
</script>
</command>
or, if you prefer the single quatation marks instead:
<command>
<pattern>say #text#</pattern>
<script>
msg ( " You say, ' " + text + " ', but nobody replies. " )
</script>
</command>
or, if you don't want the double or single quatation marks in it (not grammically correct, but it's in its base form):
<command>
<pattern>say #text#</pattern>
<script>
msg ("You say " + text + ", but nobody replies.")
</script>
</command>
----------
P.S.S.
someone should fix the wiki, so not to cause any other noobs to "pull out their hair" in frustration, hehe.
HegemonKhan
14 Feb 2013, 01:33haha... wow... I'm good... lol... you're DAMN lucky I've spotted this... lol
you had ONE other problem in your game code...
for your command pattern:
say #text#
when you copied and pasted it in, you copied a space at the end of it... so delete this hidden copied space, and now it'll work.
this is what you have currently:
say(space)#text#(space)
so change it to this:
say(space)#text#
say #text#
---------
see, your pattern was this (due to the unseen copied space at the end of it):
say(space)#text#(space)
and so, say(space)#text#(space) command code pattern doesn't match up with your game player input of, say(space)#text#
and thus the error: ~ "Don't understand this command"
---------
you can see the problem via here, using the code box:
your (incorrect) game code:
see the space after the text# and before the </pattern> ??? this is causing the command to not work also, along with your msg line being incorect too.
compared to that space being deleted by me, in this (correct) code:
see how there's now no space between the text# and </pattern> ???
you had ONE other problem in your game code...
for your command pattern:
say #text#
when you copied and pasted it in, you copied a space at the end of it... so delete this hidden copied space, and now it'll work.
this is what you have currently:
say(space)#text#(space)
so change it to this:
say(space)#text#
say #text#
---------
see, your pattern was this (due to the unseen copied space at the end of it):
say(space)#text#(space)
and so, say(space)#text#(space) command code pattern doesn't match up with your game player input of, say(space)#text#
and thus the error: ~ "Don't understand this command"
---------
you can see the problem via here, using the code box:
your (incorrect) game code:
<command>
<pattern>say #text# </pattern>
<script>
msg ("\"You say '\" + text + \"', but nobody replies.\"")
</script>
</command>
see the space after the text# and before the </pattern> ??? this is causing the command to not work also, along with your msg line being incorect too.
compared to that space being deleted by me, in this (correct) code:
<command>
<pattern>say #text#</pattern>
<script>
msg ( " You say, \" " + text + " \", but nobody replies. " )
</script>
</command>
see how there's now no space between the text# and </pattern> ???
Asyranok
14 Feb 2013, 04:12Thanks!
It's fixed. Don't rightly know what it was, but it just sort of started working suddenly.
editt: Ahh, thanks Hagemon et al, for spotting the exact spot of the error!
It's fixed. Don't rightly know what it was, but it just sort of started working suddenly.
editt: Ahh, thanks Hagemon et al, for spotting the exact spot of the error!
HegemonKhan
14 Feb 2013, 04:20be careful with highlighting+copying... make sure you don't highlight+copy a space beyond the text you want to copy 
and the use of the \" or ', is a bit confusing in its explanation in the wiki
and... syntax is a b.... !!! (at least for me... my problems are always a syntax problem... usually anyways, lol)

and the use of the \" or ', is a bit confusing in its explanation in the wiki

and... syntax is a b.... !!! (at least for me... my problems are always a syntax problem... usually anyways, lol)