double conditionals?

Locke
14 Aug 2003, 18:05
Is it possible to do these? I;m trying to set it so that if you type the command, depending on what color and what type you are, it shows a differnet image. This is what I put down, but id eson't work.

command <groom> {
msg <|you groomed the dog.|xb|n>
set <groomed; %groomed% + 1>
if ( #type# = norm ) then if( #pcolor# = red) then picture <rgroom.bmp>
then if( #pcolor# = green) then picture <ggroom.bmp>
then if( #pcolor# = blue) then picture <bgroom.bmp>
then if( #pcolor# = yellow) then picture <ygroom.bmp>
then if( #pcolor# = purple) then picture <pgroom.bmp>
then if( #pcolor# = orange) then picture <ogroom.bmp>
if ( #type# = spike ) then if( #pcolor# = red) then picture <rsgroom.bmp>
then if( #pcolor# = green) then picture <gsgroom.bmp>
then if( #pcolor# = blue) then picture <bsgroom.bmp>
then if( #pcolor# = yellow) then picture <ysgroom.bmp>
then if( #pcolor# = purple) then picture <psgroom.bmp>
then if( #pcolor# = orange) then picture <osgroom.bmp>
}

Anonymous
14 Aug 2003, 18:27
Hi

I think you need something more like this...



command <groom> {
msg <|you groomed the dog.|xb|n>
set <groomed; %groomed% + 1>

' Use this code if type is NORM....

if ( #type# = norm ) then {
if ( #pcolor# = red) then picture <rgroom.bmp>
if ( #pcolor# = green) then picture <ggroom.bmp>
if ( #pcolor# = blue) then picture <bgroom.bmp>
if ( #pcolor# = yellow) then picture <ygroom.bmp>
if ( #pcolor# = purple) then picture <pgroom.bmp>
if ( #pcolor# = orange) then picture <ogroom.bmp>
}

'Use this code if type is SPIKE...
if ( #type# = spike ) then {
if( #pcolor# = red) then picture <rsgroom.bmp>
if( #pcolor# = green) then picture <gsgroom.bmp>
if( #pcolor# = blue) then picture <bsgroom.bmp>
if( #pcolor# = yellow) then picture <ysgroom.bmp>
if( #pcolor# = purple) then picture <psgroom.bmp>
if( #pcolor# = orange) then picture <osgroom.bmp>
}

}


You don't need all those 'then's' - but you DO need to split the code into two sets of conditions that are tested depending on the value of '#type#.

Al (a.k.a. MaDbRiT)

Locke
14 Aug 2003, 22:25
Alright, thanks. I'll be able to tell you if it worked or not in about 2 hours.

EDIT: alright, I tested it, and I know the file names are right, but it still can't show teh images. This is the code I've got:

	command <groom> { 
msg <|you groomed the dog.|xb|n>

'norm type

if ( #type# = norm ) then {
if ( #pcolor# = red) then picture <rgroom.bmp>
if ( #pcolor# = green) then picture <ggroom.bmp>
if ( #pcolor# = blue) then picture <bgroom.bmp>
if ( #pcolor# = yellow) then picture <ygroom.bmp>
if ( #pcolor# = purple) then picture <pgroom.bmp>
if ( #pcolor# = orange) then picture <ogroom.bmp>
}

'spike type
if ( #type# = spike ) then {
if( #pcolor# = red) then picture <rsgroom.bmp>
if( #pcolor# = green) then picture <gsgroom.bmp>
if( #pcolor# = blue) then picture <bsgroom.bmp>
if( #pcolor# = yellow) then picture <ysgroom.bmp>
if( #pcolor# = purple) then picture <psgroom.bmp>
if( #pcolor# = orange) then picture <osgroom.bmp>
}


}



does anyone know if it's possible to change the stuff you can do with an object(e.g.-spoeak to, examine,etc.) to things like pick lock, steal, stuff like that? how do you get the repeat until script to work? this is what I've been entering:

repeat until (#enstat#=dead) { do <battle> }


and battle has a line in it that will set #enstat# to dead. It always comes up with an error though.

Anonymous
15 Aug 2003, 10:21
Hi

If you can't show the pictures firstly make sure they are in the same folder as your game file / Quest.exe. If they aren't Quest won't be able to find them. Note that if it can't find pictures Quest doesn't crash - it just doesn't show them, (records an error to the error log I think) and carries on.

You can add anything you like to the commands it is possible to use an on object. Look under 'user commands' in the online docs for how to do this.

The syntax of your repeat until loop looks fine, I would imagine you have something else in the 'battle' procedure which is causing the error.

Al

Locke
15 Aug 2003, 15:13
Anonymous wrote:
You can add anything you like to the commands it is possible to use an on object. Look under 'user commands' in the online docs for how to do this.


alright, I figured out the image display one, it was that I missed the spaces in the spike type conditional. Can I change(not add) the commands so that instead of look its something like drink, or whatever?

and where are the online docs?

Anonymous
15 Aug 2003, 15:43
Hi again


alright, I figured out the image display one, it was that I missed the spaces in the spike type conditional. Can I change(not add) the commands so that instead of look its something like drink, or whatever?



I mistyped that second batch of if's minus the space, though I got the first block right. Lack of concentration there - oops!

Don't understand why you think you need to "change" commands (look for instance). If you don't want an object to respond to 'look' then just don't provide a look msg or script. You can add a 'drink' command regardless of whether you have 'look' code or not.


and where are the online docs?



With Quest running a game, click 'help' and select 'Quest Documentation' or simply double click 'Quest.chm' in your Quest-Pro folder.

Al (MaDbRiT)

If it's any use I can put a demo of a drinkable object on this forum, let me know if you think it would be useful.


[/quote]

Locke
15 Aug 2003, 15:50
Well, I want to be able to change the game so that if you go into someone's house, you can take the objects, but instead of "take" it says "steal". I also want to add in a pick lock thing for containers and such, but I don't want it to be a typed command. One of the dropdown ones is what I'm looking for. I don't have Quest Pro(yet) is there any way I can look at the docs?

Is there any way I can set up things for a multiplayer game like commands that let you transfer gold, or items and such??

And is there any way I can create containers to keep items in, like chests and stuff?

I think Im Dead
15 Aug 2003, 18:04
Start with single player, get good at it, then try multiplayer. Trust me, it's not easy. NOT EASY.

Anonymous
15 Aug 2003, 18:53
Yeah, but challenges are good.
I;m just basically making a single player game that has multiplayer support, but I;m trying to set up stuff like trading items and such. I;m also trying to figure out how to set "take" to something different, like steal, maybe.

Farvardin
16 Aug 2003, 05:48
>I don't have Quest Pro(yet) is there any way I can look at the docs?

The docs are in the C:\Program Files\Quest folder, you don't need to own Quest pro to access to them.

Anonymous
16 Aug 2003, 07:27


I'm also trying to figure out how to set "take" to something different, like steal, maybe.



Finally realised that you mean the take BUTTON on the Quest Interface and not just add a command 'steal'.

You can't change the interface that way in Quest, though Alex would no doubt be able to provide you with a custom version of Quest that would let you do that, what would be the point? No one else would have it and so wouldn't see the 'Steal' button or whatever.

Personally I think the difference in terminology between take and steal is such that it hardly matters which word is used. But if you insist on 'steal' being used to get an object, I think currently you have to either;

a: have the player type 'steal whatever' to achieve it.

b: program the take button to warn the player that 'taking that would be STEALING!' or something such, then maybe use a menu that warns the player he'd be stealing if he took the object and ask him if he wants to continue.

The above is easy to do yourself in Quest, changing the actual interface components is effectively impossible.

Al (MaDbRiT)

Alex
21 Aug 2003, 11:41
Indeed changing the interface is not possible, though it may eventually be a feature I add. It's not a priority though (unless there are other people who think this sort of thing would be useful).

As well as the documentation in your Quest directory, you can also read the documentation online at http://www.axeuk.com/quest/developer/asl/index.htm.

I see I haven't actually uploaded the Quest 3.12 documentation (the online documentation is for v3.11) but there aren't any actual changes as far as I can remember between the two versions of the docs.

Farvardin
21 Aug 2003, 16:34


Indeed changing the interface is not possible, though it may eventually be a feature I add



For translation into several langages it would be maybe necessary. If I translate the "take" to "prendre" (in french) for ex., it sound strange to get the command "take le pain" when you expect to get "prendre le pain" (take bread) when you click on the button.
It could be nice too of course to be able to configure the commands, ex. use steal instead of take if it can be more relevant in some games.

Alex
21 Aug 2003, 17:31
Translating the buttons will indeed be possible when the LDF format is complete. Customising the buttons is a little different though, in that people may want to add or remove buttons or make them different depending on the player's location etc. This is more complex, so as I say it's something that will have to wait for a future version. But obviously translation will be possible as of course "take le pain" is just silly :)

paul_one
21 Aug 2003, 22:57
LOL

I have to admit a customising feature would be nice but it's hardly necessary. I would personally like to change the use button every now and again, or add in the odd choice in the right click menu - but by telling the player correctly about the object when you describe it (or it's surroundings) then you shouldn't need it.
Still, it would be nice.

_________________
Computer Whizz
==Insert Sig Here!==

Currently Listening To :
Wilson Phillips - Hold On
Using Winamp.