My setup is like this:
1.I have the linedef, but no script attached yet.
2. The telephone sprite sits on a table at the far end.
3. Pressing action on the linedefs around the phone (that makes up the table top) triggers a script to play a message on the other end of the phoneline. This script is written up, but not yet tested:
Code: Select all
//telephone with one time message.
bool phonescript = false;
script 101 (void)
{
if (!phonescript) {
AmbientSound("Telephone/Audio1", 180);
phonescript = true;
} else
ambientsound ("Phone/Dead", 150);
SetHudSize(600,400,TRUE);
HudMessageBold(s:"The phone-line is dead."; HUDMSG_FADEOUT, 500, CR_GOLD, 300.0, 100.0, 8.0, 0.3);
delay (100);
}
Does anyone know a good method I could use that would work? I need the phone to begin ringing once this linedef is crossed but using AmbientSound and PlaySound have proven useless, because the sound is all around the player with that method.. I need it to come from the phones location. I figured maybe something like placing an ambientsound local over there and triggering it with the linedef, but I'm not sure thats the best route to take... I also only want it to ring for a set amount of time if not answered. Maybe 10 rings then it stops, and the chance to answer has been missed. Of course, this would also mean I need to somehow alter my code for answering the phone, so that it knows you missed the chance to answer and goes straight to the ELSE section. Does this make sense?
Hopiing someone can assist me with this.
Many thanks in advance.