Doom3world

The world is yours! Doom 3 - Quake 4 - ET:QW - Prey - Rage
It is currently Sat May 25, 2013 7:05 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Lowering weapon when sprinting
PostPosted: Fri Mar 20, 2009 4:11 am 
Offline
has joined the game

Joined: Sat Apr 28, 2007 7:36 pm
Posts: 26
In idPlayer::AdjustSpeed
Code:
   } else if ( !physicsObj.OnLadder() && ( usercmd.buttons & BUTTON_RUN ) && ( usercmd.forwardmove || usercmd.rightmove ) && ( usercmd.upmove >= 0 ) ) {
      if ( !gameLocal.isMultiplayer && !physicsObj.IsCrouching() && !PowerUpActive( ADRENALINE ) ) {
         stamina -= MS2SEC( gameLocal.msec );
         gameLocal.Warning( "---->Sprinting!!!" );
         StopFiring();
         weapon.GetEntity()->LowerWeapon();
      }

The message will repeat while sprinting but StopFiring() and LowerWeapon() have no effect.


Top
 Profile  
 
 Post subject: Re: Lowering weapon when sprinting
PostPosted: Fri Mar 20, 2009 4:02 pm 
Offline
Last man standing
User avatar

Joined: Fri Apr 22, 2005 11:55 pm
Posts: 1180
Probably because you're doing it in the wrong place.
Enabilng/disabling weapons should be done only in idPlayer::UpdateWeapon, otherwise when UpdateWeapon will be called (and it happens every frame) it will override whatever you've set before.

_________________
Fragging Free - a frantic Doom3:ROE single-player modification.


Top
 Profile  
 
 Post subject: Re: Lowering weapon when sprinting
PostPosted: Fri Mar 20, 2009 5:09 pm 
Offline
is connecting to Doom3world.org

Joined: Sat Mar 21, 2009 4:16 pm
Posts: 1
Ivan_the_B is correct. Right in the idPlayer::UpdateWeapon just add this.

Code:
...snip...

   } else    if ( focusCharacter && ( focusCharacter->health > 0 ) ) {
      Weapon_NPC();
   }
   else if ( !physicsObj.OnLadder() && ( usercmd.buttons & BUTTON_RUN ) && ( usercmd.forwardmove || usercmd.rightmove ) && ( usercmd.upmove >= 0 ) )
   {
      // lower your weapon while sprinting
      if ( !gameLocal.isMultiplayer && !physicsObj.IsCrouching() && !PowerUpActive( ADRENALINE ) ) {
         gameLocal.Warning( "---->Sprinting!!!" );
         StopFiring();
         weapon.GetEntity()->LowerWeapon();
      }
   }
   else {
      Weapon_Combat();
   }

...snip...


Top
 Profile E-mail  
 
 Post subject: Re: Lowering weapon when sprinting
PostPosted: Fri Mar 20, 2009 5:27 pm 
Offline
has joined the game

Joined: Sat Apr 28, 2007 7:36 pm
Posts: 26
Thanks both of ya. Jompa spoiled the fun, though. I wanted to figure some of it out myself. :)


Top
 Profile  
 
 Post subject: Re: Lowering weapon when sprinting
PostPosted: Tue Apr 14, 2009 11:55 pm 
Offline
The first 10 posts have been the best...
User avatar

Joined: Tue Apr 14, 2009 9:15 pm
Posts: 17
Hey i can't find idplayer::updateweapon at all. where would i find it? and does anyone have Autodesk Maya PLE 8.5? The Product trials really suck.

_________________
"Hiya Georgie! Wanna Ballon?"


Top
 Profile E-mail  
 
 Post subject: Re: Lowering weapon when sprinting
PostPosted: Wed Apr 15, 2009 9:42 am 
Offline
Last man standing
User avatar

Joined: Tue Feb 22, 2005 4:59 pm
Posts: 1062
Location: In The Zone
Dingus_Borgir wrote:
Hey i can't find idplayer::updateweapon at all. where would i find it? and does anyone have Autodesk Maya PLE 8.5? The Product trials really suck.

Player.cpp is where you will find idPlayer::UpdateWeapon()

You can't export models to Doom 3 from the PLE version of Maya, so be careful with that.

_________________
http://www.the-emz.com/ - A Multiplayer Mod for Doom 3


Top
 Profile  
 
 Post subject: Re: Lowering weapon when sprinting
PostPosted: Thu Apr 16, 2009 4:08 pm 
Offline
The first 10 posts have been the best...
User avatar

Joined: Tue Apr 14, 2009 9:15 pm
Posts: 17
well, where is Player.cpp? is it in the SDK?


and i know i can't export from the PLEs, but i need something native to md5...

_________________
"Hiya Georgie! Wanna Ballon?"


Top
 Profile E-mail  
 
 Post subject: Re: Lowering weapon when sprinting
PostPosted: Thu Apr 16, 2009 11:02 pm 
Offline
is sad because his cool title went away
User avatar

Joined: Thu May 13, 2004 3:32 am
Posts: 706
Location: New Zealand
Yes, Player.cpp is part of the SDK, which you will have to download. If you didn't know that, you probably don't know that you'll also need to get a compiler to turn the code into something useable. I would suggest getting the express edition of Microsoft Visual Studio (it's completely free).

_________________
Penny Parlor, available now for Android and iOS
http://gameslabapps.com/games/pennyparlor/


Top
 Profile  
 
 Post subject: Re: Lowering weapon when sprinting
PostPosted: Fri Apr 17, 2009 1:25 pm 
Offline
Last man standing
User avatar

Joined: Tue Feb 22, 2005 4:59 pm
Posts: 1062
Location: In The Zone
Zenix wrote:
Yes, Player.cpp is part of the SDK, which you will have to download. If you didn't know that, you probably don't know that you'll also need to get a compiler to turn the code into something useable. I would suggest getting the express edition of Microsoft Visual Studio (it's completely free).

My tutorials on installing VC++ Express are here. If you're using D3 only I would recommed the 2008 version (setup is simpler). If you plan to mod for ETQW too then use the 2005 version because of the way ETQW uses the C++ runtime libarary dynamically linked instead of statically.
http://www.the-emz.com/tutorials/vstudio/

An I have SDK mirrors here:
http://www.the-emz.com/download/

_________________
http://www.the-emz.com/ - A Multiplayer Mod for Doom 3


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group