New to Quest, and Desperately Need Help with Scripts

LadySnowflake
05 Aug 2016, 06:20

Hello everyone,

I've played text adventure games off and on for years, but I've only been trying to make one for about three days now. I'm completely clueless as to how any of this works, so I've been following the Quest tutorial, creating the simple game as instructed. I understand how to do a lot of things, like creating rooms, creating exits, creating objects and characters, making objects into containers, taking and dropping objects, ETC. No problem there.

But there are two things I've had problems with, and I've literally spent several hours on each, trying to get them to work. The first issue is adding commands. As of right now, I can "say" something, and the game will respond with, "You say ----, but no one replies." I struggled with that one for a long time, and I'm still not sure what was wrong. I think the code for this command given in the tutorial must have been incorrect, but I know next to nothing about coding, so... Shrug

Anyway, what about making it possible for the player to say something, and have another character answer? Also, how do I set up other kinds of commands? What if I want to be able to "run," "climb," "touch/feel," "listen," ETC? These are just examples, because I'm really not sure at the moment what kinds of things I'd want to be able to do in a game, or even how much is possible to do in this kind of game.

Second, I'm totally lost when it comes to running scripts. I managed to be able to get my TV object to turn on and off and display different messages for each of those conditions, but I can't seem to figure out how to make anything else work. I'm supposed to use a defibrillator to revive a dead character, but no matter what I try I can't bring the character back to life. I'm also supposed to have a kitchen window that can be opened and closed, and when it is opened for the first time (only) a bee flies into the room. I can get the window open, and the bee into the room, but if I try to close the window the game says I can't do that because it's already closed. I think the trouble I'm having with both the character and the window might have something to do with setting object flags, but I'm really very confused.

I hope I've explained things well enough. If someone could walk me through the process of running scripts, step by step, using the web version, I would be ever so grateful. My only request is that you not use pictures. I can't follow pictures, only very specific written instructions. Thanks.


hegemonkhan
05 Aug 2016, 16:42

Try to keep doing as much of the entire tutorial as you can, and for parts you get stuck with it, ask for help, as the tutorial really gives you the basics of using quest ('s GUI~Editor) and introduces you to some of the basic concepts of game-making, game-making/coding logic, and coding. See below for the link (I know you don't need it - just being complete):

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

After that, there's XanMag's 'templates and tutorial' (tutorial 2) game, which he made due to the (unfortunate) lack of transition from following the tutorial's specfic instructions/guidance to trying to do stuff on your own in your own game. As it's a big jump from doing the tutorial to trying to do stuff on your own. You really have to understand the concepts, which the tutorial doesn't quite help enough with. XanMag's 'templates and tutorial' (tutorial 2) game, tries to help with this, by giving lessons/instructions on many various things that you would want to do in your game. see below for the link:

http://textadventures.co.uk/forum/games/topic/5940/quest-tutorials-and-templates-published

after that, here's some guides for you:

http://docs.textadventures.co.uk/quest/guides/
http://docs.textadventures.co.uk/quest/guides/character_creation.html (this is a good guide to study, showing how 'get input' and 'show menu' work along with some Attribute usage)
http://textadventures.co.uk/forum/samples
http://textadventures.co.uk/forum/quest (the various posts/threads in this main forum)

and there's the quest doc site itself (once you start understanding quest, and especially coding/scripting, better. As you can look up most of quest's features/stuff/content/scriptings/objects/elements/commands/verbs/etc):

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


learning to make a game and the coding/scripting and its logic involved/needed, is not easy. It's a slow process, but quest is great for this, if you're interested. I myself found quest with no knowledge of coding, about 4 years ago, and now thanks to quest, I'm taking programming classes in school (slowly towards) a CS (computer science) major, and have been shocked at how well quest has prepared me for them!

the biggest (first) jump for a person new to quest and/or especially to coding, after learning the basics of using quest, is learning quest's Attribute and 'If' Script usage, as once you learn these two SUPER scripts, you can do 90% of everything that you want to do in/for your game (making).

You have to train your brain (as this is quite unnnatural) to get into this new mindset/mentality of game-making/code logic:

it's similiar to "should I do this or should I do that", except replace "should I" with "if I do this or if I do that"

if (animal.type = "lion") {
  msg ("You run for your life, hoping you're faster than the other person, and that the other person fills up the lions belly")
} else if (animal.type = "deer") {
  msg ("Ah, look at the cute deer! You watch the harmless deer, enjoying the cute animal, in total safety")
}

if (orc.dead = true) { // GUI~Editor: 'if' Script
  msg ("The orc is already dead, silly.") // GUI~Editor: 'print a message' Script
} else if (orc.dead = false) { // optional part of the 'if' Script
  orc.dead = true // we need to tell (via set/re-set'ting the 'orc' Object's 'dead' Boolean Attribute) quest that the orc is now dead, which is what this code line does. GUI~Editor: 'set a variable or attribute' Script
  msg ("You fight and kill the orc.") // we (need to) tell/'prompt' the human/user playing the game, that the orc is dead, which is what this code line does. GUI~Editor: 'print a message' Script
}

window.is_opened = true -----> effectively/conceptually/logically: the window is open
window.is_opened = false ----> effectively/conceptually/logically: the window is closed

orc.dead = true ---> effectively/conceptually/logically: the orc is dead
orc.dead = false ---> effectively/conceptually/logically: the orc is alive

or, the opposite logic (use whichever you like better or whichever works better):

window.is_closed = true ----> effectively/conceptually/logically: the window is closed
window.is_closed = false ----> effectively/conceptually/logically: the window is open

orc.alive = true ---> effectively/conceptually/logically: the orc is alive
orc.alive = false ---> effectively/conceptually/logically: the orc is dead

we'll be using the 'is_opened' logic for the example below:

(except: we'll use the built-in Boolean Attribute: isopen, for the example below, not my custom named 'is_opened/is_closed' Boolean Attributes as seen above)

(Object Name: window)
(Boolean) Attribute Name: isopen // this is a built-in Boolean Attribute, which is part of the handling of opening/closing
Boolean Attribute Value: ('true' or 'false'), let's initially have the window being closed, so the value is initially set as: false

'close' Verb for the 'window' Object:

if (window.isopen = true) { // quest shortens when it's '=true' to this: if (window.isopen) {
  window.isopen = false
  msg ("You close the open window")
} else if (window.isopen = false) {
  msg ("The window is already closed, silly.")
}

'open' Verb for the 'window' Object:

if (window.isopen = true) { // again, quest shortens when it's '=true' to this: if (window.isopen) {
  msg ("The window is already open, silly.")
} else if (window.isopen = false) {
  window.isopen = true
  msg ("You open the closed window.")
}

You have to have this kind of mindset of 'if (conditionals)' way of thinking about everything.


anyways the above was a brief example (in code) of the logic you need to train your brain in.

to do this stuff in the GUI~Editor, you use these two scripts:

  1. Attribute usage:
run as script -> add new scipt -> 'variables' section/category -> 'set a variable or attribute' Script -> (see below)

choose the correct script: [whatever], or if you don't know the GUI~Editor script choices/options like me, then you can use the: [EXPRESSION] option/choice, and type/write in the expression (code line) directly.

some examples, using the [EXPRESSION] option/choice:

set variable player.alias = [EXPRESSION] "HK"
set variable player.strength = [EXPRESSION] 100
  1. 'If' Script usage:
run as script -> add new scipt -> 'scripts' section/category -> 'if' Script -> (see below, again using the '[EXPRESSION]' option/choice, as I don't know the GUI~Editor's script choices/options very well)

if [EXPRESSION] player.alias = "HK"

, then:

-> add new scipt -> 'output' section/category -> 'print a message' Script -> (see below, again using the '[EXPRESSION]' option/choice, as I don't know the GUI~Editor's script choices/options very well):

print a [EXPRESSION] "Ah, so you're the awesome HK!"

else:

-> add new scipt -> 'output' section/category -> 'print a message' Script -> (see below, again using the '[EXPRESSION]' option/choice, as I don't know the GUI~Editor's script choices/options very well):

print a [EXPRESSION] "Oh, hi, " + player.alias + ", nice to meet you."

anyways, again... lol

I know the code examples probably confuse you, I was just using them to show the logic/mentality understanding of it.
Use the GUI~Editor example in the part directly above this part to hopefully help you understand it better.

I also got a guide on trying to explain this stuff in more detail here:

http://textadventures.co.uk/forum/samples/topic/5559/attributes-and-if-script-guide-by-hk


this was just a quick brief (and likely confusing / poorly done) post, so please ask if you need any help or got any questions or are confused by anything, as then I can try to do a better job as I'm specifically trying to answer/respond to you or your question, lol.


P.S.

I too had some difficulty with the tutorial and specifically the defibulator part (though this fixed up a bit in the tutorial afterwards --- when I did the tutorial defibulator part 4 years ago, it was even more confusing than it is now, lol), if you want to see my own beginning for laughs (I wanted to learn to code, so that's why I quickly jumped into it):

http://textadventures.co.uk/forum/quest/topic/3348/noobie-hks-help-me-thread

I was so confused by all of the terms and overwhelmed after doing the tutorial... it took me awhile to get it all understood and straightened out, lol.


Also...

Commands vs Verbs:

Verbs act upon that specific Object to add/create them for, using the buttons and hyperlinks you can click on, during game play.

Commands are generalized, meaning you have to input-specify what Object(s) you're acting upon, via a typed-in input during game play using the command/text box at the bottom of the screen, and thus you got to set up your Commands to handle the inputs by the person playing the game.

for examples:

the 'orc' Object's 'fight' (custom-mine-HK's) Verb example (in code):

(Verbs are the just an Object's Script Attributes with a just bit extra coding to make them be Verbs)

<object name="orc">
  <attr name="fight" type="script">
    msg ("You fight the orc")
  </attr>
  <attr name="displayverbs" type="simplestringlist">fight</attr>
</object>

<verb>
  <property>fight</property>
  <pattern>fight</pattern>
</verb>

// you'd click on the 'fight' button or 'fight' hyperlink under/for/with the 'orc' Object during game play, and the results/output would be:
// You fight the orc.

vs

a 'fight' Command:

<command name="fight_command">
  <pattern>fight #object#</pattern>
  <script>
    msg ("You fight the " + object.name + ".")
  </script>
</command>

<object name="orc">
</object>

<object name="dragon">
</object>

// if I type 'fight orc' during game play, the result/output is:
// You fight the orc.
//
// if I type 'fight dragon' during game play, the result/output is:
// You fight the dragon.

// this was a very simple example, which didn't really show much in terms of handling the whatever the inputted Object was, but meh.

// Commands are a bit more confusing as they require scripting/more scripting/handling, than do Verbs. We can get more into Commands, when/if you're ready for them.

another example Command:

<command name="character_information_screen_command">
  <pattern>info #object#</pattern>
  <script>
    ClearScreen
    msg ("Name: " + object.alias)
    msg ("Strength: " + object.strength)
    msg ("Endurance: " + object.endurance)
    msg ("Dexterity: " + object.dexterity)
    msg ("Agility: " + object.agility)
    msg ("Intelligence: " + object.intelligence)    
    wait {
      ClearScreen
    }
  </script> 
</command>

<object name="player">
  <attr name="alias" type="string">HK</attr>
  <attr name="strength" type="int">100</attr>
  <attr name="endurance" type="int">90</attr>
  <attr name="dexterity" type="int">80</attr>
  <attr name="agility" type="int">70</attr>
  <attr name="intelligence" type="int">10</attr>
</object>

<object name="player2">
  <attr name="alias" type="string">John Doe</attr>
  <attr name="strength" type="int">10</attr>
  <attr name="endurance" type="int">20</attr>
  <attr name="dexterity" type="int">30</attr>
  <attr name="agility" type="int">40</attr>
  <attr name="intelligence" type="int">100</attr>
</object>

// if I were to type 'info player', the result/output would be:
//
// (the screen is cleared)
// Name: HK
// Strength: 100
// Endurance: 90
// Dexterity: 80
// Agility: 70
// Intelligence: 10
// 'continue' blue hyperlink (press to continue game)
// (the screen is thus cleared again and the game continues)

// if I were to type 'info player2', the result/output would be:
//
// (the screen is cleared)
// Name: John Doe
// Strength: 10
// Endurance: 20
// Dexterity: 30
// Agility: 40
// Intelligence: 100
// 'continue' blue hyperlink (press to continue game)
// (the screen is thus cleared again and the game continues)

hegemonkhan
05 Aug 2016, 17:39

P.S.

here's an example of a 'say' (custom-mine-HK) Command:

(this is a bit more complex usage of a Command than my previous big post's examples)

<command name="say_command">
  <pattern>say #text# to #object#</pattern>
  <script>
    if (object.parent = player.parent) {
      if (text = "hi" or text = "hello" or text = "howdy" or text = "hola" or text = "kunichua" or text = "bonjour") {
        msg (text + " " + object.name + ". How are you doing?")
      }  else if (text = "die" and object = rival) {
        msg ("\"Die " + object.name + "!\" You fight " + object.name + " and kill " + object.gender + ".") 
      } else if (text = "dragon" and HasString (object, text + "_topic")) {
        do (object, text + "_topic")
      } else if (text = "princess" and HasString (object, text + "_topic")) {
        do (object, text + "_topic")
      } else if (text = "quest" and HasString (object, text + "_topic")) {
        do (object, text + "_topic")
      } else {
        msg ("Error: This Object has no knowledge of the topic you asked about and/or otherwise has no response to you.")
      }
    } else {
      msg (Error: "You must be in the same room, in order to be able to talk, 'say', stuff to the inputted Object")
    }
  </script>
</command>

<object name="king">
  <attr name="parent" type="object">room</attr>
  <attr name="dragon_topic" type="string">The evil dragon has kidnapped by precious daughter, the princess, please save her!</attr>
  <attr name="princess_topic" type="string">(Sobbing) My precious daughter, the princess, please save her from the evil dragon! I'll give you whatever you desire as reward! Just please save my precious daughter, the princess!</attr>
  <attr name="quest_topic" type="string">The evil dragon has kidnapped my precious daugher, the princess, please save her! The dragon was seen flying off with my precious daughter, the princess, held in its talons, to its den in death mountain. Your quest is to save her, I beg and beseech you, please succeed and rescue my precious daughter, the princess!</attr>
</object>

<object name="deaf_person">
  <attr name="parent" type="object">room</attr>
<?object>

<object name="rival">
  <attr name="parent" type="object">room2</attr>
  <attr name="dragon_topic" type="string">I'm going to kill the dragon, marry the princess, and rule over this land! Muwahaha!</attr>
  <attr name="princess_topic" type="string">She's going to be my wife, after I kill the dragon, and my ticket to the crown, ruling over this land! muwahaha!</attr>
  <attr name="quest_topic" type="string">The quest is mine! I'm going to succeed and rule over this land, muwahaha!, you're such a loser! Get lost peon! Don't even think of trying to save the princess, the dragon will roast you!</attr>
</object>

<object name="player">
  <attr name="parent" type="object">room</attr>
</object>

<object name="room">
</object>

<object name="room2">
</object>

some of the different typed-in inputs you can do during game play and their results/outputs:

// if the 'player' Player Object is in 'room' Room Object:

say hi to king ---> hi king. How are you doing?
say hello to king ---> hello king. How are you doing?
say howdy to king ---> howdy king. How are you doing?
say hola to king ---> hola king. How are you doing?
say kunichua to king ---> kunichua king. How are you doing?

say die to king ---> Error: This Object has no knowledge of the topic you asked about and/or otherwise has no response to you.

say dragon to king ---> The evil dragon has kidnapped by precious daughter, the princess, please save her!

say princess to king ---> (Sobbing) My precious daughter, the princess, please save her from the evil dragon! I'll give you whatever you desire as reward! Just please save my precious daughter, the princess!

say quest to king ---> The evil dragon has kidnapped my precious daugher, the princess, please save her! The dragon was seen flying off with my precious daughter, the princess, held in its talons, to its den in death mountain. Your quest is to save her, I beg and beseech you, please succeed and rescue my precious daughter, the princess!

say hi to player2 ---> hopefully you get the idea... I'm too lazy to paste in the responses or non-repsonses/'error msgs'
say hello to player2
say howdy to player2
say hola to player2
say kunichua to player2

say die to player2

say dragon to player2
say princess to player2
say quest to player2

// yes, you can even speak-to/address, 'say', stuff to yourself, lol:
say hi to player
say hello to player
say howdy to player
say hola to player
say kunichua to player

say die to player

say dragon to player
say princess to player
say quest to player


hegemonkhan
05 Aug 2016, 18:24

P.S.S.

I found some threads/posts on using the (older version of the) defibilator in the tutorial:

http://textadventures.co.uk/forum/quest/topic/4904/tutorial-quest-the-defibrillator (see Marzipan's post with the pictures)
http://textadventures.co.uk/forum/quest/topic/4858/getting-an-error-while-trying-to-add-a-talk-to-command

I have some guides (and a completed tutorial game file --- though for an older version of quest as I've been here 4 years --- some of the scripts/scripting syntaxes/patterns/formats have been changed over the versions, so they'd need to be fixed up first before the current quest.exe engine/software to be able to run/play/open the game file) on the tutorial and/or its defiblitator/say/command/etc section stuff... I'll post them later today (I've should've done this a long time ago, as it can be helpful for people).


HK edit, ah found it online hehe:

http://textadventures.co.uk/forum/quest/topic/3630/bob-and-the-defibrillator (see my post especially, hehe. I think it's a step by step guide on using the defibiluator. Ya, my post does have a guide on the defibilator, but you got to scroll down my post a ways, as I explain a lot of other stuff above it about quest in general and the 'character creation' scripting stuff, first)


P.S.S.S.

if you're using the online/web version, you might have much more limited features. I'd really recommend downloading the offline/desktop version if you can do so, as then you've got the full features of quest. Also, the 'Game Book' version is much more limited as well, as it was built for it being used as a Game Book / CYOA type of games. So, if you want to do more RPG type of stuff with it... you may want to use the Text Adventure version instead, as it's easier to work with than trying to do more advanced scripting/RPG type stuff with the Game Book version. Pixie made a hybrid Text Adventure, which looks/acts like a Game Book, but has the full functionality of the Text Adventure.


Isychos
06 Aug 2016, 17:47

OMG, hegemonkhan! - you need to take a DEEP breath. LadySnowflake, don't run away screaming. I'm with you in the whole 'no idea these big pictures of code mean' Don't give up!


XanMag
06 Aug 2016, 18:07

I would certainly be willing to help as soon as I get home. Give me 15-20 minutes and I'll set up a live chat room?

You've asked a lot of questions, all of which have a fairly easy solution through the GUI. I'll post here again when I get back.


XanMag
06 Aug 2016, 19:03

I haven't had much experience with setting up a live text/chat room, but I am currently downloading Discord from https://discordapp.com/ - it took about three minutes to download. Right now it is downloading an update. Has been for a while. It appears to be totally free. I will update you when I can get it all figured out. We are in no hurry, right?! =)


XanMag
06 Aug 2016, 19:47

For starters, let's try this out:

https://d-i-s-c-o-r-d.gg/aPtu7QR - minus the hyphens (sorry, blame the bots)

Here is a link to the room.

I'm gone until this evening, so I will not respond. Just in case though, I will leave it open and you should be able to drop in and say hi. I'd like to have this open 24-7 in case you want to try the chat as well as the forum. So, even if you don't intend to visit, I would like to know that it works okay.

Hope to hear from you all soon.


LadySnowflake
07 Aug 2016, 00:08

Okay, I just downloaded this Discord thing, but I have no idea how to use it.


XanMag
07 Aug 2016, 01:03

When I get home (again), all you should need to do is paste that link and it will take you into the chat room. It might be 2.5 hours though, FYI. We need to sync our schedules!


hegemonkhan
07 Aug 2016, 01:33

it's not the breathing I got to worry about... it's carpal tunnel syndrome, lol. (I love to write, blame it on my history classes that I was taking years ago when I had no clue about a major/carreer in life, that's one thing I got out of history class: being a very verbose writer, as that's all you do in history: write write write... and research --- ugh, hate research! I love to write though!)

(it's harder now too, as I'm learning to program, so it's hard for me to write posts now for those who don't know programming, as I'm learning more and more in programming, it's hard to go back to know how it was when I didn't understand all this code stuff, for those who're new to all of this and don't know any coding - you can't un-learn, lol. For coders, the best way you learn to to study other people's code, the more code you see, the more you learn. it's like math, the more math problems you do and/or see the tricks/solutions of for ones you're having trouble with on your own, the more you learn math)

I was just trying to be as detailed and explain as much as I can, which surely is overwhelming -- too much information at once. People can come back to my posts when they understand some of the stuff better and then maybe my posts may be of help, lol.


XanMag
07 Aug 2016, 04:52

I'm glad to see two of you made it on. My computer will be available to me pretty much all day tomorrow. I hope to catch you then!


LadySnowflake
07 Aug 2016, 05:47

XanMag, I appreciate your willingness to help me. I am working my way through the tutorial, doing as much as I can on my own, so that I can be more specific with my questions. I am a total beginner, so I will probably have a lot of them, but I don't want to be annoying.

Hopefully we can sync our schedules soon, but I have a family barbecue going on tomorrow, so I'm not sure how much time I'll have to be on the computer. If it's okay, I'll just post a few of my questions here, and if you have the time to answer them, great. If not, maybe we can talk about them in the chat room sometime this week. There's no rush; I'm just getting frustrated because there is so much to learn and I feel so clueless, lol.

My first question pertains to the "More things to do with objects" section of the tutorial:
http://docs.textadventures.co.uk/quest/tutorial/more_things_to_do_with_objects.html

Everything is fine with updating the descriptions for the Bob character. I have no problems running a script for the character's "look at" description, adding the "if" command, choosing the "object has flag" expression, entering the flag name, and adding the appropriate messages. I've also successfully created the defibrillator object and made sure that it can be taken.

But when I get to the next part, I get lost. The tutorial says:
"Now add a “Set object flag” command. Choose Bob from the objects list, and enter the flag name “alive”."

I know I saw something that said "set object flag" when I was messing around with things a few days ago, but now I can't find it. Or, am I losing my mind and imagining things that just aren't there? Lol. I haven't bothered with the "Using Functions" or "Ask and Tell" parts of this section because they have to do with Bob, and I figured I had better wait to tackle those until I've dealt with the object flag issue.

My second question is about the "Moving objects during the game" section:
http://docs.textadventures.co.uk/quest/tutorial/moving_objects_during_the_game.html

I am able to create the "bee" object so that it doesn't appear in any of the rooms, and I can get it inside the kitchen after I've created the "window" object and opened it. And yet, the first time I set it up, I would try to close the window and the game would say that it was already closed. So I played with it a bit, and the second time I tried it, it told me the window was already open when I went to open it. Obviously, I'm missing a step somewhere.

I'm sure there are other things I'll want to ask, but I don't want to ask too many questions all at once. Thank you in advance for any wisdom you may have to share.

Oh, and I am using the web version. I know that means that I'm more limited in what I can do with a game, but the Windows desktop version isn't an option for me right now.


LadySnowflake
07 Aug 2016, 05:50

hegemonkhan, thank you for all the information. It's a bit much for me to take in and understand right now, but I appreciate the links, and I'll definitely come back to read your posts when I have a bit more experience. I'm sure they will be super helpful to me in the future.


XanMag
07 Aug 2016, 13:32

Part ONE:
Hopefully, I don't make assumptions when addressing this.

"I know I saw something that said "set object flag" when I was messing around with things a few days ago, but now I can't find it. Or, am I losing my mind and imagining things that just aren't there?"

You are correct. Wherever you have your use defib script, you will add the following (a related suggestion - when using objects on other objects, I find it more helpful to ALWAYS put the scripts I want run WITH the object I am using NOT with the object I am using it on - imagine a knife... how many things might a player try to use a knife on in a game?!? If you place scripts on 'use other object on this' for each object you might use a knife on... well, it becomes a mess trying to find those scripts again when needed):

  1. Add script.
  2. The big pop-up window will appear that has all of the possible scripts you can add. Scroll down until you see the Variables section. The first choice under this section is 'Set Object Flag'. Choose that.
  3. From here I think you know what to do. Chose Object Bob and type the name of the flag in as 'alive'.
  4. In the look at description for Bob, you need to switch it to an 'If' script and select 'If object has flag 'alive' then print whatever message you want.
    In a bit, the tutorial tells you that you need to switch the use defib script to check to see IF Bob has the 'alive' flag. That way you cannot use it on him again when he is alive! If you have problems with that part let me know.

Now, you can skip this next diatribe if you wish but here are my two cents on what you SHOULD do instead. When it comes to making your own game, think of all of those things that you could do with Bob now that he is alive! You could speak to him, ask him about things, give him things, tell him about stuff, look at him, OR have him respond to ANYTHING the player does! If you complete this section as the tutorial suggests, you will need to check to see if Bob has the alive flag for every action you want Bob to respond to. Instead of that, here is my little cheat, which may be easier for you anyway.

  1. Create a dead room. That is, create a room with no entrances or exits. I call my dead room "Item Warehouse". The player will NEVER know this room even exists!
  2. Create an object in this room. Name it alivebob. In the alias under the name, type in Bob.
  3. In the 'use defib on bob' script, simply add a move object script and move object Bob to [desired room] and move bob (the previously dead Bob) to the Item Warehouse.
    Now when you try to interact with alivebob (aka Bob), you don't have to check for any flags at all. The player will not notice that there are actually two different Bobs at all. It will only appear as one and it might save you the hassle of trying to check flags! A note however - I only do this for objects that are incredibly dynamic, like NPCs. Quick example, if you have a sword in your game that is protected by a steel cage and a button that lifts that cage, I would use a flag. Push button, add flag to cage named lifted, run proper scripts to look at cage and getting the sword. I hope part one makes sense. Ask if you have questions.

Part TWO:
This sort of is related to my alternative suggestion above.

And yet, the first time I set it up, I would try to close the window and the game would say that it was already closed. So I played with it a bit, and the second time I tried it, it told me the window was already open when I went to open it. Obviously, I'm missing a step somewhere.

It sounds like you almost have the whole bee thing settled, so I'll just mention this. I just created a scenario in my 'Quest - Templates and Tutorial Game' and I ran into the same problem. I looked back at my code and realized I had forgotten to add an 'open object window' script in the 'Script to run when opening object:' section under the container tab for the window. Double check to make sure you have the 'open object window' script in the 'when opening' section and a 'close object window' script in the 'when closing' section. If you do, two things I would suggest... make sure you didn't add a flag named 'open' or 'closed' to the window (I've done that once) and/or delete all things related to the 'window' object and start again. I've come to understand that sometimes things work out when I start fresh. Another side note, there are some other things that I did that are pretty easy to deal with the bee situation. If you are curious, let me know and I'll let you know what I did to "liven up" that situation.

Hopefully the above will clear up a little bit of that tutorial. It is rather difficult to understand the goal of the tutorial sometimes when the code lingo is not understood. I was overwhelmed once, too. Even after a couple year using Quest, I still need to ask for advice on the forums from time to time. It's an ever-learning process, but is very enjoyable when you can start to understand the essential basics for game creation.

On a side note, the desktop/download version is WAY less buggy and WAY more stable than the online version. I have never used the online version, so my advice is strictly for the desktop version. This may cause some stumbling along the way. Download the desktop version ASAP! =)

Good luck!


hegemonkhan
07 Aug 2016, 18:51
this is what I did for the 'window' Object:

1. 'kitchen' Room Object -> 'Objects' Tab -> add -> Name: window

2. 'window' Object -> 'Setup' Tab -> Type: [Object]

3. 'window' Object -> 'Features' Tab -> check-in the box of 'Container: object is a container or surface, or it can be opened and closed' // this reveals/shows/adds the 'Container' Tab.

4. 'window' Object -> 'Container' Tab -> Container Type: [Openabled/Closeable]

5. 'window' Object -> 'Container' Tab -> check-in the box of 'Can be Opened'

6. 'window' Object -> 'Container' Tab -> check-in the box of 'Can be Closed'

7. 'window' Object -> 'Container' Tab -> Script to run when opening object -> (see below)

add new script -> 'objects' section/category -> 'open object' Script -> Open object [object] [window]

add new script -> 'scripts' section/category -> 'if' Script -> if [object contains] Parent [object] [kitchen] Containers child [object] [bee]

then:

-> add new script -> 'output' section/category -> 'print a message' script -> print [message] You open the window. Not much happens.

else:

-> add new script -> 'output' section/category -> 'print a message' script -> print [message] You open the window and the bee flies into the kitchen.

-> add new script -> 'objects' section/category -> 'move object' Script -> Move object [object] [bee] to [object] [kitchen]

-> add new script -> 'Timers' section/category -> 'Enabled timer' Script -> Enabled timer [name] [NAME_OF_YOUR_BEE_TIMER]

// when you create/add and setup your 'bee' Timer, do NOT check in the box of 'enable timer', as we don't want it to already be enabled, we want it to be enabled from/by opening up the window.

8. 'window' Object -> 'Container' Tab -> Script to run when closing object -> (see below)

add new script -> 'output' section/category -> 'print a message' Script -> print [message] You close the window.

add new script -> 'objects' section/category -> 'close object' Script -> close object [object] [window]

if I understand the built-in stuff... if you use the 'Container Tab: container type: openable/closeable', 'Container Tab: can be opened', 'Container Tab: can be closed', 'Container Tab: scripting: 'open object' Script', and the 'Container Tab: scripting: 'close object' Script', then you don't need do all the handling yourself in the scripting, quest will do it for you.

if you don't use the stuff above, then you got to manually do the handling:

// Note: the pseudocode below is not addressing the bee scripting that is needed, just the open/close logic

open window action:

if (window.isopen) {
  msg ("The window is already open, silly.")
} else {
  window.isopen = true
  msg ("You open the window")
}

close window action:

if (window.isopen) {
  window.isopen = false
  msg ("You close the window")
} else {
  msg ("The window is already closed, silly.")
}

hegemonkhan
07 Aug 2016, 18:54

I think you'll be able to understand my previous post this time, hehe. I tried to give you a step by step via using the GUI~Editor

do you still need any help with the defibilator or the 'say/saying' command?


P.S.

Boolean (true/false) Attribute:

// creating/adding the 'alive' Boolean Attribute for/of/to the 'bob' Object (its Value will be false, as we want bob to initially be dead):

'bob' Object -> 'Attributes' Tab -> Attributes -> add -> (see below)

(Object Name: bob)
Attribute Name: alive
Attribute Type: boolean
Attribute Value: false // already stated why above

................................................................
// in code scripting: bob.alive = false

// in code as 'creation' tag block:

<object name="bob">
  <attr name="alive" type="boolean">false</attr>
</object>
......................................................

upon using the defibulated to revive bob, we revive bob by changing/set'ting/re-set'ting his 'alive' Boolean Attribute's Value to 'true', by:

in code scripting: bob.alive = true

or, via the GUI~Editor's: run as script -> 'variables' section/category -> 'set object flag' Script // this sets the Value to 'true', whereas 'unset object flag' sets the Value to 'false'

so, 'set object flag' and 'unset object flag', merely toggle/change the value back and forth: 'true' <-----> 'false'

LadySnowflake
11 Aug 2016, 08:51

Thanks, guys, for the help with the window/bee situation. I got it all figured out now. :)

However, if I could get some input on this section from the tutorial, I'd really be grateful:
http://docs.textadventures.co.uk/quest/tutorial/multiple_choices___using_a_switch_script.html

As far as I can tell, I did exactly what it says to do. but when I launch my game and type in any of the numbers, the only response I get is, "Sorry, wrong number!"

I thought maybe the problem was in the "default" section, so I deleted that script and tried again. That time I got no response at all. I don't know how to attach screen shots here, but if I can figure that out I'll post a pic of my scripts.

Thanks.❄


The Pixie
11 Aug 2016, 09:53

Rather than a screen shot, click on the code view icon, and copy-and-paste the code.

My first thought when I looked at the tutorial page was that it would not work because you are comparing a string to an int, but when I tried it, it does work. Here is the code for the very simple version that I did:

switch (text) {
  case (999) {
    msg ("Police")
  }
  default {
    msg ("Wrong number")
  }
}

hegemonkhan
11 Aug 2016, 15:31

while not seeing your code (not seeing what you did), and if you followed the tutorial, then a guess at something to look into would be with accidentally adding in a space (white space), such as into your 'case' conditions.

also with the Command, make sure it's 'pattern' is this:

dial #text#

and for your 'switch', you want it to be: switch (text)

so you need the #...# in the Command's 'pattern', but NO #.....# in the 'switch (in here)'

again, also check for accidental spaces (white spaces).


if you copy and paste, you got to be especially careful about copying and pasting in accidental spaces (white spaces).


@ Pixie:

interesting how the numbers in the 'cases' don't need the double quotes, is the switch/case eval'ing it, or is it the Command/Command's 'pattern' that is doing the 'eval' of it?


LadySnowflake
11 Aug 2016, 21:25

Here is the code:

switch ("text") {
case (999) {
msg ("There's no need to call the police now.")
}
case (94672) {
msg ("Madame Buxom, Queen of Pain, is on her way.")
}
case (32461) {
msg ("A voice at the other end of the line says, "Stop calling this number, you pervert!"")
}
case (15629) {
msg ("You are neither hungry enough nor drunk enough for anything from Luigi's Pizza Palace right now.")
}
}
msg ("Sorry, wrong number!")


The Pixie
11 Aug 2016, 21:36

First line should not have quotes:

switch (text) {

LadySnowflake
11 Aug 2016, 22:18

Thank you. The correct messages are now being displayed for each number, except after the correct message is printed it is also printing, "Sorry, wrong number!" Any thoughts on that?


hegemonkhan
12 Aug 2016, 02:36

here's how it should look:

(scripting is just like an outline, in how its ordering/sequence of running its scripts is done)

switch (text) {
  case (999) {
    msg ("There's no need to call the police now.")
  }
  case (94672) {
    msg ("Madame Buxom, Queen of Pain, is on her way.")
  }
  case (32461) {
    msg ("A voice at the other end of the line says, "Stop calling this number, you pervert!"")
  }
  case (15629) {
    msg ("You are neither hungry enough nor drunk enough for anything from Luigi's Pizza Palace right now.")
  }
  default {
    msg ("Sorry, wrong number!")
  }
}

think of the 'switch' as a block (which is like a shopping list, of multiple items, the 'cases' and optionally also the 'default', you need to get/do)

you had a separate second block of just a 'msg' Script, so the 'switch' (first) block is run, and then your second block (your 'msg' Script) is run.

whereas, (since you messed with the 'default' script in trying to figure it out - which is good for learning - but now you got this mistake we're dealing with fixing now) if you had the 'msg' Script be the script for the 'switch' block's 'default' item (which is run, only if all of the 'case' items/conditions, fail), then it'd be apart of the 'switch' block, and not a separate second block to be run, after the 'switch' (first) block is run.


how it should look, a concpetual example:

(having a single block/shopping-list: the 'switch' block/shopping-list)

'switch' block:
for the VARIABLE or value in the 'switch (VARIABLE or Value) {'
-> case 1 -> check if the VARIABLE's Value or the Value in the 'switch (in here) {'  matches up to the Value in: case (Value 1) {
-> case 2 -> if case 1 fails, check if the VARIABLE's Value or the Value in the 'switch (in here) {'  matches up to the Value in: case (Value 2) {
-> etc etc etc cases
-> default -> if the 'switch (VARIABLE or Value) {' fails or if all of the cases fail, run the 'default's' 'msg' script of 'msg ("Sorry, wrong number")'

vs what you had, again a conceptual look:

(having two blocks/shopping-lists: a 'switch' block/shopping-list and a single 'msg' script itemed block/shopping list)

'switch' block:
for the VARIABLE or value in the 'switch (VARIABLE or Value) {'
-> case 1 -> check if the VARIABLE's Value or the Value in the 'switch (in here) {'  matches up to the Value in: case (Value 1) {
-> case 2 -> if case 1 fails, check if the VARIABLE's Value or the Value in the 'switch (in here) {'  matches up to the Value in: case (Value 2) {
-> etc etc etc cases

a separate second block (a single 'msg' script block):
msg ("Sorry, wrong number")

so, does this make sense in why you're seeing both of: one of the switch's responses and the 'Sorry, wrong number', responses ??

LadySnowflake
12 Aug 2016, 07:00

Thanks, HK. I see now what I did wrong, and have fixed it. Everything is running smoothly now! :D I appreciate your assistance.


hegemonkhan
12 Aug 2016, 13:20

unfortunately, scripting 'nesting' (indenting) and layering (what it is inside of) is very picky... as it determines how the scripts behave, just like how if you change the indenting on an outline... you get a very different outline....


The Pixie
12 Aug 2016, 13:58

And I would say that the GUI does you no favours keeping it straight. If you can get your head round code, the auto-indenting makes that sort of thing far more obvious.


LadySnowflake
13 Aug 2016, 06:35

Ugh, I just don't know how I'll ever be able to learn code. I'd love to, but it seems so overwhelming, and I don't even know how/where to start. All I know is some very basic HTML.


hegemonkhan
13 Aug 2016, 19:59

try this link if interested:

http://textadventures.co.uk/forum/samples/topic/5559/attributes-and-if-script-guide-by-hk

for a start at learning the syntax/format and basics for quest's code language

there's also 'codecademy.com' for learning the normal/main code languages used by people, and there's also 'udemy' too but I've not tried it out yet (it may be a bit more advanced programming stuff though). Also, there's tons of sites/forums on whatever languages you want to learn.

The main programming languages are generally (in the US): C++ and Java, and (more popular/used one in Europe than US) Python.


if you're interested in learning, I'd be glad to help you! I like helping people learn to code, though I'm not the best teacher, sighs.

my (link above) guide probably is confusing... sighs... but ask questions and I can try to help/explain more clearly (well, I'll try to, lol) and/or in more detail...


programming uses VARIABLES, which is the same as algebra's use of variables and substitution of them:

algebra VARIABLES (for this example): 'x' and 'y'

x = 50
y = x + 100
// y = 150

quest programming using Attribute VARIABLES:

there's a slight difference between math-algebra and programming... you have the right side of the '=' symbol as the content that is STORED/PUT_INTO the ATTRIBUTE VARIABLE on the left side of the '=' sign:

in math algebra:

'x = 10' is the same as '10 = x'

x = 10 ---> NO error
10 = x ---> NO error

but this is NOT the case in programming:

x = 10 ---> NO error
10 = x ---> ERROR!

as technically, the 'equal' sign is an 'ASSIGNMENT' programming operation, not an 'equal to' math operation.

ASSSIGNMENT:
x = 10
// '10' is being put/stored into 'x'
// x <---- 10

though, within an 'if' Script, the '=' sign is a comparison operation:

player.alias = "HK"
if (player.alias = "HK") {
// if ("HK" = "HK") {
  msg ("Indeed, player.alias = \"HK\", NO error")
}

player.alias = "HK"
if ("HK" = player.alias) {
// if ("HK" = "HK") {
  msg ("Indeed, \"HK\" = player.alias, NO error")
}

player.alias = "LadySnowflake"
if ("HK" = player.alias) {
// if ("LadySnowflake" = "HK") {
  // NO/FALSE: 'LadySnowflake' is not equal to "HK", this script is NOT done:
  msg ("Indeed, \"HK\" = player.alias, NO error")
} else {
  // since the condition failed/wasn't-true above, do this script instead:
  msg ("No, \" LadySnowflake\" is not equal to \"HK\"")
}

(Attribute VARIABLES are great because they can be used anywhere, as Attributes are 'saved/attached-to/connected-to/inside-of/contained-within' that Object, and thus, so long as that Object exists or still exists, you can 'load'/use Attribute VARIABLES anywhere in your game)

I like to describe the syntax/format as this: OBJECT_NAME.ATTRIBUTE_NAME = VALUE_OR_EXPRESSION

replace OBJECT_NAME with: game
replace ATTRiBUTE_NAME with: x
replace VALUE_OR_EXPRESSION with: game.x + 50

replace OBJECT_NAME with: game
replace ATTRiBUTE_NAME with: y
replace VALUE_OR_EXPRESSION with: game.x + 100

// (hopefully, you get the idea for the rest of my examples)
// (these are in-code examples, the GUI~Editor's scripts are slightly different in look/syntax/format, hopefully you can get it, but if not, let me know)

game.x = 50
game.y = game.x + 100
// game.y = 150
// to display it:
msg ("y = " + game.y)
// output/displayment: y = 150

player.strength = 50
player.strength = player.strength + 100
// player.strength = 150
// to display it:
msg ("Player Strength: " + player.strength)
// output/displayment:
// Player Strength: 150

player.alias = "HK"
game.greeting = "Hello, " + player.alias + ", how are you doing?"
// game.greeting = Hello, HK, how are you doing?
// and to display it:
msg (game.greeting)
// output/displayment: Hello, HK, how are you doing?

player.alias = "LadySnowFlake"
game.greeting = "Hello, " + player.alias + ", how are you doing?"
// game.greeting = Hello, LadySnowFlake, how are you doing?
// and to display it:
msg (game.greeting)
// output/displayment: Hello, LadySnowflake, how are you doing?

the first big thing to learn in/for quest's programming, is Attribute usage and then also the 'if' usage.

but, learning Attributes is not easy, it'll take some time, along with the 'if' scripting usage and logic, also takes time.

you'll likely be overwhelmed, as too much information... I was too when I started... I got all the terms jumbled up, as I didn't understand them enough, after I got done with the tutorial.


to get a taste with using/learning Attributes and scripting (I don't think it uses the 'if' script though, unfortunately), this is really a great first lesson to study/learn/understand:

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


and if interested, you can see my own slow learning quest code progress for a laugh (learning to code is not easy - it's a very slow process - I've been learning quest coding for 4 years now, it's a slow process):

http://textadventures.co.uk/forum/quest/topic/3348/noobie-hks-help-me-thread

I quickly jumped into the quest code, as I really wanted to learn to code, hehe. I was so confused by all of the terms... laughs

(I'm still shocked at how well quest, and especially the help from Pixie, Jay, Pertex, and etc others here, has taught me programming/coding, as I've been doing pretty well in the programming school classes that I'm now taking)