If All connected sensors == True: activate All connected actuators

The idea is that with this system the code would not be name dependent

The code might be something like this:


If AllConnectedSensors.positive == True: 
   cont.activate ['AllConnectedActuators']

So my question is, Can this be done?

All help is welcome,

And controller?

You would use for loops in python… I dont have any GE programming knowledge so that is as far as i can help

Like BPR said, a simple AND controller will do exactly what you want. If you have to use a Python controller for some reason, this code will work fine.

import bge

cont = bge.logic.getCurrentController()

# check if all sensors are positive
for sens in cont.sensors:
    if not sens.positive:
        break
    
# activate all actuators
else:
    for actu in cont.actuators:
        cont.activate(actu)

Thanks All, Problem Solved!