newb question

thinktank
15 Aug 2005, 07:08
Yes, I'm new... but... that doesn't make me un-important, I hope?

I just got this one question...

How does the command "change/add an object/room property" work? I can clearly see there's "Object or Room name" field, as well as "Property data" field, but... how do you change the value of existing property? OR, if you have an object that has a property and you want it NOT to have that property (or vice versa), how would you go about to doing that?

Other than that, I'm having a ball making my first game... The Black Hole.
In it, you will play the role of the only man in the universe who can survive a Black Hole. But it won't be easy... I'll make sure of that.

paul_one
15 Aug 2005, 09:39
To set a property, or change a property is the same thing.

You'd put the object name in, and then in the property field, you'd have:
height=3


That would give the object (Mike for instance) a property called height, and give that property a value of 3.

Doing exactly the same and putting:
height=5

a little bit later, you would change the height property's value to 5 from 3.

Now there are two types of properties:
(*) Boolean properties
(*) Value'd properties.

Boolean properties can only be on/off, yes/no, 1/0, etc...
Examples: Edible / un-(well, in)-edible, Asleep / awake (not-asleep), Eye's open / eyes shut, reading / not reading.
You can really class stuff into two catagories really easily, to help you understand how Alex implemented this... You are either:
Doing something or,
NOT Doing something.

So say you want to give, and then take the property "expensive" to an object (say a ming vase)... You would put in the property field:
expensive
To give the property and:
not expensive
To remove that property.

I hope this has helped you out.

thinktank
15 Aug 2005, 11:04
Simple enough.

But... is it possible to set a boolean variable to its opposite value? For instance, if I wanted to have a button that turned a light on and off (without having the PUSH BUTTON script check whether it was "on" or NOT "on"), could it be possible to make the PUSH BUTTON script simply set the light to its opposite boolean state?

Just in case that wasn't clear, here's a better example:

In C, you can say:

IsLight = !IsLight;

this would set the boolean IsLight to false if the value was originally true.
Likewise, it would set the boolean IsLight to true if the value was originally false.

Is this possible? *shrugs*

paul_one
15 Aug 2005, 15:08
Ah, sorry but I aimed at the lowest common denominator in my last post.

Now that I know you have some experience, I shall step up a few notches.

Yes, there is - but no there isn't.

C and C++ have nifty shortcuts, but more importantly it's taken many years, and evolved from other languages.
ASL isn't too old, being developed by one man, using Visual Basic.. Plus it is a sort-of-scripting language, whish always tries to give the coder a higher shelf to do things from.

In code, to do what you wish, you have one line:
if property <object; booleanval> then property <object; not booleanval> else property <object; booleanval>

But unfortunately if you use QDK it get's stretched into 5 lines I think, and you have to open about 7 different windows.
Conditional, check for property, object & boolean, then -> set property, else -> set property.

Are you planning to use the ASL code? Or are you using QDK for now?

thinktank
15 Aug 2005, 16:07
ASL or QDK? Well, let me put it this... I favor programming, but I find many of the programming routines to be ... excessively monotonous. I have started my own text adventure engine in C#, but I constantly put my mind into infinite logic loops trying to figure out the perfect way to create one... it's kind of stupid, I know, but hell, that's why I call myself a Thinktank.

But it's not like I can't finish what I start. I created an RPG based on my own menu-driven game engine for a CSAP course that used many of the same principles of the QUEST engine... such as the idea of dynamic properties.

Anyway, I have programmed way too much in my lifetime and I feel like using QDK is a good getaway from the programming world. IMO, QDK is more object-oriented than OOP itself.

...so... I'm only using the QDK, and for a pretty good reason--programming has got my fingers typing code in my sleep... enough is enough!

paul_one
15 Aug 2005, 20:17
Ahhh, I usually think of about 4 different versions and then choose the simplest & quickest - usually it's the same thing (I haven't gone into C/C++ enough to know specific shortcuts etc).

The thing that is always posted to the C/C++ forums (I monitor two of the *cough* best *cough* ) is to get it working first - then refine it. I do both, simultaneously, to a point where I can respect the code I write.

Personally I hate menu-stuff.. It's just TOO limiting unless it's done correctly, or used sparcely.

But yeah, I'll keep in mind that you're using QDK, but you'll have to stick with any hints I make, you should be able to make a just to halfway understand where I'm going with sentances, and sometimes it is just better to paste the stuff into the file using notepad (or the editor of your choice... Notepad++ is good!) and re-load into QDK.

thinktank
16 Aug 2005, 01:10

Personally I hate menu-stuff.. It's just TOO limiting unless it's done correctly, or used sparcely.


Well, I incline to agree, but I was only in high school when I made the game and I only had 2 weeks to make it. So I'm pretty impressed with the 1000 lines of code I wrote that actually compiled and made a decent game... except for the fact that it crashed when players went into the "forbidden" forest... but I can't say I didn't warn the players! :lol: And not to mention, the game was huge! I'm certain it would've taken months to beat it... but overall, well worth its 1000 lines of code. 8)


you should be able to make a just to halfway understand where I'm going with sentances



:? Hmm... well, I certainly don't understand this sentence.

paul_one
16 Aug 2005, 08:38
Oops, there goes my English *stares out window*.

Erm, I think it's meant to be something along the lines of "I usually expect people to make certain leaps in understanding - as it really isn't all that hard... I may point you in one direction, and I may sometimes be rough... But you should try to understand the general idea behind sentances."
.. Something like that.

thinktank
16 Aug 2005, 23:30

I usually expect people to make certain leaps in understanding - as it really isn't all that hard... I may point you in one direction, and I may sometimes be rough... But you should try to understand the general idea behind sentances.



I understand the first part ... but still, which sentences are you referring to?