conversation tutorial broke my game

dwn
05 Feb 2013, 03:08
I can't figure out why trying to load Dynamic Menus for Conversations and it broke my game, so I cannot load or edit it?

http://quest5.net/w/index.php?title=Dyn ... oldid=2461

I followed these instructions:

Setting Up

The first thing you need to do is to include the library in your game, so (once you have it downloaded) expand the "Advanced" object in the left pane, then click on "Included Libraries". In the right pane, click on "Add", and navigate to the downloaded file. Save and reload.

And I get this screen trying to start game:

brokegame.jpg


Does ayone know how to undo this?

HegemonKhan
05 Feb 2013, 03:21
simply open your game file with notepad, wordpad, or notepad++, highlight it, copy it, and then paste it here.

unless it's not something you've done, then maybe the library code just needs to be adjusted for the new 5.3 version of quest.

--------

your game's not broken, quest simply requires your code to be perfect, so something is wrong with just the coding. you can simply remove the library and its coding, and your game will be back to normal as it was, or we can try to figure out what the problem is, but we'll need you to post the game code, first, before we can help you.

------

as the error reads:

Failed to load game due to the following errors:
*Error: Error adding type 'editor_room' to element 'DerelictTown_Region': No element 'editor_room' of type 'ObjectType'

without your game file yet, I'm not too sure exactly what you've done wrong, as I am still learning these error messages myself, maybe someone else can better help you, but it looks like (as best as I can deduce) you might have a mistake with the:

<inherit name="editor_room" />
(this is what it should look like, and it should be correct, as it is the default object type of quest for all rooms, so you probably did something wrong, and messed it up)

on your 'DerelictTown_Region' room

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

this is no big deal, we just need to see your game code, and then to compare it with the dynamic conversation library's code.

-----------

I myself had about ~20+ errors with my combat system code, all of which were mostly stupid typos, of wrong syntax and~or formatting of the code, lol.

my biggest culprit:

always forgetting to add the ">" at the end of a code line, lol.

for example, I often would type this in:

<inherit name="editor_room"

forgetting to add the "/>" at the end of it, which correctly looks like:

<inherit name="editor_room" />

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

you should download this:

http://notepad-plus-plus.org/download/v6.2.3.html

and use it to open up your game file (right click on game file, edit with notepad++), as it is really helpful to spot mistakes in your code writing. simply go to its top menu bar to languages and select ' xml ' near the bottom of the list.

dwn
05 Feb 2013, 03:41
HegemonKhan wrote:simply open your game file with notepad, wordpad, or notepad++, highlight it, copy it, and then paste it here.

unless it's not something you've done, then maybe the library code just needs to be adjusted for the new 5.3 version of quest.

--------

your game's not broken, quest simply requires your code to be perfect, so something is wrong with just the coding. you can simply remove the library and its coding, and your game will be back to normal as it was, or we can try to figure out what the problem is, but we'll need you to post the game code, first, before we can help you.


Thanks yeah, I did that and managed to undo it and patch it back together in notepad just on a whim, without really know what I was doing--I was going to play around with the conversation system. Seems like there should be a simple tutorial on how to load the code and scripts and libraries, with screenshots, show you where to insert the code, but I haven't managed to find anything like that yet. I'll keep at it...

dwn
05 Feb 2013, 03:45
I mainly wanted to implement an "ask about" conversation menu...so that if you talked to an NPC, choices would appear depending on places you've visited, other NPC's you talked to, or objects you have.

I know it involves setting flags, but I haven't exactly figured all that out yet, and thought the Dynamic Menus for Conversations would help...perhaps I'll try loading/installing it again and see what happens, lol...

HegemonKhan
05 Feb 2013, 03:47
read the libraries carefully, and follow along carefully ;)

the tiniest simpliest mistake will give your quest an error when trying to load the game and~or when actually playing your game... (beware of creating an infinite loop, as that "crashes" the game, lol. I had this problem with my combat system, but I got it fixed, all on my own, or mostly so, as Pertex has been helping me too with it, I can't remember now what I had done all on my own, and what I had help with in doing from Pertex, it's been too long now for my bad memory to remember exactly, lol)

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

(from my previous post)

you should download this:

http://notepad-plus-plus.org/download/v6.2.3.html

and use it to open up your game file (right click on game file, edit with notepad++), as it is really helpful to spot mistakes in your code writing. simply go to its top menu bar to languages and select ' xml ' near the bottom of the list.

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

sure, I can help you with ask/tell verb conversations.

let me take a look at it myself, as I haven't dealt with this yet, but it's simple enough now for me to get easily.

what do you want to do exactly?

for example:

have Gandalf randomly give various comments about:

Mines of Moria
The Ring of Power
The Lonely Mountain
etc etc

or do you want to set it up, so you type in the question, and get a response to it?

or something else?

----------

dwn wrote:I mainly wanted to implement an "ask about" conversation menu...so that if you talked to an NPC, choices would appear depending on places you've visited, other NPC's you talked to, or objects you have.


this is asking for some more advanced stuff, but you might as well start to learn it, hehe.

I'll get working on this for you.

dwn
05 Feb 2013, 03:54
HegemonKhan wrote:read the libraries carefully, and follow along carefully ;)

the tiniest simpliest mistake will give your quest an error when trying to load the game and~or when actually playing your game... (beware of creating an infinite loop, as that "crashes" the game, lol. I had this problem with my combat system, but I got it fixed, all on my own, or mostly so, as Pertex has been helping me too with it, I can't remember now what I had done all on my own, and what I had help with in doing from Pertex, it's been too long now for my bad memory to remember exactly, lol)


Thanks, I just got it to work, so I have no idea what happened before? I'm trying to keep the game simple, I remember having also tried a combat system with a different IF language, and it got way too elaborate and just kept compounding with errors and crashes to no end, so I'll wait before trying anything as convoluted as that--right now I have my hands and head full just learning the simple things.

dwn
05 Feb 2013, 04:00
Well, I want a really easy conversation menu, a list of choices of topics, like in a CYOA book, but I don't want the player to be able to ask Gandalf about the "Mines of Moria", or anything else, until they have in game knowledge of it somehow.

So let's say the player has to first find a book that has information about "Moria" before that choice will be appear as a topic of conversation to ask Gandalf about.

That's basically what I'm looking to be able to do right now in the game.

HegemonKhan
05 Feb 2013, 04:00
I know the feeling, laughs. After going through the tutorial, I was so overwhelmed with just all the damn lexicon of terms, lol.
And, you've no idea the trouble I had with just doing the character creation code block, laughs.

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

give me a day to get you some simple example of a game file coding on what you want.

HegemonKhan
05 Feb 2013, 15:17
the basic code blocks would be:

(these two code blocks do NOT involve a character to ask the hints of, instead you type in the command, to bring up this hint system, but they are also what you would use to work with a character using its ask/tell verbs, though for full~best usage, I'll need to use the subtracting/joining~adding of lists for what you want, but I still have to learn this, albiet it shouldn''t take too much time)

<game name="???">
<topics type="list">???,???,???</topics>
<??? type="boolean">false</???>
<??? type="boolean">false</???>
</game>

<command name="hint">
<pattern>hint</pattern>
<script>
hint_system
</script>
</command>

<function name="hint_system">
show menu ("Hint about what?", game.topics, false) {
hint = result
switch (hint) {
case ("???") {
if (game.??? = true) {
msg ("???")
}
else {
msg ("No hint available")
}
}
case ("???") {
if (game.??? = true) {
msg ("???")
}
else {
msg ("No hint available")
}
}
}
</function>


~~OR~~

<command name="hint">
<pattern>hint #text#</pattern>
<script>
hint_system (text)
</script>
</command>

<function name="hint_system" parameters="text">
result = text
switch (result) {
case ("???") {
if (game.??? = true) {
msg ("???")
}
else {
msg ("No hint available")
}
}
case ("???") {
if (game.??? = true) {
msg ("???")
}
else {
msg ("No hint available")
}
}
}
</function>


these will require some explaining for you, so ask me about them.

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

I'll need to learn how to work with lists, and subtracting/adding~joining items from/to a list, to give a better response to what you want, so this might take me a bit longer to do so.

I could try to make a demo game, so you can see it fully, but this will take even more time to do so.

dwn
05 Feb 2013, 22:38
HegemonKhan wrote:the basic code blocks would be:

(these two code blocks do NOT involve a character to ask the hints of, instead you type in the command, to bring up this hint system, but they are also what you would use to work with a character using its ask/tell verbs, though for full~best usage, I'll need to use the subtracting/joining~adding of lists for what you want, but I still have to learn this, albiet it shouldn''t take too much time)

these will require some explaining for you, so ask me about them.

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

I'll need to learn how to work with lists, and subtracting/adding~joining items from/to a list, to give a better response to what you want, so this might take me a bit longer to do so.

I could try to make a demo game, so you can see it fully, but this will take even more time to do so.


Thanks for the help, I'll have to look at that closer, right now I am still too green to understand it. It looks like you're devising a hint system, and that's what I had in mind, except it would be a conversational menu-system between a player and an NPC.

For example, you might be using Dynamic Menus for Conversation, where it presents a list of topics that you can ask the NPC about.

However, you might want to be able to *hide* certain topics and keep them from appearing on the menu, until the player runs across them in the game, so you can avoid spoiling any surprises down the road.

For example, let's say you "speak to" the City Guard--the game responds with:

MENU
Talk to the City Guard about...

Curfew
The King's Army
The Blacksmith

Hidden topic: *The Troll under the bridge*

Maybe you don't want the player to be able to ask about "the troll under the bridge" via the topic menu before he/she has even run across it in the game yet. So it would be nice if there was a way where you could *hide* conversational menu topics until an object was flagged, letting the game know that the player *seen* the troll in the game, before enabling it as a conversational topic with other NPCs.

That's what I wish I could figure out how to implement, I'm sort of surprised nobody's done something like this already, as it seems like it should be one of the basic elements of a game.

HegemonKhan
06 Feb 2013, 04:29
the dynamic conversation library does this already, I can help you get it to work... this time around, hehe. it uses a creative method of having the topics being as held objects of the character, and using the scope to hide the objects and thus so their topic scripts.

the other way is either using the ask/tell, or creating our own slightly modified verb, so we can implement the coding for it.

I've looked over this stuff, and I can help you do it, I'll get working on making a game file for you on this, I've just been a bit lazy, as it will take a little time to construct it for you.

dwn
07 Feb 2013, 02:31
HegemonKhan wrote:the dynamic conversation library does this already, I can help you get it to work... this time around, hehe. it uses a creative method of having the topics being as held objects of the character, and using the scope to hide the objects and thus so their topic scripts.

the other way is either using the ask/tell, or creating our own slightly modified verb, so we can implement the coding for it.

I've looked over this stuff, and I can help you do it, I'll get working on making a game file for you on this, I've just been a bit lazy, as it will take a little time to construct it for you.


Thanks, I'm beginning to get the hang of it a little more - time will tell.

HegemonKhan
07 Feb 2013, 05:44
actually, what you want is really easy to do (I think and hope, lol. I haven't tested this yet, but I hope it will work, lol):

http://quest5.net/wiki/Dictionary_add

dictionary add (dictionary, string key, any type item)

or if you want to use a menu:

http://quest5.net/wiki/List_add

list add (list, any type item)

http://quest5.net/wiki/StringListItem

StringListItem ( stringlist , int index )

http://quest5.net/wiki/Using_Lists

http://quest5.net/wiki/Scriptdictionary

http://quest5.net/wiki/Using_Dictionaries

http://quest5.net/wiki/StringDictionaryItem

StringDictionaryItem ( stringdictionary , string key )

http://quest5.net/wiki/ScriptDictionaryItem

ScriptDictionaryItem ( scriptdictionary , string key )

---------

make your hint~guide character object, let's say a wizard, and in the wizard character object's code (using code view mode or note/note++/word pad), add this:

<ask type="scriptdictionary">
</ask>


we're doing this, so that we have a blank ' ask ' verb for the wizard (if we used the GUI mode for this, we'd have to give him hints already, so this is how we create a blank ask scriptdictionary for the wizard)

so it should look like this:

<object name="wizard">
<inherit name="editor_object />
<ask type="scriptdictionary">
</ask>
</object>


then, it's just a matter of adding this code line [ dictionary add (dictionary, string key, any type item) ] to where/what ever you want:

for example

you've got an orc which needs to be killed to get it's key for a locked door, and to create the hint for this, you've got to ' look at orc ', and in the description (which is what the ' look at ' command does: gives you the description) for the orc, change the description to ' Run A Script '. Add in some message for its description, but also had in this script line too:

dictionary add (wizard.ask, orc, msg ("You need to kill the orc for his key to open up the locked door"))

so, when you ' look at orc' it will now create the wizard's hint code for what to do with the orc, and thus you will only have this hint code option after you ' look at orc ', as you want the orc to be unknown by the game player, until he's got to that point in the game, and not revealed ahead of time due to the wizard's hint options.

this will add this hint into the ask script block for your wizard, it should now be a choice, you should be able to type in ' ask wizard about orc ' or see the hyperlink option choice for ' orc '.

so (I think) it should look like this (for the orc):

<object name="orc">
<inherit name="editor_object" />
<lookat type="script">
dictionary add (wizard.ask, orc, msg ("You need to kill the orc for his key to open up the locked door"))
msg ("He's big, green, and mean")
</lookat>
</object>


and the wizard's code block, hopefully should now look like this:

<object name="wizard">
<inherit name="editor_object />
<ask type="scriptdictionary">
<item key="orc">
msg ("You need to kill the orc for his key to open up the locked door")
</item>
</ask>
</object>


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

if you want to use a menu, it's pretty much the same:

<game name="Testing Game Stuff">
<topics type="list"></topics>
</game>

<object name="wizard">
<speak type="script">
show menu ("Hint about what?", game.topics, false) {
switch (result) {

<!--
HK Edit: thanks Pertex for this correction! of switch (game.topics) { to switch (result) {
-->

case ("orc") {
msg ("You need to kill the orc for his key to open up the locked door")
}
}
}
</speak>
</object>

<object name="orc">
<lookat type="script">
list add (game.topics, orc)
msg ("He's big, green, and mean")
</lookat>
</object>

Pertex
07 Feb 2013, 08:12
HegemonKhan wrote:
<game name="Testing Game Stuff">
<topics type="list"></topics>
</game>

<object name="wizard">
<speak type="script">
show menu ("Hint about what?", game.topics, false) {
switch (game.topics) {
case ("orc") {
msg ("You need to kill the orc for his key to open up the locked door")
}
}
}
</speak>
</object>


I think
switch (result) {

would be correct :D

HegemonKhan
07 Feb 2013, 10:33
oops, thanks Pertex!

corrected code:

<game name="Testing Game Stuff">
<topics type="list"></topics>
</game>

<object name="wizard">
<speak type="script">
show menu ("Hint about what?", game.topics, false) {
switch (result) {
case ("orc") {
msg ("You need to kill the orc for his key to open up the locked door")
}
}
}
</speak>
</object>

<object name="orc">
<lookat type="script">
list add (game.topics, orc)
msg ("He's big, green, and mean")
</lookat>
</object>


--------

quick question:

could you work in a striptdictionary in the show menu directly [ show menu ("Hint about what?, game.topics ("orc;itemkey2", ";" and "msg ("valuehint1");msg ("valuehint2")", ";"), false) ~ ya, I don't know how the syntax would look, lol ] or indirectly [ show menu ("Hint about what?", game.topics, false) { and then for its msg (StringListitem (game.topics (1) -1) ~ err... or however its syntax is suppose to look ], or must it be a list (stringlist) with the switch cases?

HegemonKhan
07 Feb 2013, 16:17
.
.
@dwn,

here's a *very* brief (lol) demo game:

(copy this code below ~ click on the blue ' select all ' hyperlink, start up a new quest game, go into the Code View mode ~ click on the toggle button for the GUI~Code View mods ~ looks like a notepage, highlight all of your new game code, delete all of it, and then paste in this code below, save your game file, close down your game, restart your game and play it, can you win my game? Let's see if you can!, lol, hehe)

(to add in your own stuff, just look at this game code, and hopefully you'll understand, if not, then ask me, and I'll explain it)

<asl version="530">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<turns type="int">0</turns>
<statusattributes type="stringdictionary">turns = </statusattributes>
<hint_list type="list">null_hint</hint_list>
<autodisplayverbs type="boolean">false</autodisplayverbs>
<pov type="object">player</pov>
<start type="script">
character_creation
</start>
<hint_dict type="scriptdictionary">
<item key="doormat_hint">
msg ("Try to pull the doormat. Type in: pull doormat")
</item>
</hint_dict>
</game>
<object name="homeyard">
<inherit name="editor_room" />
<object name="player">
<inherit name="defaultplayer" />
<inherit name="editor_player" />
<drop type="boolean">false</drop>
<displayverbs>Look at</displayverbs>
<inventoryverbs>Look at; Use; Drop</inventoryverbs>
</object>
<object name="guide">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<displayverbs>Look at; Hint</displayverbs>
<inventoryverbs>Look at; Use; Drop</inventoryverbs>
<hint type="script">
show menu ("Hint about what?", game.hint_list, false) {
switch (result) {
case ("null_hint") {
msg ("No hints are available")
}
case ("doormat_hint") {
msg (ScriptDictionaryItem (game.hint_dict,"doormat_hint"))
}
}
}
</hint>
</object>
<exit name="to_frontyard" to="frontyard" />
</object>
<object name="frontyard">
<inherit name="editor_room" />
<object name="doormat">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<displayverbs>Look at</displayverbs>
<pull type="script">
MakeObjectVisible (frontdoorkey)
msg ("You found a key under the doormat")
</pull>
<look type="script">
list add (game.hint_list, "doormat_hint")
msg ("Your guide has a new hint for you now")
</look>
</object>
<object name="frontdoorkey">
<inherit name="editor_object" />
<alias>key</alias>
<drop />
<take />
<visible type="boolean">false</visible>
</object>
<exit name="to_homeyard" to="homeyard" />
</object>
<turnscript name="game_turns">
<enabled />
<script>
if (frontdoorkey.parent = player) {
msg ("You've won the game!")
finish
}
game.turns = game.turns + 1
</script>
</turnscript>
<verb>
<property>hint</property>
<pattern>hint</pattern>
<defaultexpression>"You can't hint " + object.article + "."</defaultexpression>
</verb>
<function name="character_creation">
msg ("What is your name?")
get input {
player.alias = result
msg (" - " + player.alias)
show menu ("What is your gender?", split ("male;female",";"), false) {
player.gender = result
show menu ("What is your race?", split ("american;european;african;asian",";"), false) {
player.race = result
show menu ("What is your eye color?", split ("blue;green;hazel;amber;brown",";"), false) {
player.eye_color = result
show menu ("What is your hair color?", split ("yellow;orange;red;brown;black;grey;white",";"), false) {
player.hair_color = result
show menu ("What is your skin color?", split ("white;light;tan;dark;red;brown;black",";"), false) {
player.skin_color = result
show menu ("What is your maturity?", split ("adult;teen;child",";"), false) {
player.maturity = result
msg ("What is your age?")
get input {
player.age = result
msg (" - " + player.age)
msg (player.alias + " is a " + player.age + " year old " + player.gender + " " + player.race + " " + player.maturity + " with " + player.eye_color + " eyes, " + player.hair_color + " hair, and " + player.skin_color +" skin.")
wait {
ClearScreen
}
}
}
}
}
}
}
}
}
</function>
</asl>

dwn
08 Feb 2013, 01:53
HegemonKhan wrote:.
.
@dwn,

here's a *very* brief (lol) demo game:

(copy this code below ~ click on the blue ' select all ' hyperlink, start up a new quest game, go into the Code View mode ~ click on the toggle button for the GUI~Code View mods ~ looks like a notepage, highlight all of your new game code, delete all of it, and then paste in this code below, save your game file, close down your game, restart your game and play it, can you win my game? Let's see if you can!, lol, hehe)

(to add in your own stuff, just look at this game code, and hopefully you'll understand, if not, then ask me, and I'll explain it)

<asl version="530">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<turns type="int">0</turns>
<statusattributes type="stringdictionary">turns = </statusattributes>
<hint_list type="list">null_hint</hint_list>
<autodisplayverbs type="boolean">false</autodisplayverbs>
<pov type="object">player</pov>
<start type="script">
character_creation
</start>
<hint_dict type="scriptdictionary">
<item key="doormat_hint">
msg ("Try to pull the doormat. Type in: pull doormat")
</item>
</hint_dict>
</game>
<object name="homeyard">
<inherit name="editor_room" />
<object name="player">
<inherit name="defaultplayer" />
<inherit name="editor_player" />
<drop type="boolean">false</drop>
<displayverbs>Look at</displayverbs>
<inventoryverbs>Look at; Use; Drop</inventoryverbs>
</object>
<object name="guide">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<displayverbs>Look at; Hint</displayverbs>
<inventoryverbs>Look at; Use; Drop</inventoryverbs>
<hint type="script">
show menu ("Hint about what?", game.hint_list, false) {
switch (result) {
case ("null_hint") {
msg ("No hints are available")
}
case ("doormat_hint") {
msg (ScriptDictionaryItem (game.hint_dict,"doormat_hint"))
}
}
}
</hint>
</object>
<exit name="to_frontyard" to="frontyard" />
</object>
<object name="frontyard">
<inherit name="editor_room" />
<object name="doormat">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<displayverbs>Look at</displayverbs>
<pull type="script">
MakeObjectVisible (frontdoorkey)
msg ("You found a key under the doormat")
</pull>
<look type="script">
list add (game.hint_list, "doormat_hint")
msg ("Your guide has a new hint for you now")
</look>
</object>
<object name="frontdoorkey">
<inherit name="editor_object" />
<alias>key</alias>
<drop />
<take />
<visible type="boolean">false</visible>
</object>
<exit name="to_homeyard" to="homeyard" />
</object>
<turnscript name="game_turns">
<enabled />
<script>
if (frontdoorkey.parent = player) {
msg ("You've won the game!")
finish
}
game.turns = game.turns + 1
</script>
</turnscript>
<verb>
<property>hint</property>
<pattern>hint</pattern>
<defaultexpression>"You can't hint " + object.article + "."</defaultexpression>
</verb>
<function name="character_creation">
msg ("What is your name?")
get input {
player.alias = result
msg (" - " + player.alias)
show menu ("What is your gender?", split ("male;female",";"), false) {
player.gender = result
show menu ("What is your race?", split ("american;european;african;asian",";"), false) {
player.race = result
show menu ("What is your eye color?", split ("blue;green;hazel;amber;brown",";"), false) {
player.eye_color = result
show menu ("What is your hair color?", split ("yellow;orange;red;brown;black;grey;white",";"), false) {
player.hair_color = result
show menu ("What is your skin color?", split ("white;light;tan;dark;red;brown;black",";"), false) {
player.skin_color = result
show menu ("What is your maturity?", split ("adult;teen;child",";"), false) {
player.maturity = result
msg ("What is your age?")
get input {
player.age = result
msg (" - " + player.age)
msg (player.alias + " is a " + player.age + " year old " + player.gender + " " + player.race + " " + player.maturity + " with " + player.eye_color + " eyes, " + player.hair_color + " hair, and " + player.skin_color +" skin.")
wait {
ClearScreen
}
}
}
}
}
}
}
}
}
</function>
</asl>


Thanks, I just tried this out, and if I could adapt this to a "speak to" or "talk to" conversational model seems like it would work great. Wouldn't you have to override the scripting that already exists to handle stuff like "talk to" or "speak to" in the game code? I'm beginning to think Quest is actually more complex to learn than Inform 7, seems like it's made for programmers with scripting knowledge and skills than people with no coding experience, but I'll keep trying. Thanks for the help, I'll figure it out eventually.

HegemonKhan
08 Feb 2013, 02:11
simple:

in your GUI mode, go to your character's verb tab, and add in the talk to or speak to (there's a button on the right for a pull down menu, it should ahve the talk to or speak to verb there, as I get confused which verb you use: talk, speak, talk to, or speak to) verb. You do this, so it creates the code line for you (for when you go into the code view mode).

now, go into your code view mode, and simply use my script block (you may need to adjust it slightly for use in your game) of my guide's ' hint ' script, for your character's (talk, speak, talk to, or speak to) verb coding.

so, your game code should look like this (based upon using my demo game):

<asl version="530">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>d83ba5bb-2e3c-4f31-80c9-3e88a2dc082c</gameid>
<version>1.0</version>
<turns type="int">0</turns>
<statusattributes type="stringdictionary">turns = </statusattributes>
<hint_list type="list">null_hint</hint_list>
<autodisplayverbs type="boolean">false</autodisplayverbs>
<pov type="object">player</pov>
<start type="script">
character_creation
</start>
<hint_dict type="scriptdictionary">
<item key="doormat_hint">
msg ("Try to pull the doormat. Type in: pull doormat")
</item>
</hint_dict>
</game>
<object name="homeyard">
<inherit name="editor_room" />
<object name="player">
<inherit name="defaultplayer" />
<inherit name="editor_player" />
<drop type="boolean">false</drop>
<displayverbs>Look at</displayverbs>
<inventoryverbs>Look at; Use; Drop</inventoryverbs>
</object>
<object name="your_character_name">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<displayverbs>Look at; Whatever_the_verb_you_are_using</displayverbs>
<inventoryverbs>Look at; Use; Drop</inventoryverbs>
<whatever_the_verb_you_are_using type="script">
show menu ("Hint about what?", game.hint_list, false) {
switch (result) {
case ("null_hint") {
msg ("No hints are available")
}
case ("doormat_hint") {
msg (ScriptDictionaryItem (game.hint_dict,"doormat_hint"))
}
}
}
</whatever_the_verb_you_are_using>
</object>
<exit name="to_frontyard" to="frontyard" />
</object>
<object name="frontyard">
<inherit name="editor_room" />
<object name="doormat">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<displayverbs>Look at</displayverbs>
<pull type="script">
MakeObjectVisible (frontdoorkey)
msg ("You found a key under the doormat")
</pull>
<look type="script">
list add (game.hint_list, "doormat_hint")
msg ("Your guide has a new hint for you now")
</look>
</object>
<object name="frontdoorkey">
<inherit name="editor_object" />
<alias>key</alias>
<drop />
<take />
<visible type="boolean">false</visible>
</object>
<exit name="to_homeyard" to="homeyard" />
</object>
<turnscript name="game_turns">
<enabled />
<script>
if (frontdoorkey.parent = player) {
msg ("You've won the game!")
finish
}
game.turns = game.turns + 1
</script>
</turnscript>
<verb>
<property>hint</property>
<pattern>hint</pattern>
<defaultexpression>"You can't hint " + object.article + "."</defaultexpression>
</verb>
<function name="character_creation">
msg ("What is your name?")
get input {
player.alias = result
msg (" - " + player.alias)
show menu ("What is your gender?", split ("male;female",";"), false) {
player.gender = result
show menu ("What is your race?", split ("american;european;african;asian",";"), false) {
player.race = result
show menu ("What is your eye color?", split ("blue;green;hazel;amber;brown",";"), false) {
player.eye_color = result
show menu ("What is your hair color?", split ("yellow;orange;red;brown;black;grey;white",";"), false) {
player.hair_color = result
show menu ("What is your skin color?", split ("white;light;tan;dark;red;brown;black",";"), false) {
player.skin_color = result
show menu ("What is your maturity?", split ("adult;teen;child",";"), false) {
player.maturity = result
msg ("What is your age?")
get input {
player.age = result
msg (" - " + player.age)
msg (player.alias + " is a " + player.age + " year old " + player.gender + " " + player.race + " " + player.maturity + " with " + player.eye_color + " eyes, " + player.hair_color + " hair, and " + player.skin_color +" skin.")
wait {
ClearScreen
}
}
}
}
}
}
}
}
}
</function>
</asl>

dwn
08 Feb 2013, 02:16
HegemonKhan wrote:simple:

in your GUI mode, go to your character's verb tab, and add in the talk to or speak to (there's a button on the right for a pull down menu, it should ahve the talk to or speak to verb there, as I get confused which verb you use: talk, speak, talk to, or speak to) verb. You do this, so it creates the code line for you (for when you go into the code view mode).

now, go into your code view mode, and simply use my script block (you may need to adjust it slightly for use in your game) of my guide's ' hint ' script, for your character's (talk, speak, talk to, or speak to) verb coding.


Okay, I'll give it a shot. Thanks!

HegemonKhan
08 Feb 2013, 02:19
refresh and see my previous post, as I added in what the game code should look like, for what you want for your game.

P.S.

so... were you able to win my demo game?
(did you find and take the key?)

dwn
08 Feb 2013, 02:29
HegemonKhan wrote:refresh and see my previous post, as I added in what the game code should look like, for what you want for your game.

P.S.

so... were you able to win my demo game?
(did you find and take the key?)


Still going through the code, haven't won it yet, I keep switching back and forth to see if I can follow what's happening there...

HegemonKhan
08 Feb 2013, 03:43
ooo... trying to match up the GUI stuff and the coding... is a pain in the rear end... lol... I was doing that... then I realized it is just easier to learn and work with the code... I only use (and~or look up a code on) the GUI for only when I really need to.

------

once you get the basics, reading/understanding the code is no big deal, but it is a pain to scour through a library, finding all the pieces that go together... stay away from Pertex' Combat library, lol.

-----

as for my demo game:

the coding in question revolves around three things:

(I apologive, as it is a pain to jump around between them, as I myself got annoyed with my own coding, as I was trying to get it to work, I was getting myself confused, I should reorganize it, so the coding is easier to find and follow along with it, meh)

1. the game object script block: its hint_list and hint_dict
2. the guide character object script block
3. the doormat object script block

for order of the coding (and thus my demo game walkthrough) goes like this:

1. guide -> null = no hint
2. doormat = look at (short cut: just type in: pull doormat)
(2.5. the doormat item of the game script block's hint_list is added, allowing for the guide to now access the hint_dict for giving you the doormat_hint)
3. guide -> doormat hint
4. doormat -> type in: pull doormat
5. take key
6. win the game (game over)

sgreig
08 Feb 2013, 06:40
Not to hijack the thread or anything, but I just want to address the comment dwn made about Quest being for experienced programmers and scripters.

It's actually not the case. However, even though systems like Inform and Quest can abstract the syntax of a programming language to make it more palatable to people, at the end of the day you still have to learn how to think logically and methodically about how to accomplish what you want to do. That, in itself, is the real foundation of programming. Quest is designed to boil programming down to this bare essence so that new people have a lower barrier to entry to learning game logic, as they don't have to learn syntax on top of everything, but if you stick with it it's quite rewarding. :D

dwn
08 Feb 2013, 15:19
sgreig wrote:Not to hijack the thread or anything, but I just want to address the comment dwn made about Quest being for experienced programmers and scripters.

It's actually not the case. However, even though systems like Inform and Quest can abstract the syntax of a programming language to make it more palatable to people, at the end of the day you still have to learn how to think logically and methodically about how to accomplish what you want to do. That, in itself, is the real foundation of programming. Quest is designed to boil programming down to this bare essence so that new people have a lower barrier to entry to learning game logic, as they don't have to learn syntax on top of everything, but if you stick with it it's quite rewarding. :D


I think the most frustrating part with Quest and learning the scripting is the lack of tutorials and library resources, it's a newer IF language so I understand that, and Quest makes it easy to pick up on a lot of things well with the intuitive way you construct some of the bits of the game via tabs and menus, but when it comes to scripting and handling NPC behavior, which seems the most vital part of IF gameplay, the supporting documentation seems badly lacking. Most of the scripts you find on the forums that I have seen are un-commented, so it's difficult to figure out what's going on, and how to even begin to try to adapt it to you scenario. So it puts you in the position of having to go to the forums and plead for help. Thankfully there's people nice enough to answer questions and post examples, but I think there should be a Resource Library specifically for common NPC Behaviors which newbies can consult, with commented code blocks, explaining where and how to insert these into the game. That would speed up the learning process.

If I manage to get a lot of these examples working I'll add comments to the code and append them to a post or something, so somebody else doesn't have to ask the same questions again, but I really think an NPC Behavior Library should be added to the existing documentation, like Inform 7 has with their Recipe Book examples.

HegemonKhan
08 Feb 2013, 16:14
it takes time to create~construct a code (especially when you don't know what you're doing efficiently, like me), it takes more time to create~construct a game, it takes even more more time to create~construct a library, it takes even more more more time to add in comments, it takes even more more more more more time to create~construct a walkthrough...

there's actually enough libraries to start to learn what you're doing, though it's a slow and hard process, and there's not a nice progression of libraries on~for gradual learning step by step of harder coding, that is all well connnected... I think designing a programming class would be really difficult and take an enormous amount of time and effect to make it so that anyone or any noob, can just follow along with no difficulties.

you just need to take something small and study it, until you understand it well, then move onto the next thing, it's a very slow process, but as you do this, you start to learn the coding, and also you slowly spot easier or better ways (and~or how) of doing things.

the big secret is to break up everything into small pieces, both for learning and for creating~constructing your various codes. Then, you put all those small pieces together.

Alex
08 Feb 2013, 16:30
Quest is a community effort. If there's anything you want to change, by all means suggest it - but if you have the time, all the code and documentation is there to be updated by anybody that wants to.

So, if something's not clear in the documentation, or you think something is missing, certainly ask a question about it - and when you find the answer, you can go straight in and update the documentation for everybody.

The wiki is at http://quest5.net/wiki/Main_Page and if you need an account, just ask (I've turned off the registration form as it gets hammered by spammers). All you need to do is email me with your desired username.

dwn
08 Feb 2013, 16:43
Alex wrote:Quest is a community effort. If there's anything you want to change, by all means suggest it - but if you have the time, all the code and documentation is there to be updated by anybody that wants to.

So, if something's not clear in the documentation, or you think something is missing, certainly ask a question about it - and when you find the answer, you can go straight in and update the documentation for everybody.

The wiki is at http://quest5.net/wiki/Main_Page and if you need an account, just ask (I've turned off the registration form as it gets hammered by spammers). All you need to do is email me with your desired username.


Yeah, I'll be happy to do that after I get a couple of working examples to archive that other people can consult. Right now, I've only got one example that works so far, randomized descriptions for objects and NPC's by HegemonKhan (thanks again, btw!).

HegemonKhan
08 Feb 2013, 18:27
this is a very useful link, when you deal with the coding (as it's hard to remember all the codes, lol):

http://quest5.net/wiki/Category:All_Fun ... t_Commands

your reference for all (or most of) the code lines :D

just look through this for whatever you want to do, though actually implementing it, isn't so easy for us learning code noobs

-------

and here's the tutorial link:

http://quest5.net/wiki/Tutorial

and here's the guides and~or library links:

http://quest5.net/wiki/How_to

and here's more (or the same, lol) library links:

http://www.textadventures.co.uk/quest/resources/

and the main wiki page has some useful additional links of stuff on it too:

http://quest5.net/wiki/Main_Page