I have set up a simple script, which when activated with a sensor determines whether or not a sound is played. The Game API reads that I can use getFilename() to return the name of the file associated with the actuator, but all that I get is the name of the actuator. The (simplified) script looks like this:
Code: Select all
import GameLogic
co = GameLogic.getCurrentController()
obj = co.getOwner()
sens = co.getSensor("sensor")
if sens.isPositive():
actuator = co.getActuator("actuator")
filename = actuator.getFilename()
# print filename
GameLogic.addActiveActuator(actuator, True)
Thanks,
farbin