Author |
Message |
JayREEZY
|
Tuesday, November 22, 2011
I'm wondering if tier animatons can be implimented to save space. So transformations can have different animations while having the same upper and lower.md3 file as tier1.
EX:
|
Zeth
The Admin
|
Tuesday, November 22, 2011
cg_tier.c, line 21
Com_sprintf(filename,sizeof(filename),"players/%s/animation.cfg",modelName);
Currently this is loading from the player's root path only. What should be done instead is move this string creation (and the followup call to CG_ParseAnimationFile) to the tier loop underneath. If the animation.cfg file is present in the tier folder, it'll be used. If not, the default animation.cfg would be used.
Sidenote : Not sure exactly why the fallback for a missing animation.cfg resorts to a player/character path as this does not exist in any iteration of ZEQ2-lite that I am familiar with. Probably should be removed as well or resort to Goku as a fallback animation.cfg.
cg_players.c, line 84
The CG_ParseAnimationFile function will probably need to be altered as well. This currently reads the animation.cfg file from the path from above and loads the data into the ci structure as well the ci->animations structure. If you want per-tier support, you have two options.
You can either make the ci->animations structure an array of the same type (with max tiers being the amount) OR you can re-parse the config file whenever the tier changes. The first option will prevent load-sluggishness when swapping tiers, but will consume a bit more memory and take (slightly) more on the implementation end to get done.
Since CG_ParseAnimationFile currently only takes a path, you'd need to pass it an integer for the array index to use when populating the data. Additionally, you'd need to grep the code and find instances where ci->animations was used for data lookup (just looks like cg_weapons and cg_player files at first glance). You'll need to adjust this to base the lookup on the current tier for the player as the index.
That should be all there is to it. Good luck!
|
Linkxp500
|
Tuesday, November 22, 2011
Zeth wrote : cg_tier.c, line 21
Com_sprintf(filename,sizeof(filename),"players/%s/animation.cfg",modelName);
Currently this is loading from the player's root path only. What should be done instead is move this string creation (and the followup call to CG_ParseAnimationFile) to the tier loop underneath. If the animation.cfg file is present in the tier folder, it'll be used. If not, the default animation.cfg would be used.
Sidenote : Not sure exactly why the fallback for a missing animation.cfg resorts to a player/character path as this does not exist in any iteration of ZEQ2-lite that I am familiar with. Probably should be removed as well or resort to Goku as a fallback animation.cfg.
cg_players.c, line 84
The CG_ParseAnimationFile function will probably need to be altered as well. This currently reads the animation.cfg file from the path from above and loads the data into the ci structure as well the ci->animations structure. If you want per-tier support, you have two options.
You can either make the ci->animations structure an array of the same type (with max tiers being the amount) OR you can re-parse the config file whenever the tier changes. The first option will prevent load-sluggishness when swapping tiers, but will consume a bit more memory and take (slightly) more on the implementation end to get done.
Since CG_ParseAnimationFile currently only takes a path, you'd need to pass it an integer for the array index to use when populating the data. Additionally, you'd need to grep the code and find instances where ci->animations was used for data lookup (just looks like cg_weapons and cg_player files at first glance). You'll need to adjust this to base the lookup on the current tier for the player as the index.
That should be all there is to it. Good luck!
Hmm... Maybe I will look into this for Winter Break. It seems like something I would like implemented as well.
|
JayREEZY
|
Tuesday, November 22, 2011
Wow... I should learn coding too....
|
JayREEZY
|
Saturday, December 03, 2011
Zeth wrote : If the animation.cfg file is present in the tier folder, it'll be used. If not, the default animation.cfg would be used.
I just took a little more time to read this . Is this implimented already? Or is this the part that needs to be coded?
|