fixes again

added d1_trainstation_01 to map list of World of Hate and World of Fear
fixed debug overlays from Teleporter Bullets being rendered all the time
added readme note about bind issue
No Climbing can no longer happen on d1_trainstation_05 because it's a bad map to be introduced to the effect on
weapon selection HUD things now last for the same amount of real time, regardless of host_timescale, to fix issues with Superhot and Supercold making it difficult to select weapons
Low Gravity, Super Gravity, and Invert Gravity now behave better with vehicles. Zero Gravity remains the same.
This commit is contained in:
Pinsplash 2023-05-23 08:09:10 -05:00
parent cb18a622f2
commit 9e1b5f89ad
4 changed files with 116 additions and 16 deletions

View File

@ -88,13 +88,14 @@ These settings have been put in their own CFG files so you can control what they
* `portalsopenall.cfg`: Sets `r_portalsopenall`. Force-opens all areaportals. Most users will want to use 1 because if 0, areas of levels may become invisible until you enter them. This was intended to help performance, but Chaos can disrupt this feature due to sequence breaking. Normally the default is 0, but in Chaos, it's 1.
## Known issues
* Sometimes the bar at the top won't appear after loading a save/map. The mod is still working. The bar should appear once the next effect starts.
* Many people have been having an issue where their binds are incorrect. Check them in the keyboard menu before playing.
* To ensure all effects work right, sv_cheats is automatically set to 1. Don't change it.
* The "Saved..." message may not appear. The save is still made.
* Sometimes the bar at the top won't appear after loading a save/map. The mod is still working. The bar should appear once the next effect starts.
* The "Saved..." message may not appear. The save is still made. (As long as you pressed the right button. See first note.)
* The car compass HUD element does not display correctly.
* If you play maps from something that isn't _Half-Life 2/Episode One/Two_, the "Node graph out of date" message will appear every time you go to a new map for the first time. This message is harmless, but if you wish, you can copy the `.AIN` files from the mod as well. It will also stop appearing after you've visited each map a single time, because the mod has now generated its own copy of the node graph. The `.AIN` files are included for _Half-Life 2/Episode One/Two_.
* If you take a weird path through d3_c17_13, you may not activate the strider in the car pit. You will have to kill it before the intended route can continue.
* **Super Grab** sometimes makes it harder to grab things.
* **Didn't Skip Arm Day** sometimes makes it harder to grab things.
* Sometimes things are invisible with **Orthographic Camera**. Turning on the flashlight may fix it.
* Collisions can be weird when **Slow Physics** is on.

View File

@ -26,14 +26,14 @@
ConVar hud_showemptyweaponslots( "hud_showemptyweaponslots", "1", FCVAR_ARCHIVE, "Shows slots for missing weapons when recieving weapons out of order" );
#define SELECTION_TIMEOUT_THRESHOLD 0.5f // Seconds
#define SELECTION_FADEOUT_TIME 0.75f
#define SELECTION_TIMEOUT_THRESHOLD 0.5f * cvar->FindVar("host_timescale")->GetFloat() // Seconds
#define SELECTION_FADEOUT_TIME 0.75f * cvar->FindVar("host_timescale")->GetFloat()
#define PLUS_DISPLAY_TIMEOUT 0.5f // Seconds
#define PLUS_FADEOUT_TIME 0.75f
#define PLUS_DISPLAY_TIMEOUT 0.5f * cvar->FindVar("host_timescale")->GetFloat() // Seconds
#define PLUS_FADEOUT_TIME 0.75f * cvar->FindVar("host_timescale")->GetFloat()
#define FASTSWITCH_DISPLAY_TIMEOUT 1.5f
#define FASTSWITCH_FADEOUT_TIME 1.5f
#define FASTSWITCH_DISPLAY_TIMEOUT 1.5f * cvar->FindVar("host_timescale")->GetFloat()
#define FASTSWITCH_FADEOUT_TIME 1.5f * cvar->FindVar("host_timescale")->GetFloat()
#define CAROUSEL_SMALL_DISPLAY_ALPHA 200.0f
#define FASTSWITCH_SMALL_DISPLAY_ALPHA 160.0f

View File

@ -75,6 +75,7 @@
#include "ai_playerally.h"
#include "hl_gamemovement.h"
#include "npc_PoisonZombie.h"
#include "physics_saverestore.h"
#ifdef HL2_EPISODIC
#include "npc_alyx_episodic.h"
@ -955,6 +956,7 @@ BEGIN_DATADESC( CHL2_Player )
DEFINE_AUTO_ARRAY(m_iActiveEffects, FIELD_INTEGER),
//DEFINE_UTLVECTOR(m_iTerminated, FIELD_INTEGER),
DEFINE_INPUTFUNC(FIELD_VOID, "InsideTransition", InputInsideTransition),
//DEFINE_PHYSPTR(m_pController),
END_DATADESC()
@ -2101,6 +2103,8 @@ void CHL2_Player::PlayerRunCommand(CUserCmd *ucmd, IMoveHelper *moveHelper)
}
void CHL2_Player::StartGame()
{
//if (!m_pController)
// m_pController = physenv->CreateMotionController(this);
const char *pMapName = STRING(gpGlobals->mapname);
//scripting of canals 11 requires an airboat to be present, give player a new one if they came here without one
if (!Q_strcmp(pMapName, "d1_canals_11"))
@ -2136,6 +2140,7 @@ void CHL2_Player::StartGame()
//-----------------------------------------------------------------------------
void CHL2_Player::Spawn(void)
{
//m_pController = physenv->CreateMotionController(this);
StartGame();
if (gpGlobals->eLoadType == MapLoad_NewGame)
{
@ -4364,6 +4369,12 @@ void CHL2_Player::UpdateClientData( void )
void CHL2_Player::OnRestore()
{
BaseClass::OnRestore();
/*
if (m_pController)
{
m_pController->SetEventHandler(this);
}
*/
m_pPlayerAISquad = g_AI_SquadManager.FindCreateSquad(AllocPooledString(PLAYER_SQUADNAME));
}
@ -5412,11 +5423,11 @@ bool CChaosEffect::CheckEffectContext()
//could distrupt cutscenes
if (m_nID == EFFECT_NPC_HATE || m_nID == EFFECT_NPC_FEAR)
if (!Q_strcmp(pMapName, "d1_trainstation_04") || !Q_strcmp(pMapName, "d1_canals_03") || !Q_strcmp(pMapName, "d1_eli_01")
if (!Q_strcmp(pMapName, "d1_trainstation_01") || !Q_strcmp(pMapName, "d1_trainstation_04") || !Q_strcmp(pMapName, "d1_canals_03") || !Q_strcmp(pMapName, "d1_eli_01")
|| !Q_strcmp(pMapName, "d2_coast_10")
|| !Q_strcmp(pMapName, "d3_breen_01")
|| !Q_strcmp(pMapName, "ep1_citadel_03") || !Q_strcmp(pMapName, "ep1_c17_02b")
|| !Q_strcmp(pMapName, "ep2_outland_01") || !Q_strcmp(pMapName, "ep2_outland_07") || !Q_strcmp(pMapName, "ep2_outland_08") || !Q_strcmp(pMapName, "ep2_outland_10a"))
|| !Q_strcmp(pMapName, "ep1_citadel_03") || !Q_strcmp(pMapName, "ep1_c17_02b")
|| !Q_strcmp(pMapName, "ep2_outland_01") || !Q_strcmp(pMapName, "ep2_outland_07") || !Q_strcmp(pMapName, "ep2_outland_08") || !Q_strcmp(pMapName, "ep2_outland_10a"))
return false;//bad map
//if we miss the trigger_changelevel, the pod will get killed, killing us
@ -5430,6 +5441,11 @@ bool CChaosEffect::CheckEffectContext()
if (!Q_strcmp(pMapName, "ep1_citadel_03"))
return false;
//d1_trainstation_05 is a bad map to be introduced to No Climbing on
if (m_nID == EFFECT_INCLINE)
if (!Q_strcmp(pMapName, "d1_trainstation_05"))
return false;
if (m_nContext == EC_NONE)
return true;
@ -7980,30 +7996,95 @@ void CEBumpy::DoOnVehicles(CPropVehicleDriveable *pVehicle)
void CEGravitySet::StartEffect()
{
bool bNegative = g_ChaosEffects[EFFECT_INVERTG]->m_bActive;
//CBasePlayer* pPlayer = UTIL_GetLocalPlayer();
//CHL2_Player *pHL2Player = static_cast<CHL2_Player*>(pPlayer);
CBaseEntity *pVehicle;
switch (m_nID)
{
case EFFECT_ZEROG:
sv_gravity.SetValue(0);
Msg("Setting sv_gravity to 0\n");
pVehicle = gEntList.FindEntityByClassname(NULL, "prop_v*");
/*
while (pVehicle)
{
IPhysicsObject *pList[VPHYSICS_MAX_OBJECT_LIST_COUNT];
int count = pVehicle->VPhysicsGetObjectList(pList, ARRAYSIZE(pList));
if (count)
{
for (int i = 0; i < count; i++)
{
pHL2Player->m_pController->AttachObject(pList[i], true);
}
}
pVehicle = gEntList.FindEntityByClassname(pVehicle, "prop_v*");
}
*/
break;
case EFFECT_SUPERG:
sv_gravity.SetValue(bNegative ? -1800 : 1800);
Msg("Setting sv_gravity to %i\n", bNegative ? -1800 : 1800);
pVehicle = gEntList.FindEntityByClassname(NULL, "prop_v*");
while (pVehicle)
{
pVehicle->SetGravity(3);
pVehicle = gEntList.FindEntityByClassname(pVehicle, "prop_v*");
}
break;
case EFFECT_LOWG:
sv_gravity.SetValue(bNegative ? -200 : 200);
Msg("Setting sv_gravity to %i\n", bNegative ? -200 : 200);
pVehicle = gEntList.FindEntityByClassname(NULL, "prop_v*");
while (pVehicle)
{
pVehicle->SetGravity(0.3333f);
pVehicle = gEntList.FindEntityByClassname(pVehicle, "prop_v*");
}
break;
case EFFECT_INVERTG:
Msg("Setting sv_gravity to %i\n", -sv_gravity.GetInt());
sv_gravity.SetValue(-sv_gravity.GetInt());
pVehicle = gEntList.FindEntityByClassname(NULL, "prop_v*");
while (pVehicle)
{
pVehicle->SetGravity(-pVehicle->GetGravity());
pVehicle = gEntList.FindEntityByClassname(pVehicle, "prop_v*");
}
break;
}
physenv->SetGravity(Vector(0, 0, -GetCurrentGravity()));
}
/*
//this counteracts the force of gravity. i don't know why this number works well, it just does.
//I decided to not do this because each vehicle needs its own gravity amount and it just seems like an entire can of worms
ConVar gravity_counter_amount("gravity_counter_amount", "-0.4f");
IMotionEvent::simresult_e CHL2_Player::Simulate(IPhysicsMotionController *pController, IPhysicsObject *pObject, float deltaTime, Vector &linear, AngularImpulse &angular)
{
if (g_ChaosEffects[EFFECT_ZEROG]->m_bActive)
{
bool bNegative = g_ChaosEffects[EFFECT_INVERTG]->m_bActive;
float flAmt = gravity_counter_amount.GetFloat() * (bNegative ? -600 : 600);
linear.z -= flAmt;
}
return SIM_GLOBAL_ACCELERATION;
}
void CHL2_Player::UpdateOnRemove()
{
if (m_pController)
{
physenv->DestroyMotionController(m_pController);
m_pController = NULL;
}
BaseClass::UpdateOnRemove();
}
*/
void CEGravitySet::StopEffect()
{
bool bNegative = g_ChaosEffects[EFFECT_INVERTG]->m_bActive;
//CBasePlayer* pPlayer = UTIL_GetLocalPlayer();
//CHL2_Player *pHL2Player = static_cast<CHL2_Player*>(pPlayer);
CBaseEntity *pVehicle;
switch (m_nID)
{
case EFFECT_ZEROG:
@ -8011,6 +8092,22 @@ void CEGravitySet::StopEffect()
case EFFECT_LOWG:
sv_gravity.SetValue(bNegative ? -600 : 600);
Msg("Unsetting sv_gravity to %i\n", bNegative ? -600 : 600);
pVehicle = gEntList.FindEntityByClassname(NULL, "prop_v*");
/*
while (pVehicle)
{
IPhysicsObject *pList[VPHYSICS_MAX_OBJECT_LIST_COUNT];
int count = pVehicle->VPhysicsGetObjectList(pList, ARRAYSIZE(pList));
if (count)
{
for (int i = 0; i < count; i++)
{
pHL2Player->m_pController->DetachObject(pList[i]);
}
}
pVehicle = gEntList.FindEntityByClassname(pVehicle, "prop_v*");
}
*/
break;
case EFFECT_INVERTG:
Msg("Setting sv_gravity to %i\n", -sv_gravity.GetInt());

View File

@ -1981,16 +1981,18 @@ void CBaseEntity::FireBullets( const FireBulletsInfo_t &info )
if (IsCombatCharacter())
{
//Vector vecShootOffset = GetAbsOrigin() - MyCombatCharacterPointer()->Weapon_ShootPosition();
//Msg("B %0.1f %0.1f %0.1f - %0.1f %0.1f %0.1f\n", tr.endpos.x, tr.endpos.y, tr.endpos.z, vecShootOffset.x, vecShootOffset.y, vecShootOffset.z);
//SetAbsOrigin();//position gun was shot from does not match our origin
Vector vecFinal = tr.endpos - vecDir * 5;//push them a bit out of the wall cause reasons
NDebugOverlay::Cross3D(vecFinal, 16, 0, 0, 255, true, 30);
NDebugOverlay::Line(MyCombatCharacterPointer()->Weapon_ShootPosition(), vecFinal, 0, 0, 255, true, 30);
if (unstuck_debug.GetBool())
{
NDebugOverlay::Cross3D(vecFinal, 16, 0, 0, 255, true, 30);
NDebugOverlay::Line(MyCombatCharacterPointer()->Weapon_ShootPosition(), vecFinal, 0, 0, 255, true, 30);
}
trace_t zFixTrace;
Vector vecShootPos = GetAbsOrigin() - MyCombatCharacterPointer()->Weapon_ShootPosition();
UTIL_TraceLine(vecFinal, vecFinal + vecShootPos, MASK_NPCSOLID_BRUSHONLY, this, COLLISION_GROUP_NONE, &zFixTrace);
vecFinal = zFixTrace.endpos;
NDebugOverlay::Cross3D(vecFinal, 16, 255, 0, 255, true, 30);
if (unstuck_debug.GetBool()) NDebugOverlay::Cross3D(vecFinal, 16, 255, 0, 255, true, 30);
QAngle aAngle = GetAbsAngles();
Vector vecVel = GetAbsVelocity();
bool bSleep = false;