Can't get this to work. The sound ALWAYS plays after the rest sequence.
void main()
{
object oPC = GetLastPCRested();
if (GetLastRestEventType()==REST_EVENTTYPE_REST_STARTED)
{
if (GetLocalInt(GetFirstPC(), "canrest") == 0)
{
FloatingTextStringOnCreature("You can't rest here . . .", oPC, FALSE);
AssignCommand(oPC, ClearAllActions());
return;
}
AssignCommand(oPC, PlaySound("Camping"));
DelayCommand(0.5, FadeToBlack(oPC,FADE_SPEED_SLOW));
}
else if (GetLastRestEventType()==REST_EVENTTYPE_REST_CANCELLED)
{
// No longer used but left in for the community
// WMFinishPlayerRest(oPC,TRUE); // removes sleep effect, etc
FadeFromBlack(oPC,FADE_SPEED_SLOW);
}
else if (GetLastRestEventType()==REST_EVENTTYPE_REST_FINISHED)
{
// No longer used but left in for the community
// WMFinishPlayerRest(oPC); // removes sleep effect, etc
FadeFromBlack(oPC,FADE_SPEED_SLOW);
}
}
How can I get sound to play DURING the sequence?
For testing purposes, just change "Camping" to some other wav related mono sound that comes with NWN.
FP!