Re: Is Turning Player To A Component A Good Idea ?

#12
fury22uk wrote:I think I might have idea. Check on the left in properties when you drop this component. Cause I experienced some double component load and I had write my own animation component


DAYUM That worked ?!?!

Yeah that was the problem. I thought that extra component kept the coordinates and changes. So it was simply extra ?
Also ıt keeps loading an extra one each time it reloads this entity. What ?
Why do you think that happens ? Or what do you think I should be doing ?

Re: Is Turning Player To A Component A Good Idea ?

#13
Yes, I indeed experienced this issue. It loads multiple components of the same type. Okay, so to get rid of this you will have to rewrite components that get multiplied. The original ones are not designed for the way you're trying to do it. You should start from AdvancedAnimationsComponent. Go to cryteks github and find cpp file of the Animation component and the others and use them as a reference to write your own components. I did that and I use my custom components to avoid this issue. I have not found any other resolve for this issue though.

Second thing is... why do you drop your player in editor ? I don't do it at all. I create player component entity in schematyc to create custom player classes and then I use them from main menu to choose which entity (player class) is to be spawned. For the editor to make development easier, you should player apropriate if (gEnv->IsEditor ()) in game plugin and in editor use default player class for the development purposes
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Re: Is Turning Player To A Component A Good Idea ?

#14
fury22uk wrote:Yes, I indeed experienced this issue. It loads multiple components of the same type. Okay, so to get rid of this you will have to rewrite components that get multiplied. The original ones are not designed for the way you're trying to do it. You should start from AdvancedAnimationsComponent. Go to cryteks github and find cpp file of the Animation component and the others and use them as a reference to write your own components. I did that and I use my custom components to avoid this issue. I have not found any other resolve for this issue though.

Second thing is... why do you drop your player in editor ? I don't do it at all. I create player component entity in schematyc to create custom player classes and then I use them from main menu to choose which entity (player class) is to be spawned. For the editor to make development easier, you should player apropriate if (gEnv->IsEditor ()) in game plugin and in editor use default player class for the development purposes


Hey I just found out that it doesn't matter what I do. Even with a clean "blank" project with zero code and a new level, each time I create a new schematyc it always double loads it even if I just have a schematyc with a single camera. It isn't really anything I do. It "always" double loads (and keeps loading even more each time reloaded) any new schematyc created by a user. Here (bottom right):

Image


I got to admit. I am a bit (a lot) annoyed at this. I pretty much spent a whole month thinking it was my mistake.

Image

Re: Is Turning Player To A Component A Good Idea ?

#16
I found a core issue of this problem with duplicated characters. I fixed it in my recent video tutorial about RPG Game Tutorial, but I will also describe it here:

In Revive() method you call m_pAnimationComponent->ResetCharacter();. If you look inside of this method, you will see that it actually assigns character slot not to some stable slot index, but everytime you call this method, it will basically create or find new slot, and new character gets assigned! Which is wrong. Do simple check in Revive method to see if you indeed have more than one character:

Code: Select all

for(int i = 0; i<10; i++)
{
   if(ICharacterInstance *pChar = m_pEntity->GetCharacter(i))
   {
      CryLogAlways("CHARACTER IS IN SLOT %d", i);
   }
}

And watch you number of characters pop up..
You need to free those slots that have this "additional" character.

Code: Select all

m_pEntity->FreeSlot(fakeCharacterSlotId);

I will edit this post and add later a link when my video is uploaded.

Edit https://youtu.be/rdd8u72yKSQ
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Re: Is Turning Player To A Component A Good Idea ?

#17
Thanks for submitting your solution to this problem,

May I ask if you have submitted an issue on our GitHub issue page? It would be most appreciated if you could do this if you haven't already so we can more easily track this problem.
Uniflare
CRYENGINE Community Coordinator
Here to help the community and social channels grow and thrive.

My personal belongings;
Beginner Guides | My GitHub | Splash Plugin

Re: Is Turning Player To A Component A Good Idea ?

#18
I think this isn't any type of bug. This is logical mistake and misuse of the Animation component. It is simply not designed for editor-made players. Although yeah, it would be cool to have more control over these components. Anyway their code is on Crytek's github, so people can see how to re-write it.
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Who is online

Users browsing this forum: No registered users and 1 guest