Reset Health Counter

Hammock
03 Mar 2011, 05:00
I have worked my tail off on my first room learning how things work or attempting to learn anyway. I finally succeeded in getting the room layed out and the unlock exit works great (if you can find the hidden items to make it work). My next task is to make the health counter which is set to decrement by 3 on every action reset to its orginal value upon entering the newly unlocked room. I have an idea but most of my ideas run around in circles until I finally hit on one that works. If you have any suggestions I would greatly appreciate it.

Also i am curious as to whether or not the QDK 4.1.4 program I have downloaded is complete on my computer. The reason I ask this question is after many, many months of writing and editing my original story (part 1) as an interactive novel what happens if, for whatever reason, Axe Software discontinues running the Quest programs? Do I have all the files I need to continue editing and releasing my current story as well as the many editions to follow without any kind of online support to run the program? I've done some checking and I know that Quest has been out for some time and there is a new version in the works so this may seem like a dumb or ignorant question but it is a thought that crossed my mind.

Thanks to Axe Software for creating this program, it is nice to have an interesting and interactive way to share my story; hopefully it will take me no more than a year to get the first book/game out.

Cryophile
03 Mar 2011, 05:32
Quest won't be going anywhere soon, and the version you have is certainly complete. Quest isn't in beta, and while there is constant development and new work done on it regularly it is still very much a finished product.

As for the health counter...

Is the player planning to return to the previous room? There are many ways you could go about this, but the obvious method would be to decrement the variable after or before each turn in the room, and run a check to make sure it hasn't hit zero. You can then reset the variable for when the player enters the new room. If you'd prefer to not go through all of this again you could check a flag (do these still exist?) or property for having completed that room and check for that before you mess with the variables.

I can walk you through this more explicitly or write up a brief code block if you'd prefer, but I figure you'd want to learn it on your own. This can all be found in the documentation as well.

Alex
03 Mar 2011, 11:20


Also i am curious as to whether or not the QDK 4.1.4 program I have downloaded is complete on my computer.



Yes, everything you need is complete on your computer. If all the websites were to suddenly disappear it wouldn't make any difference. Not that they are about to disappear of course!

Hammock
04 Mar 2011, 13:45
Cryophile wrote:Quest won't be going anywhere soon, and the version you have is certainly complete. Quest isn't in beta, and while there is constant development and new work done on it regularly it is still very much a finished product.

As for the health counter...

Is the player planning to return to the previous room? There are many ways you could go about this, but the obvious method would be to decrement the variable after or before each turn in the room, and run a check to make sure it hasn't hit zero. You can then reset the variable for when the player enters the new room. If you'd prefer to not go through all of this again you could check a flag (do these still exist?) or property for having completed that room and check for that before you mess with the variables.

I can walk you through this more explicitly or write up a brief code block if you'd prefer, but I figure you'd want to learn it on your own. This can all be found in the documentation as well.


The decrement is already set at -3 per action and works perfectly. My next step was to try and have it reset upon entering the new room but got busy with some other details. The player will be reusing rooms in this story and that is another area I will need to work on, any rooms set up as health resets will remain that way but I will probably want to modify the room for future visits (add some things and story parts while taking other things and story parts out). I have the QDK Tutorial printed out but trying to convert its basic info into what Im trying to do is a little frustrating at times and I have glanced at parts of the other guide but mostly what happens is I get the info on how to write commands (for instance) and the help line says they are for processing any player input - which is great (I have a find #object# command I would like to use as an in game hint/tip guide for when the player gets frustrated). I need "find" to work individually for each object that the player might need help with without putting it in the verb box where it is automatically assigned to that obect. When the player gets stuck trying to find hidden objects they will most likely type in find# thatobject#, since the object is hidden the game wont see it so the player gets no response and typing find with another object name doesnt make sense when they will be asking for help with the hidden object. The problem is the guide doesnt explain in detail (or at all in some cases) how to circumnavigate these types of issues, I want the command to be specific to its assigned hidden object (even if I use the word 'find' multiple times I need it to respond to its assigned object insteads of giving me its origaally assigned text no matter what I type in). I will probably have many issues to come but this is where I am at right now, any advice and help will be greatly appreciated.

I have made good progress though, the first room is completely layed out with assigned text. The hidden objects and associated verbs/actions work admirably, the health meter counts down and if you complete the room you can unlock the door to the next area. Next is to reset the health, figure out an independent 'find' command that works, upload the background pic for that room and find some music for it. The new area will be an even longer learning curve as it is a building consisting of nine rooms, yee haw!

Hammock
04 Mar 2011, 14:39
Alex wrote:


Also i am curious as to whether or not the QDK 4.1.4 program I have downloaded is complete on my computer.



Yes, everything you need is complete on your computer. If all the websites were to suddenly disappear it wouldn't make any difference. Not that they are about to disappear of course!




Thank you for responding to my question, I appreciate all the help and advice I get here on the forum.

Cryophile
07 Mar 2011, 15:57
I can't help you directly without you being a little more specific, but I can give you some tips that might push you in the right direction.

A lot of object information is stored in properties that can be read or modified (alias, description, etc.) and commands in that object's action script, such as take (...but not drop, it seems?), will override default behaviour (as would custom commands). These can also be inherited from types.

Properties are your best friend. You can use them to store any piece of information and make items unique to any sense or purpose you'd like. If you only want certain objects to be affected by a command just add a unique property to all of them and have that command check for the property.

Learn how to use functions. They're very handy for commands or routines you do on a regular basis, and the return function is very handy. If you have regular checks you need to perform then throw it into a function and have it perform everything you need. It can return 1 for success and 0 for failure, and you can decide what happens during success or failure in the location you called that check from.

Hopefully this helps, and if you have any specific questions I'm more than willing to help out. I can also be reached at my instant messenger accounts listed in my profile as well.

Hammock
08 Mar 2011, 05:04
I figured out a way to run a find command for hidden objects that doesnt interfere with the game text commands, I use it to leave a last ditch clue for the player.
My new problem is making the game end when the health bar reaches zero, I can add points for good moves and take points away for bad moves but I cant make the player lose the game if it reaches zero. The health counter will bottom out but no matter how I try to tell it to read a finish game command it doesnt work. Help! Thanks for all your help thus far.



Cryophile wrote:I can't help you directly without you being a little more specific, but I can give you some tips that might push you in the right direction.

A lot of object information is stored in properties that can be read or modified (alias, description, etc.) and commands in that object's action script, such as take (...but not drop, it seems?), will override default behaviour (as would custom commands). These can also be inherited from types.

Properties are your best friend. You can use them to store any piece of information and make items unique to any sense or purpose you'd like. If you only want certain objects to be affected by a command just add a unique property to all of them and have that command check for the property.

Learn how to use functions. They're very handy for commands or routines you do on a regular basis, and the return function is very handy. If you have regular checks you need to perform then throw it into a function and have it perform everything you need. It can return 1 for success and 0 for failure, and you can decide what happens during success or failure in the location you called that check from.

Hopefully this helps, and if you have any specific questions I'm more than willing to help out. I can also be reached at my instant messenger accounts listed in my profile as well.

Alex
08 Mar 2011, 12:28
Are you using a Status Variable for your health counter? You should be able to use an "if" in the "on change" script to finish the game when the counter reaches zero... make sure when you're comparing things in your "if" that you use "%variablename%" and not just "variablename".

If that's no help, please attach your ASL file here (use "Upload attachment" underneath the save/preview/submit buttons when replying) and I'll take a look at what's happening.

Pertex
08 Mar 2011, 13:44
or you can decrement the variable in a function and then check the variable like this:

Hammock
13 Mar 2011, 00:29
Alex wrote:Are you using a Status Variable for your health counter? You should be able to use an "if" in the "on change" script to finish the game when the counter reaches zero... make sure when you're comparing things in your "if" that you use "%variablename%" and not just "variablename".

If that's no help, please attach your ASL file here (use "Upload attachment" underneath the save/preview/submit buttons when replying) and I'll take a look at what's happening.



Yes, I'm using a status variable, I must have been missing something when setting up the compare variables. I will try this again and see how it goes.

Im having a problem now with setting up a chest to take and give objects. I went thru the tutorial step by step and nothing is working, It might just be me right now, tired from vacation and my comp was acting stupid with the pics that are part of a completed room. I can accomplish what I need for the story without the player being able to use the chest for storage but I thought it would be more realistic to make use of the chest as more than just a stepping stone to the next room. I understand about all the conditions for the objects (like being takeable) but there is zero interaction between the chest and these objects no matter how I try to set it up, the game says it cant see that here for all of the objects (2 from another room the player takes with him and 1 from the current room which is already in the chest) and the FLAGS for open , close dont work even though the flag for the previous door is working just fine.

Im probably just tired and will get it all figured out but I will certainly take any suggestions. Thanks for all your help.

I dont see a file titled ASL anywhere, where is it stored at?

Hammock
13 Mar 2011, 00:32
Pertex wrote:or you can decrement the variable in a function and then check the variable like this:



Thanks for your help Pertex, the decrement is working fine as well as adding back and taking away for certain actions its just the finish game im not setting up right.

Cryophile
13 Mar 2011, 00:35
I believe QDK defaults to your 'Documents' folder, but you should be able to boot up QDK and 'Save as' to see where it's saving to.

Are you using the built-in container function for your chest, or writing your own? What do you mean by 'no interaction'? Are there any errors in your status window when you run the game in Quest?

Hammock
13 Mar 2011, 00:47
Cryophile wrote:I believe QDK defaults to your 'Documents' folder, but you should be able to boot up QDK and 'Save as' to see where it's saving to.

Are you using the built-in container function for your chest, or writing your own? What do you mean by 'no interaction'? Are there any errors in your status window when you run the game in Quest?


I tried th built in container function and that is not working period even when I try to do the simple version described in the Ttutorial. Then I tried writing it on my own using conditional commands (sometimes compounding them) which has worked for other issues previously but it is not working here. I can get some commands ( mostly text) to work, but the objects will not move to chest or vice versa and the open, close flag isnt working. Ive got something out of whack, was going to erase the whole scenario in the morning and start over again. No errors in the status window.

ok, I know where the game is being saved to, I just didnt understand what he wanted me to post, im kinda cagey about letting my story out till the first chapter is complete.

Hammock
13 Mar 2011, 00:55
Also, I dont get how the built in string variables are supposed to work because the tutorial makes it sound like I can set up the whole give/take objects thing with two built in strings that handle the recording of whatever object the player adds or removes. I havnt got a built in command of any kind to work yet and that is probably causing most of my problems with this issue as I cant see any other way to set it up other than to work with every object individually but that is pointless when you can just use one object as a command for another to appear when you need it to and after that the player can drop it in any room they like if they no longer want it or need it.

Cryophile
13 Mar 2011, 00:57
That's rather strange. I would recommend using the container function. What seemed to be the problem with it?

Here's an example game with a working container and two objects to put inside of it. I just snapped it together with QDK so it should look very similar to your own .asl file


You are in The Room.
There is Chest, rock and stick here.

> get rock
You pick it up.

> get stick
You pick it up.

> open chest
You open it.

> put rock in chest
Done.

> put stick in chest
Done.

> close chest
You close it.




EDIT:

The string variables for the object being used during add/remove are #quest.add.object.name# and #quest.remove.object.name#

Hammock
13 Mar 2011, 01:52
Thanks for the sample game, that helped a lot to be able to see how it works. From what I can tell the movement of the object is exactly the same as if I simply used "take" and "drop" except that the chest has to be unlocked before the object will move to your inventory but that will be automatic unless you require a key to unlock the chest. Awesome, then the only reason I actually need those commands is if I want to restrict usage of the chest which at this point I do not. All of the commands I am using will already accomplish the same task plus I can move objects and people in and out of play using accessible commands and place restrictions on any move/text command all within one place. For some reason I thought the container commands would accomplish all of those tasks for multiple objects without the need for further definition.

Right on, now I will just go in and take out the tangle of text/command that is there and redo it with the same concept I used in the first room. Thanks for the help.

Cryophile
13 Mar 2011, 07:13
I'll throw together a very short game that should help explain some features of Quest.

EDIT:

Well, not so much a game as a playable scenario that displays tricks and features of Quest. I may throw out several of them that get increasingly more complex. I find learning by example to be one of the best methods, and I can always walk people through difficult parts if they don't understand.

Hammock
02 Apr 2011, 17:57
Right on. Learning by trial and error seems to be the best way, I've come up with some neat solutions to problems and its fun when you finally get something to work right. I've been sick for the last litle bit and tied up wth obligations but I finally got back to writing the story again today. I'm trying to get going on the third room but there always seems to be something needs tweeking in the current two or just in general. Coming along good though, putting some helpful menus in and even some maps, wish the program would quit grinding internal errors every time I upload a new pic though.

Alex
02 Apr 2011, 19:50
If you ever see an internal error, please let me know, as these are bugs in Quest that can be fixed.

Just let me know the exact steps I need to take to reproduce the problem (maybe including an example game file that demonstrates the issue), and I'll fix it for the next version.

Hammock
03 Apr 2011, 15:45
The internal errors I experience only happens with photo uploads, everything else seems to work beautifully. What happens is I upload photos for any hidden objects that I may have in a room, when a player finds the object the associated photo pops up on the screen. The photos are uploaded randomly as I locate one that works but everytime I upload a new one it sends all the other photo scripts into "internal error". It is nearly impossible to mess up the script command for a photo as all you do is insert the correct file in its proper place within any given script and thats it the photo should pop every time that command is typed by the player. I have tried to find fault with my method but there is nothing wrong with the command order, it has to be a glitch in the Quest program. I need to be able to put the pics in so I can run the story and make sure things work properly but everytime I get a new pic I have to spend a day deleting and retyping all the script commands that involve photos (I cant just delete and reupload because then the photo is out of order and I need the text to be in a certain place depending on pic size). It is quite frustrating sometimes.

Problem:

I have a command to "open chest" which tells the script to show a pic (this pic is already uploaded)
Next day I find a pic for another object so I upload it and run back thru story to check it, when I get back to "open chest" instead of the pic I am supposed to get I get an "internal error" message.
This happens every time I upload a pic or make a change to a map.
Sometimes after I get it all sorted out I'll have a pic that wants to display twice when its script is run (I have one doing that now) and I cant figure where the cross up is at, the file is only uploaded in one place so how could it possibly be looping like that.

Alex
04 Apr 2011, 08:29
I've had a bit of a play with this and I can't seem to reproduce the problem. Could you send me a zip file of your game and images please?

Also, are you saving your game's ASL file to the same folder each time?

Hammock
04 Apr 2011, 12:41
I save usng the save button in the game edior, when I play the game to check functions and script I always save it to the same file.

I dont know how to upload the game file to you and when I tried to export the CAS from the editor the whole game dissappeared. what the hell do I do now, that was a ton of work just gone! HELP

I can't find the game at all now, what do I do

Alex
04 Apr 2011, 13:38
What do you mean "disappeared"?

You should always be able to find it again from the File menu - it lists your recent files at the bottom.

If you zip your game file and images, then email it to me at alex@axeuk.com I'll see if I can reproduce your disappearing pictures problem.

Hammock
04 Apr 2011, 17:32
I don't know what happened to the original files, luckily I had everything on a flash drive so I was able to get it all straightened out. I will get those files emailed to you shortly. Since I had to resend files to my computer I deleted all the old save files and transferred any other uneeded files to another flash so my comp files and my back up flash drive only contain the pic files, some docx files, my play save file and the Quest file. Maybe the house cleaning will have helped solve the problem.