What about setting up a master node for all those nodes. Then, whenever one of them is clicked, they send a signal to the master node telling it which of them was clicked, and it changes the variable to whatever the corresponding value is (1, 2, etc.). If it detects a mouse click (via the normal
Input.is_action_just_pressed method), but doesn't get any signal, it just changes it to the neutral value (0).
It's a little sketchy though, there might be a better way to do it.