This member has provided no bio about themself...

  • View media
  • View media
  • View media
  • View media
  • View media
  • View media
RSS My Blogs

Here is the Problem: If the player "uses" ( push USE-Key) on a func_pushable, he can speed up himself by strafing or he can push it very fast away ignoring friction of the entity. Here is my fix. New/changed entries are pink.

Open func_break.cpp and go to CPushable::Move:

void CPushable :: Move( CBaseEntity *pOther, int push )
{
entvars_t* pevToucher = pOther->pev;
int playerTouch = 0;

// Is entity standing on this pushable ?
if ( FBitSet(pevToucher->flags,FL_ONGROUND) && pevToucher->groundentity && VARS(pevToucher->groundentity) == pev )
{
// Only push if floating
if ( pev->waterlevel > 0 )
pev->velocity.z += pevToucher->velocity.z * 0.1;

return;
}

if ( pOther->IsPlayer() )
{
if ( push && !(pevToucher->button & (IN_FORWARD|IN_USE)) ) // Don't push unless the player is pushing forward and NOT use (pull)
return;
playerTouch = 1;
}

float factor;

if ( playerTouch )
{
if ( !(pevToucher->flags & FL_ONGROUND) ) // Don't push away from jumping/falling players unless in water
{
if ( pev->waterlevel < 1 )
return;
else
factor = 0.1;
}
else
factor = 1;
}
else
factor = 0.25;

pev->velocity.x += pevToucher->velocity.x * factor;
pev->velocity.y += pevToucher->velocity.y * factor;

float length = sqrt( pev->velocity.x * pev->velocity.x + pev->velocity.y * pev->velocity.y );

if ( length > MaxSpeed() ) //if ( push && (length > MaxSpeed()) ) <- this is the old entry. why no fricition (maxspeed) if player uses ( means "push = 0" ) the func_pushable? delete this!
{
pev->velocity.x = (pev->velocity.x * MaxSpeed() / length );
pev->velocity.y = (pev->velocity.y * MaxSpeed() / length );
}

if ( playerTouch )
{
if ( pevToucher->button & IN_FORWARD ) //we need this! without the entity doesnt stop when player halts. no player movement = no entity movement.
{
pevToucher->velocity.x = pev->velocity.x;
pevToucher->velocity.y = pev->velocity.y;
}

if ( (gpGlobals->time - m_soundTime) > 0.7 )
{
m_soundTime = gpGlobals->time;
if ( length > 0 && FBitSet(pev->flags,FL_ONGROUND) )
{
m_lastSound = RANDOM_LONG(0,2);
EMIT_SOUND(ENT(pev), CHAN_WEAPON, m_soundNames[m_lastSound], 0.5, ATTN_NORM);
// SetThink( StopSound );
// pev->nextthink = pev->ltime + 0.1;
}
else
STOP_SOUND( ENT(pev), CHAN_WEAPON, m_soundNames[m_lastSound] );
}
}
}

Comments
PanSartre Creator
PanSartre

This code is more or less my code. The thing is, I never learned to program C++. I only tried to understand some parts in the goldscr-code and tried to use the existing functions to build this flamethrower. A good coder would see that this isn a smart methode to create a flamethrower in HL. It reach the engine limits very fast (too many entities error). At the moment its really more an experiment.

Reply Good karma+2 votes
ADTeam™
ADTeam™

Totally love it, anyways :D!

Reply Good karma Bad karma+1 vote
ADTeam™
ADTeam™

You look like one of the last real HL modders out there. I totally agree with you, your comment in "EXTINCTION" can't be more accurate.

"Modders" these days are doing "mods" with others work, without giving any credit nor explaining where did they took the model/prop from. Such a shame.

Besides that, I love that flamethrower code, is that yours? Seems like an amazing job!

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Level
96%
Gamer
7
Avatar
Avatar
Last Online
Country
Germany Germany
Gender
Male
Friends
Become friends
Member watch
Follow
Statistics
Rank
14,938 of 603,057
Visitors
4,554 (2 today)
Time Online
23 minutes
Activity Points
197
Watchers
2 members
Comments
34
Site visits
1,151
Contact
Contact
Send Message
Friends
ADTeam™
ADTeam™ Online
Trempler
Trempler Online
ToTac
ToTac Online
kefch0
kefch0 Online
the-middleman
the-middleman Online