Page 3 of 3

Re: 5.4 C++ Play sound

Posted: Fri Jan 19, 2018 7:47 am
by cry-thomas
...And I have to change the order of the parameters (name, occlusionType, transformation, SetCurrentEnvironments, control_id).
Right, my bad, in 5.4 the order of those parameters is as you described, we adjusted that for 5.5 so look out for that change if you upgrade your project to 5.5 once released. ;)
Also, I adjusted my last example to not use the control name for the audio object name as that might be confusing and isn't how it's meant to be used.

Re: 5.4 C++ Play sound

Posted: Fri Jan 19, 2018 8:47 am
by fury22uk
As I understand, GetOrCreateComponent works, if you register your component for editor like this (and not only with CryTek's standard components):

Code: Select all

static void RegisterYourComponent(Schematyc::IEnvRegistrar& registrar)
{
Schematyc::CEnvRegistrationScope scope = registrar.Scope(IEntity::GetEntityScopeGUID());
{
Schematyc::CEnvRegistrationScope componentScope = scope.Register(SCHEMATYC_MAKE_ENV_COMPONENT(YourComponent));
// Functions
{
}
}
}

CRY_STATIC_AUTO_REGISTER_FUNCTION(&RegisterYourComponent);
Without doing this, you can attach your component only via GetOrCreateComponentClass.
Correct. Totally forgot about that fact :)