I have written a script using the camera for face tracking, which used to work ok.
But now, at the begining of the script I have the following error message : "ControlCommand" is not supported for this control (Camera).
When i click OK, the script continues, but face tracking is not activated.
I think that the ControlCommand sentence is ok, so i don't unserstand the issue.
Here is a screen copy with the script and the error:
Edit: copy of the script :
IF ($CameraIsTracking = 0)
ServoRandom(d10, 30, 70)
ServoRandom(d11, 40, 75)
ELSEIF ($CameraIsTracking = 1)
MP3TriggerPlayTrack(d5, 38400, 5, 2000)
It's hard to see that script with this screen capture. Can you post it by it's self?
Did you try to activate the face tracking and then try the script? You may have to have it active for the script to run properly.
Install the DeBug control and then run the script. Watch the readout in the window and it will tell you what line the problem is on and maybe what the problem is.
I have edit my first post with a copy of the script.
If I activate face tracking I have the same message. In fact there is no error, neither in the script debug console, neither in a Debug Control... just this message and then the script continues, but the ControlCommand function don't work.
How are you sending the $CameraIsTracking variable to the script? You need to get that info to the script somehow.
I installed your script in my EZ Builder and it ran without error once I placed $CameraIsTracking = 0 or $CameraIsTracking = 1 above the :Loop
Ok, so I think the problem is more complicated than i thought, because when I close and open EZ-Builder many times, sometimes (but rarely) the script works perfectly (with face tracking activation), without no message.
So it seems that it is a random issue...
The $CameraIsTracking variable is present in the "Variables" tab of script settings, so I think it's ok.
Nevertheless, I tried to place $CameraIsTracking = 0 or $CameraIsTracking = 1 above the :Loop, but no effect.
OK, that variable thing makes sense.
Maybe you have a Windows problem? Your script works nicely on my laptop using it's built in web cam. However I was not connected to the EZ-B board.
In fact, I think that it is a problem with my EZ-Builder project. I have created a new test project with only the script, the camera and the mp3 Trigger and everything works well.
So it seems that there is some control or something in my project that enter in conflict with the ControlCommand & Camera in my scripts....
I have found where is the issue :
I have a Digital Control to swith-on the camera and I have called it: "Camera".
It seems that the script confuses the real Camera Control with the Digital Control called "Camera"... Since I have renamed the Digital control "Camera01", everything is OK.
Maybe it happens since the last update, with the new feature: "Digital Controls display custom text instead of ON/OFF", but I am not sure...
For future refence, here is the help from the manual regarding ControlCommand() or CC(). I marked the parts in bold that are of interest to you
ControlCommand( windowName, ControlCommandParameter, [values])
. Sends a command to the window by its name. Look further down in this document for available ControlCommand() parameters under the ControlCommand Parameter section.
. This command has a shorthand alias which is "CC" (See examples below).
. Example: ControlCommand( "ADC Graph", pauseOn )
. Example: ControlCommand( "SoundBoard", Track_3 )
. Example: ControlCommand( "Camera", CameraTweet, "This is an Image Description" )
. Example: ControlCommand( "Script Manager", ScriptStart, "MyScript" )
. Example: ControlCommand( "Speech Recognition", PauseMS, 3000)
. Example: cc("Auto Position", AutoPositionAction, "Action Name")
. Example: cc("Auto Position", AutoPositionFrame, "Frame Name")
. Example: cc("Auto Position", AutoPositionFrame, "Frame Name", 50, 3)
. Example: cc("Speech Recognition", PauseMS, 2000)
Great! I had a problem something like that a while ago. I had variables named the same in a few scripts and things seemed broken.
Glad it worked out.