dCinema improvements

* Visiblity and effect records
* Recorder will catch effects from behaviors
* Documentation for setting up a scene to play automatically.
* Documentation for server-side preconditions.
This commit is contained in:
wincent
2023-10-29 17:37:26 +01:00
parent e4320d3e63
commit cdc9dda3c4
14 changed files with 418 additions and 25 deletions

View File

@@ -4,6 +4,8 @@
#include "Game.h"
#include "Logger.h"
#include "Recorder.h"
void AttackDelayBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, const BehaviorBranchContext branch) {
uint32_t handle{};
@@ -11,6 +13,8 @@ void AttackDelayBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bi
LOG("Unable to read handle from bitStream, aborting Handle! %i", bitStream->GetNumberOfUnreadBits());
return;
};
Cinema::Recording::Recorder::RegisterEffectForActor(context->originator, this->m_effectId);
for (auto i = 0u; i < this->m_numIntervals; ++i) {
context->RegisterSyncBehavior(handle, this, branch, this->m_delay * i, m_ignoreInterrupts);

View File

@@ -3,13 +3,17 @@
#include "BehaviorContext.h"
#include "BehaviorBranchContext.h"
#include "Recorder.h"
void PlayEffectBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
const auto& target = branch.target == LWOOBJID_EMPTY ? context->originator : branch.target;
Cinema::Recording::Recorder::RegisterEffectForActor(target, this->m_effectId);
// On managed behaviors this is handled by the client
if (!context->unmanaged)
return;
const auto& target = branch.target == LWOOBJID_EMPTY ? context->originator : branch.target;
PlayFx(u"", target);
}