Page MenuHomeFeedback Tracker

Unable to 2 sounds in a row in Trigger On Act. Script
Closed, ResolvedPublic

Description

Playsound3d unable to play 2 sounds in a row in an activation script within a trigger.

Details

Legacy ID
3080325556
Severity
None
Resolution
Not A Bug
Reproducibility
Always
Category
Sound
Steps To Reproduce

Start the Editor.
Choose Stratis.
Insert a Rifleman AT as Player (BLUFOR/Blue/Men/Rifleman (AT)).
Insert a Trigger away from player that activates on BLUFOR entering area
Group the trigger to the Player rifleman
In the "On Act." script for the trigger, paste:

playSound3D ["a3\sounds_f\weapons\Rockets\explosion_missile_04.wav", player];
sleep 10;
playSound3D ["a3\sounds_f\weapons\Rockets\explosion_missile_05.wav", player];

Launch scenario, walk into the trigger area.
Expected it to play the sounds separated by 10 seconds. It plays the first, but never the second.

Event Timeline

pojo2k8 edited Steps To Reproduce. (Show Details)Apr 10 2013, 7:36 PM
pojo2k8 edited Additional Information. (Show Details)
pojo2k8 set Category to Sound.
pojo2k8 set Reproducibility to Always.
pojo2k8 set Severity to None.
pojo2k8 set Resolution to Not A Bug.
pojo2k8 set Legacy ID to 3080325556.May 7 2016, 1:33 PM
pojo2k8 added a subscriber: pojo2k8.

Never mind, figured it out ... Sleep doesn't work in scripts and it was playing both sounds.

Solution:
null=[] spawn {playSound3D ["a3\sounds_f\weapons\Rockets\explosion_missile_05.wav", player]; hint "sound played..."; sleep 10;hint "sleep finished..."; playSound3D ["a3\sounds_f\weapons\Rockets\explosion_missile_04.wav", player]; hint "second sound played...";};

Please close as not a bug... Or change to a bug Sleep doesn't work in activation script.

There are certain places where you cannot use interruption, trigger's on activation being one of them. With -showScripErrors enabled you'll be alerted to that fact.