give this to her

MatCauthon137
ok. So I have an object called Jody, that I have defined as a person. I also have an object called glass. In the properties for Jody, I have said that glass can be given to her. Also, in the glass properties, I have stated that the glass can be given to Jody. However in the game, when I try to give the glass to Jody, it tells me that "Hard as you try, you cannot do that" Any suggestions? Here are some samples of code from my game. Hope it helps.
define object <glass>
take {
give <glass>
if not flag <start> then {
speak <Now you need to turn on the water.>
msg <Type "turn on X" where X is the object you wish to activate, in this case, the sink.>
}
}
hidden
give to <Jody>
properties <fillable; drinkable>
action <fill> {
if not flag <waterglass> then {
flag on <waterglass>
if flag <sinkon> then msg <You fill the glass with water.> else msg <There is no running water around here.>
}
else msg <The glass is already full.>
if not flag <firstfill> and here <blackcat1> then {
speak <That looks mighty tasty, take a drink.>
speak <Don't forget to refill it when you're done.>
msg <Type "drink from X" where X is the object you wish to drink from, in this case, the glass.>
flag on <firstfill>
}
else do <drink>
}
action <drink> if flag <waterglass> then {
msg <It tastes really good.>
flag off <waterglass>
}
else msg <The glass is empty.>
end define
define object <Jody>
speak if not flag <start> and not got <glass> and ( %chores% < 2 ) then {
say <Go and get me a glass of water. This is your second chore.>
speak <Meet me in the kitchen.>
move <blackcat1; Kitchen>
}
displaytype <person>
article <her>
gender <she>
give <glass> {
msg <thank you>
lose <glass>
}
end define

Alex
It doesn't look like you've actually defined anything to happen when the player gives the object to Jody - your "give to <Jody>" tag is blank. You need to put some script there, e.g.


give to <Jody> {
move <glass; Jody>
msg <You give the glass to Jody.>
}

MatCauthon137
I thought I had defined what should happen under Jody's interaction tag.

define object <Jody>
speak if not flag <start> and not got <glass> and ( %chores% < 2 ) then {
say <Go and get me a glass of water. This is your second chore.>
speak <Meet me in the kitchen.>
move <blackcat1; Kitchen>
}
displaytype <person>
article <her>
gender <she>
give <glass> {
msg <thank you>
lose <glass>
}
end define

But I tried what you said, leaving jody's interaction tag the way it was and editing the glass interaction tag to read,

define object <glass>
take {
give <glass>
if not flag <start> then {
speak <Now you need to turn on the water.>
msg <Type "turn on X" where X is the object you wish to activate, in this case, the sink.>
}
}
hidden
give to <Jody> {
move <glass; Kitchen>
hide <glass>
}
properties <fillable; drinkable>........

there is more there, to finish defining the glass itself, pretty much the same as the original post. But you can see I moved the glass out of the inventory. Yet it still says "Hard as you try you cannot do that."

MaDbRiT
Hi guys...

A quick perusal of the code shows that the glass is defined as "hidden" - and I didn't notice anything (although I admit I only looked quickly) that changes this anywhere else in the code.

In Quest the player cannot interact with hidden objects - so I suspect that is why you are getting the 'you can't do that' responses.

If you want an object not to be visible, but still able to be interacted with, you need to make it INVISIBLE not HIDDEN.

Any help?

Al (MaDbRiT)

MatCauthon137
Actually, the glass becomes available when the cupboard is opened. I have that in the cupboard script. The problem lies in the fact that after you get the glass, which can only be done once it is available, you can't give it to anyone.

Anonymous
MatCauthon137 wrote

Actually, the glass becomes available when the cupboard is opened. I have that in the cupboard script.



That isn't at all obvious from the code you posted - ah, the perils of only pasting *part* of the relevant code strike again... :roll:

Al (MaDbRiT)

MaDbRiT
Hi MatCauthon137;

Here's a 'hacked about' version of your code dropped into a template to make it a testable piece... I've commented out a lot of the tests just to get back to the core 'give glass functionality.

As it is - the 'give glass' works just fine, you might find that comparing this to your code lets you spot your problem :-)

' Quest 3.5 ASL Template


define game <Game Name>

asl-version <350>

gametype singleplayer

game version <1.0>
game author <Your Name>
game copyright <© 2004 ...>
game info <Enter any additional information about this game here.>

start <Start Room>

end define

define room <Start Room>

look <Description Goes Here>

define object <glass>
take {
give <glass>
' if not flag <start> then {
' speak <Now you need to turn on the water.>
' msg <Type "turn on X" where X is the object you wish to activate, in this case, the sink.>
' }
}
' hidden

' give to <Jody> { '<<< YOU DON'T NEED THIS - THE 'give <Jody>' in the glass
' lose <glass> '<<< OBJECT WILL CAUSE IT NEVER TO BE USED...
' }

properties <fillable; drinkable>

action <fill> {
if not flag <waterglass> then {
flag on <waterglass>
if flag <sinkon> then msg <You fill the glass with water.> else msg <There is no running water around here.>
}
else msg <The glass is already full.>
if not flag <firstfill> and here <blackcat1> then {
speak <That looks mighty tasty, take a drink.>
speak <Don't forget to refill it when you're done.>
msg <Type "drink from X" where X is the object you wish to drink from, in this case, the glass.>
flag on <firstfill>
}
else do <drink>
}

action <drink> {
if flag <waterglass> then {
msg <It tastes really good.>
flag off <waterglass>
}
else msg <The glass is empty.>
}
end define

define object <Jody>
' speak if not flag <start> and not got <glass> and ( %chores% < 2 ) then {
' say <Go and get me a glass of water. This is your second chore.>
' speak <Meet me in the kitchen.>
' move <blackcat1; Kitchen>
' }
displaytype <person>
article <her>
gender <she>
give <glass> {
msg <thank you>
lose <glass>
hide <glass>
}
end define
end define


define text <intro>
Enter intro text here
end define

define text <win>
Enter win text here
end define

define text <lose>
Enter lose text here
end define



Al (MaDbRiT)

MatCauthon137
OK, I give up. I have tried everything. Yes Mad, even the code you sent me. I cannot seem to figure it out. And so a proposal. I will send the asl file to someone, anyone, and you play around with it and see if you can figure out what I am doing wrong. Please???

Anonymous
ok, the problem you are experiencing here is the same as any you'd experience with multiple variables in the same command statement. When there are two input variables expected Quest gets a bit jumbled in it's interpretation of "what" exactly is a variable, it has to think "ok in the statement 'Give #this# to #that#' is 'this' the object or is 'this to' the object." This has been denied a bit and said to be untrue, but it's true, deal with it.

The way to get around this would be to have a 'Give #recipient#' type command, where the command checks if you are 'holding' an object(not just in your inventory, though that would work as well), then if the #recipient# is there, then if the recipient can take the object, move it to them. While at the beginning it may seem less intuitive to have things work like this, it makes more sense eventually as people are going to be 'picking up' things. So give them a semblance of hands, and do it this way.

I'd error check your code right now, but I'm busy drinking, and when not doing that, working. Try and do it my way, guarantee it will work or I'll make it.


P.S. I'm such a badass, that last promise can be held true to most ANYTHING!!! I PWN3D ALL JOO BIOTCHES!!!!1

Anonymous
Hi Matcauthon137

Send me the asl if you want - I'll see if I can spot the problem in the 'full# version

Al (MaDbRiT)

(You can get my e-mail address from my profile)

MatCauthon137
Anonymous wrote:Hi Matcauthon137

Send me the asl if you want - I'll see if I can spot the problem in the 'full# version

Al (MaDbRiT)

(You can get my e-mail address from my profile)


Your e-mail address isn't listed in your profile. You can e-mail me at [email protected], and then I will have it though.

MaDbRiT

Your e-mail address isn't listed in your profile.



No it isn't is it - :oops:

My website address is - and that has an e-mail link - but whatever, I'll e-mail you momentarily...

Al

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums