About Store Forum Documentation Contact



Post Reply 
Some problems with SkelAnimCache
Author Message
b1s Offline
Member

Post: #1
Some problems with SkelAnimCache
Okay so..

Normally our players is created like this:

void Player::create(Game::ObjParams &obj)
{
sac.fist_l=NULL;
sac.fist_r=NULL;

and after this we load rest of our own animations etc..

but when i try to use save and load functions it gives a problem
it tries to load the default skeleton and gives an error from the fist anims..

Likse so:
Code:
---------------------------
Error
---------------------------
SkelAnim "anim/fist-l.anim" not found in skeleton.
---------------------------
OK  
---------------------------

this same error also comes if we dont have the default animations in that folder.. (which is crap imo)
but as we are loading the player to the world with

__super::load(f);

this does not find the animations from the same folder..
I have also tried throwing the animations to every folder i can imagine without success.
Now I would create my own load but I don't have any clue what the hell is happening inside the CHR objects load function so I really don't know what to do here.. If you have any suggestions please let me know.

Thanks
01-07-2011 09:46 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #2
RE: Some problems with SkelAnimCache
You have to set animations on load as well. Are you doing that? Bloody Massacre does it like so:

Code:
void Player::setNonSavedParams()
{
   sac_aim_l=&cskel.getSkelAnim("anim/Aim-L.anim");
   sac_aim_r=&cskel.getSkelAnim("anim/Aim-R.anim");
}

void Player::create(Game::ObjParams &obj)
{
   __super::create(obj);
   setNonSavedParams();
}

Bool Player::load(File &f)
{
   if(__super::load(f))
   {
      ...
      setNonSavedParams();
      return true;
   }
   return false;
}
01-07-2011 10:57 PM
Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #3
RE: Some problems with SkelAnimCache
well ive tried to set the animations after the super::load()
but the error seems to happen during the load and it cant find the animations..
01-07-2011 11:32 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #4
RE: Some problems with SkelAnimCache
So if you comment out the "sac.fist_l=NULL;" and "sac.fist_r=NULL;" lines, the error doesn't occur?
01-08-2011 12:29 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Some problems with SkelAnimCache
The default Game::Chr codes load the animations from the
"data/anim" folder, you should just copy all files from SDK and it should work fine.

You can modify this behavior if you have Game::Chr sources.
01-08-2011 01:09 AM
Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #6
RE: Some problems with SkelAnimCache
yeah well i've actually done that..
i have copied the animations and in the create function it works that way.
i can use super::create() and it find the animations perfectly..
but when i save and load the player on load it gives and error for the same thing even tho my default animations are present..
setting null to those animations wont fix the problem.
this might be an issue if our project has some sort of different folder settings but i have tried sticking those animations to every single folder i could imagine and the error still occurs.
01-08-2011 05:22 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: Some problems with SkelAnimCache
If I remember correctly load method calls exactly the same animation loading setup as create method. Do you modify perhaps DataPath multiple times or change Paks During game? Once I get back home I'll check the load sources
01-08-2011 05:50 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: Some problems with SkelAnimCache
what's your custom character save/load methods?
maybe you have this error because you have some bug in save/load? (this can be any custom save/load method of custom game object class)

or are you trying to load old savegame files? (at some point in version history there was mention old savegames may not work)
01-08-2011 07:26 PM
Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #9
RE: Some problems with SkelAnimCache
yeah.. i always try saving and loading when the error occurs.
Player is the only character in game and im only trying out loading at very simple form like this.
the pak folder or datapath is probably the thing that gives the error..
cause im not modifying the create at all and it loads fine.
but with load it dosen't so somehow the folder structure gets screwed.
Code:
Bool Player::load(File &f)
{

   if(__super::load(f))
   {
      f>>ctrl_pos;
      return true;
   }

   return false;
}


for the datapaths

i only set them once in main initPre()

DataPath("data");
Paks.add("engine.pak");
(This post was last modified: 01-10-2011 09:12 AM by b1s.)
01-10-2011 09:01 AM
Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #10
RE: Some problems with SkelAnimCache
Okay this has been solved.. the problem was in my end so.. nvm and sorry for the disturbance.
01-10-2011 01:43 PM
Find all posts by this user Quote this message in a reply
Post Reply