DillTheKraut last edited by
is it possible to work with triggers in the js actor?
Eg. output trigger by if statement or funktion triggered by input.
Juriaan Tech Staff last edited by
Could you tell us a bit more?
Simply sending a 1 would fire the trigger.
timkelly last edited by
likewise for trigger outputs - you can output to a trigger, but if you have one constantly changing argument the trigger will be firing constantly also - but this can be solved by running it through a value changed actor and using the trigger output of that
There is probably a much more elegant solution (someone please hop in if so!), but this is what I've found to work well.
timkelly last edited by timkelly
@juriaan oooh interesting - in which case this may be a bug?
See how trigger here is continually firing - while the trigger going through value changed (which is behaving correctly in this instance) is not?
DillTheKraut last edited by DillTheKraut
Thank you, this works for the input.
But an output allways triggers if any of the inputs are changed, despite any code there is. Even without any code at all. I guess this is the same issue there is, with the Global values actors?
These trigger outputs even when activating a scene or user actor without any intended rule to do so.
Therefore the only solution is, to go with integer 0/1 and a comparator connected.
I remember a forum discussion and an explanation by Mark about this, but can´t remember the exact reason for it.
Juriaan Tech Staff last edited by Juriaan
What I do is the following;
- Create a variable in my main called response
- Set all the values to a default value that I'm sending. For triggers, this is a 0. For other values, this might be a loop through of my input vars, etc
- Alter the response array based on the code in main / other functions
- Return response array
@DusX could you look into the attached Izzy file and let us know or this is behavoir that is expected ? Press 'r' to reset (or use the button in the Control panel) and use 'j' to jump to the next Scene. What we see is that in the counter / output we get a '1', should be zero. Since we didn't actively trigger it right ?
DusX Tech Staff last edited by
@Juriaan exactly. I tend to output booleans as a way to read a trigger. If 1 send trigger, if 0 don't.