I am creating a Component. I have created two (boolean) signals for it, “TurnTable” and “Door”
I then try to trigger functions based on the trigerred signasl but it doenst work
from vcScript import * comp = getComponent() turn_signal = comp.findBehaviour("Turn_Table")#prints <vcBoolSignal object> door_signal = comp.findBehaviour("Door") #prints <vcBoolSignal object> def OnRun(): while True: triggerCondition(lambda: getTrigger()==door_signal or getTrigger()==turn_signal) print "Something Trigerred" #prints "Something Trigerred" print getTrigger() #prints "None" if getTrigger()==turn_signal: TurnTable() #doesnt execute if getTrigger()==door_signal: Door(door_signal.Value) #doesnt execute
From the print statement (Something Trigerred) its clear that the tiggerCondition() works as needed
However, the getTrigger() works only in the lambda function (Otherwise it wouldnt have printed Something trigerred). The two if statements fail as getTrigger() gets the value “None” and doest execute functions TurnTable() and Door(). Also goes without saying that I have the python script as connections to the signals or else the lambda functions wouldnt return True
What could I be possibly doing wrong? I use VC premium 4.1 on a windows 10 PC.
Any help is appreciated. Thanks