Welcome, Guest. Please login or register. Did you miss your activation email?
collapse

Author Topic: (For some odd reason) I'm remaking SMOD stuff for Source SDK (2007) HL2!  (Read 21310 times)

0 Members and 1 Guest are viewing this topic.

Offline sirmasters

  • *
  • +5% chance to make useful post
  • sirmasters barely matters.sirmasters barely matters.
    • My Twitter (My Forums are inactive at the moment)
I know, this doesn't directly relate to SMOD (But SMOD is the reason I'm doing this),but  I've been working on a mod and I decided to try and add bullet time to it... It works.... Partially. Currently, I had to settle with running the code like this (Due to host_timescale being a cheat, trying to advoid using sv_cheats... Meh, beggers can't be choosers.) :

Code: [Select]
/*
This is the major part of the code that runs bullet time.
Impulse 110 is run, and checks if bullet time is on, then run BulletTimeTurnOn(), otherwise, run BulletTimeTurnOff().
*/
void CHL2_Player::BulletTimeTurnOn( void )
{
   if( m_HL2Local.m_flSuitPower < 50 )
   {
      CPASAttenuationFilter filter( this );
      filter.UsePredictionRules();
      EmitSound( filter, entindex(), "HL2Player.SprintNoPower" );

      return;
   }

   if( !SuitPower_AddDevice( SuitDeviceBulletTime ) )
      return;
   //Stupid me, this never gets called >.>
//   #ifdef CLIENT_DLL
//      engine->ClientCmd_Unrestricted("host_timescale 0.2");
//   #endif

   CPASAttenuationFilter filter( this );
   filter.UsePredictionRules();
   EmitSound( filter, entindex(), "HL2Player.SprintStart" );
//   engine->ClientCommand( INDEXENT( entindex() ), "bulletimeon" );
   engine->ServerCommand("sv_cheats 1; host_timescale 0.2;\n");
   m_fBulletTimeOn = true;
}


//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CHL2_Player::BulletTimeTurnOff( void )
{
   if ( m_HL2Local.m_bitsActiveDevices & SuitDeviceBulletTime.GetDeviceID() )
   {
      SuitPower_RemoveDevice( SuitDeviceBulletTime );
   }
//   engine->ClientCommand( INDEXENT( entindex() ), "bulletimeoff" );
   engine->ServerCommand("sv_cheats 1; host_timescale 1.0;\n");
//   #ifdef CLIENT_DLL
//      engine->ClientCmd_Unrestricted("host_timescale 1.0");
//   #endif
   m_fBulletTimeOn = false;
}
/*
Somewhere else, it checks if bullet time is running and sucks the power out of the AUX thingy at a really slow rate. I wuv taking computer science, it improved my coding a lot more.
*/

I tested it, and it works... Minus all the optional effects that SMOD has (And probily has some tweaks needed also). Anyway, at least I found a way to make bullet time... I also started messing around with more code, maybe I can do something more useful once my skills are really good. :D

District Chaos - Bullet Time Test (WIP)
District Chaos - Messing with currently coded features
Note: I am hyper from all the Asian candy I bought from the market.

EDIT: I might make some kind of open source SMOD if I can remake the important stuff from SMOD.
« Last Edit: December 03, 2012, 05:12:11 AM by sirmasters »
._. I love coffee.

Offline Counter-Life™

  • *
  • *
  • +17% chance to make useful post
  • Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!Counter-Life™ is a rising star!
    • Youtube Channel
Re: I (partially) replicated bullet time code on Source SDK (2007) HL2!
« Reply #1 on: December 02, 2012, 08:38:56 AM »
Good work! I only played once around with C++ to simply add a weapon(copy/paste SMG1 code and rename it) I even failed at that. Keep up the good work, you might can do ur own "SMOD".

Offline Spasior

  • IKEA Meatballs Son!!!
  • *
  • *
  • +3% chance to make useful post
  • Spasior has no influence.
Re: I (partially) replicated bullet time code on Source SDK (2007) HL2!
« Reply #2 on: December 02, 2012, 01:43:38 PM »
That code looks really juicey to me aleast. Keep at it and you will do really good. :)
erutangiS

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
Re: I (partially) replicated bullet time code on Source SDK (2007) HL2!
« Reply #3 on: December 02, 2012, 10:34:43 PM »
hey nice, keep us updated :)

Offline sirmasters

  • *
  • +5% chance to make useful post
  • sirmasters barely matters.sirmasters barely matters.
    • My Twitter (My Forums are inactive at the moment)
Re: I (partially) replicated bullet time code on Source SDK (2007) HL2!
« Reply #4 on: December 03, 2012, 12:31:34 AM »
Just added a test video. :D
._. I love coffee.

Offline Fidchell

  • *
  • *
  • +4% chance to make useful post
  • Fidchell has no influence.
Re: I (partially) replicated bullet time code on Source SDK (2007) HL2!
« Reply #5 on: December 03, 2012, 01:30:06 AM »
I don't see anything here a simple bind chain can't do.

Offline sirmasters

  • *
  • +5% chance to make useful post
  • sirmasters barely matters.sirmasters barely matters.
    • My Twitter (My Forums are inactive at the moment)
Re: I (partially) replicated bullet time code on Source SDK (2007) HL2!
« Reply #6 on: December 03, 2012, 01:57:12 AM »
I don't see anything here a simple bind chain can't do.

This suck power from AUX, since a normal bind (IE:
Alias BT_Tog "+BT"
alias +BT "sv_cheats 1; host_timescale 0.2; Alias BT_Tog '-BT'"
alias -BT "sv_cheats 1; host_timescale 1.0; Alias BT_Tog '+BT'")  would make it infinite. I also added a overlay (For now, it's just the Zoom overlay, will change later) just a few minutes ago that shows when bullet time is activated. But the main point is, we got a form of code for Bullet Time. ;~;
« Last Edit: December 03, 2012, 02:03:18 AM by sirmasters »
._. I love coffee.

Offline Fidchell

  • *
  • *
  • +4% chance to make useful post
  • Fidchell has no influence.
Re: I (partially) replicated bullet time code on Source SDK (2007) HL2!
« Reply #7 on: December 03, 2012, 03:09:46 AM »
Didn't mean to insult your work. It looks like you're slowly adding more to this. Look forward to what else you have to add.

Offline sirmasters

  • *
  • +5% chance to make useful post
  • sirmasters barely matters.sirmasters barely matters.
    • My Twitter (My Forums are inactive at the moment)
Re: I (partially) replicated bullet time code on Source SDK (2007) HL2!
« Reply #8 on: December 03, 2012, 04:23:02 AM »
Didn't mean to insult your work. It looks like you're slowly adding more to this. Look forward to what else you have to add.

I just got the kicking view model to work... Right after I removed to working attack code for kicking. >.>

All this code will be on the github for my mod.

EDIT:

I'm getting some rather good progress on this mod, though if I really wanted to remake SMOD... Map Add would be the most painful for be to remake.
._. I love coffee.

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
Re: I (partially) replicated bullet time code on Source SDK (2007) HL2!
« Reply #9 on: December 03, 2012, 04:48:03 AM »
Didn't mean to insult your work. It looks like you're slowly adding more to this. Look forward to what else you have to add.

I just got the kicking view model to work... Right after I removed to working attack code for kicking. >.>

All this code will be on the github for my mod.

EDIT:

I'm getting some rather good progress on this mod, though if I really wanted to remake SMOD... Map Add would be the most painful for be to remake.

I must admit its great to see someone working on it. We always mused about someone carrying on the mantle (so to speak). If you decide to pursue a SMOD-type mod you can count on our support, if you need anything.

edit: well, even the_author seemed to have problems with the mapadd code, because its full of work arounds, unhandled errors, and other shenanigans.
« Last Edit: December 03, 2012, 04:58:43 AM by BIZ »

Offline sirmasters

  • *
  • +5% chance to make useful post
  • sirmasters barely matters.sirmasters barely matters.
    • My Twitter (My Forums are inactive at the moment)
Re: I (partially) replicated bullet time code on Source SDK (2007) HL2!
« Reply #10 on: December 03, 2012, 06:39:34 AM »
Didn't mean to insult your work. It looks like you're slowly adding more to this. Look forward to what else you have to add.

I just got the kicking view model to work... Right after I removed to working attack code for kicking. >.>

All this code will be on the github for my mod.

EDIT:

I'm getting some rather good progress on this mod, though if I really wanted to remake SMOD... Map Add would be the most painful for be to remake.

O_o... I just... recreated kicking... though some props wont be kicked (Physics wise, I'm working on fixing that so it pushes everything, barrels and bricks seems to be kicked fine) no matter what... I just made the physics force strong enough.... to kick a car across dm_motel.....
« Last Edit: December 03, 2012, 06:55:11 AM by sirmasters »
._. I love coffee.

Offline sirmasters

  • *
  • +5% chance to make useful post
  • sirmasters barely matters.sirmasters barely matters.
    • My Twitter (My Forums are inactive at the moment)
I'm going to post the of my mod's github here: https://github.com/sirmastercombat/BFA_DC (I'll make a download of the base mod folder eventully), I'll be updating this time to time if I get something done code wise. You're free to examine and use for your own HL2 mods if you wish.
._. I love coffee.

Offline sirmasters

  • *
  • +5% chance to make useful post
  • sirmasters barely matters.sirmasters barely matters.
    • My Twitter (My Forums are inactive at the moment)
Re: (For some odd reason) I'm remaking SMOD stuff for Source SDK (2007) HL2!
« Reply #12 on: December 05, 2012, 01:08:53 AM »
Here's a download link to test it out yourself: http://www.mediafire.com/download.php?8wi99iip73aaun4

If you encounter any problems or wish for a feature (Don't ask for anything too extreme), message me here or PM me.

EDIT:

Woops, almost forgot...

Code: [Select]
ConVar kick_throwforce( "kick_throwforce", "20", FCVAR_ARCHIVE, "The default throw force of kick without player velocity." );
ConVar kick_damage( "kick_damage", "50", FCVAR_ARCHIVE, "The default damage of kick without player velocity." );

ConVar kick_throwforce_mult( "kick_throwforce_mult", "1", FCVAR_ARCHIVE, "The multiplier for kick force." );
ConVar kick_damage_mult( "kick_damage_mult", "1", FCVAR_ARCHIVE, "The multiplier for kick damage." );

ConVar kick_throwforce_div( "kick_throwforce_div", "48", FCVAR_ARCHIVE, "Divide the velocity by this." );
ConVar kick_damage_div( "kick_damage_div", "48", FCVAR_ARCHIVE, "Divide the velocity by this." );

Kick ConVars. T_T I pretty much went odd with this one when it came to damage and physics force calculation.
« Last Edit: December 05, 2012, 01:11:23 AM by sirmasters »
._. I love coffee.

Offline Daemoniator

  • *
  • +1% chance to make useful post
  • Daemoniator has no influence.
Re: (For some odd reason) I'm remaking SMOD stuff for Source SDK (2007) HL2!
« Reply #13 on: December 09, 2012, 10:28:56 PM »
I must know that leaning on wall script, that would make my modification perfect.
Twenty-Sixteen

Offline sirmasters

  • *
  • +5% chance to make useful post
  • sirmasters barely matters.sirmasters barely matters.
    • My Twitter (My Forums are inactive at the moment)
Re: (For some odd reason) I'm remaking SMOD stuff for Source SDK (2007) HL2!
« Reply #14 on: December 09, 2012, 11:19:21 PM »
I must know that leaning on wall script, that would make my modification perfect.

From what I can guess, it is moving and tilting the camera, while keeping the player's true position the same, as well as modifying the aiming position.... I think.
._. I love coffee.

 

* SMMOD Twitter