[TUTORIAL ]Replacing the player model in a template project.

#1
So what exactly are we gonna use for this tutorial?
Character Tool - here we importing a character with animations, assigning a new skeleton to the skeleton list and creating some animation settings.
Generating a Solution - We generate a solution and get a little bit into visual studio, we compile the whole build.
Replacing the Characters - Replacing the character with the code and replace the character we want to play as.



  • Changing the Character in a template.
  • Import the FBX you already have with animations into your character root folder.
  • Import the Character by, opening the character tool and just drag and drop the fbx file into the viewport of the tool.
  • Adjust and test the animations in the character tool.
  • Now you can either go to /animations/skeletonlist.xml and add the newly imported skeleton with, f.e:

    Code: Select all

    <Skeleton name="deer" file="Your File Root"/>
  • Or you can go to the character tool and add the skeleton by yourself:

Spoiler!  Show

  • Choose the CHR file and add it. Then go you your animations and create a new animsetting. Add your skeleton to it.

Spoiler!  Show



Now we have to generate a solution
Go to your root folder of the project and on game.cryproject or something similar and click with rmb and choose: Generate Solution.

Spoiler!  Show

  • After the solution is generation, go into the folder, solutions and open game.sln
  • Look for player.cpp
  • In Player.cpp look for the line 25 and replace the

Code: Select all

m_pAnimationComponent->SetCharacterFile("DEFAULT"); To m_pAnimationComponent->SetCharacterFile("Your Root CDF File");

Spoiler!  Show

(Simply change the root to your CDF File)
  • Now compile the whole build by Build->"Build Solution".

Spoiler!  Show

You should not get any errors.
  • Close Visual Studio now.
  • Now go to "Assets/Animations/Mannequin/Preview/Player.xml"
  • Change line 4 and 5 to your character cdf.
  • You can delete the other characters.
ANIMATIONS
  • Now let's change the animations.
  • For that, open the Mannequin Editor, go to file->Open Preview and open the player.xml
  • In the Fragments, go to Walk->Option 1, replace the animation on FirstPersonLayer and ThirdPersonLayer to your own walk animation

Spoiler!  Show

  • Change it for every animation and then go to file, save all.
Boom! Our character is done.

Soon a video version of this tutorial will be available for you guys, also on how to change the character in template and GameSDK.
Follow for more on my personal twitter :) : https://twitter.com/RomaPerezogin

Re: [TUTORIAL ]Replacing the player model in a template project.

#2
Nice work Romah..
BTW images don't work for some reason.

Much needed tutorial for the community. IMO the character replacing, import, animations, etc are the most overlooked but so much needed. I was working with chars last week on GameSDK :) Good to see template version. Looking forward to see the video :) Thanks.
GorbashGaming - Beginner Tutorials for CE https://www.youtube.com/channel/UCIjN10 ... Img/videos

Who is online

Users browsing this forum: No registered users and 1 guest