Hey guys. Are you still working on Cassandra?
I started working on my mod again and since I needed to play an animation during a conversation, I discovered it wasn't working properly. I fiddled with the settings of the event, and finally it crashed the compiler. I thought maybe you guys need to do something like this too...
Now I have never written "native" code for any Unreal engine game and I don't know how exactly the UnrealScript / C++ binding works, but I discovered that the ConEventAnimation.uc file had different variables than the C++ header file.
I think I fixed this by modifying the .uc file like this (I added the lines where my name is in the comment):
Code:
var Actor eventOwner; // Pawn who owns this event
var String eventOwnerName; // NPC who owns event
var Name sequence; // Animation Sequence
var byte playMode; // Erkki: 1 = no looping, 0 = looping
var int playLength; // Erkki: play time of animation in seconds
var Bool bFinishAnim; // Wait until animation finishes
var bool bLoopAnim; // Loop Animation
Now changing this probably fixes the crashes, but it doesn't add any functionality yet. I think they didn't use/implement this properly in Deus Ex, forgot about it and left a bug in there... bLoopAnim isn't even present in the C++ header and looping depends on playMode == 0 (no looping playMode == 1). So you'd need to derive a new class from DeusEx.ConPlay and override the ConPlayAnim state. And add some functionality yourself. I only used a sort of hack and added Sleep(playLength) because I needed some timing unrelated to the actual animation. playLength is an INT though, I should divide it to get more precision
Code:
//After Begin: I added this
ConEventAnimation(currentEvent).bLoopAnim = (ConEventAnimation(currentEvent).playMode == 0);
// For debugging
log( "ANIM.Name : " $ ConEventAnimation(currentEvent).sequence);
log( "ANIM.Mode : " $ ConEventAnimation(currentEvent).playMode);
log( "ANIM.Length : " $ ConEventAnimation(currentEvent).playLength);
log( "ANIM.Finish : " $ ConEventAnimation(currentEvent).bFinishAnim);
log( "ANIM.Loop : " $ ConEventAnimation(currentEvent).bLoopAnim);
// This near the end of the state, the part after else was already there...
if ((ConEventAnimation(currentEvent).playLength > 0))
Sleep(ConEventAnimation(currentEvent).playLength);
else if (( !ConEventAnimation(currentEvent).bLoopAnim ) && ( ConEventAnimation(currentEvent).bFinishAnim ))
ConEventAnimation(currentEvent).eventOwner.FinishAnim();