Alice Community  

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

Reply
 
Thread Tools Display Modes
Freeze Controls? Idk what to call it.
Old
Taterific
Guest
 
Status:
Posts: n/a
Default Freeze Controls? Idk what to call it. - 02-24-2010, 02:09 PM

This is probably pretty simple.
I just can't figure it out.

I've made this cool Helicopter flying thing, pretty sweet.
HOWEVER, I want the player to watch the helipopper [as I call it] start up before they can control it.

How can I make it so you can't control it, until it's already done starting up?

I'm new to Alice, so if it involves a lot of If/Else or While statements, and all that, you'll have to go real slow and use small words. ;]

Thanks!
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 02-24-2010, 02:38 PM

It depends if you are using the "Let arrow keys move object" event. If you are using that, you will probably have to switch to a custom movement method because you cannot add if/else statements into the events bar (at least not into that particular event).

If you do not know how to do custom movement methods with the "While key is being pressed", then it will be very difficult to explain.


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
Taterific
Guest
 
Status:
Posts: n/a
Default 02-24-2010, 04:37 PM

well it's a helicopter
So the arrow key's make it go UP, DOWN, and Turn LEFT, and RIGHT.
While WSAD keys make him move FORWARD, BACKWARD and strafe LEFT and RIGHT.

So there are a lot of controls. And I don't use their arrow key ones, I made my own... [obviously]
   
Reply With Quote
Old
Taterific
Guest
 
Status:
Posts: n/a
Default 02-24-2010, 04:42 PM

Oh wow, I just figured it out based off of what you said.

I guess I was closer than I thought.

I just made a variable for the helicopter called "moveable" and set it = to 1.
And after it "starts up" it get's set to 2.
And I have an IF/ELSE statement in all the move events saying it has to be set to 2.

SO thanks for the inspiration.
If there's an easier way, or maybe this isn't what you meant, feel free to reply with what you were going to say...
   
Reply With Quote
Old
Taterific
Guest
 
Status:
Posts: n/a
Default 02-24-2010, 04:55 PM

Now how do you make it so only after it takes off and you fly it into the ground you crash?

It can be as simple as just making it so your controls freeze and fire spawns.
I'll figure out the rest myself.

I just need to know how to call a method when the chopper hits the ground, after it leaves the ground for the first time... if that makes sense.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 02-24-2010, 05:07 PM

That is almost exactly what I was going to have you do, except I was going to make you create a boolean variable instead of a number variable, but it doesn't really matter.

In order to determine if the helicopter is above the ground or not, you have to make a "while something is true" event in the events panel, and go to the helicopter's function tab and look for "helicopter is underneath object" and drag that into the beginning of the event. Now, put in the beginning part the method you created to make the helicopter crash. For example in this method you can vehicle the camera to the world, you can make the "moveable" variable turn back to 1 so that you cannot move helicopter anymore, and so on.


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
Taterific
Guest
 
Status:
Posts: n/a
Default 02-24-2010, 05:56 PM

Oh wow. Thanks a bunch man.

Think you could help me with atleast one last thing?

I'm using the fire special effect for when he crashes.
It's not working but here's what I'm trying:

In the crash method, I'm having a 'hidden under ground' fire thing "set point of view" to the chopper. I have the fire big enough so that if it worked, it would be visible through the ground.
I also have the camera move up so it's not under ground also, and look down at the crash site.
The "crash site" which is SUPPOSED to be nothing but a ton of fire, is simply a patch of grass...

There a way to replace the chopper with fire or something? Or spawn fire where it crashed...?

Thanks again. Maybe, if you want, I'll post it for you to see when I get somewhat done. =]
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 02-24-2010, 06:49 PM

You can have the fire be vehicled to the helicopter at all times and have its isShowing == false, and then when the helicopter crashes, you can make the helicopter either disappear (isShowing == false) or turn it's color to black. Then you make the fire isShowing == true.

If you want the helicopter to crash as soon as it touches the ground instead of when it is already below the ground, you can change the While event to say something like "While ((helicopter's distance above ground) < 1) && (movable == 2))". You can replace the 1 with another number (just test it to see what number fits best to make it look most realistic).

In order to get this though, you will want to go to world's function tab and put "Both a and b" in the While event, and then look again and for the "a" part of "Both a and b", put "a < b" in that. Then for the "a" of "a < b", go to the helicopter's function tab and put in "Helicopter's distance above object" and for object select ground. Then for the "b" of "a < b" just put the number. Now for the "b" of "Both a and b", drag the movement variable in and just select 2.


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

Last edited by Dameria; 02-24-2010 at 08:40 PM.
   
Reply With Quote
Old
Taterific
Guest
 
Status:
Posts: n/a
Default 02-24-2010, 08:32 PM

I've been trying to decipher that for quite a while now..
I'm almost onto something...
but I get lost around the Both A and B part
I know where that is and I put it in the spot but after that I'm confused.

"a of a<b" all that stuff... I don't know what this all is supposed to look like...
It asks for Number values when a < b. When I put it in it's like A? .25; .5; 1; 5? then B? same thing..


Right now I'm stuck at
WHILE [[both 'True' and 'True'] is true]
During: World.Crash.


wait I think I got it. Only now, since the Chopper starts off on the ground, it explodes instantly. before it can take off...

UGH, well I changed it to instead of 1 above ground, like.. -0.25 above ground. and it works up until I get to the spot. Then the whole game crashes... instead of just the chopper..
It has something to do with in the crash method I set Moveable back to 1. Cause when I got rid of that, it didn't crash, only you can still fly the helicopter around after it's "crashed"
So I made the visibilty of the chopper go false. So you can't see it, but it's still there. If you fly back over the ground, the game crashes. If I can just get the Heli to STOP moving when it goes underground, It will be fine. But if I mess with that "movable" variable at all, it flips shit.

Last edited by Taterific; 02-24-2010 at 08:53 PM.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 02-24-2010, 08:45 PM

Does this help? The a < b is the one with helicopter < 1

Yea I'm sorry in my original instructions I told you to put world.moveable == 1, but it was supposed to be a 2
Also, do not put your crash method in the During one, put it in Begin
Make sure to put in your crash method "(moveable) set value to 1"

And again, change that 1 to the number that looks the most realistic (test crash until you get best results).
Attached Images
File Type: jpg helicopterexample.jpg (18.8 KB, 20 views)


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

Last edited by Dameria; 02-24-2010 at 08:52 PM.
   
Reply With Quote
Reply

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