- self.anim_die1 = '0 1 0.5'; // 2 seconds
- self.anim_die2 = '1 1 0.5'; // 2 seconds
- self.anim_draw = '2 1 3'; // TODO: analyze models and set framerate
- self.anim_duck = '3 1 100'; // this anim seems bogus in most models, so make it play VERY briefly!
- self.anim_duckwalk = '4 1 1';
- self.anim_duckjump = '5 1 100'; // zym anims keep playing until changed, so this only has to start the anim, landing will end it
- self.anim_duckidle = '6 1 1';
- self.anim_idle = '7 1 1';
- self.anim_jump = '8 1 100'; // zym anims keep playing until changed, so this only has to start the anim, landing will end it
- self.anim_pain1 = '9 1 2'; // 0.5 seconds
- self.anim_pain2 = '10 1 2'; // 0.5 seconds
- self.anim_shoot = '11 1 5'; // TODO: analyze models and set framerate
- self.anim_taunt = '12 1 0.33'; // FIXME? there is no code using this anim
- self.anim_run = '13 1 1';
- self.anim_runbackwards = '14 1 1';
- self.anim_strafeleft = '15 1 1';
- self.anim_straferight = '16 1 1';
- self.anim_dead1 = '17 1 1';
- self.anim_dead2 = '18 1 1';
- self.anim_forwardright = '19 1 1';
- self.anim_forwardleft = '20 1 1';
- self.anim_backright = '21 1 1';
- self.anim_backleft = '22 1 1';
- self.anim_melee = '23 1 1';
- animparseerror = FALSE;
- animfilename = strcat(self.model, ".animinfo");
- animfile = fopen(animfilename, FILE_READ);
- if (animfile >= 0)
- {
- self.anim_die1 = animparseline(animfile);
- self.anim_die2 = animparseline(animfile);
- self.anim_draw = animparseline(animfile);
- self.anim_duck = animparseline(animfile);
- self.anim_duckwalk = animparseline(animfile);
- self.anim_duckjump = animparseline(animfile);
- self.anim_duckidle = animparseline(animfile);
- self.anim_idle = animparseline(animfile);
- self.anim_jump = animparseline(animfile);
- self.anim_pain1 = animparseline(animfile);
- self.anim_pain2 = animparseline(animfile);
- self.anim_shoot = animparseline(animfile);
- self.anim_taunt = animparseline(animfile);
- self.anim_run = animparseline(animfile);
- self.anim_runbackwards = animparseline(animfile);
- self.anim_strafeleft = animparseline(animfile);
- self.anim_straferight = animparseline(animfile);
- self.anim_forwardright = animparseline(animfile);
- self.anim_forwardleft = animparseline(animfile);
- self.anim_backright = animparseline(animfile);
- self.anim_backleft = animparseline(animfile);
- self.anim_melee = animparseline(animfile);
- fclose(animfile);
-
- // derived anims
- self.anim_dead1 = '0 1 1' + '1 0 0' * (self.anim_die1_x + self.anim_die1_y - 1);
- self.anim_dead2 = '0 1 1' + '1 0 0' * (self.anim_die2_x + self.anim_die2_y - 1);
-
- if (animparseerror)
- print("Parse error in ", animfilename, ", some player animations are broken\n");
- }
- else
- dprint("File ", animfilename, " not found, assuming legacy .zym model animation timings\n");
+ self.anim_die1 = animfixfps(self, '0 1 0.5'); // 2 seconds
+ self.anim_die2 = animfixfps(self, '1 1 0.5'); // 2 seconds
+ self.anim_draw = animfixfps(self, '2 1 3');
+ // self.anim_duck = '3 1 100'; // This anim is broken, use slot 3 as a new free slot in the future ;)
+ self.anim_duckwalk = animfixfps(self, '4 1 1');
+ self.anim_duckjump = '5 1 100'; // NOTE: zym anims keep playing until changed, so this only has to start the anim, landing will end it
+ self.anim_duckidle = animfixfps(self, '6 1 1');
+ self.anim_idle = animfixfps(self, '7 1 1');
+ self.anim_jump = '8 1 100'; // NOTE: zym anims keep playing until changed, so this only has to start the anim, landing will end it
+ self.anim_pain1 = animfixfps(self, '9 1 2'); // 0.5 seconds
+ self.anim_pain2 = animfixfps(self, '10 1 2'); // 0.5 seconds
+ self.anim_shoot = animfixfps(self, '11 1 5'); // analyze models and set framerate
+ self.anim_taunt = animfixfps(self, '12 1 0.33');
+ self.anim_run = animfixfps(self, '13 1 1');
+ self.anim_runbackwards = animfixfps(self, '14 1 1');
+ self.anim_strafeleft = animfixfps(self, '15 1 1');
+ self.anim_straferight = animfixfps(self, '16 1 1');
+ self.anim_dead1 = animfixfps(self, '17 1 1');
+ self.anim_dead2 = animfixfps(self, '18 1 1');
+ self.anim_forwardright = animfixfps(self, '19 1 1');
+ self.anim_forwardleft = animfixfps(self, '20 1 1');
+ self.anim_backright = animfixfps(self, '21 1 1');
+ self.anim_backleft = animfixfps(self, '22 1 1');
+ self.anim_melee = animfixfps(self, '23 1 1');
+ self.anim_duckwalkbackwards = animfixfps(self, '24 1 1');
+ self.anim_duckwalkstrafeleft = animfixfps(self, '25 1 1');
+ self.anim_duckwalkstraferight = animfixfps(self, '26 1 1');
+ self.anim_duckwalkforwardright = animfixfps(self, '27 1 1');
+ self.anim_duckwalkforwardleft = animfixfps(self, '28 1 1');
+ self.anim_duckwalkbackright = animfixfps(self, '29 1 1');
+ self.anim_duckwalkbackleft = animfixfps(self, '30 1 1');
+ // TODO introspect models for finding right "fps" value (1/duration)