by leileilol » Fri Oct 15, 2010 3:50 am
There's many ways. I'll just go through a few of them
THE OLD DEATHMATCH ESSENTIALS WAY:
Many different Player.mdls with the gun model changed itself on the model itself. This is EXTREMELY MEMORY CONSUMPTIVE as you need 16 whopping megabytes of memory to allocate typically... and that's just for the software renderer! Go GL with it, and considering the texture mapping for each player's colors, the texture memory footprint would be THROUGH THE DAMN ROOF raping your poor PSP.
THE HEXEN2 WAY:
Additional standing, running firing and pain animations for each weapon inside the same player.mdl. WARNING: ALSO TEXTURE MEMORY INTENSIVE and patience intensive, and polygonal intensive too as you're cramming in a ton of verts in there. this works best if you know how to model low poly weapons and know how to cram it in the UVs. hexen 2 got away with it back in 1997 because each player only had a limit of FOUR WEAPONS and most of them were sticks
THE SLIGHTLY MORE MODERN QUAKE2ISH "vwep" WAY:
A weapon model pre-animated according to the host model's animation, with a movetype_follow entity. The engine must support that and hiding the said entity in first person. WARNING: LOTS OF TIME CONSUMING MAKING THESE
EVEN SLIGHTLY MORE MODERN:
Like above, but with QuakeC vector offsets for every frame for the gun to put in the hand. Saves memory but is even more network intensive
A LOT LESS MODERN (the Duke3D, Kleshik way):
Stick the gun over the damn head.
THE ALMOST RIGHT WAY:
MD3 tags. Player MUST be MD3, must feature a tag_ to attach to. This is how Quake3 did it, it's a bit less time consuming, provided md3s and weapon models are ready. The engine of course must support it (darkplaces, fteqw)
THE RIGHT ? WAY:
The above but with skeletons and all the stuff's done through CSQC saving bandwidth.
THE HALF-LIFE WAY:
Weapons have p_ models which usually contain base skeleton with the weapon verts assigned to them. You could just say 'why not just tag' but this way allows for the egon weapon to connect from the backpack for example essentially allowing you to put weapon parts on any damn bone you like. No Quake engines support this, though maybe Darkplaces through CSQC does by sharing an animmodelindex.