Axe Software Forums
  Quest Developer Forum
  Pictures and Money


Author Topic:   Pictures and Money
JimGtzy posted 18-09-2001 22:01 GMT     
I have two questions, and they're both bugging the crap outta me.

1.)How do I put pictures in?

2.)How do I make it so that when I check a kitchen countertop, have it say "you found 50 dollars", and make it say something different the next time i check it? I already have the money variables set, but my problem is that "you found 50 dollars"keeps repeating itself.

If anybody can help me with this than please do. It would be greatly appreciated.

MaDbRiT posted 18-09-2001 22:16 GMT          
Before we can offer any useful advice, we need to know if you are using Quest 2 or 3 and if you are coding with QDK or by hand..

KInd of pointless to tell you how to do it in a way you don't use after all :-)

Al

JimGtzy posted 18-09-2001 22:32 GMT          
Oh yea, sorry bout that.

I'm using QDK 3.0.

Alex posted 18-09-2001 22:50 GMT          
1. At the relevant point in your game, use the script command "Show a picture", from the Multimedia category.

2. Presumably this is the text that's printed when the player types "look at countertop"? If so, you need to change the countertop's description. You can do this by changing the "look" property of the "countertop" object in the countertop's look script - the script command you need is "Change an object's (or room's) property" in the Objects category. Select the object "countertop" from the objectlist and enter "look=Whatever the new description is" in the "Property data" box.

JimGtzy posted 18-09-2001 23:03 GMT          
OK, thanks for you help on ?#2, but I got the picture command to work, but the attributes I type in have no effect on how the picture appears. The picture window is always the same size. Why is this?
Alex posted 18-09-2001 23:16 GMT          
Hmm... you're right. Something isn't working properly. Also I've noticed it doesn't display the script command correctly on the Script Commands Editor... which means we'll have a Quest/QDK 3.02 before too long.

Thanks for pointing this out!

JimGtzy posted 18-09-2001 23:20 GMT          
No problem Alex. Sorry to bother you again, but the whole "Look Property" thing is confusing me. Here's my scenario. I have a counter and i want my character to look at it. When he looks at it, it will say "you found 50 dollars". Then it gives me 50 dollars. But my problem is, when i click LOOK again, the process repeats itself. Is there a way to switch it off and make it say "nothing is left on the counter"??

Thanks

Computer Whizz posted 18-09-2001 23:42 GMT          
Yes.....

Almost, if not, ALL programmer's use this sort of thing!
I call it a "switch" but, you may have heard differently...

What you do is set it to check a variable, say "counter_money". Now when the game starts up you might want to set the variable.
When the command is run, it checks for the variable. If it is "1" then print "just a normal counter top." but when the variable is "0" then print "You find 50 dollars..." set <money; %money% + 50>, and then set <counter_money; 1>. That should be it.
MaDbRiT might explain it better, but my explaination is for speed writing!

Computer Whizz

MaDbRiT posted 19-09-2001 20:28 GMT          
There are several ways to do the 'money on the counter' - here's how I'd do it. You can cut and paste the following and run it in Quest :-)

quote:

define game <Game Name>
asl-version <300>
game version <1.0>
game author <Da MaDbRiT>
game copyright <� 2001>
game info <Money magic>

start <kitchen>

define variable <money>
type numeric
value <0>
display nozero <Cash $$!.>
end define

end define

define room <kitchen>
look <A modern 'fitted kitchen' with a highly polished counter.>
prefix <a>

define object <counter>
properties <cash-rich>
look {
if property <counter; cash-rich> then {
msg <Well I'm blowed - $$50! You pocket the cash immediately.>
property <counter; not cash-rich>
set <money; %money% +50>
}
else{
msg <It's clean and shiny - but not very interesting>
}
}
invisible
end define

end define

define text <intro>
Run this and type 'look at counter' a couple of times...
end define

define text <win>
Enter win text here
end define

define text <lose>
Enter lose text here
end define


All the 'trickery' is contained within the counter object. What I have done is set the counter to initially have a property of being 'cash-rich'. This is a boolean property and so is either 'true' or 'false', i.e. the counter is either cash rich (true) or not cash rich (false).

Now when first looked at, the code tests to see if the counter is 'cash-rich' - if it is ('returns true' in code-speak) the code prints the message about finding money, increases the money by $50 and then sets the counter to be NOT cash-rich.

Second or later time the counter is looked at - the 'is cash-rich' test now fails (returns false) and so the 'shiny but uninteresting' message gets printed.

The cash-rich property (or any other method) when used in this 'true/false' way to indicate a condition is usually referred to as a 'flag'.

Hope this helps!

Al

JimGtzy posted 20-09-2001 02:35 GMT          
Well thanks Madrabbit, I understood everything you said, but how can I do that in QDK? Or WAS your description FOR QDK?
MaDbRiT posted 20-09-2001 14:10 GMT          
The code I supplied was hand written in TEXTPAD rather than generated with QDK.

It is quite simple to create the same code with QDK - or it SHOULD be. I tried to create the code as above, it seemed to look O.K. when creating the game but the output file 'hung' with a too many "}" error when run in Quest. This has to be the infamous 'brackets' bug in QDK rearing its ugly head.

I think a new Quest/QDK release addressing this issue amongst others is in the pipeline?

Al

JimGtzy posted 20-09-2001 20:57 GMT          
Ok, now that QDK v3.02 is out, can you explain how to use that ASL code you wrote and apply it to QDK?
MaDbRiT posted 21-09-2001 20:02 GMT          
JimGtzy asked:

quote:
Ok, now that QDK v3.02 is out, can you explain how to use that ASL code you wrote and apply it to QDK?

I can try, sorry for the delay but the virus writers of the world are keeping people like me very busy at the moment - the morons. :-

Anyway, here's what I did in QDK to get a working result.

Assuming you know how to define the kitchen room, and basics like setting the startroom and defining the 'money' status variable, here is a blow-by-blow of how to create the 'counter' object with disappearing money in QDK.

quote:

Making sure you have the kitchen selected in the Rooms box, Click the ADD button below the object list box, name the object as 'counter' in the dialog that appears and click O.K. This puts you in the Object Properties window.

Click the 'Interactions & Misc' tab, then click the 'Properties & Actions' button. Now click the 'Properties' tab and click 'ADD', In the 'name' box type 'cash-rich', then click 'OK'.

Before leaving the 'Interactiions & Misc' check the 'Initially Invisible' box.

Now click on the 'Description' tab, type 'a' in the prefix box, and click on the 'EDIT' button alongside 'Look Script'.

This takes you to the script editor window. Click the 'Add conditional' button, which opens the 'Conditional Script' dialog.

Alongside the 'IF' window (top) click 'Add', which will present you with a list of conditions, from the list select 'An object (or room) has a property' Now on the right, drop down the selection box and choose 'counter'. Move to the 'Property' box below and type in 'cash-rich'. Click 'OK' The 'IF' window should now say:-

"counter" has the property "cash-rich"

Click on the EDIT button beside the THEN window, The script editor appears again, this time click 'add Command'. Expand the 'Print' tree by clicking on the + symbol, and click on 'print a message'. In the message window type, "There is $$50 on the counter! You pocket it immediately." Click 'OK'.

(note the double $$ is required - check the manual for why!)

Click 'add Command' again, select 'variables' and from the list 'set a variable', the variable name (top box) is 'money', and the variable contents must be '%money% + 50'. Click 'OK'.


Click 'add Command' again, select 'objects' and from the list 'change an object's (or room's) property. Select 'counter' from the 'Object or Room name' selection box, and type 'not cash-rich' in the 'Property Data' box. Click 'OK'.

There should be three lines of script in the editor window now - so click 'OK'.

Back at the Conditional Script dialog, check the 'ELSE' box, and click the 'Edit' button beside it. Once again from the Script Editor click on 'add command', select 'print', then 'print a message' and type, ;'The counter is shiny and clean but quite empty' in the message box. Click 'OK'.

That returns you to the Conditional Script window, the script is complete so just click 'OK' here and 'OK' again at the Object Properties window.

Save the game and run it in Quest!


Note that I used ' single quotes to highlight stuff here, you don't ever type those!

Hope this gets you up and running, the above looks confusing unless you are looking at QDK as you read it - I'd suggest you PRINT this and follow it through.

Al

JimGtzy posted 22-09-2001 22:47 GMT          
Yo MadRabbit,

You kick ass. Thanx for the tip. I'm not COMPLETELY stupid, i mean i knew i had to use a switch because i worked a lot with rpgmaker2000 before QDK, but i wasn't too familiar with this system. Your tip helped a lot thanx.

Jim