Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Tand3rsson

"Say" sound issues

Recommended Posts

Okey, I have (honestly) searched around for this.

Basically, I have a chopper in the unsung mod. Whenever the player calls the chopper for transport, it will "say" a random music file when it's more than 400 meters from its home helipad, namned "base".

This gives me 2 problems:

1. IF the chopper is called on, gets a distance of 400 m from "base", then returns within 400m, and exits this circle again before the first music file is done, I suddenly have two files playing from the chopper at the same time. So the question is basically, how do I stop a sound, initiated with the say command?`

heli1 say "sound1".

2. When using: heli1 say "sound1", if I am inside the chopper, looking in a first person view the sound is extremly low. However, if I am looking in a 3d person view, or is outside the chopper, the music is much louder.

When using "playMusic", this problem does not happen, however, then the music is not coming from the chopper, which kills the whole idea. Any ideas as how to solve this?

Share this post


Link to post
Share on other sites

1. You can't stop a sound, although I thought a unit was incapable of playing two sounds at the same time (which is why we use playSound sometimes instead of say, but it's not spatial). Try playing a dummy sound a couple of times before restarting it, or prevent restart.

2. Sound obstructions from the chopper itself (it's the "outside chopper" that is generating the sound). You may try to have the pilot or some invisible unit "say" the sound, but I'm not sure if it'll work.

Share this post


Link to post
Share on other sites

Attach an invisible H object to the helicopter and make it say the music. When you want to stop it, set the object's damage to 1.

Share this post


Link to post
Share on other sites

Thanks, how would I go about if i want it to create a new invisible H, mid game, inorder to play a new music strip?

Share this post


Link to post
Share on other sites

You can setDamage 0 the old one and use it again.

Share this post


Link to post
Share on other sites
_invisibleH = "HeliHEmpty" createVehicle (getPos heliname);

That would just give me a invis h at the helis pos, it wont follow it right?

Share this post


Link to post
Share on other sites
That would just give me a invis h at the helis pos, it wont follow it right?

right.

this will attach the inv h to heli, but beware that setdammage can have unforseen consequences here, not sure, do test.

_invisibleH = "HeliHEmpty" createVehicle (getPos heliname);
_invisibleH attachTo [heliname];

this will simply loop around setting the inv h to the heli pos acurately not using attach while the damage of the inv h is 0:

_invisibleH = "HeliHEmpty" createVehicle (getPos heliname);
while {(getDammage _invisibleH) == 0} do {
  _invisibleH setPos (getPos heliname);
  sleep 0.1;
};

you can switch out (getDammage _invisibleH) != 0 with any condition,

1: while heli still can fly: canMove heliname

2: while heli is alive: alive heliname

3: while damage of heli is below a certain level: (getDammage heliname) < 0.5

and so on and so forth ;)

Share this post


Link to post
Share on other sites

Thank you! I am not home atm, but when I get there I'll try it out and then let you know how it went

Share this post


Link to post
Share on other sites
Sign in to follow this  

×