May 7, 2018 at 9:44 am #183667
I want to turn Listerners on and off as needed….
So I went into Events/SetValues section of main page and created the “variable”.
To double check, I tried with a string variable, and did a “OutputValue” to see what it was
For true/false the string value would be yes/no
I switch it to Boolean, and for true/false it would be 1/0.
But when I did this for listner, it would not work (it seems to default to disabled)
Enabled [STRING] ListenerEnabled
If I do this
Enabled [STRING] YES
Enabled [STRING] NO
It works as expected, but if I use ListenerEnabled “variable”, it does not work properly
(I tested with ListenerEnabled defined as a string and also defined as a boolean.
(raw text of plist section below)
May 7, 2018 at 1:46 pm #183675
Okay, what you’re doing does work, but I’m not sure if its doing what ya think =)
So yeah, you can use a SetValues dict and create a variable named ListenerEnabled set to YES (as a String).
What confused me is that looked similar to the actual Enabled property you can use in an EventListener. So I thought you were trying to start or stop a Listener using SetValues.
And by the way, you do have Event properties StartListener and StopListener where the value would be the listener name.
If it helps, describe what you’re doing and I can suggest the setup.
May 7, 2018 at 2:00 pm #183676
Yes, I am wondering if I set it up right….
For my puzzle, I AnimateNodeToSlot, to gather puzzle pieces together closer to the actual puzzle. (that is, puzzle pieces far away are too annoying to drag, when just one click will bring them all in, closer to puzzle.)
But guess what? 🙂
If a puzzle is animated/dragged to slot, if it happens to “fly over” the spot in puzzle it belongs, it gets captured! Like it was placed there by user.
Thus, during this process, I would need to turn off the puzzle listeners, do the AnimateNodeToSlot, then turn on the puzzle listners again.
(more in next post)
May 7, 2018 at 3:42 pm #183684
The reason why I switched to individual, is that I also set a property on a node that is placed into puzzle to false. (custom property)
I do this so that these nodes can get skipped, I had to add a line of code into page where the AnimateNodeToSlot is done, to skip “invalid” puzzle piece sprites.
(that is, puzzle pieces that are done)
You must be logged in to reply to this topic.