Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
Crouching?
Old
simsman2011
Senior Member
 
simsman2011's Avatar
 
Status: Offline
Posts: 132
Join Date: Jul 2011
Location: somewhere on Earth
Default Crouching? - 07-28-2011, 06:36 AM

I made the player crouch by making an event in which when "c" is typed the player moves down 5 meters duration:0.25 seconds
but how can I make the same event but adding that when "c" is typed again the player moves up 5 meters duration:0.25 seconds (setting pose won't do anything about that)

ANY HELP WILL BE APPRECIATED
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,145
Join Date: Dec 2010
Location: N/A
Default 07-28-2011, 07:37 AM

Quote:
Originally Posted by simsman2011 View Post
I made the player crouch by making an event in which when "c" is typed the player moves down 5 meters duration:0.25 seconds
but how can I make the same event but adding that when "c" is typed again the player moves up 5 meters duration:0.25 seconds (setting pose won't do anything about that)

ANY HELP WILL BE APPRECIATED
It would require a use of a variable and an if/else statement. For example:

Code:
if(PlayerPostion == 0)
{
      // include code to crouch here
      // increment variable by one
}
else
{
      // include code to move up 5 meters duration: 0.25 seconds
      // decrement variable by one
}
   
Reply With Quote
Old
DensetsuNoKaboom
Senior Member
 
DensetsuNoKaboom's Avatar
 
Status: Offline
Posts: 1,188
Join Date: May 2010
Location: e4eaf2
Default 07-28-2011, 09:29 AM

At the beginning of the world, playerPosition should be 0.


Thank you for taking the time to read this signature. This signature loves you.
   
Reply With Quote
Old
DensetsuNoKaboom
Senior Member
 
DensetsuNoKaboom's Avatar
 
Status: Offline
Posts: 1,188
Join Date: May 2010
Location: e4eaf2
Default 07-28-2011, 10:42 AM

Go to world's properties, and click "create new variable". Call it playerPosition, select "number", and choose 0 for its value. Then drag in an If/Else, drag the variable playerPosition into where it says "true", choose "playerPosition ==".


Thank you for taking the time to read this signature. This signature loves you.
   
Reply With Quote
Old
simsman2011
Senior Member
 
simsman2011's Avatar
 
Status: Offline
Posts: 132
Join Date: Jul 2011
Location: somewhere on Earth
Default 07-28-2011, 11:36 AM

THANK YOU But I did it by another way........
Thank you for helping.....


==========ــــــــــــــــــــــــــــــــــــــ==============
==========SiMsMaN.....2O11=============
==========ــــــــــــــــــــــــــــــــــــــ==============
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,145
Join Date: Dec 2010
Location: N/A
Default 07-28-2011, 11:41 AM

Quote:
Originally Posted by simsman2011 View Post
THANK YOU But I did it by another way........
Thank you for helping.....
Your welcome. There are multiple ways that you could have done it, but my way is how I would have done it.
   
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.