So...reading the lexicon, would I be able to dynamically replace actors in a cutscene with LoadCutscene()?
For example, let's say I place Zathrian in a cutscene and animate him, etc...but then I have a script that runs a check against NTB_MAIN_ZATHRIAN_SACRIFICES_HIMSELF and NTB_MAIN_ZATHRIAN_KILLED_BY_PC, and if either of these return true, I could use LoadCutscene() to replace him with Lanaya (keeping the same animations/keyframes, etc)?
Maybe something like...
if (NTB_MAIN_ZATHRIAN_SACRIFICES_HIMSELF || NTB_MAIN_ZATHRIAN_KILLED_BY_PC) {
resource rCutscene = R"cutscene.cut";
object oHero = GetHero();
object oLanaya = UT_GetNearestCreatureByTag(oHero, "ntb100cr_lanaya");
LoadCutscene(rCutscene, oHero, 1, "ntb100cr_zathrian", oLanaya);
}
LoadCutscene() function w/dynamic actors in cutscene?
Débuté par
techwench
, déc. 21 2010 08:25
#1
Posté 21 décembre 2010 - 08:25
#2
Posté 22 décembre 2010 - 01:29
Nearly however:
In any event your script should look a little more like this:
- aTargetTagsToReplace has to be an array of strings (even if you're only replacing 1 actor)
- aReplacementObjects has to be an array of objects (again even if you're only replacing 1 actor)
In any event your script should look a little more like this:
if(NTB_MAIN_ZATHRIAN_SACRIFICES_HIMSELF || NTB_MAIN_ZATHRIAN_KILLED_BY_PC)
{
resource rCutscene = R"cutscene.cut";
object oHero = GetHero();
// create and populate an array of tags to be replaced
string[] aTargetTagsToReplace;
aTargetTagsToReplace[0] = "ntb100cr_zathrian";
// create and populate an array of objects to use as replacements
object[] aReplacementObjects;
aReplacementObjects[0] = UT_GetNearestCreatureByTag(oHero, "ntb100cr_lanaya");
// load and play the cutscene with the appropriate replacements
LoadCutscene(rCutscene, oHero, TRUE, aTargetTagsToReplace, aReplacementObjects, TRUE);
}
Modifié par Sunjammer, 22 décembre 2010 - 01:32 .
#3
Posté 22 décembre 2010 - 02:22
Ah. Very cool. I haven't gotten that far yet (um...minor setbacks heh) but I'm making a mental note of it and will give it a shot when I get to that point. Thanks!
#4
Posté 22 décembre 2010 - 02:48
I just ran a very quick and dirty test of this, and it worked...I just had to move Lanaya from the cutscene to the area and leave her inactive. Thanks again, Sunjammer!





Retour en haut






