JACoders / OpenJK

Community effort to maintain and improve Jedi Academy (SP & MP) + Jedi Outcast (SP only) released by Raven Software
GNU General Public License v2.0
2.03k stars 614 forks source link

Allow additional animations #82

Open mrwonko opened 11 years ago

mrwonko commented 11 years ago

It would be useful if mods could add additional animations without having to change the original .gla. (Incidentally, that would also help with redistribution, since the new files are no longer modified versions of Raven's assets.)

It could work like this: When loading a .gla, all animations from .gla files in the folder with the name of the .gla get loaded as well. So to add a climbing animation to _humanoid, you'd have

The latter is akin to animation.cfg, but since there can be multiple additional files we obviously need to use a recognizable name.

An obvious problem here is MAX_QPATH - when adding to the animations with already long filenames, the path could easily get longer than 64 characters. As long as the filesystem is able to cope with that it won't be apparent to anybody once the additional animations have been added though.

Some groundwork for this has already been done in SP, where _models/players/_humanoid/humanoid<levelname>/humanoid<levelname>.gla_ is added when playing maps/<levelname>.bsp. (Which also easily reaches MAX_QPATH, by the way.)

eezstreet commented 11 years ago

MP has some tie-ins as well, they just aren't implemented. The variable you're looking for is ->animIndex. This was to be used in Siege, but it doesn't really work.

Sent from my Windows Phone


From: Willi Schinmeyermailto:notifications@github.com Sent: ‎4/‎11/‎2013 1:51 AM To: Razish/OpenJKmailto:OpenJK@noreply.github.com Subject: [OpenJK] Allow additional animations (#82)

It would be useful if mods could add additional animations without having to change the original .gla. (Incidentally, that would also help with redistribution, since the new files are no longer modified versions of Raven's assets.)

It could work like this: When loading a .gla, all animations from .gla files in the folder with the name of the .gla get loaded as well. So to add a climbing animation to _humanoid, you'd have

The latter is akin to animation.cfg, but since there can be multiple additional files we obviously need to use a recognizable name.

An obvious problem here is MAX_QPATH - when adding to the animations with already long filenames, the path could easily get longer than 64 characters. As long as the filesystem is able to cope with that it won't be apparent to anybody once the additional animations have been added though.

Some groundwork for this has already been done in SP, where _models/players/_humanoid/humanoid/humanoid.gla_ is added when playing maps/.bsp. (Which also easily reaches MAX_QPATH, by the way.)


Reply to this email directly or view it on GitHub: https://github.com/Razish/OpenJK/issues/82

xycaleth commented 11 years ago

animIndex is also used for NPC and vehicle animations. You'll have a hard time using it though, because the code assumes anything other than 0 is not a player.

eezstreet commented 11 years ago

Maybe. Try looking around at how the player deals with multiple skeletons in SP, and reuse the animIndex var to specify which skeleton you're using in a particular frame.

Sent from my Windows Phone


From: Alex Lomailto:notifications@github.com Sent: ‎4/‎11/‎2013 5:58 AM To: Razish/OpenJKmailto:OpenJK@noreply.github.com Cc: eezstreetmailto:eezstreet@live.com Subject: Re: [OpenJK] Allow additional animations (#82)

animIndex is also used for NPC animations. You'll have a hard time using it though, because the code assumes anything other than 0 is not a player.


Reply to this email directly or view it on GitHub: https://github.com/Razish/OpenJK/issues/82#issuecomment-16225845

mrwonko commented 11 years ago

You'll have a hard time using it though

I'm fine with having to do some work. I'm not in a rush. I'll take a look at this at some point.