The Daily Click ::. Forums ::. Klik Coding Help ::. A simple thing
 

Post Reply  Post Oekaki 
 

Posted By Message

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
3rd September, 2008 at 20:07:55 -

Upon pressing Q
flag 3 is off
flag 3 on

upon pressing Q - flag 3 off
flag 3 is on
flag 3 off

How to make it happen?

Image Edited by the Author.

 
Code me a sausage!

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
3rd September, 2008 at 20:10:30 -

http://create-games.com/forum_post.asp?id=228764 This is probably your problem.

Image Edited by the Author.

 

  		
  		

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
3rd September, 2008 at 20:20:57 -

Your code is flipping it on and off instantly. You need to add another flag which turns on when you press Q, and turns off when you let go.

Example, flag 10 is the flag I was just talking about.

Upon pressing Q
flag 3 is off
flag 10 is off.
Flag 3 on
Flag 10 on


Upon pressing Q
flag 3 is on
flag 10 is off.
Flag 3 off
Flag 10 on


Flag 10 is on
(negate) Repeat while pressing Q
Flag 10 off

So when you press Q, flag 10 turns on, and when you let go, it turns it off.


Image Edited by the Author.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
3rd September, 2008 at 20:22:14 -

Same thing. Except, Peblo tailored it directly for you. I was too lazy.

Image Edited by the Author.

 

  		
  		

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
3rd September, 2008 at 20:24:27 -

thx word word

 
Code me a sausage!

Nick of All Trades

Possibly Insane

Registered
  03/09/2002
Points
  2312

Game of the Week Winner
5th September, 2008 at 00:11:53 -

I'd say, use a values instead

- upon pressing Q
Add Value X

- Value X is 2
Set value X to 0

 
n/a

Ricky

loves Left For Dead 2

Registered
  28/12/2006
Points
  4075

Has Donated, Thank You!Game of the Week WinnerVIP MemberWii OwnerHero of TimeGOTM Winner! - November 2009I am an April Fool
5th September, 2008 at 08:33:00 -

Uppon pressing Q
toggle flag 3

pretty simple

Image Edited by the Author.

 
-

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
5th September, 2008 at 17:04:06 -

wow thats really simple

 
Code me a sausage!

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
5th September, 2008 at 20:33:58 -


Originally Posted by Ricky
Uppon pressing Q
toggle flag 3

pretty simple

Image Edited by the Author.


LMAO! That's completely true! I think most people forgot the toggle flag button existed

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Cyber Smurf



Registered
  22/08/2008
Points
  33
5th September, 2008 at 22:42:31 -

Just a small comment from an observer -

Some of us do not think logically, that is why we oversee the simple things, that can make your life easier. It has allways been a problem for me. I must continually say to myself; "Think logical!"

Of course the toggle action is the one to be used. Know your software and know your logic, and things can get much simpler - hehe.

Keep on clicking.

 
n/a

Jon Lambert

Administrator
Vaporware Master

Registered
  19/12/2004
Points
  8235

VIP MemberWii OwnerTDC Chat Super UserI am an April FoolSSBB 3265-4741-0937ACCF 3051-1173-8012360 Owner
5th September, 2008 at 22:45:52 -


Originally Posted by Peblo
Your code is flipping it on and off instantly. You need to add another flag which turns on when you press Q, and turns off when you let go.

Example, flag 10 is the flag I was just talking about.

Upon pressing Q
flag 3 is off
flag 10 is off.
Flag 3 on
Flag 10 on


Upon pressing Q
flag 3 is on
flag 10 is off.
Flag 3 off
Flag 10 on


Flag 10 is on
(negate) Repeat while pressing Q
Flag 10 off

So when you press Q, flag 10 turns on, and when you let go, it turns it off.


Image Edited by the Author.



Why not take the events he originally put up and add "Only one action when event loops" to each? Or use one with the toggle flag option and "Only one action when event loops".

 
Sandwich Time!Whoo!

JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
5th September, 2008 at 23:20:41 -


Originally Posted by Muz

Originally Posted by Ricky
Uppon pressing Q
toggle flag 3

pretty simple

Image Edited by the Author.


LMAO! That's completely true! I think most people forgot the toggle flag button existed



I certainly did. But I was thinking in terms of the other one-- the one involving menu selection changing, I didn't think about the specific problem.

 

  		
  		

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
6th September, 2008 at 00:31:38 -


Originally Posted by Jon & George Lambert

Originally Posted by Peblo
Your code is flipping it on and off instantly. You need to add another flag which turns on when you press Q, and turns off when you let go.

Example, flag 10 is the flag I was just talking about.

Upon pressing Q
flag 3 is off
flag 10 is off.
Flag 3 on
Flag 10 on


Upon pressing Q
flag 3 is on
flag 10 is off.
Flag 3 off
Flag 10 on


Flag 10 is on
(negate) Repeat while pressing Q
Flag 10 off

So when you press Q, flag 10 turns on, and when you let go, it turns it off.


Image Edited by the Author.



Why not take the events he originally put up and add "Only one action when event loops" to each? Or use one with the toggle flag option and "Only one action when event loops".



It usually works out that way, but sometimes french logic overrides your own and you have to find alternate ways of doing code.

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
   

Post Reply



 



Advertisement

Worth A Click