Search found 20 matches

Re: 5.4 C++ Play sound

The reason why your components get null is because u used wrong method to attach them to your entity. You used GetOrCreateComponent. This method only works with cryteks components. With your custom component you go GetOrCreateComponentClass Once again, I've learned something new. It works! Cheers C...

Re: 5.4 C++ Play sound

What if you try just this? void CPlayerComponent::PlaySound() { static constexpr char* szControlName = "bullet_impact"; CryAudio::ControlId const id = CryAudio::StringToId(szControlName ); Vec3 const position(ZERO); // position the sound where you want it to play in the world CryAudio::SExecuteTrig...

Re: 5.4 C++ Play sound

EntityAudioComponent I proposed is not one of Crytek's default components. It's based on it, but not the same. So check that out definitely. Finally I've found a little time to look at that. But how to implement this? I've tried to define and declare similar I do it with the Crytek's default compon...

Re: 5.4 C++ Play sound

Wow, a lot of infos. Unfortunatelly I don't have much time today to test everything. One thing I've tested and have partial success is the 2D solution from cry-thomas. When I start the game (debug from VS2017 or launch the game with right mouse on "Game.cryproject") and I press the key (I bound a sm...

Re: 5.4 C++ Play sound

Oh, at the moment I just want to play a sound when a press a button, either from a file or one created with the Audio Controls Editor. I thought I can use an engine function for that, 1. Last few times tried with the ISO template c++ (will the solution be different if I use the FP or TP template?!) ...

Re: 5.4 C++ Play sound

Any update or any other idea on that? At the moment I just want to know how to play a sound when for example I press a button. Either define the sound from a file name or use a sound created in "Audio Controls Editor". Tried to add a trigger component (I thought it works like in the sandbox) but no ...

Re: Upgrade 5.3 to 5.4

Yes, as far as I know you can change engine version for you project.

Go to the main folder of your project and press with the right mouse button on you "Game.cryproject" file. Then select "switch engine" and choose 5.4 on the drop down.

Hope that helps
Charalampos :-)

Re: Add predifined components to custom component via c++

.h file: Cry::DefaultComponents::CRigidBodyComponent* m_pRigidBodyComponent = nullptr; .cpp file, you need to call this in the Initialize() function: m_pRigidBodyComponent = m_pEntity->GetOrCreateComponent<Cry::DefaultComponents::CRigidBodyComponent>(); This works for me. This works for me too! Hav...

Re: Add predifined components to custom component via c++

I'm a bit confused about your question - you talk first about WeaponComponent, which already registered and can be used, but then you have problems registering CBaseMeshComponent? Or is it about automatically getting CBaseMeshComponent in entity, which already has WeaponComponent? ... Hi pashkoff, ...

Go to advanced search