(Old code tutorial) Extra weapon frames! -By Conner94 from Wolf Planet forum

View previous topic View next topic Go down

(Old code tutorial) Extra weapon frames! -By Conner94 from Wolf Planet forum

Post by Officer-M. John (Admin) on Sun Mar 27, 2016 9:45 am

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

Writte by Conner94 on Mon Jan 17, 2005 7:48 pm
avatar
Officer-M. John (Admin)
Admin

Posts : 328
Join date : 2015-10-02
Age : 19

View user profile http://wolf3dfanboys.usersboard.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum