Axe Software Forums
  Quest Developer Forum
  Help with properties


Author Topic:   Help with properties
Thraka posted 21-03-2002 04:07 GMT     
here is my code.. it is not working someone please help me.

define room <Freescape Ship - Your quarters>
alias <Your Quarters>
look <The room is dimly lit. Your bed is to your left, covers thrown everywhere. A few clothes litter the floor. A closet is to your right and a dresser is facing you. To your rear is a door.>
command <clean #thing#> {
if ( #thing# = room ) or ( #thing# = quarters ) then {
if property <Bed; dirty=1> and here <Clothes> then {
msg <You tidy up your room by making your bed and picking up your clothes>
conceal <Clothes>
property <Bed; dirty=0>
}
if here <Clothes> and property <Bed; dirty=0> then doaction <Clothes; cleanme>
if not here <Clothes> and property <Bed; dirty=1> then doaction <Bed; cleanme>
if not here <Clothes> and property <Bed; dirty=0> then msg <The quarters are already clean.>
msg <GOT IN SIDE!>
}
msg <did command CLEAN>
}

define object <Clothes>
look msg <Dirty, smelly, and down right just discusting.>
take {
msg <Cleaning up your room a bit, you put them away.>
hide <clothes>
}
invisible
properties <dirty=1>
action <cleanme> {
msg <You clean up the clothes.>
hide <Clothes>
}
end define

define object <Bed>
look msg <Covers are strewn all over. The sheet is hanging out and the pillow is upside down.>
invisible
properties <dirty=1>
action <cleanme> {
msg <You make the bed nice and tidy.>
property <Bed; dirty=0>
}
end define

indescription <You're standing in:>
end define

define text <intro>

end define

define text <win>

end define

define text <lose>

end define

Alex posted 21-03-2002 18:15 GMT          
What do you mean by "it is not working"? I'm unable to test it as my usual computer is broken, and I don't know what problem you're experiencing exactly.
Thraka posted 22-03-2002 00:14 GMT          
Is it possible to just look at it and read it like that? If you can, the If statements are not comming back true when they should.. I'm not sure if I'm testing a property in the if statement correctly so please check that. I want to check for if the clothes exist in the room, and if the bed.dirty = 1

The game starts out with these conditions so the if statement should work but it doesn't ever get to where it has the line

msg <You tidy up your room by making your bed and picking up your clothes>

Andy C posted 22-03-2002 03:34 GMT          
I'm no expert but it looks like the clothes are not in the room in this code. The define clothes section is not in the define room section.
Andy C posted 22-03-2002 03:36 GMT          
OOPS - Ignore my last post!
Computer Whizz posted 22-03-2002 05:49 GMT          

The reason for that is because the item "Clothes" start off hidden - when they are hidden they do not appear in the room (persay) and so quest ignores them...

The only way you can get this to work is if you have them showing!

Or you could do it so that instead of checking first, it reveals and then checks, then instead of hiding the clothes - simply MOVE them to an "limbo" room!

Computer Whizz