Author Topic: Fall damage SFX  (Read 798 times)

When a player falls from a velocity of whatever that can lower their health, a random SFX from the file would play.

pretty sure smm has this as a feature; i could possibly just extract that part of it and make it a simple add-on or something


i could possibly just extract that part of it and make it a simple add-on or something

Any progress?

Any progress?
no, sorry. i shouldn't have said that i was going to make it since i don't plan on it any time soon, but it should be relatively easy to someone else to do this, ripping code from SMM or not


Ah, okay.
ok, slight change of heart; i've taken this part right out of SMM's code with a minor change so it'll be really easy for someone to package it and all; i might do it myself but don't count on it since i'm too lazy to produce anything. you should post the varying sounds that you want used for this so someone can make this a complete add-on and iirc the next SMM add-on to be released, which apparently stopped at blood and bodies (link).
Code: [Select]
//datablock portion, obviously incomplete since more sounds are needed
datablock AudioProfile(FallFatalSound0) {
fileName = $SMM::Path @ "res/sounds/fallFatal.wav";
description = AudioClosest3D;
preload = true;
};

datablock AudioProfile(FallInjurySound0) {
fileName = $SMM::Path @ "res/sounds/fallInjury.wav";
description = AudioClosest3D;
preload = true;
};

package smmDamagePackage {
function Armor::damage(%this, %obj, %src, %pos, %damage, %type) {
if (%type == $DamageType::Fall) {
%obj.specialDamageType = "fall";
if(%obj.isCrouched())
{
%damage = %damage * 3; //original value 3
}
if(%fatal) {
serverPlay3D(FallFatalSound @ getRandom(3), %obj.getPosition()); //name the sounds FallFatalSound(0,1,2,3) ex: FallFatalSound2. for just one sound, remove "@ getRandom(3)" from this and the other line
}
else {
serverPlay3D(FallInjurySound @ getRandom(3), %obj.getPosition());
}
%obj.doDripBlood(2);
}

Parent::damage(%this, %obj, %src, %pos, %damage, %type); //no idea if this needs to be returned, it appears to work fine without
}
};

activatePackage("smmDamagePackage");
« Last Edit: December 16, 2015, 04:18:16 PM by QuadStorm »

So do I just put that in a server.cs with the sound files?

Bump, I would really like to have this.

« Last Edit: December 22, 2015, 02:18:22 PM by Swollow »