View Full Version: [Code] Extra weapon frames! -By Conner94

wolfers >>Coding Alliance >>[Code] Extra weapon frames! -By Conner94


<< Prev | Next >>

Conner94- 01-17-2005
[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: // // 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: // // 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: 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: { {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


Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.