At the end of my cutscenes, a roaring sound can be heard. It looks like it comes from removing polymorph (into "null human") whether I set the effect's duration to exactly what I need or longer/permanent and then remove it through another function. If I don't use the polymorph effect, there is no sound.
The PC must not be seen in these cutscenes. Is there a way to avoid the noise?
Please review the order and timing of other things in this script, too. On one playtesting, the camera facing was wrong, even though I thought it worked fine before. After changing the delays, it seems to be working again, but I'm not so certain it's all good.
void RemovePoli() {
object oPC = GetFirstPC();
effect eEff = GetFirstEffect(oPC);
while (GetIsEffectValid(eEff)) {
if (GetEffectType(eEff) == EFFECT_TYPE_POLYMORPH)
RemoveEffect(oPC, eEff);
eEff = GetNextEffect(oPC);
}
}
void main() {
object oPC = GetFirstPC();
object oPCsEndDestination = GetObjectByTag("end_dest");
object oPCPosition = GetObjectByTag("cutscene_pov");
effect eDomi = EffectCutsceneDominated();
float nDur = 50.0f;
// actors
object oNPC1 = GetObjectByTag("NPC1_tag");
object oNPC2 = GetObjectByTag("NPC2_tag");
// store camera
StoreCameraFacing();
// set time to daytime
SetTime(14, 0, 0, 0);
// polymorph PC (I also tried with duration being nDur and no RemovePoli(), and with DURATION_TYPE_PERMANENT)
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectPolymorph(POLYMORPH_TYPE_NULL_HUMAN), oPC, 3600.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectCutsceneGhost(), oPC, nDur);
BlackScreen(oPC);
// camera facing
DelayCommand(1.0f, AssignCommand(oPC, SetCameraFacing(-1.0, 5.0f, 85.0, CAMERA_TRANSITION_TYPE_SNAP)));
// bring PC, dominate
AssignCommand(oPC, ActionJumpToObject(oPCPosition));
DelayCommand(1.2f, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDomi, oPC, nDur-2.0));
DelayCommand(1.2f, SetCutsceneMode(oPC, TRUE, FALSE));
// the scene begins
DelayCommand(5.0f, FadeFromBlack(oPC));
DelayCommand(7.5f, AssignCommand(oNPC1, ActionSpeakString("''Do you have everything, sir?''")));
DelayCommand(13.0f, AssignCommand(oNPC2, ActionSpeakString("''Sure, sure...''")));
// NPCs talk, walk and play animations, some get destroyed with DestroyObject()
// ...
// restore camera
DelayCommand(nDur+1.0f, RestoreCameraFacing());
// end the cutscene
DelayCommand(nDur, FadeToBlack(oPC));
DelayCommand(nDur+2.0f, SetCutsceneMode(oPC, FALSE));
DelayCommand(nDur+2.2f, RemovePoli());
DelayCommand(nDur+3.0f, AssignCommand(oPC, ActionJumpToObject(oPCsEndDestination)));
}
Modifié par Lovelamb, 15 février 2012 - 03:47 .