Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Can Alice remember past actions?
Old
cjworld
Junior Member
 
Status: Offline
Posts: 8
Join Date: Dec 2011
Question Can Alice remember past actions? - 12-15-2011, 11:55 AM

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?
   
Reply With Quote
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Default 12-15-2011, 12:04 PM

Quote:
Originally Posted by cjworld View Post
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?
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


<Insert_Signature_Here>
   
Reply With Quote
Past part
Old
cjworld
Junior Member
 
Status: Offline
Posts: 8
Join Date: Dec 2011
Question Past part - 12-15-2011, 12:30 PM

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?
   
Reply With Quote
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Default 12-15-2011, 12:40 PM

Quote:
Originally Posted by cjworld View Post
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?
hmmm. Didn't think of that. Well it is probably a simple logic problem, and I am terrible at logic.


<Insert_Signature_Here>
   
Reply With Quote
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Default 12-15-2011, 12:50 PM

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


<Insert_Signature_Here>
   
Reply With Quote
Where creating method?
Old
cjworld
Junior Member
 
Status: Offline
Posts: 8
Join Date: Dec 2011
Question Where creating method? - 12-15-2011, 09:15 PM

Quote:
Originally Posted by dakota95 View Post
Then make a method called "pick up object 1" place an if/else statement in the method.
What object am I creating the method under?
   
Reply With Quote
Old
GameKid
Senior Member
 
GameKid's Avatar
 
Status: Offline
Posts: 467
Join Date: May 2011
Location: My magnificent castle
Default 12-15-2011, 11: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.


[COLOR=e4eaf2]Your text here[/COLOR]
Come on, you know you want to try it.
   
Reply With Quote
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Default 12-16-2011, 12:16 PM

Quote:
Originally Posted by cjworld View Post
What object am I creating the method under?
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


<Insert_Signature_Here>
   
Reply With Quote
Old
GameKid
Senior Member
 
GameKid's Avatar
 
Status: Offline
Posts: 467
Join Date: May 2011
Location: My magnificent castle
Default 12-17-2011, 01:50 AM

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


[COLOR=e4eaf2]Your text here[/COLOR]
Come on, you know you want to try it.
   
Reply With Quote
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Default 12-17-2011, 08:53 PM

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


<Insert_Signature_Here>
   
Reply With Quote
Reply

Tags
function, functions, victory, victory conditions

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.