Alice Community  

Go Back   Alice Community > Alice 2 > Bugs and Troubleshooting

Reply
 
Thread Tools Display Modes
Function That doesn't work.
Old
obsidian1292
Guest
 
Status:
Posts: n/a
Exclamation Function That doesn't work. - 09-18-2010, 08:49 AM

Hello Alice forums,

My class and I have found a function that are in some objects and not others.
One example is this: In the cat object, in functions, under other, there is a function named: (cat)'s variable named (variableName) of type (valueclass). We are trying to drag the function into the code and it does not seem to drop anywhere, regardless of the command that we try to use it in. What is the purpose of that function?



Thanks so much you guys,


obsidian1292
   
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 09-18-2010, 10:18 AM

It's intended to allow you to reference customized variables for individual objects from a general context. The prime example would be something like having each cat have it's own custom number variable called height, then having a list method have each cat jump "cat's variable named height of type number" meters.
   
Reply With Quote
Old
KsMomOf2
Guest
 
Status:
Posts: n/a
Default 09-19-2010, 07:58 AM

But, when I create a variable for the cat named height and try to drag it into a method, it doesn't let me drop it anywhere ... so, does it not work or am I doing something incorrectly?

I add the cat, I create the cat's variable "Height" ... I add a line to myfirstmethod that says cat move up 1 meter and I try to drag the cat's function "variable named <variable name> of type <variable class> " it and drop it ... and it won't let me drop it.

I was hoping to be able to use this function to create an array of cats all with class variable "height" and then to be able to have them all jump different heights - but, I can't figure out how to access this variable ... if just doing individual objects (one cat) - then I can just drag the "Height" into the command, but if I want to use the array, I cannot.

I expected the function to work similarly to the "part named" function ... but I can't seem to get it to work.
   
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 09-19-2010, 12:25 PM

My assumption was the same, since the partnamed function actually works. If it wouldn't drop, however, I may be wrong and may well be broken, as you said. Apologies.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 09-19-2010, 12:58 PM

Same here, that function does not work for me either. I really wish it did, as I have said in other posts also, because it would make enemy AI and other methods a lot easier when having multiple enemies in most games. Instead of making a separate method for each enemy, you would be able to use this function to have one method that is used for every enemy. This won't work though, because the function cannot be dropped anywhere like you said.


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
alice 2.2, function, problems

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.