I created a quick and easy way of extracting all the animation (.anim) files from the Apocalypse Pack.
Functions:
Create_AnimationDatabase(AnimationName$, Dir$)
This function will scan the folder Dir$ and write all .anim file names to the database assigning an index to each.
- AnimationName$ = The animation file name.
- Dir$ = The directory to create the new files
Load_AnimationDatabase(AnimationName$, Dir$, DFS, KFS)
This function will load the database created under the database indexes of DFS and KFS. Refer to the DFS index for "GetAnimationIndex" later. The function will also load every .anim file it find in directory Dir$.
- AnimationName$ = The animation file name.
- Dir$ = The directory to create the new files
- DFS/KFS = Database Indexes (Dark Data)
GetAnimationIndex(DFS, Name$)
By giving a name you get the index of the anim file loaded.
- DFS = Database Index
- Name$ - Animation Name
GoTo Statements:
Extract_Animation:
Since the anim is the same for ever mod zombie and slow zombie I use a for loop to reduce the amount of code. The base animation is extracted first and then the extra animations for that object are extracted.
Extract_BaseAnimation:
The anim from 1 - 91 are the same so this goto statement is called instead of having a lot of redundant code.
Extract_Animation:
Dir$ = Get Dir$()
` Mod Zombie 1 - 8
For Index = 1 To 8
Set Dir Dir$ : Set Dir "Media\Zombies\Mod Zombie " + Str$(Index) + "\Object"
Load Object "mobzombie" + Str$(Index) + ".X", 1
EnAn_objSaveNoAnims 1, "mobzombie" + Str$(Index) + "_NoAnims.dbo"
Set Dir Dir$ : Set Dir "Media\Zombies\Mod Zombie " + Str$(Index) + "\Animation"
GoSub Extract_BaseAnimation
EnAn_objExtractAnimation 1, "ModZombie Run Forward.anim", 2501, 2519
EnAn_objExtractAnimation 1, "ModZombie Run Forward 2.anim", 2527, 2545
EnAn_objExtractAnimation 1, "ModZombie Idle 1.anim", 2553, 2602
EnAn_objExtractAnimation 1, "ModZombie Idle 2.anim", 2609, 2658
EnAn_objExtractAnimation 1, "ModZombie Idle 3.anim", 2665, 2714
EnAn_objExtractAnimation 1, "ModZombie Idle 4.anim", 2721, 2770
EnAn_objExtractAnimation 1, "ModZombie Double Slash.anim", 2776, 2848
EnAn_objExtractAnimation 1, "ModZombie Left Slash.anim", 2861, 2904
EnAn_objExtractAnimation 1, "ModZombie Double Hand Slash Forward.anim", 2916, 2969
EnAn_objExtractAnimation 1, "ModZombie Double Hand Slash Left.anim", 2981, 3034
EnAn_objExtractAnimation 1, "ModZombie Yell.anim", 3046, 3094
EnAn_objExtractAnimation 1, "ModZombie Yell 2.anim", 3104, 3154
EnAn_objExtractAnimation 1, "ModZombie Blunt Obj To Head Front.anim", 3165, 3235
EnAn_objExtractAnimation 1, "ModZombie Blunt Obj To Head Back.anim", 3245, 3300
EnAn_objExtractAnimation 1, "ModZombie Blunt Obj To Head Front 2.anim", 3310, 3370
EnAn_objExtractAnimation 1, "ModZombie Blunt Obj To Head Front 3.anim", 3380, 3440
Delete Object 1
Create_AnimationDatabase("Mod Zombie" + Str$(Index), Get Dir$())
Next Index
` Slow Zombie 1 - 4
For Index = 1 To 4
Set Dir Dir$ : Set Dir "Media\Zombies\Slow Zombie " + Str$(Index) + "\Object"
Load Object "slowzombie" + Str$(Index) + ".X", 1
EnAn_objSaveNoAnims 1, "slowzombie" + Str$(Index) + "_NoAnims.dbo"
Set Dir Dir$ : Set Dir "Media\Zombies\Slow Zombie " + Str$(Index) + "\Animation"
GoSub Extract_BaseAnimation
EnAn_objExtractAnimation 1, "SlowZombie Walk.anim", 2530, 2559
EnAn_objExtractAnimation 1, "SlowZombie Slash.anim", 2561, 2600
EnAn_objExtractAnimation 1, "SlowZombie Bite.anim", 2869, 2907
EnAn_objExtractAnimation 1, "SlowZombie Bite x3.anim", 2910, 3023
EnAn_objExtractAnimation 1, "SlowZombie Reach.anim", 2602, 2637
EnAn_objExtractAnimation 1, "SlowZombie Zombie Fall Forward.anim", 2671, 2784
Delete Object 1
Create_AnimationDatabase("Slow Zombie" + Str$(Index), Get Dir$())
Next Index
` Shroudling
Set Dir Dir$ : Set Dir "Media\Zombies\Shroudling\Object"
Load Object "shroudling.X", 1
EnAn_objSaveNoAnims 1, "shroudling_NoAnims.dbo"
Set Dir Dir$ : Set Dir "Media\Zombies\Shroudling\Animation"
GoSub Extract_BaseAnimation
EnAn_objExtractAnimation 1, "Shroudling Walk.anim", 2499, 2560
EnAn_objExtractAnimation 1, "Shroudling Thrust.anim", 2563, 2598
EnAn_objExtractAnimation 1, "Shroudling Walk 2.anim", 2601, 2662
EnAn_objExtractAnimation 1, "Shroudling Attack 2.anim", 2665, 2700
EnAn_objExtractAnimation 1, "Shroudling Yell.anim", 2703, 2793
Delete Object 1
Create_AnimationDatabase("Shroudling", Get Dir$())
` Wall Zombie Attacker
Set Dir Dir$ : Set Dir "Media\Zombies\Wall Zombie Attacker\Object"
Load Object "wall zombie_attacker.X", 1
EnAn_objSaveNoAnims 1, "wall zombie_attacker_NoAnims.dbo"
Set Dir Dir$ : Set Dir "Media\Zombies\Wall Zombie Attacker\Animation"
EnAn_objExtractAnimation 1, "WallZombieAttacker Up.anim", 0, 0
EnAn_objExtractAnimation 1, "WallZombieAttacker Down.anim", 6, 8
EnAn_objExtractAnimation 1, "WallZombieAttacker Getup.anim", 10, 38
EnAn_objExtractAnimation 1, "WallZombieAttacker Attack.anim", 39, 78
EnAn_objExtractAnimation 1, "WallZombieAttacker Yell.anim", 79, 126
Delete Object 1
Create_AnimationDatabase("Wall Zombie Attacker", Get Dir$())
` Zombie Crawler
Set Dir Dir$ : Set Dir "Media\Zombies\Zombie Crawler\Object"
Load Object "zombiecrawler.X", 1
EnAn_objSaveNoAnims 1, "zombiecrawler_NoAnims.dbo"
Set Dir Dir$ : Set Dir "Media\Zombies\Zombie Crawler\Animation"
GoSub Extract_BaseAnimation
EnAn_objExtractAnimation 1, "ZombieCrawler Slash.anim", 46, 85
Delete Object 1
Create_AnimationDatabase("Zombie Crawler", Get Dir$())
Set Dir Dir$
Return
Extract_BaseAnimation:
EnAn_objExtractAnimation 1, "Spawn.anim", 190, 209
EnAn_objExtractAnimation 1, "Idle.anim", 210, 234
EnAn_objExtractAnimation 1, "Move Slow.anim", 235, 259
EnAn_objExtractAnimation 1, "Strafe Left.anim", 260, 279
EnAn_objExtractAnimation 1, "Strafe Right.anim", 280, 299
EnAn_objExtractAnimation 1, "Move Fast.anim", 300, 318
EnAn_objExtractAnimation 1, "Reload Weapon.anim", 319, 355
EnAn_objExtractAnimation 1, "Climb.anim", 160, 189
EnAn_objExtractAnimation 1, "Impact Front.anim", 3245, 3300
EnAn_objExtractAnimation 1, "Bounce Front.anim", 3245, 3300
EnAn_objExtractAnimation 1, "Get Up Front.anim", 523, 552
EnAn_objExtractAnimation 1, "Impact Back.anim", 40, 59
EnAn_objExtractAnimation 1, "Bounce Back.anim", 60, 79
EnAn_objExtractAnimation 1, "Get Up Back.anim", 523, 552
EnAn_objExtractAnimation 1, "Impact Left.anim", 120, 139
EnAn_objExtractAnimation 1, "Bounce Left.anim", 140, 159
EnAn_objExtractAnimation 1, "Impact Right.anim", 80, 99
EnAn_objExtractAnimation 1, "Bounce Right.anim", 100, 119
EnAn_objExtractAnimation 1, "Crouched Idle.anim", 356, 380
EnAn_objExtractAnimation 1, "Crouched Move Slow.anim", 381, 405
EnAn_objExtractAnimation 1, "Crouched Strafe Left.anim", 381, 405
EnAn_objExtractAnimation 1, "Crouched Strafe Right.anim", 381, 405
EnAn_objExtractAnimation 1, "Crouched Move Fast.anim", 381, 405
EnAn_objExtractAnimation 1, "Crouched Reload Weapon.anim", 406, 442
EnAn_objExtractAnimation 1, "Freeform Idle.anim", 443, 462
EnAn_objExtractAnimation 1, "Freeform Move.anim", 463, 492
EnAn_objExtractAnimation 1, "Weapon Spawn.anim", 553, 572
EnAn_objExtractAnimation 1, "Weapon Idle.anim", 573, 597
EnAn_objExtractAnimation 1, "Weapon Move Slow.anim", 598, 622
EnAn_objExtractAnimation 1, "Weapon Strafe Left.anim", 623, 642
EnAn_objExtractAnimation 1, "Weapon Strafe Right.anim", 643, 662
EnAn_objExtractAnimation 1, "Weapon Move Fast.anim", 663, 681
EnAn_objExtractAnimation 1, "Weapon Reload Weapon.anim", 682, 731
EnAn_objExtractAnimation 1, "Weapon NEW Climb.anim", 160, 189
EnAn_objExtractAnimation 1, "Weapon Impact Front.anim", 0, 19
EnAn_objExtractAnimation 1, "Weapon Bounce Front.anim", 20, 39
EnAn_objExtractAnimation 1, "Weapon Get Up Front.anim", 882, 911
EnAn_objExtractAnimation 1, "Weapon Impact Back.anim", 40, 59
EnAn_objExtractAnimation 1, "Weapon Bounce Back.anim", 60, 79
EnAn_objExtractAnimation 1, "Weapon Get Up Back.anim", 912, 941
EnAn_objExtractAnimation 1, "Weapon Impact Left.anim", 120, 139
EnAn_objExtractAnimation 1, "Weapon Bounce Left.anim", 140, 159
EnAn_objExtractAnimation 1, "Weapon Impact Right.anim", 80, 99
EnAn_objExtractAnimation 1, "Weapon Bounce Right.anim", 100, 119
EnAn_objExtractAnimation 1, "Weapon Crouched Idle.anim", 732, 756
EnAn_objExtractAnimation 1, "Weapon Crouched Move Slow.anim", 757, 781
EnAn_objExtractAnimation 1, "Weapon Crouched Strafe Left.anim", 757, 781
EnAn_objExtractAnimation 1, "Weapon Crouched Strafe Right.anim", 757, 781
EnAn_objExtractAnimation 1, "Weapon Crouched Move Fast.anim", 757, 781
EnAn_objExtractAnimation 1, "Weapon Crouched Reload Weapon.anim", 782, 831
EnAn_objExtractAnimation 1, "Weapon Freeform Idle.anim", 832, 851
EnAn_objExtractAnimation 1, "Weapon Freeform Move.anim", 852, 881
Return
Function Create_AnimationDatabase(AnimationName$, Dir$)
CurrentDir$ = Get Dir$()
Set Dir Dir$
` Create Data File
KFS Create 2, AnimationName$ + ".kfs", 6, 0, 0
DFS Create 1, AnimationName$ + ".dat", 1
Find First
FileName$ = Get File Name$()
FileType = Get File Type()
If FileType = 0
If GetFileExtension$(Lower$(FileName$)) = ".anim"
Name$ = GetFileName$(FileName$)
DFS Add Field 1, "Integer As " + Name$
EndIf
EndIf
While FileType <> -1
Find Next
FileName$ = Get File Name$()
FileType = Get File Type()
If Mid$(FileName$, 1) <> "."
If FileType = 0
If GetFileExtension$(Lower$(FileName$)) = ".anim"
Name$ = GetFileName$(FileName$)
DFS Add Field 1, "Integer As " + Name$
EndIf
EndIf
EndIf
EndWhile
DFS Finish 1
` Create KFS File
RecordCount = 0
Find First
FileName$ = Get File Name$()
FileType = Get File Type()
If FileType = 0
If GetFileExtension$(Lower$(FileName$)) = ".anim"
Inc RecordCount, 1
Name$ = GetFileName$(FileName$)
Record = DFS Add(1)
DFS Put 1, Name$, RecordCount
DFS Save 1, Record
EndIf
EndIf
While FileType <> -1
Find Next
FileName$ = Get File Name$()
FileType = Get File Type()
If Mid$(FileName$, 1) <> "."
If FileType = 0
If GetFileExtension$(Lower$(FileName$)) = ".anim"
Inc RecordCount, 1
Name$ = GetFileName$(FileName$)
Record = DFS Add(1)
DFS Put 1, Name$, RecordCount
DFS Save 1, Record
EndIf
EndIf
EndIf
EndWhile
DFS Close 1
KFS Close 2
Set Dir CurrentDir$
EndFunction
Function Load_AnimationDatabase(AnimationName$, Dir$, DFS, KFS)
CurrentDir$ = Get Dir$()
Set Dir Dir$
` Load DarkData Files
KFS Open KFS, AnimationName$ + ".kfs"
DFS Open DFS, AnimationName$ + ".dat"
Find First
FileName$ = Get File Name$()
FileType = Get File Type()
If FileType = 0
If GetFileExtension$(Lower$(FileName$)) = ".anim"
Index = EnAn_AnimLoad(FileName$)
EndIf
EndIf
While FileType <> -1
Find Next
FileName$ = Get File Name$()
FileType = Get File Type()
If Mid$(FileName$, 1) <> "."
If FileType = 0
If GetFileExtension$(Lower$(FileName$)) = ".anim"
Index = EnAn_AnimLoad(FileName$)
EndIf
EndIf
EndIf
EndWhile
Set Dir CurrentDir$
EndFunction
Function GetAnimationIndex(DFS, Name$)
Index = DFS Get(DFS, Name$)
EndFunction Index
remstart
Frames Animation sequence
0, 79 "crouch_idle"
80, 116 "crouch_strafe_left"
117, 153 "crouch_strafe_right"
154, 188 "crouch_turn_left"
189, 223 "crouch_turn_right"
224, 260 "crouch_walk"
261, 297 "crouch_walk_backward"
298, 347 "death_backward"
348, 401 "death_forward"
402, 458 "death_left"
459, 515 "death_right"
516, 595 "idle"
596, 651 "jump"
652, 685 "pain_back"
686, 724 "pain_forward"
725, 761 "pain_left"
762, 798 "pain_right"
799, 878 "pistol_crouch_idle"
879, 915 "pistol_crouch_strafe_left"
916, 952 "pistol_crouch_strafe_right"
953, 987 "pistol_crouch_turn_left"
988, 1022 "pistol_crouch_turn_right"
1023, 1059 "pistol_crouch_walk"
1060, 1096 "pistol_crouch_walk_backward"
1097, 1146 "pistol_death_backward"
1147, 1200 "pistol_death_forward"
1201, 1257 "pistol_death_left"
1258, 1314 "pistol_death_side_right_v02"
1315, 1394 "pistol_idle"
1395, 1450 "pistol_jump"
1451, 1484 "pistol_pain_back"
1485, 1523 "pistol_pain_forward"
1524, 1560 "pistol_pain_left"
1561, 1597 "pistol_pain_right"
1598, 1622 "pistol_run"
1623, 1641 "pistol_run_backward"
1642, 1666 "pistol_run_left"
1667, 1691 "pistol_run_right"
1692, 1724 "pistol_turn_left"
1725, 1757 "pistol_turn_right"
1758, 1788 "pistol_walk"
1789, 1829 "pistol_walk_backward"
1830, 1869 "pistol_walk_left"
1870, 1909 "pistol_walk_right"
1910, 1989 "rifle_crouch_idle"
1990, 2024 "rifle_crouch_turn_left"
2025, 2059 "rifle_crouch_turn_right"
2060, 2096 "rifle_crouch_walk"
2097, 2133 "rifle_crouch_walk_backward"
2134, 2170 "rifle_crouch_walk_left"
2171, 2207 "rifle_crouch_walk_right"
2208, 2257 "rifle_death_backward"
2258, 2311 "rifle_death_forward"
2312, 2368 "rifle_death_left"
2369, 2425 "rifle_death_right"
2426, 2505 "rifle_idle"
2506, 2561 "rifle_jump"
2562, 2595 "rifle_pain_back"
2596, 2634 "rifle_pain_forward"
2635, 2671 "rifle_pain_left"
2672, 2708 "rifle_pain_right"
2709, 2733 "rifle_run"
2734, 2752 "rifle_run_backward"
2753, 2777 "rifle_run_left"
2778, 2802 "rifle_run_right"
2803, 2835 "rifle_turn_left"
2836, 2868 "rifle_turn_right"
2869, 2899 "rifle_walk"
2900, 2940 "rifle_walk_backward"
2941, 2980 "rifle_walk_left"
2981, 3020 "rifle_walk_right"
3021, 3045 "run"
3046, 3064 "run_backward"
3065, 3089 "run_left"
3090, 3114 "run_right"
3115, 3147 "turn_left"
3148, 3180 "turn_right"
3181, 3211 "walk"
3212, 3252 "walk_backward"
3253, 3292 "walk_left"
3293, 3332 "walk_right"
remend
remstart
0 = Spawn
1 = Idle
2 = Move Slow
3 = Strafe Left
4 = Strafe Right
5 = Move Fast
6 = Reload Weapon (or Toss)
10 = Climb
11 = Impact Front
12 = Bounce Front
13 = Get Up Front
14 = Impact Back
15 = Bounce Back
16 = Get Up Back
17 = Impact Left
18 = Bounce Left
20 = Impact Right
21 = Bounce Right
31 = Crouched Idle
32 = Crouched Move Slow (same)
33 = Crouched Strafe Left (same)
34 = Crouched Strafe Right (same)
35 = Crouched Move Fast (same)
36 = Crouched Reload Weapon (or toss)
40 = Freeform Idle
41 = Freeform Move
50 = Weapon Spawn
51 = Weapon Idle
52 = Weapon Move Slow
53 = Weapon Strafe Left
54 = Weapon Strafe Right
55 = Weapon Move Fast
56 = Weapon Reload Weapon (or Toss)
57 = Weapon NEW Climb
61 = Weapon Impact Front
62 = Weapon Bounce Front
63 = Weapon Get Up Front
64 = Weapon Impact Back
65 = Weapon Bounce Back
66 = Weapon Get Up Back
67 = Weapon Impact Left
68 = Weapon Bounce Left
70 = Weapon Impact Right
71 = Weapon Bounce Right
81 = Weapon Crouched Idle
82 = Weapon Crouched Move Slow (same)
83 = Weapon Crouched Strafe Left (same)
84 = Weapon Crouched Strafe Right (same)
85 = Weapon Crouched Move Fast (same)
86 = Weapon Crouched Reload Weapon (or toss)
90 = Weapon Freeform Idle
91 = Weapon Freeform Move
remend
Download the Folders from this
post.
Download the .Anim files from MegaUpload
here.
This snippet is used in my project
Zombie Project: Early WIP.
Any comments, questions, or bugs let me know. Don't forget to credit me if you use any of my code.
DigitalFury