Counter/Attribute/Flag Use in the Web Version of Quest
scullison
14 Jul 2013, 17:18Greetings,
I'm working my way through the tutorial 'Conversations' at quest5.net's wiki. Regarding varying responses, I'm having trouble making basic if/then statements that are dependent upon a counter or attribute work via the web version of Quest. I would be grateful for a solution to what may be an easy problem.
I would like for a character to respond differently to a "speak to" command the second time it occurs than upon the first, and in a different way still on the third occasion. Via the web version of quest, in which I do not have access to the 'Attributes' tab for an object, what is the easiest way to do this?
I intend to introduce programming via Quest to children during the coming week, so I am grateful for any guidance that may be provided.
Thank you.
Steve
I'm working my way through the tutorial 'Conversations' at quest5.net's wiki. Regarding varying responses, I'm having trouble making basic if/then statements that are dependent upon a counter or attribute work via the web version of Quest. I would be grateful for a solution to what may be an easy problem.
I would like for a character to respond differently to a "speak to" command the second time it occurs than upon the first, and in a different way still on the third occasion. Via the web version of quest, in which I do not have access to the 'Attributes' tab for an object, what is the easiest way to do this?
I intend to introduce programming via Quest to children during the coming week, so I am grateful for any guidance that may be provided.
Thank you.
Steve
scullison
14 Jul 2013, 17:30In case you're curious, here's my most recent attempt.


When I try talking to the character, I get this message:
"Error running script: Error compiling expression 'Smart Barry.countdown = 0': CompareElement: Operation 'Equal' is not defined for types 'Object' and 'Int32'"
I anticipate that I'm making newbie mistakes, but appreciate the patience and wisdom of the experienced in this matter.


When I try talking to the character, I get this message:
"Error running script: Error compiling expression 'Smart Barry.countdown = 0': CompareElement: Operation 'Equal' is not defined for types 'Object' and 'Int32'"
I anticipate that I'm making newbie mistakes, but appreciate the patience and wisdom of the experienced in this matter.

jaynabonne
14 Jul 2013, 20:15My suspicion is that you don't actually have an attribute Smart Barry named "countdown" (when something doesn't exist, it's assumed to be an object, for some reason). You do have a command called "thecountdown" which sets "countdown" to 0 on Smart Barry, but I don't know if you ever execute it. I'm also not sure why you would have such a command (but then, I don't know what you're doing).
I think you should (at least) define an int "countdown" attribute on Smart Barry and init it to 0. That way the attribute will at least exist.
I think you should (at least) define an int "countdown" attribute on Smart Barry and init it to 0. That way the attribute will at least exist.
scullison
14 Jul 2013, 22:37"I think you should (at least) define an int "countdown" attribute on Smart Barry and init it to 0. That way the attribute will at least exist."
Thank you. I think that my problem is that I don't know how to do this.
Thank you. I think that my problem is that I don't know how to do this.

jaynabonne
14 Jul 2013, 22:48Select Smart Barry.
In the tabs on the right, you will see a tab marked Attributes. Click that.
Then go down to the Attributes list at the bottom and click "+Add". For the name, enter "countdown". When you hit Enter, an attribute will be created, but it will have the wrong type (it will be a string). So click the dropdown list where it says String and change it to Integer. The default value will be 0, so you should be good at that point. (Note: I am looking at the desktop version, not the web version. I'm assuming the interface and behavior is the same. If not, let me know, and I'll fire up a web project.)
In the tabs on the right, you will see a tab marked Attributes. Click that.
Then go down to the Attributes list at the bottom and click "+Add". For the name, enter "countdown". When you hit Enter, an attribute will be created, but it will have the wrong type (it will be a string). So click the dropdown list where it says String and change it to Integer. The default value will be 0, so you should be good at that point. (Note: I am looking at the desktop version, not the web version. I'm assuming the interface and behavior is the same. If not, let me know, and I'll fire up a web project.)
scullison
15 Jul 2013, 00:43The web version isn't the same, but I borrowed a PC and it wasn't too hard, and was just as you said. Thank you. I'm not going to worry about how to do this from the website for now.