Another Named Variable Object question
How can I compare a "Named Variable Object" variable to something in the condition side of things?
Here's what I did:
For the condition, I clicked on the "Named Variable Object", selected "Alterable Values", then selected "Compare to one of the alterable values."
When the box popped up asking me to select my variable, I clicked "Use expression". Upon THAT box popping up, I clicked "Retrieve data from an object."
That's when I was finally able to click on the "Named Variable Object" and select "Value" and "Get Value".
After that, my condition looks like this:
Alterable Value (GetValue{ " Named Variable Object ", "Desired Variable")) of "Named Variable Object" >= 15
And yet the program runs as if the condition is never fulfilled, when I KNOW it is. Is there something I'm screwing up here?
Thanks for the help!
Re: Another Named Variable Object question
I think alterable values are 0 based... ?
Re: Another Named Variable Object question
Maybe this illustrates it better:
http://www.megaupload.com/?d=FPCJHOYG
Re: Another Named Variable Object question
Re: Another Named Variable Object question
I mean that Alterable Value A is #0 and not #1.
Re: Another Named Variable Object question
Hi alxmrg. Would you please use box.net or some other site to upload your examples?
Thanks
Marv
Re: Another Named Variable Object question
http://www.filedropper.com/example_6
That should be better-- it was giving me problems yesterday. Thanks!
Re: Another Named Variable Object question
But why would that prevent me from calling upon the object for a variable? What does it matter what slot it is?
Re: Another Named Variable Object question
It sounds like you're not wanting to use alterable values at all, is that right? Then you should be using the condition "Compare two general values" in the "special object" (built in to the expression editor, looks like a computer), then put your code in there.
Re: Another Named Variable Object question
Quote:
Originally Posted by alxmrg
But why would that prevent me from calling upon the object for a variable? What does it matter what slot it is?
Because what if you are getting the wrong alterable value and THAT is causing it to not be true, due to it being the wrong number?
Re: Another Named Variable Object question
I've re-read alxmrg's original post, he definitely doesn't want to use alterable values at all: "How can I compare a "Named Variable Object" variable to something"
My guess is, alx doesn't know what alterable values are.
Re: Another Named Variable Object question
Ah, that worked, thanks! I guess I've always been able to directly compare an object's alterable value to something else by going through the object itself, but "Compare two general values" works just fine (and in this case, is the ONLY thing that works).
Re: Another Named Variable Object question
What's the difference between, say, an active object's alterable values and the "Named Variable Object"'s values? Don't they fulfill the same purpose? They are both essentially values that are linked to an object and can be altered. I fail to see the difference...
Re: Another Named Variable Object question
The named variable object has both its own (unlimited number of) "named variables" and (26) "alterable values" (like other objects have). You wanted to compare to one of the named variables, but unfortunately from what you're saying it doesn't have a "compare to named variable" condition. Instead, you used the "compare to alterable value" condition, which is where you went wrong.
The code you wrote originally would retrieve the named variable you asked for, then retrieve an alterable value by that number (0 = Alt A, 1 = Alt B, etc), then compare that to the number you typed. That's a bit more complicated than what you really wanted.
Re: Another Named Variable Object question
Ah, thanks for the clarification. I guess because it superficially *looked* like it had given me the ability to substitute in Named Variables into the Alterable Value selection bar, I assumed that it actually had.
Re: Another Named Variable Object question
It's an easy mistake to make, until you know about it :)