Wolf Planet Forum Index Wolf Planet
We want you here!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Code] Extra weapon frames! -By Conner94

 
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance
View previous topic :: View next topic  
Author Message
Conner94
Moderator


Joined: 15 Jan 2005
Posts: 249
Location: ???

PostPosted: Mon Jan 17, 2005 7:48 pm    Post subject: [Code] Extra weapon frames! -By Conner94 Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance All times are GMT
Page 1 of 1

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001 phpBB Group

Chronicles phpBB2 theme by Jakob Persson (http://www.eddingschronicles.com). Stone textures by Patty Herford.