First Animations
Now that we have the basic model loaded into GameCore and ensured that all of the textures are loaded, let's go ahead and apply a couple of animations to the character.
There are 2 methods of loading animations in GameCore - the first is by 'bundling' all of the animations with the main character mesh itself. The second is by loading stand-alone independent animation files in the OPR file.
I'm going to cover the second technique as it seems to be the most common method that people use.
This is likely due to the fact that most popular modding engines (such as Source or Unreal-based games) seem to use this technique, but it not required - future additions to this Character Setup Guide will cover the second technique (using AddAnimRange, if you want to do some research on your own). The default Simple Character BlockMan uses this technique as well, if you wish to check an example.
As I mentioned, each animation that we will be using will be contained in a seperate FBX file. Each animation will be loaded via the LoadAnimation OPR property, like so:
LoadAnimation Idle Idle.fbx
What this entry specifies is that we are going to 'Load an Animation' from the file 'Idle.fbx' and we are going to name it 'Idle', so we can reference it from within the engine (either via script or via other motions, which we'll cover in a moment.
Tip: GameCore automatically plays an object's Idle' animation when the object is loaded - so if you ever need / want something to be animated in a world, simply give it an idle animation and voila!
Pretty straightforward, yes?
To get our character setup and moving, we are going to need 3 primary animations - idle, walk and run. These animations will serve as our 'Lower Body' animations going forward.
Loading these 3 animations into our character ends up with the following as our 'in progress' OPR file for the character:
OPRP
LoadObject MyCharacter.fbx
LoadAnimation Idle Idle.FBX
LoadAnimation Walk Walk.FBX
LoadAnimation Run Run.FBX
We now have our basic character loaded, as well as 3 animations, which we have named 'Idle', 'Walk' and 'Run'.
Look how easy that was!
You can switch to the object viewer to preview your character's animations - simply select each animation in the list and watch as your character plays each of them.
Next, we'll add a few Motions so that we can start doing some motion blending and get our animations in-game!
Printer-friendly version- Login to post comments
- PDF version
