Game Engine - Sound Actuator/Python

Game Engine, Players & Web Plug-in, Virtual Reality, support for other engines

Moderators: jesterKing, stiv

Post Reply
farbin
Posts: 4
Joined: Thu Oct 24, 2002 7:09 pm
Location: United States - East Coast

Game Engine - Sound Actuator/Python

Post by farbin »

I have just started working with scripting to control the sound actuator and I have come across some unexpected behavior. Just wanted some input as to whether I am doing this right or not.

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)

Am I missing something or doing this the wrong way? The API only states that I should get a filename, but "actuator" is not the file name.

Thanks,
farbin

calli
Posts: 38
Joined: Wed Oct 16, 2002 10:59 am
Contact:

Post by calli »

Its just a very old bug....

Sorry.

farbin
Posts: 4
Joined: Thu Oct 24, 2002 7:09 pm
Location: United States - East Coast

Post by farbin »

; (

That is unfortunate.
setFilename() does not seem to work either.

Guess I need to start coding.

Post Reply