Err changing descriptions and dialogue...
Freyja
07 Jun 2013, 22:35Okay I've run into a bit of a problem. So far I've been making a game, and I pretty much figured out most that I need to know by myself.
I looked around the wiki and it isn't helping so I guess I'll ask here.
This isn't an issue with the game but a basic query.
I want to make a sort of counter. So if I talk to someone, and then I talk to them again I can have a different response, depending on actions or whatever.
I tried to make a sort of attribute but I am unable to bring up the value. What kind of script should I use. Or should I just give up and make the same character for each time I talk to them?
Furthermore, I was wondering how I can do something similar to change how my character looks so "Look at me." And have an attribute or whatever in the background keeping checking as to how I'm doing.
1 strgh = "You have very little muscle." vs 2 strgh = "You have some muscle showing."
Any ideas?
I looked around the wiki and it isn't helping so I guess I'll ask here.
This isn't an issue with the game but a basic query.
I want to make a sort of counter. So if I talk to someone, and then I talk to them again I can have a different response, depending on actions or whatever.
I tried to make a sort of attribute but I am unable to bring up the value. What kind of script should I use. Or should I just give up and make the same character for each time I talk to them?
Furthermore, I was wondering how I can do something similar to change how my character looks so "Look at me." And have an attribute or whatever in the background keeping checking as to how I'm doing.
1 strgh = "You have very little muscle." vs 2 strgh = "You have some muscle showing."
Any ideas?
Liam315
08 Jun 2013, 01:58You've got the right idea, although you actually have two options depending on what you want. Do you want the responses to change in a predefined order (i.e. 1st time you get response A, 2nd time B, 3rd time C and so on) or do you want an answer picked out of a pool of answers at random?
If it's the latter then http://quest5.net/wiki/Random_default_answers is what you need.
To make things go along in a predefined order, you'll need to make a new attribute on the character you want to use it on and set it to an integer. For the sake of example I'll call the attribute "stage" and set it to 1 to begin with. You can use an "if..." or "switch" script to govern what happens for each value:
To change the number of the stage, use the set variable script:
You could set the value directly, but using the +1 method is better if you want it to change every time you talk to someone, look at yourself etc. Just insert it into the appropriate place in your script.
If it's the latter then http://quest5.net/wiki/Random_default_answers is what you need.
To make things go along in a predefined order, you'll need to make a new attribute on the character you want to use it on and set it to an integer. For the sake of example I'll call the attribute "stage" and set it to 1 to begin with. You can use an "if..." or "switch" script to govern what happens for each value:
if (character.stage = 1) {
msg ("blah blah blah")
}
else if (character.stage = 2) {
msg ("wibble wibble wibble")
}
else if (character.stage = 3) {
msg ("wobble wobble wobble")
}
etc.....
To change the number of the stage, use the set variable script:
character.stage = character.stage + 1
You could set the value directly, but using the +1 method is better if you want it to change every time you talk to someone, look at yourself etc. Just insert it into the appropriate place in your script.
Sora574
08 Jun 2013, 02:08Okay, first let's start with this part
What you want is more than possible.
The easiest way I can think of is doing something like this:
This sets the attribute named 'says' of an object to a string ("Hello, I am an NPC."). Now since you have that, you can change it whenever you want. So, say you want their response to change after a quest is complete. Then you would just change the attribute to whatever else you want, like this:
And remember, whenever you want to print the person's message, just do
Print message: [expression] [npc.says]
As for changing the player's "Look at" message, that's impossible.
...I'm just kidding. Nothing's really impossible.
Just go to the player's "Options" tab.
Where it says: "Look at object" description: [Text]
Change [Text] to [Run script]
Then, just do a script similar to this
One last thing:
I gave you 2 ways to do the same thing. You can do the same thing for the first one as you did for the second one. (Not really vice versa, but it might be possible.)
I think some of this is actually covered in the tutorial on the wiki, too... I'm not sure, I never really looked at the tutorial myself.
EDIT: Darn, Liam beat me to it... It looks like as soon as I hit the 'Reply' button too. Oh well
Freyja wrote:I want to make a sort of counter. So if I talk to someone, and then I talk to them again I can have a different response, depending on actions or whatever.
I tried to make a sort of attribute but I am unable to bring up the value. What kind of script should I use. Or should I just give up and make the same character for each time I talk to them?
What you want is more than possible.
The easiest way I can think of is doing something like this:
npc.says = "Hello, I am an NPC."
This sets the attribute named 'says' of an object to a string ("Hello, I am an NPC."). Now since you have that, you can change it whenever you want. So, say you want their response to change after a quest is complete. Then you would just change the attribute to whatever else you want, like this:
npc.says = "Congratulations on the completed quest!"
And remember, whenever you want to print the person's message, just do
Print message: [expression] [npc.says]
As for changing the player's "Look at" message, that's impossible.
...I'm just kidding. Nothing's really impossible.
Just go to the player's "Options" tab.
Where it says: "Look at object" description: [Text]
Change [Text] to [Run script]
Then, just do a script similar to this
if (player.strgh = 1) {
msg ("You have very little muscle.")
}
else if (player.strgh = 2) {
msg ("You have some muscle showing.")
}
One last thing:
I gave you 2 ways to do the same thing. You can do the same thing for the first one as you did for the second one. (Not really vice versa, but it might be possible.)
I think some of this is actually covered in the tutorial on the wiki, too... I'm not sure, I never really looked at the tutorial myself.
EDIT: Darn, Liam beat me to it... It looks like as soon as I hit the 'Reply' button too. Oh well

Freyja
10 Jun 2013, 19:13Thank you, guys it helped a lot.
Now can someone explain to me as to how I can make dialogue choices?
Now can someone explain to me as to how I can make dialogue choices?
HegemonKhan
10 Jun 2013, 21:34there's a lot of ways to do this, but it's the same design:
0. plug this stuff into a default or created "talk" verb or command script, or you could use the game player~user 's input via "get input", too.
1. give a list of choices (or don't, as this is optional obviously)
2. if this choice,
3. then do whatever script
or
"split" creates a quick local (temporary) list, if you want a global (permanent) list, then you got to create one, and then plug in its name into where the "split" is in the above example.
you can also use dictionaries too, though it gets a bit more confusing.
also, if you want more complex dialogue (such as one dialogue topic requiring another dialogue topic), you'll have to use the same method, create a flag (boolean attribute), such as "sword_topic_viewed=true", and then use "if" for the conditional, such as "case ("orc") { -> if (sword_topic_viewed=true), then msg ("Use the sword to kill the orc"). I can explain this better, if you're interested, as this isn't that clear, as I was just being brief about it.
Also, if you don't want topics to be available until they're suppose to be, then I can explain how to do that as well (basically, it just involves adding topics to the list, when the requirements have been met, and etc like stuff).
here's some references for you:
http://quest5.net/wiki/Category:All_Fun ... t_Commands
http://quest5.net/wiki/Using_Lists
http://quest5.net/wiki/Using_Dictionaries
http://quest5.net/wiki/Show_menu
http://quest5.net/wiki/Switch
http://quest5.net/wiki/Get_input (you could use this if you want to use the game player~user 's input)
http://quest5.net/wiki/Conversations
http://quest5.net/wiki/Dynamic_Menus_for_Conversations
http://quest5.net/wiki/Hs-multiple
http://quest5.net/wiki/Hs-asktell
http://quest5.net/wiki/Hs-addingquestion1
and here's some conversation testing game stuff for you to look at:
(you'll need to convert it to v5.4, as this is for v5.3, ask someone to help you do the converting, if you need it)
this is really old, using v5.2 lol:
0. plug this stuff into a default or created "talk" verb or command script, or you could use the game player~user 's input via "get input", too.
1. give a list of choices (or don't, as this is optional obviously)
2. if this choice,
3. then do whatever script
msg ("What do you want to talk about?")
msg ("Type 1 for sword, 2 for evil_sorcerer, or 3 for princess")
get input {
game.topic=result
switch (game.topic) {
case ("1") {
msg ("Sword_info")
}
case ("2") {
msg ("Evil_sorcerer_info")
}
case ("3") {
msg ("Princess_info")
} else {
msg ("That's not a topic, please select one of the defined numbers provided to you: 1 for sword, 2 for evil_sorcerer, or 3 for princess)
}
}
}
or
show menu ("your_message", split ("choice_1; choice_2; choice_3", ";"), false_or_true ~ for canceling_ie_going_back) {
game.topics=result
switch (game.topics) {
case ("choice_1") {
do whatever script
}
case ("choice_2") {
do whatever script
}
case ("choice_3") {
do whatever script
}
}
}
"split" creates a quick local (temporary) list, if you want a global (permanent) list, then you got to create one, and then plug in its name into where the "split" is in the above example.
you can also use dictionaries too, though it gets a bit more confusing.
also, if you want more complex dialogue (such as one dialogue topic requiring another dialogue topic), you'll have to use the same method, create a flag (boolean attribute), such as "sword_topic_viewed=true", and then use "if" for the conditional, such as "case ("orc") { -> if (sword_topic_viewed=true), then msg ("Use the sword to kill the orc"). I can explain this better, if you're interested, as this isn't that clear, as I was just being brief about it.
Also, if you don't want topics to be available until they're suppose to be, then I can explain how to do that as well (basically, it just involves adding topics to the list, when the requirements have been met, and etc like stuff).
here's some references for you:
http://quest5.net/wiki/Category:All_Fun ... t_Commands
http://quest5.net/wiki/Using_Lists
http://quest5.net/wiki/Using_Dictionaries
http://quest5.net/wiki/Show_menu
http://quest5.net/wiki/Switch
http://quest5.net/wiki/Get_input (you could use this if you want to use the game player~user 's input)
http://quest5.net/wiki/Conversations
http://quest5.net/wiki/Dynamic_Menus_for_Conversations
http://quest5.net/wiki/Hs-multiple
http://quest5.net/wiki/Hs-asktell
http://quest5.net/wiki/Hs-addingquestion1
and here's some conversation testing game stuff for you to look at:
(you'll need to convert it to v5.4, as this is for v5.3, ask someone to help you do the converting, if you need it)
<!--Saved by Quest 5.3.4762.29157-->
<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>
<asl version="530">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="NPC Crowd">
<gameid>70d76bbb-2e9b-455e-a69e-b79f47955343</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
<turns type="int">0</turns>
<statusattributes type="stringdictionary">turns = </statusattributes>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<drop type="boolean">false</drop>
</object>
<object name="locked_door">
<inherit name="editor_object" />
<drop type="boolean">false</drop>
<knock type="script">
if (NPC_Crowd.parent = locked_room) {
msg ("You hear a voice call out, \"Give me a moment! I'll be right out!\" from behind the door.")
}
else if (NPC_Crowd.parent = room) {
msg ("Nobody answers.")
}
</knock>
</object>
<object name="NPC_Crowd">
<inherit name="editor_object" />
<alias>crowd</alias>
<behaviorDesc type="list">A dusty old tome.; It's a weathered volume.; A very old book with that familiar musty book smell.</behaviorDesc>
<drop type="boolean">false</drop>
<speak type="script">
msg (StringListItem(NPC_Crowd.behaviorDesc, GetRandomInt(1,3) - 1))
</speak>
</object>
</object>
<object name="locked_room">
<inherit name="editor_room" />
</object>
<turnscript>
<enabled />
<script>
SetTurnTimeout (5) {
if (NPC_Crowd.parent = room) {
MoveObject (NPC_Crowd, locked_room)
}
else if (NPC_Crowd.parent = locked_room) {
MoveObject (NPC_Crowd, room)
}
}
</script>
</turnscript>
</asl>
<asl version="530">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="StringDicTest">
<gameid>490059fa-4154-4263-afa3-33dab1095527</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="npc">
<inherit name="editor_object" />
<conversation type="stringdictionary">1 = A;2 = B;3 = C</conversation>
<speak type="script">
invoke (StringDictionaryItem (this.conversation , ToString (GetRandomInt (1,3))))
</speak>
</object>
</object>
</asl>
this is really old, using v5.2 lol:
<asl version="520">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Testing Game Stuff">
<gameid>cd102f9d-370a-4bda-b6ea-ca42288f619c</gameid>
<version>1.0</version>
<start type="script">
question1
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="defaultplayer" />
<answer1>HK</answer1>
</object>
</object>
<function name="question1">
msg ("To proceed, you must answer the question correctly")
msg ("What is my name? Answer: HK")
get input {
msg (result)
if (player.answer1 = result) {
msg ("You got the answer right, you may proceed")
}
else {
msg ("Wrong answer, try again")
question1
}
}
</function>
</asl>