The only thing in the game that does not require a skeleton to animate are handweapons that are attached to a soldier. Aside from that, everything needs a skeleton for it to be animated. The animation system does not load the skeleton. This is done at the object template level.
The bones you create can be just about anything since the BF1942 scripts will convert them to bones on export (just don't get too crazy and use something ultra exotic like reactor objects as bones or something, not tested it fully.

)
In the case of the flags, I just used point objects. The main thing to do is apply a skin modifier to your mesh and include your bones and then proceed to weight the vertexes. Once done you export the SKN file first. Make sure your skeleton is selected, then use the scripts to export the SKN file. (in the Skeleton and Skin tab). Then export your mesh (and any collison meshes if any are present). Also note that animated meshes do not require a shadow mesh. The game uses the lowest detail lod in the lod tree to make the shadow. (if your mesh is exported with more then one lod) In BFV, the engine uses the highest detail lod in the lod tree to make the shadow. Something I wished vanilla BF1942 does. I just removed the lower detail lods from my soldier meshes to solve the issue of poor soldier shadow quality like missing hand shadows)
Then export your SKE file. (leave the "Is Weapon" check box unchecked unless your animating a weapon as those don't involve animated meshes). The rest is done with coding to get the game to load your ske and skn files. Your object that uses the animated mesh must be a AnimatedBundle and the geometry template must be "AnimatedMesh". Use the ObjectTemplate.createSkeleton command to load your skeleton and the ObjectTemplate.setAnimationState command to load the animation. (use existing code as a reference)
Same goes for the geometry template. The GeometryTemplate.setSkin command loads your SKN file. The path always starts at the archives folder so the animations rfa must be in your path to the file. Unless you decided to do something odd and dump your SKN/SKE files into your standardMesh rfa instead in which case your path would have to reflect that.
If your animating things like balls or cups, it gets very simple. Just one bone and skin all the vertexes to that bone and do the exporting. So that would be a good start. Then animate the bone as if it was your ball/cup/other simple object and the resulting animation will animate the same way in BF1942. Just make sure you set the correct play back speed in the animation coding or you may end up with animations that play to fast. If you see that it's playing to slow even on 1.0 speed, you'll need to adjust the number of frames in your max scene/or make it animate faster in the scene. I've found that BF1942 won't allow me to set speeds higher then 1.0. You can only slow down things. So it's better to have your animation play too fast in Max since you can then fine tune the speed of it ingame via the animation state machine coding.
As for making animations, I can't fully explain it right now as it would take a lot of text to do that

, but if you've seen any of Archi's tutorials on animating weapons in BF1942 on youtube before he pulled them, then that covers the basics. Knowing how to use key frames and stuff to actually animate is the main thing. Also when exporting an animation, be sure all the bones you animated are selected. When you fill in the numbers for the time frame to export be sure to reenter them again when you "add" the animation the export list as it tries to set the frame count above the frames available in your scene. (as the scripts were originally designed to export sequences of multiple animations it seems). If you fail to do this it will export two non-existant frames and you'll end up with a >1kb baf file that won't contain the animation.
Also note, if your animating something like a ball or cup and have it move a significant distance from the object's center of mass then you will end up with visibility issues with the mesh when ingame. The game only displays objects in memory if it determines that it is close enough to the camera view. It uses the bounding box of the object to determine this (this also effects when effect emitters activate). For example the luigi blimp in my mario kart mod would go invisible if I look away from it at random angles and it would disappear and reappear randomly. The center of mass of the object is invisible (it's where the root bone usually is) and thus you would have to have that area on your screen for the mesh to animate or become visible. So fix this issue simply create a Bundle object and addtemplate dummy objects to make the host object's bounding box very large. Then addtemplate your animated object to it. The dummy objects fool the game into thinking the object is larger then it actually is, and will always think it's viewable from the camera and will always render it. This trick also works on getting effects to always emit.
Example code:
Code: Select all
ObjectTemplate.create Bundle HostObject
rem ------------------------------------------
ObjectTemplate.addTemplate NullObject
ObjectTemplate.setPosition 0/0/-1024
ObjectTemplate.addTemplate NullObject
ObjectTemplate.setPosition 0/0/1024
ObjectTemplate.addTemplate NullObject
ObjectTemplate.setPosition -1024/0/0
ObjectTemplate.addTemplate NullObject
ObjectTemplate.setPosition 1024/0/0
rem ------------------------------------------
ObjectTemplate.addTemplate YourAnimatedObject
ObjectTemplate.create DummyObject NullObject
Yep, DummyObject is a valid object class in BF1942. It's an used object class and I use it for my dummy objects.
Hope this helps in getting you started.
