Tutorial: Copy files and attack types

Tutorials for game development.
Post Reply
Cimeries
Lumberjack (Developer)
Lumberjack (Developer)
Posts: 7720
Joined: Wed Jul 23, 2008 6:56 am

Tutorial: Copy files and attack types

Post by Cimeries »

Copy files (Copy.txt) are among the easiest things, if you can figure them out, that is.
Hopefully, this will help some of you when dealing with animations, and will help you avoid creating new ones for your models (which is a very grueling and time consuming task, trust me).

Code: Select all

// This file contains information for copying actions to save memory...
// The format is colon followed by the action names
: XXXX YYYY
: XXXX YYYY
: XXXX YYYY


The format is simple, Colon, space, X section, space, Y section.
The value in the X section replaces the value in the Y section.

How is that useful you ask me?
It will let your character use objects that require animations that it lacks.
I'll explain: Let's say you want to make a healer that is able to use daggers, but you suck at animating. badly.
All you have to do is create a copy file and write the following in a new row:

Code: Select all

: ZAP THRUST

And your healer will now stab with her healing animation, which is a slowish forward thrust, and should work just fine.

Simple, isn't it? If you know your way around animations, then you can stop reading, you already know all there is to know, go ahead and make uncle Chainsaw proud. :D

If you're new to animations, or want to refresh your knowledge, keep reading.

First, here's a list of animation names (Referred to as 'Attack Type' in most data files) and a short explanation about each: *

Code: Select all

UNARMED - I haven't figured this one out yet, It seems to be a N/A value.
THRUST - Stab attack, a forward thrust used with spears, cinquedeas, daggers, etc.
SLICE - Slashing attack, used with various swords and other slashing weapons, a diagonal slice that may hit multiple enemies.
CHOP - Overhead chop attack, mostly used with hatchets.
BASH - A simple downward swing, used with maces, hammers, etc.
LONGBOW - As the name implies, the character stretches both hands in a longbow fashion. (Also, this will drop any items in the other hand.)
XBOW - The animation used with crossbows, a forward swing/thrust thingey.
FLINGED - (Throwing?) This one appears to be unused.
PARRY - Shield block animation, the character will block any attacks from the front. Unable to move until button is released.
ZAP - Used for wands.


* - This information can be a little misleading, because different models may have different animations (or may have copy files of their own in effect, which is a good reason to check them before you go ahead and edit stuff).
For example, Zombor's SLICE, CHOP, and BASH attacks are all diagonal overhead swings, because they are all considered as SLICE attacks in his copy file.
This information is 100% correct for the standard Soldier model.

Now, about matching and replacing:
Some animations can be easily replaced with others and they will appear almost the same, while others will look horrible.
Here is a list of good combinations that can easily replace each other with very little difference (the order does not matter):

Code: Select all

: THRUST XBOW
: THRUST ZAP
: ZAP XBOW
: BASH CHOP
: SLICE CHOP


You can also go ahead and try things that won't normally match, just experiment and see how they look.

Now, about the default attack animations:

A default attack is the action an object does when it uses a hand that has no other objects in it.
It is listed as the object's own Attack type in it's data file, as seen below.

Code: Select all

// Other item and damage stuff
DamageTarget type ( SLASH, CRUSH, POKE, HOLY,
                    EVIL, FIRE, ICE, or ZAP )   : CRUSH
Attack type if it's a weapon ( UNARMED, THRUST,
                     SLICE, CHOP, BASH, LONGBOW,
                     XBOW, FLINGED, PARRY, ZAP)   : SLICE

This can be found in the data file, just below the flags.
We're going to work with the second one for now.

Monsters and players usually have an unarmed attack as a SLICE, THRUST, BASH, etc. The soldier and the rogue use a SLICE animation, which makes their attack look like they're swiping their fist.

Weapons have attacks that match the way they should be used, a sword would have a SLICE animation, and a Knife would have a THRUST animation.
Note that the user must also have that animation available to use the item, otherwise you'd just get a message saying you can't use it.
Other things that shouldn't have attacks, such as furniture, doors, and items that are not weapons oftentimes simply have UNARMED, which appears to have no meaning and is the default value.

To see which animations are available to your character's model, you can either experiment until you know, more or less, or you can check it out with a modelling program, by examining the frame names.

The relevant frame names can be found below, if your model doesn't have one of them, it doesn't have the animation, and you should replace it in your copy file if you want to use it, or create the missing animation yourself.

Code: Select all

ACTIONUA   // Unarmed attack left 
ACTIONUB   // Unarmed attack left (2nd frame)
ACTIONUC   // Unarmed attack right
ACTIONUD   // Unarmed attack right (2nd frame)
ACTIONTA   // Thrust attack left
ACTIONTB   // Thrust attack left  ('')
ACTIONTC   // Thrust attack right
ACTIONTD   // Thrust attack right  ('')
ACTIONCA   // Chop attack left
ACTIONCB   // Chop attack left
ACTIONCC   // Chop attack right
ACTIONCD   // Chop attack right
ACTIONSA   // Slice attack left
ACTIONSB   // Slice attack left
ACTIONSC   // Slice attack right
ACTIONSD   // Slice attack right
ACTIONBA   // Bash attack left
ACTIONBB   // Bash attack left
ACTIONBC   // Bash attack right
ACTIONBD   // Bash attack right
ACTIONLA   // Longbow attack left
ACTIONLB   // Longbow attack left
ACTIONLC   // Longbow attack right
ACTIONLD   // Longbow attack right
ACTIONXA   // Crossbow attack left
ACTIONXB   // Crossbow attack left
ACTIONXC   // Crossbow attack right
ACTIONXD   // Crossbow attack right
ACTIONFA   // Flinged attack left
ACTIONFB   // Flinged attack left
ACTIONFC   // Flinged attack right
ACTIONFD   // Flinged attack right
ACTIONPA   // Parry attack left ( 1 frame )
ACTIONPB   // Parry attack left ( DON'T USE )
ACTIONPC   // Parry attack right ( 1 frame )
ACTIONPD   // Parry attack right ( DON'T USE )
ACTIONZA   // Zap left
ACTIONZB   // Zap left
ACTIONZC   // Zap right
ACTIONZD   // Zap right


That's it, for now, I can see that it's a little messy, but I hope you still managed to learn something from this bizarre adventure, or something.

-- Uncle Chainsaw :teach:
:wink:
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Remember to mention the WALK attack animation. It tells the model to play no animation at all when used. Mostly used for models without attack animations or items which do not make it's holders hands move when used (lamp?).

The UNARMED attack animation is only used by characters and monsters. It's the animation monsters and certain classes use when attackin unarmed. (Scorpion, soldier unarmed, etc.)

ZAP attack is also used for most spell books and runes.
User avatar
Maxaxle
Darkshine Knight (Extremist fanatic)
Darkshine Knight (Extremist fanatic)
Posts: 4035
Joined: Fri Jul 25, 2008 8:16 pm
Location: San Diego, CA
Contact:

Post by Maxaxle »

Whatever happened to the dancing and sitting animations? Are those unused or deleted?
"Failing to plan is planning to fail."
Bug me if you want to play a game.
User avatar
PurpleSquerkle
Massive Gelfeet (Developer)
Massive Gelfeet (Developer)
Posts: 3176
Joined: Wed Jul 23, 2008 4:54 am
Location: Oakland, CA
Contact:

Post by PurpleSquerkle »

Sitting is unused right now; nobody even has it.

The default animation is actually a "dancing" animation; there are a few others, I think, but they are unused.



By the way, I think that if you remove the comment thingies (DL and DR or whatever they are) from the animation for longbow shooting, you can actually make an animation that does not drop weapons.
Similarly, I'm pretty sure you could make other animations drop weapons as well.
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Sitting is actually used when riding a mount.

Dancing is used when standing still without moving (look at every character they still move - breathe sneeze etc.). This is called "dance" animation.
User avatar
PurpleSquerkle
Massive Gelfeet (Developer)
Massive Gelfeet (Developer)
Posts: 3176
Joined: Wed Jul 23, 2008 4:54 am
Location: Oakland, CA
Contact:

Post by PurpleSquerkle »

There's a separate sitting animation, though; MH. It's not used.

And I know the standing "still" animation is one of the DA ("dancing"); that's what I just said. :P

And the bored animations right now are MC ("cheering") animations most of the time, although they should be DB, DC, or DD, according to actions.txt.
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Then the text is wrong.

MC - Misc ( Cheer/Slam Left )
MD - Misc ( Show Off/Slam Right/Rise from ground )

The DA, DB, DC and DD are the "dance" animations or the "default" animation as you call it. They are all randomly played when standing still.

And MH is used when riding mounts, no?
User avatar
PurpleSquerkle
Massive Gelfeet (Developer)
Massive Gelfeet (Developer)
Posts: 3176
Joined: Wed Jul 23, 2008 4:54 am
Location: Oakland, CA
Contact:

Post by PurpleSquerkle »

Nope. It's MI.
Post Reply