2 registered members (AndrewAMD, Lapsa),
1,331
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: sound code
[Re: xXxGuitar511]
#75486
05/28/06 18:24
05/28/06 18:24
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
The second code that I posted worked perfectly for me...
It plays a sound (ONCE) when the player model gets close enough to the entity with the action assigned...
If you need to, change the variable player.x, to camera.x.
If your still having problems, then learn c-script via the manual...
xXxGuitar511 - Programmer
|
|
|
Re: sound code
[Re: aslam]
#75489
05/28/06 20:30
05/28/06 20:30
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
Code:
sound SkelVoiceSND = <Voices.wav>; // The sound... var SkelVoiceVol = 200; // The volume...
ACTION SkelVoice { my.skill1 = 200; // Distance player has to be within to play the sound while(player == null) {wait(1);} while(my.skill1 > 0) { if (vec_dist(my.x, player.x) <= my.skill1) { ent_playsound(my, SkelVoiceSND, SkelVoiceVol); my.skill1 = 0; } wait(1); } }
Last edited by xXxGuitar511; 05/29/06 16:35.
xXxGuitar511 - Programmer
|
|
|
Re: sound code
[Re: aslam]
#75492
05/29/06 16:37
05/29/06 16:37
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
I updated the code, see if it works now... (Changes in red)
The problem is that the player and the skeleton are starting out within the range set. Try the changes above, and if it doesn't work... then I don't know...
xXxGuitar511 - Programmer
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|