Conner94 Moderator

Joined: 15 Jan 2005 Posts: 249 Location: ???
|
Posted: Mon Jan 17, 2005 7:48 pm Post subject: [Code] Extra weapon frames! -By Conner94 |
|
|
This tutorial will show you how to add extra frames to a weapon. For this example, we will make the chaingun have 3 addition frames, thus making it easy to convert it to a shogun, rifle ect with coking action.
First, we need to add are new sprites. Open up WL_Def.c and do a search for "chain". You should see this:
| Code: |
//
// player attack frames
//
SPR_KNIFEREADY,SPR_KNIFEATK1,SPR_KNIFEATK2,SPR_KNIFEATK3,
SPR_KNIFEATK4,
SPR_PISTOLREADY,SPR_PISTOLATK1,SPR_PISTOLATK2,SPR_PISTOLATK3,
SPR_PISTOLATK4,
SPR_MACHINEGUNREADY,SPR_MACHINEGUNATK1,SPR_MACHINEGUNATK2,MACHINEGUNATK3,
SPR_MACHINEGUNATK4,
SPR_CHAINREADY,SPR_CHAINATK1,SPR_CHAINATK2,SPR_CHAINATK3,
SPR_CHAINATK4,
};
|
Now, we have to add 3 more frames. Change that to this:
| Code: |
//
// player attack frames
//
SPR_KNIFEREADY,SPR_KNIFEATK1,SPR_KNIFEATK2,SPR_KNIFEATK3,
SPR_KNIFEATK4,
SPR_PISTOLREADY,SPR_PISTOLATK1,SPR_PISTOLATK2,SPR_PISTOLATK3,
SPR_PISTOLATK4,
SPR_MACHINEGUNREADY,SPR_MACHINEGUNATK1,SPR_MACHINEGUNATK2,MACHINEGUNATK3,
SPR_MACHINEGUNATK4,
SPR_CHAINREADY,SPR_CHAINATK1,SPR_CHAINATK2,SPR_CHAINATK3,
SPR_CHAINATK4, SPR_CHAINATK5,SPR_CHAINATK6, SPR_CHAINATK7,
}; |
Now that we have are additional sprites, open up WL_agent.C, and scroll down until you see this:
| Code: |
struct atkinf
{
char tics,attack,frame; // attack is 1 for gun, 2 for knife
} attackinfo[4][14] =
{
{ {6,0,1},{6,2,2},{6,0,3},{6,-1,4} },
{ {6,0,1},{6,1,2},{6,0,3},{6,-1,4} },
{ {6,0,1},{6,1,2},{6,3,3},{6,-1,4} },
{ {6,0,1},{6,1,2},{6,4,3},{6,-1,4} },
};
|
Now, to make it follow the addition frames, edit the last set of numbers to this:
| Code: |
{ {6,0,1},{6,1,2},{6,4,3},{6,0,4},{6,0,5},{6,0,6},{6,-1,7} },
|
The first "6" in each part is the time in wich it is shown. Change that to whatever you like. You can, by what I know, have 10 frames at most, the last one have a "0" at the end instead of "10", or it will crash. As you can see, it is very simple, and can be used for many diffrent effects
EDIT: You may have to recompile WL_DRAW.C |
|