Using the server.cs file from
Bushido's/Munk's Footsteps Mod, I tried to replace the pain and death sounds. After I edited the script, everything worked, except, well, for the new pain/death sounds. Here is the script:
exec("./script_footstep.cs");
function addNewSounds()
{
if(isFile("./SOUNDS/jump.wav"))
jumpSound.fileName = "./SOUNDS/sn_jump.wav";
if(isFile("./SOUNDS/lightOn.wav"))
lightOnSound.fileName = "./SOUNDS/lightOn.wav";
if(isFile("./SOUNDS/lightOff.wav"))
lightOffSound.fileName = "./SOUNDS/lightOff.wav";
if(isFile("./SOUNDS/death.wav"))
deathSound.fileName = "./SOUNDS/death.wav";
if(isFile("./SOUNDS/pain.wav"))
painSound.fileName = "./SOUNDS/pain.wav";
}
addnewSounds();
package newSounds
{
function JumpSound::onAdd(%this)
{
parent::onAdd(%this);
if(isFile("./SOUNDS/sn_jump.wav"))
%this.fileName = "./SOUNDS/sn_jump.wav";
}
function lightOnSound::onAdd(%this)
{
parent::onAdd(%this);
if(isFile("./SOUNDS/lighton.wav"))
%this.fileName = "./SOUNDS/lighton.wav";
}
function lightOffSound::onAdd(%this)
{
parent::onAdd(%this);
if(isFile("./SOUNDS/lightOff.wav"))
%this.fileName = "./SOUNDS/lightOff.wav";
}
function deathSound::onAdd(%this)
{
parent::onAdd(%this);
if(isFile("./SOUNDS/death.wav"))
%this.fileName = "./SOUNDS/death.wav";
}
function painSound::onAdd(%this)
{
parent::onAdd(%this);
if(isFile("./SOUNDS/pain.wav"))
%this.fileName = "./SOUNDS/pain.wav";
}
};
activatePackage(newSounds);
Bear with me, I'm new to TorqueScript.
The things I added were, obviously the lines with "pain.wav" and "death.wav".
What am I doing wrong?
Thanks.
edit: I suck at posting links
Link to addon (remains unchanged, except for pain.wav and death.wav)
http://www.mediafire.com/?6bwgm1d930j3qvg