Try:
if (~A & A) {soundPlay(1,1,"Something")}
It checks wether or not the expression was executed by A changing. It will work as long as A is an input.
interval(10)
if (!clk() & A) {soundPlay(1,1,"Something")}
I need the interval, and I need the sound NOT to repeat.
-If I remove "!clk()" the sound will repeat constantly if A is true.
-If I use the "!clk()" the sound doesn't play at all
any help with making E2: sounds WITH an interval(10,20,30...) but the sound does NOT repeat?![]()
David Bowie is very disappointed in you!
You probably didn't know that David Bowie is very disappointed in you, but...now you do. And no, we don't know why
Try:
if (~A & A) {soundPlay(1,1,"Something")}
It checks wether or not the expression was executed by A changing. It will work as long as A is an input.
"If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
-- Niels Bohr
But the A isn't an Input, thats the thing![]()
David Bowie is very disappointed in you!
You probably didn't know that David Bowie is very disappointed in you, but...now you do. And no, we don't know why
Persist it, and it will also work. (You can't use tilde on nonpersisted vars, and inputs and outputs are automatically persisted)
This is exactly what I am trying to do...
Inputs
Outputs
Persist E:entity Use
interval(10)
E=owner()
Use=E:keyUse()
if (!clk() & Use == 1) {E:soundPlay(1,1,"Whatever")}
if I don't use "!clk()" it will repeat
if I use "!clk()" there is no sound at all
David Bowie is very disappointed in you!
You probably didn't know that David Bowie is very disappointed in you, but...now you do. And no, we don't know why
Last edited by Matte; 08-07-2009 at 03:32 PM.
"If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
-- Niels Bohr
Aw dang you're right. What's wrong with me. Confused it with $. Try this:
if (!clk() & Use == 1 & $Use == 1)
EDIT: yeah Matte's is less redundant than mine. Don't need to check Use==1.
Last edited by nescalona; 08-07-2009 at 03:30 PM.
You can't use ~ on persistant variables.
~ checks if an input has executed the E2.
Edit:
Holy shit I just got triple ninja'd
so why does "$" makes any difference?
David Bowie is very disappointed in you!
You probably didn't know that David Bowie is very disappointed in you, but...now you do. And no, we don't know why
Bookmarks