Is Turning Player To A Component A Good Idea ?

#1
Hey everyone. I was getting into C++ and I wanted to consult something.

I am using something similar to 3rdPersonShooter templates SpawnPoint component to point out where player spawns. I though turning Player into an "addable" component would be usable to designate which Schematyc entity I consider as a player by adding it, thus spawning it where SpawnPoint is.
I managed to do it as you can see it in the pic below and it seems to be working well for now. Question is: Do you experienced people see a problem with this approach? You think that would cause a problem later on ? (I am trying to make a 3rd person shooter type of thing.)

Thanks, and kudos to Comnponent system ;)

Image

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

#2
I've been using "addable" player for a while now. And I never experienced any problem at all. I use it for my multiplayer game too. I made player component that has a lot of gameplay properties like for example speed, strength etc. Rpg-like. And I access them from schematyc. This way I can actually create new schematyc entity and set various player classes with different properties, models, etc. Cool.
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 ?

#3
fury22uk wrote:I've been using "addable" player for a while now. And I never experienced any problem at all. I use it for my multiplayer game too. I made player component that has a lot of gameplay properties like for example speed, strength etc. Rpg-like. And I access them from schematyc. This way I can actually create new schematyc entity and set various player classes with different properties, models, etc. Cool.


Thank you very much. And thanks for the tutorials :)

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

#7
I turned the player in the fps template into a component successfully.

I also commented out a few lines in gameplugin.cpp to prevent an instance of the player component from being created automatically at game start:
In CGamePlugin:::OnClientConnectionReceived:

Code: Select all

CPlayerComponent* pPlayer = pPlayerEntity->GetOrCreateComponentClass<CPlayerComponent>();

and OnCLientReadyForGameplay:

Code: Select all

      if (CPlayerComponent* pPlayer = pPlayerEntity->GetComponent<CPlayerComponent>())
         {
            pPlayer->Revive();
         }


Is this safe? Or am I breaking something important by commenting out this code?

Also, there's a problem when using a player component that's placed in the editor. When launching via the game launcher, there's another instance of the player geometry stuck in a t-pose. Why is this happening and where do I look into this?
playercomponenttpose.JPG
playercomponenttpose.JPG (24.99 KiB) Viewed 204 times

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

#9
quasarwei wrote:
Also, there's a problem when using a player component that's placed in the editor. When launching via the game launcher, there's another instance of the player geometry stuck in a t-pose. Why is this happening and where do I look into this?
playercomponenttpose.JPG


I had the exact same problem and tried to fix it for 2 weeks and and no answers to my thread:

viewtopic.php?f=36&t=4288

Also no, even when you don't convert player into a component you get the exact same double-load with Advanced Animation Component. It also happeens when you "Reload Scripts" in the menu.

Who is online

Users browsing this forum: Bing [Bot] and 1 guest