Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Can Alice remember past actions? (http://www.alice.org/community/showthread.php?t=7812)

cjworld 12-15-2011 10:55 AM

Can Alice remember past actions?
 
I remember my professor saying that Alice could remember past actions [for example, in my game, the player is supposed to win after they have gone to three different places (being within the threshold of the objects)]. How can I make it so that the win message won't appear if you go to the third place without having been to the first two places?

dakota95 12-15-2011 11:04 AM

[QUOTE=cjworld;44658]I remember my professor saying that Alice could remember past actions [for example, in my game, the player is supposed to win after they have gone to three different places (being within the threshold of the objects)]. How can I make it so that the win message won't appear if you go to the third place without having been to the first two places?[/QUOTE]

you could try placing 3 if else statements inside of each other. I'm not sure now it would work but its worth a try. I've gotten 2 if/else statements working while inside of each other but 3 might be a little slow. Never know till you try

cjworld 12-15-2011 11:30 AM

Past part
 
Okay, but if you do that, won't Alice think it will only give the winning speech if you are at all three places at once? And if so, would putting a "Do in order" in there fix that?

dakota95 12-15-2011 11:40 AM

[QUOTE=cjworld;44665]Okay, but if you do that, won't Alice think it will only give the winning speech if you are at all three places at once? And if so, would putting a "Do in order" in there fix that?[/QUOTE]
hmmm. Didn't think of that. Well it is probably a simple logic problem, and I am terrible at logic.

dakota95 12-15-2011 11:50 AM

I came up with a solution, here is what you do:

At the first place put an object on the ground really close to the check point. Then make the objects "is showing" false. Then make a method called "pick up object 1" place an if/else statement in the method. Then put the if/else statement inside of an infinite loop. Say "if camera is within "5 meters" of "the invisible object" then "the invisible object" move to camera, and set vehicle to camera. Do this for each of the three checkpoints. Then say if "object 1" is within "5 meters" of "object 2" (then make another if/else statement inside of that one) say if "object 2" is within "5 meters" of "object 3". Then make another if else statement inside of the second one, and say if "object 3" is within "5 meters" of object "object 1" then "give prize"

I know this may be difficult to understand. If you have any questions about it feel free to ask

cjworld 12-15-2011 08:15 PM

Where creating method?
 
[QUOTE=dakota95;44667]
Then make a method called "pick up object 1" place an if/else statement in the method.
[/QUOTE] What object am I creating the method under?

GameKid 12-15-2011 10:15 PM

No, no, no. What you need to do is create three booleans. There's a button that says "New variable" under world's properties. Those can be used in if/else statements in the event list.

dakota95 12-16-2011 11:16 AM

[QUOTE=cjworld;44701]What object am I creating the method under?[/QUOTE]

you can create the method under world. Just have any object (doesn't really matter what) as long as it moves to you and with you it will work.

@gamekid

guess that would work. I'm just terrible at using 'em

GameKid 12-17-2011 12:50 AM

Eh, you don't suck, it's just that you can't use them in methods.

dakota95 12-17-2011 07:53 PM

I did basically the same thing in my knight design game.


All times are GMT -5. The time now is 07:57 AM.

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