This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

A litle script, but I got no output
#1
I have made this script:
But when I send a 1 value at this two objectadress, nothing happen. What do I do wrong?

Code:
Input_1 = event.getvalue('0/2/3')
Input_2 = event.getvalue('0/2/9')
Output = '0/2/0'

if input_1 == 1
  and input_2 == 1 then
grp.write(output, 35)
  end
   
Reply
#2
Hi,
use == true instead of == 1 at your if-statement.
Best regards

forsterm
Reply
#3
I tried that, but it didn't help

Code:
Input_1 = event.getvalue('0/2/3')
Input_2 = event.getvalue('0/2/9')
Output = '0/2/0'

if input_1 == true
  and input_2 == true then
grp.write(output, 35)
  end
Reply
#4
And check for case sensitive Input_ =…  -> if input_1 instead of if Input_1 … and Output =.. -> grp.write(output, .. instead of grp.write(Outpu..

I recommend to only use lower case to avoid those kind of mistakes..
Reply
#5
Didn't help

Code:
input_1 = event.getvalue('0/2/3')
input_2 = event.getvalue('0/2/9')
output = '0/2/0'

if input_1 == true
  and input_2 == true then
grp.write(output, 35)
  end
Reply
#6
Sorry missed that one, event.getvalue needs to be grp.getvalue

Also try to log your vars like log(input_1, input_2) so you know their values that you need to use in your conditions…
Reply
#7
Hi Quattro,
You have created an event on the scene object. So the script start every time this object change. I suggest you to create a script on tag and assign to input 1and 2 this tag.
So every time that those objects change the script starts.
Pay attention at the variables name must be the same.
Best regards Cristian
Reply
#8
Hi, tanks alot. I got it to work.
I now used grp.getvalue, change that the script react at a tag, and put the same tag on both adress object
Reply


Forum Jump: