Alice Community  

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

Reply
 
Thread Tools Display Modes
Stopping current actions for a simulation
Old
jissan11
Junior Member
 
Status: Offline
Posts: 14
Join Date: Mar 2011
Default Stopping current actions for a simulation - 06-05-2011, 01:09 PM

I have a world where two bumper cars are moving around if you click the green button. What I'm trying to do is to get the red button to stop the movement of the bumper cars (without resetting the world). In other words, to get the bumper cars to stop where they are and to then move again after the green button is pressed. I've tried using a boolean to get to work...but it hasn't. Any help is appreciated.

P.S.: You can do whatever you want to get this to work. i don't have any set requirements.
Attached Files
File Type: a2w A3_bumpercars_Jissan.a2w (368.6 KB, 18 views)
   
Reply With Quote
Old
DeathxKiller
Senior Member
 
DeathxKiller's Avatar
 
Status: Offline
Posts: 53
Join Date: May 2011
Location: Midlothian
Default 06-05-2011, 01:38 PM

we cant do your homewotk for you. this is an alice assignment. try using a lever switch instead of a two button switch. works when i tried it
   
Reply With Quote
Old
jissan11
Junior Member
 
Status: Offline
Posts: 14
Join Date: Mar 2011
Default 06-05-2011, 02:45 PM

I understand that but what i'm asking is help with homework, not doing it. I need to know how to get Alice to stop running the simulation when the button (or switch is that's used instead) is pressed. I could have easily have posed the question with:

How do you stop a set of actions in game?
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 06-05-2011, 02:59 PM

Use the event "While something is true"

Put the car movements in the during section, and have a boolean variable that changes when you hit the switch in the condition.

Voila


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
Old
jissan11
Junior Member
 
Status: Offline
Posts: 14
Join Date: Mar 2011
Exclamation 06-06-2011, 06:01 AM


I understand what you are telling me to do except for the following:

-where should the boolean be created? under functions or under properties?
-won't this only allow the code to stop and not restart again once pressed?

Thanks for the help
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 06-06-2011, 10:03 AM

Use a Boolean variable that changes when you press the button

IF (Variable=true) then
Set value to false
Else
Set value to true

That should change it back and forth and go on and off when you press the button. Make sure your variable is world-level, not class-level.


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
Reply


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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.