Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
Function - (What)'s variable named (variable)
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default Function - (What)'s variable named (variable) - 05-05-2010, 09: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
   
Reply With Quote
The .partNamed Function?
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 500
Join Date: Sep 2007
Location: Austin, Texas
Default The .partNamed Function? - 05-05-2010, 11:30 PM

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.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 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.


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
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 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?


(')>
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 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.


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
   
Reply With Quote
Reply

Tags
bug, funciton, variable

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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