Make simple actions

Anonymous
20 Sept 2003, 03:08
Im completely new at Quest coding but not at normal scripting (VB, C++ ect).
I know that I can make scripts in Quest...but ...where do I put them ?

Also, can I use an object without holding them?

Also, lets say that I have a notebook and a pensil and I want to write an answer to a math problem, 2 + 2. How do I write the command so the user could type in "Write 4" and how do I check if the answer is correct?

Also, how can I change the 'look' description after something happens. Lets say I turn the lamp off and want to change the room dsc to "The room is pitch black".

I would really appreciate your help. :roll:

Thanks

Farvardin
20 Sept 2003, 04:55
What are you calling scripts ? Is it the same as a procedure ?

define procedure <hints2>
...Your code...

end define

You can call this by :

command <hints about #@object#> {
if ( #object# = YourObject) then do <hints2> else { etc...

If you're talking about the command "script", then use it in a room definition. It's what happened when you entered this room.

Also, can I use an object without holding them?



I'm not sure but I think you can do this by overriding the verb "use" in a room definition :

define room <...>
command <use #@object1#; push #@object1#> if ( #object1# = button) then do <Washing>


Also, how can I change the 'look' description after something happens.



I think you can achieve this with a script :

script {
if flag <nolight> then msg <|n it's pitch black... etc... >
}

You can maybe also do this, based on the general description of a room :

description {
set string <indescription; $gettag(#quest.currentroom#;indescription)$>
msg <#indescription#|n|b|cl#quest.formatroom#|xb|cb|n>
msg <#quest.lookdesc#|n>
if ( #indescription# = ) then set string <indescription; You are in> else {
set numeric <len; $lengthof(#indescription#)$>
set numeric <len; %len%-1>
set string <indescription; $left(#indescription#;%len%)$>
}
' if not ( #quest.doorways.out# = ) then msg <You can go out to #quest.doorways.out#.>
' if not ( #quest.doorways.dirs# = ) then msg <You can go #quest.doorways.dirs#.>
' if not ( #quest.doorways.places# = ) then msg <You can go to #quest.doorways.places#.>
if not ( #quest.objects# = ) then msg <You can see #quest.formatobjects#.|n>
}

(it's my own edition of this description definition, but you can modify it for your purpose)

Anonymous
20 Sept 2003, 15:31
Yea thanks for all this code..but you didnt answer the first question. The one that does it all. Where do I write this code to!!! lol :wink:

Farvardin
20 Sept 2003, 16:02
The 1st question ? About script ? You mean, how to edit the sources ?

It's very easy : if you start some parts of your game with the QDK, and then want to "tweak" it by hand, simply edit in a text editor the ASL file generated by QDK ! :) It's not a binary file, but an ascii file
Of course you can also generate an asl file from scratch, but I find it easier to copy, paste and edit from an other source...

Anonymous
20 Sept 2003, 16:15
By acii editor, you mean like a ... um ... notepad?

And also could you actually make an example for me of how to write it, for example, the write in notebook problem. Just so I could use an example. (Arek5942@cs.com) I would really apreciate it. :oops:

Farvardin
20 Sept 2003, 16:23
like notepad ? Yes, this kind of editor. Though it's not recommended to use this one which is very limited, but it's still possible to do.

I'm using editpad light, it's very good : http://www.jgsoft.com/

Edit Plus is good too... (i've made a syntax colouring for it btw, I'll make it available from my website one day...)

About your code with a notebook, I think I could program it, but I've already much to do with my own game...

paul_one
20 Sept 2003, 19:03
Notepad is fine in XP - but in older versions of Windows it IS very limited, to about a 64k file size limit and no replace feature.
Wordpad's fine though - and easy to save in ascii format.
_________________
Computer Whizz
==Insert Sig Here!==

Currently Listening To :
NO SONG
Using Winamp.

Farvardin
20 Sept 2003, 19:48
xp is not really fine on a computer :)

Text editors with multiple tabs are much better, but it's true now notepad on xp allow to save with ctrl + s and select all with ctrl + a ...

Anonymous
21 Sept 2003, 23:05
WinXP is not a problem for me because I have Win2k and I downloaded EdidPadLite and I do like it much better then Notepad. Thanks.

Anonymous
21 Sept 2003, 23:09
(That guest above was me....I forgot to write me name in)

One more question. How do I compile my finished game? Mine is not finished yet, but I tried to put the game file and Quest.exe on a floppy, and I wanted to run the game from there, and I got an error that 'Object dont exist' or something. Why? :?:

Alex
22 Sept 2003, 07:01
You got that error because you can't just put Quest.exe on a disk and hope it will work - it needs many other files, so to put Quest on a system you need to run the full installation file i.e. http://www.axeuk.com/quest/quest312.exe .

When you compile a game using QCompile it is converted into the encrypted CAS format, so other people can't edit it. However, it still requires Quest to run.

If you want your game to run as a stand-alone game, without requiring people to download and install Quest separately, you can have a custom build. People will be able to run one setup file which will install your game with a "transparent" copy of Quest - so they won't even know it's there. Your game will be able to be installed and run just like any other Windows application. For more information please see http://www.axeuk.com/quest/custom.htm