Function - (What)'s variable named (variable) -
05-05-2010, 10:35 PM
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.
Check out my best projects so far and please comment:
Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
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.
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.
Check out my best projects so far and please comment:
Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
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?
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.
Check out my best projects so far and please comment:
Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301