Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Questions and Comments (http://www.alice.org/community/forumdisplay.php?f=9)
-   -   Function - (What)'s variable named (variable) (http://www.alice.org/community/showthread.php?t=4357)

Dameria 05-05-2010 09:35 PM

Function - (What)'s variable named (variable)
 
When you look at the world functions, this is the last function there. Now, this would be a very helpful function for me if I knew how to drag it into if/else statements, or any other code for that matter! I sometimes need this function, but for some reason Alice will not let me drop it anywhere. Is this a problem that only I have, or does everyone else have the same problem? I cannot drop it into anything.

Thanks in advance.

MrMoke 05-05-2010 11:30 PM

The .partNamed Function?
 
Really Quirky!
If you pass an object into a method via a parameter, or you have a bunch of the same objects in a list, you need to use that function to access the individual parts, since the parameter name will not be the original object name.
:cool:

Dameria 05-06-2010 02:09 PM

I don't quite understand you post. Could you post a simple world showing how this is used? I was thinking more along the lines of having a group of objects in a list that all have a similarly named variable, so I can check to see if that variable has been turned true or not for the individual person. It would help in creating AI for games.

x2495iiii 05-06-2010 02:43 PM

No, he's confusing the partNamed function with the one you asked about, the variableNamed function. And unfortunately, I'm not sure what it's supposed to do either. It should behave like the partNamed function, right?

Dameria 05-06-2010 03:32 PM

Yeah, I've had a few worlds where it would have come in handy, but I guess it is a bug that they need to work out in Alice 3.0. The partNamed comes in handy though when working with a group of things like enemies, and setting their AI with as little code possible. Now I just need the variableNamed and it would be even better.


All times are GMT -5. The time now is 05:36 PM.

Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.