![]() |
![]() ![]() ![]() ![]() ![]()
|
Author | Topic: Problem with properties.. |
Thraka |
![]() Ok in the conditions of a script, how do i specify IF a property = a value THEN using the GUI of the editor? all i have to pick from is: An object (or room) has a property shouldn't there be An objects (or room's) property value |
gamer1962 |
![]() Here is sample code from my game: action <getit> if Use this $objectproperty(#takeobj#;bought)$ when referring to a string variable (#takeobj#) that has the object or room name or this #objectorroomname:property name# if you are going to use the real name of the object/room |
Thraka |
![]() So is it basically to really make a game you have to do most of it by hand? |
MaDbRiT |
![]() quote: Not at all, it depends on what you are trying to achieve. If you want to test the value of a property (not whether it exists) you need to use the compare two strings or values option, not the object (or room) has a property option. Use #object:property# in 'String 1' to read the value of the property, then set the 'equal to' box to whatever test you require and pop the test value into 'String 2'. This allows you to build the test you need within Q.D.K. If your object is contained in a variable you need to tweak the syntax a little, Al
|
MaDbRiT |
![]() p.s. Just a thought, the expression $objectproperty(#takeobj#;bought)$ can be rewritten like so... #(takeobj):bought# In latest versions of Quest ASL, this is a shorter and neater way to get the same answer :-) Al |
Computer Whizz |
![]() So the variables need the ()'s around then while the actual object names stay as just names.... Or are the ()'s just there for show? Computer Whizz |
MaDbRiT |
![]() Computer Whizz wrote...
quote: Exactly so C.W. where you use the objects actual name you don't need the parentheses, when you need to read it from a string variable you do need them. :-) Al |
Alex |
![]() You need the brackets if the object name is actually a variable which contains the object name. The following do the same thing: if ( #potato:price# > 50 ) then msg <Expensive for a vegetable.> and set string <thing; potato> |
Alex |
![]() By the way, is anybody else concerned about how often I use vegetables in my ASL examples? I think I am. |
Computer Whizz |
![]() LOL.... I really don't think about it that often but I guess you do use vegetables alot... I use an example of what I've just been thinking of. Computer Whizz |
MaDbRiT |
![]() Hi (again) All
quote: I think it betrays a subconcious obsession with potato chips... the vegetable seems to be potatoes in so many examples! Personally I use 'widgets' as example objects, along with pseudo 'action' code of 'foo & bar' (a time honoured variation on F.U.B.A.R. - which is military slang for F... ahem! F/Messed Up Beyond All Recognition) For those who don't know about 'widgets' and are wondering, GET A LIFE! Seriously, 'widgets' are the fictional products beloved of examples used when learning to be an Accountant. Fictional factories make 'widgets', you buy and sell 'widgets' etc. I trained as an Accountant many years ago so that explains my 'widget' fixation. Here endeth the lesson :-) Al |
Thraka |
![]() Thanks for the help guys.. I did it all and now i get this error when trying to run the game. Too many } - unable to open file |
gamer1962 |
![]() if your nesting if then's using QDK it can cause errors like that |
MaDbRiT |
![]() Thraka reported the error...
quote: I think there was a bug in earlier versions QDK that caused this, but that Alex had fixed it now. (Am I right Alex?) Do you have the latest QDK? Al |
Alex |
![]() There was a bug fixed in QDK 3.02 that was for a missing brace - but not for too many of them. I do recall fixing something else in the shared ASL loading code that was to do with braces, although I can't find myself mentioning it in any of the versions text files, so Thraka if you could please confirm what version you're using...? If it's Quest/QDK 3.1 then please send me a copy of your ASL file and I'll take a look into it. |
Thraka |
![]() Yes it's 3.1 I'll send it in email |
Thraka |
![]() Sent email awhile ago.. Havn't gotten to it yet? |
Thraka |
![]() It seems to happen whenever I add a second conditional statement to a rooms custom player command. |