DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

Animated weapons
Page 1 of 1
DieHard Wolfers Forum Index -> Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
Guest




Last Visit:





PostPosted: Fri Feb 04, 2005 10:16 pm
   Subject: Animated weapons
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Curouis if anyone has coded this yet to have an aninmated weapon that either flickers, glows or something while standing still?
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2248
Location: Ontario
canada.gif

PostPosted: Sat Feb 05, 2005 3:19 pm
   Subject: Re: Animated weapons
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Angel of Death wrote:
Curouis if anyone has coded this yet to have an aninmated weapon that either flickers, glows or something while standing still?


It hasn't been asked for before.... and is definitely not in a tutorial anywhere... But it shouldn't be that hard.

Logic Tree:

Add a variable to the gamestate structure....
Set variable to gametics when player not moving (long type) else set 0 or false...
Use same variable to count game tics since last check...
And if tics is greater than say 3 seconds... start animating weapon by using different weapon frames...

Shouldn't be that hard to code up for someone....

Greg
BrotherTank

_________________

The probability of someone watching you is directly related to the Stupidity of your actions
&
The two most abundant things in the Universe are Hydrogen & Stupidity - H.Ellison

Which of those is more relevant to you??
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 3:19 ago.

Topics: 111
Posts: 1772
Location: A hole in the wall
australia.gif

PostPosted: Sun Feb 06, 2005 4:18 pm
   Subject: Re: Animated weapons
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yeah, I was looking at this for Extremities. I was thinking of putting a chainsaw in (like doom). I thought of using WSJ's animated sprites, then make it skip the second frame. ie SPR_CHAINREADY,SPR_CHAINREADY2,SPR_CHAINATK1 etc

_________________
WolfSource - Your news source since the beginning of time (2019)
WSJ
DieHard Officer
DieHard Officer


Joined: 17 Apr 2004
Last Visit: 30 Nov 2017

Topics: 24
Posts: 506

blank.gif

PostPosted: Sun Feb 06, 2005 6:47 pm
   Subject: Re: Animated weapons
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Deathshead wrote:
Yeah, I was looking at this for Extremities. I was thinking of putting a chainsaw in (like doom). I thought of using WSJ's animated sprites, then make it skip the second frame. ie SPR_CHAINREADY,SPR_CHAINREADY2,SPR_CHAINATK1 etc


Yes, that's the kind of thing I did. As I told Luke (Angel of Death) in an e-mail...

Quote:
Just for an example, let's say you have a flamethrower with 2 animation frames while not being fired... "SPR_FLAMEREADY1" and "SPR_FLAMEREADY2". So in wl_draw.c in the "DrawPlayerWeapon" routine, look for this:

if (gamestate.weapon != -1)
{
shapenum = weaponscale[gamestate.weapon]+gamestate.weaponframe;


Right under that, add this:

if (shapenum == SPR_FLAMEREADY1) shapenum+=(frameon>>4)%2;

That will give you 2 animation frames. If you want more than that, change the "%2" to something else. Now in wl_agent.c, the code for the firing animation would normally be like "{ {6,0,1},{6,1,2},{6,0,3},{6,-1,4} },"... but since you have 2 frames for the non-firing animation, you'd have to start with "{6,0,2}" instead of "{6,0,1}" (the third number, "1", represents the sprite to use in that frame.)


Perhaps I'm not the best at explaining things, but... you get the idea. Smile
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 3:19 ago.

Topics: 111
Posts: 1772
Location: A hole in the wall
australia.gif

PostPosted: Sun Feb 06, 2005 8:04 pm
   Subject: Re: Animated weapons
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

AY! Thanks mate Very Happy

_________________
WolfSource - Your news source since the beginning of time (2019)
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts ?? Anyone know how to make wolf read .txt files ??
Author: jamez
3 1578 Tue May 30, 2006 1:29 am
Zombie_Plan View latest post
No new posts Guards using other weapons...
Author: andy3012
19 4412 Fri Feb 25, 2005 9:48 am
andy3012 View latest post
No new posts [Info] High resolution weapons - 2 methods
Author: Guest
19 540 Sun Feb 06, 2005 12:08 am
Sporb2000 View latest post
No new posts [Help] Code on Weapon changing
Author: wolf3dbreaker
8 1889 Thu Jan 13, 2005 12:08 pm
Guest View latest post
No new posts Animated Floors
Author: Guest
5 200 Mon May 31, 2004 4:40 pm
Guest View latest post
 
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


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group