I have a component with a property which decides how many of the same scripts it will run at the same time. So if i set it to 4 i will have Script1, Script2, Script3, Script4.
The scripts will all listen to the same string signal, which is on the format “SciptThatShouldlIsten, Information1, Information2…”. This means that i want to retrieve the script name from inside the script on some sort of function similar to getComponent().
comp.findBehavioursByType or comp.findBehaviour doesn’t really give me much, since the index of the specific script has to be found for itself.
if you want to add a signal to the script you are in right now you can use:
currentScript = comp.findBehaviour(__file__.split("::")[1])
signal = comp.findBehaviour("someSignal")
if not currentScript in signal.Connections:
connections = signal.Connections
connections.append(thisScript)