English Change firing sound

6 replies
Goto Page
To the start Previous 1 Next To the start
04.08.14 08:49:23 am
Up
-RZ-
User
Offline Off
There is any way to change the bow behavior firing sound?
Sorry, I am not good with scripts (I understand and I can edit, but "create" scripts is another stuff).
Thank you.
*Hello*
04.08.14 03:07:45 pm
Up
Hurri04
Super User
Offline Off
no, I dont think this is possible with just scripts normally.

what might work though is to replace the bow sound in the sfx folder with an empty sound file and "override" the sound for every item which uses the bow behaviour by hand by using the s2 cmd play command.
04.08.14 05:15:50 pm
Up
-RZ-
User
Offline Off
Oh, I don't want to replace the firing sound. But thanks anyway.
*Hello*
04.08.14 05:55:40 pm
Up
Hurri04
Super User
Offline Off
you don't? then what do you want to do? because the op reads to me like you wanted to...
05.08.14 12:03:05 am
Up
-RZ-
User
Offline Off
Oh, I'm sorry, what I tried to say:

Bow
name=Bow
id=...
behavior=bow
//Bow default shooting sound

My crazy gun
name=Wunnderwaffe MM-118
id=...
behavior=bow
//my weapon sound

do you understand? I want to change just for my weapon.
*Hello*
05.08.14 12:40:04 am
Up
Hurri04
Super User
Offline Off
well, since there is no definition line for a firing sound I'm pretty sure that this is tied to the behaviour.
thus to change the sound you would have to either pick a different behaviour (see here for reference, scroll down to "item beaviours") or do what I described above.

obviously you'd have to make the script play the old sound for the weapons which are supposed to keep the old sound and play your new sound for your own weapon.
09.11.14 11:25:15 pm
Up
mutantroosta
User
Offline Off
this is from the game itself (not my code)

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
### Shotgun
id=110
name=Shotgun
group=weapon
icon=gfx\shotgun.bmp
model=gfx\shotgun.b3d
scale=0.335
behaviour=gun
range=120
rate=800
mat=metal
weight=2500
info=this gun causes a lot of damage but it has only a very small range
damage=10
healthchange=0
script=start
     on:attack1 {
          if (gety("unit",1)<-15){
               skipevent;
               speech "negative";
          }else{
               if (playergotitem(29)>0) { play "shotgun.wav"; }
          }
     }
     on:impact {
          $tmp=impact_class();
          $tmp2=impact_id();
          //+100 Bonus Damage on Flesh
          if (compare_material($tmp,$tmp2,"flesh")==1){
               damage $tmp,$tmp2,100;
          //+100 Bonus Damage on Fruit
          } elseif (compare_material($tmp,$tmp2,"fruit")==1){
               damage $tmp,$tmp2,100;
          //+200 Bonus Damage on Glass
          } elseif (compare_material($tmp,$tmp2,"glass")==1){
               damage $tmp,$tmp2,200;
          }
          freevar $tmp;
          freevar $tmp2;
     }
     on:inhand {
          play "crack1.wav";
     }
     on:noammo {
          speech "negative";
          msg "No ammo!",3;
     }
script=end

and this is a tweaked version
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
### my gun
id=...
name=my gun
group=weapon
icon=gfx\mygun.bmp
model=gfx\mygun.b3d
scale=0.335
behaviour=gun
range=120
rate=800
mat=metal
weight=2500
info=this gun causes a lot of damage but it has only a very small range
damage=10
healthchange=0
script=start
     on:attack1 {
          if (gety("unit",1)<-15){
               skipevent;
               speech "negative";
          }else{
               if (playergotitem(29)>0) { play "mygun.wav"; }
          }
     }
     on:impact {
          $tmp=impact_class();
          $tmp2=impact_id();
          //+100 Bonus Damage on Flesh
          if (compare_material($tmp,$tmp2,"flesh")==1){
               damage $tmp,$tmp2,100;
          //+100 Bonus Damage on Fruit
          } elseif (compare_material($tmp,$tmp2,"fruit")==1){
               damage $tmp,$tmp2,100;
          //+200 Bonus Damage on Glass
          } elseif (compare_material($tmp,$tmp2,"glass")==1){
               damage $tmp,$tmp2,200;
          }
          freevar $tmp;
          freevar $tmp2;
     }
     on:inhand {
          play "crack1.wav";
     }
     on:noammo {
          speech "negative";
          msg "No ammo!",3;
     }
script=end


pretty basic really =]
To the start Previous 1 Next To the start