Fairly simple set up. We need to take our model, save it to a new file (I recommend a _tp suffix, for instance mine is named baseball_bat_tp.ma.) Now you’re going to have to create some “CryHelperNodes.” This is bogus, it’s technically just a fancy name for some other thing, which is simply being used to track a MAT16. Er, a positional translation matrix. Um, the weapons spot in 3d space. Or, more specifically: the sharp part of the weapon, in 3d space.
At this point in space (the sharp one), create a locator and name it “collision.” Now duplicate it, and name the copy “weapon_term.” One of these is going to be the location which determines if things are getting hit – and the other is for drawing effects. (At least… that’s my understanding.) You can now attach them to the mesh by grouping them in the outliner, or simply parenting them to the mesh.
Since it’s a weapon, we’ll need a physics mesh. This is basically an object primitive (I used a rectangular box) which serves as bounding geometry. It’s really pretty simple, a model is included in the same group as the render-mesh. This primitive is given a specially prepared material (which is included in the same Material Group.) This material simply has a setting which tells the Engine it’s not to be drawn. (In Maya, this is done in the materials “Extra Attributes” by setting the value to “ProxyNoDraw.” (We did this in step 2.))
You might have noticed – I had to flip my third person model from intended placement. When the player was picking it up, it was backwards. A 180 degree rotation fixes this. Honestly it’d be better to use a separate animation, but hardly imperative. Could have just as easily left it unrotated too…
Anyway, now you need to set up the Geometry export data. If you’re using Max or XSI… I can’t really help you. But if you’re using Maya then you are in luck!
The Maya to CryEngine 3 Geometry Export Process
- Select the mesh, and put it in a group. (if applicable, include any bounding geometry)
- Name the group anything you like, but suffix it with _group.
- Now put the group into another group, name it the same, but instead of a suffix, prefix it with CryExportNode _. Suffix it with _tp. (Mine is named cryexportnode_baseball_bat_tp)
Note: Whatever comes after cryexportnode_ is the filename used for export.
- Open the CryTek UI and click Assign Variables.
- Now select the CryExportNode _* group and assign it’s type as Geometry(*.CGF) in the Attributes panel.
- It should now be ready to export (assuming it passes through the Validator unfettered.)
- Open CryTek UI and click on Export.
- You should have a *.CGF file in with the source scene asset. You will relocate this to the engine.