new tag hitsound?

new tag hitsound?

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

new tag hitsound?

Post by Noruas »

Put this tag in unit fbi and make like
hitsound1=filename.wav;
hitsound2=filename.wav;
hitsound3=filename.wav;//3 max
Whenever the unit gets hit by a weapon, it makes a certain sound, that way certain weapons like bullets when it hits people or things that make noises can make a grunt or hurt noise. OR
weaponhitsound=filename.wav,weapon;
So that if hit by certain weapon, make certain noise, for bullets hitting metal and such. blalbalbal just another idea.
User avatar
unpossible
Posts: 871
Joined: 10 May 2005, 19:24

Post by unpossible »

didn't TAK have this?
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

Post by Noruas »

I dont know, i never had TAK...
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

TAK allowed you to emit sounds via script and there's a script function called when the unit is hit.
User avatar
unpossible
Posts: 871
Joined: 10 May 2005, 19:24

Post by unpossible »

so that means it's in there already...you just need to specify the sounds in the script and randomly choose one...
sorry i forgot about the sound thing. is it emitsound?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

play-sound("filename",intensity);

script must be compiled as a TA:K script
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Ahhhh... TAK script... aha... thanks very much, zwzsg!
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

For the billionth time

In any case, this tag wouldn't be that great, or even doing it from the script. We can't tell if that was a bullet that just hit or the fringe of a nuclear explosion. It'd sound kind of odd to hear bullet sounds when it's an artillery shot...
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

Post by Noruas »

For the billionth time thanks abunch... atleast its possible to get a noise off in cob scripts, i keep getting a smoke piece error. Actually there are tiny little balls inside missles called ball bearing that fly out like bullets but much faster and do devasting effects around the area, and makes bullet hitting metal like sounds, but its all drowned out by the missle.
Sounds do work, but make sure u compile them as a tak script, but heres my example: #define TAK // This is a TAK script

#include "sfxtype.h"
#include "exptype.h"

#include "springsmoke.h"

piece flare1, flare2, turret, base, sleeves, barrel1, barrel2;

static-var restore_delay, Static_Var_2, Static_Var_3;


SoundControl()
{
while( TRUE )
{
if( Static_Var_3 )
{
play-sound( "tankenginegoing", 2 );
}
sleep 2000;
}
while( FALSE )
{
}
if( Static_Var_3 )
{
play-sound( "tankenginestopped", 2 );
}
sleep 5000;
}

Create()
{
hide flare1;
hide flare2;
Static_Var_2 = 0;
restore_delay = 3000;
Static_Var_3 = 0;
start-script SoundControl();
}

StartMoving()
{
play-sound( "tankenginestarting", 2 );
sleep 4000;
Static_Var_3 = 1;
}

StopMoving()
{
Static_Var_3 = 0;
sleep 1200;
play-sound( "tankenginestoping", 2 );
}

SetMaxReloadTime(time)
{
restore_delay = time * 2;
}

RestoreAfterDelay()
{
sleep restore_delay;
turn turret to y-axis <0.000000> speed <180.000000>;
turn sleeves to x-axis <0.000000> speed <180.000000>;
}

AimPrimary(Func_Var_1, Func_Var_2)
{
signal 2;
set-signal-mask 2;
turn turret to y-axis Func_Var_1 speed <180.000000>;
turn sleeves to x-axis <0.000000> - Func_Var_2 speed <180.000000>;
wait-for-turn turret around y-axis;
wait-for-turn sleeves around x-axis;
start-script RestoreAfterDelay();
return (1);
}

FirePrimary()
{
if( Static_Var_2 == 0 )
{
show flare1;
move barrel1 to z-axis [-1.000000] speed [300.000000];
sleep 150;
hide flare1;
wait-for-move barrel1 along z-axis;
move barrel1 to z-axis [0.000000] speed [3.000000];
}
if( Static_Var_2 == 0 )
{
show flare2;
move barrel2 to z-axis [-1.000000] speed [300.000000];
sleep 150;
hide flare2;
wait-for-move barrel2 along z-axis;
move barrel2 to z-axis [0.000000] speed [3.000000];
}
Static_Var_2 = !Static_Var_2;
}

AimFromPrimary(Func_Var_1)
{
Func_Var_1 = 2;
}

QueryPrimary(Func_Var_1)
{
if( Static_Var_2 == 0 )
{
Func_Var_1 = 0;
}
if( Static_Var_2 == 1 )
{
Func_Var_1 = 1;
}
}

SweetSpot(piecenum)
{
piecenum = base;
}

Killed(Func_Var_1, Func_Var_2)
{
hide flare1;
hide flare2;
if( Func_Var_1 <= 25 )
{
Func_Var_2 = 1;
explode barrel1 type BITMAPONLY | EXPTYPE_SMALLEXPLOSION;
explode barrel2 type BITMAPONLY | EXPTYPE_SMALLEXPLOSION;
explode base type BITMAPONLY | EXPTYPE_MEDIUMEXPLOSION;
explode flare1 type BITMAPONLY | EXPTYPE_LARGEEXPLOSION;
explode flare2 type BITMAPONLY | EXPTYPE_LARGEEXPLOSION;
explode sleeves type BITMAPONLY | EXPTYPE_XLARGEEXPLOSION;
explode turret type BITMAPONLY | EXPTYPE_LARGEEXPLOSION;
return (0);
}
if( Func_Var_1 <= 50 )
{
Func_Var_2 = 2;
explode barrel1 type FALL | EXPTYPE_SMALLEXPLOSION;
explode barrel2 type FALL | EXPTYPE_SMALLEXPLOSION;
explode base type BITMAPONLY | EXPTYPE_MEDIUMEXPLOSION;
explode flare1 type FALL | EXPTYPE_LARGEEXPLOSION;
explode flare2 type FALL | EXPTYPE_LARGEEXPLOSION;
explode sleeves type 1 | EXPTYPE_XLARGEEXPLOSION;
explode turret type FALL | EXPTYPE_LARGEEXPLOSION;
return (0);
}
if( Func_Var_1 <= 99 )
{
Func_Var_2 = 3;
explode barrel1 type FALL | 8 | 16 | 2 | EXPTYPE_SMALLEXPLOSION;
explode barrel2 type FALL | 8 | 16 | 2 | EXPTYPE_SMALLEXPLOSION;
explode base type BITMAPONLY | EXPTYPE_MEDIUMEXPLOSION;
explode flare1 type FALL | 8 | 16 | 2 | EXPTYPE_LARGEEXPLOSION;
explode flare2 type FALL | 8 | 16 | 2 | EXPTYPE_LARGEEXPLOSION;
explode sleeves type 1 | EXPTYPE_XLARGEEXPLOSION;
explode turret type FALL | 8 | 16 | 2 | EXPTYPE_LARGEEXPLOSION;
return (0);
}
Func_Var_2 = 3;
explode barrel1 type FALL | 8 | 16 | 2 | EXPTYPE_SMALLEXPLOSION;
explode barrel2 type FALL | 8 | 16 | 2 | EXPTYPE_SMALLEXPLOSION;
explode base type BITMAPONLY | EXPTYPE_MEDIUMEXPLOSION;
explode flare1 type FALL | 8 | 16 | 2 | EXPTYPE_LARGEEXPLOSION;
explode flare2 type FALL | 8 | 16 | 2 | EXPTYPE_LARGEEXPLOSION;
explode sleeves type 1 | 2 | EXPTYPE_XLARGEEXPLOSION;
explode turret type FALL | 8 | 16 | 2 | EXPTYPE_LARGEEXPLOSION;
}
It works, timing is abit off, but it was meant for a tank.
Post Reply

Return to “Feature Requests”