Page MenuHomeFeedback Tracker

SetScale - Inconsistent Behaviour
Assigned, UrgentPublic

Description

In an MP environment, SetScale has inconsistent behaviour with regards to its scaling of hitboxes depending on the number of players in the vicinity.

With a single client in the vicinity, the hitbox is correctly scaled.
When two or more clients are in the vicinity, the hitbox reverts to scale 1.0.

Applying SetScale in any and all EntityEvents does not result in the expected behaviour of a correctly scaled hitbox.

It has been mentioned previously by some that SetScale is only intended for visual adjustments, and yet the correct scaling of hitboxes in certain circumstances indicates that the desired behaviour could potentially be accommodated.

There is no expectation of adjustments to pathing or other collision physics, but correctly scaled hit detection would be appreciated.

Details

Severity
Tweak
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General
Steps To Reproduce
modded class ZombieBase
{
    static float m_new_scale = 3.0;

    void ZombieBase()
    {
        if (GetGame().IsClient())
        {
            SetEventMask(EntityEvent.POSTFRAME|EntityEvent.FRAME|EntityEvent.INIT);
        }
    }

    void ~ZmbF_ShortSkirt_Base()
    {
        if (GetGame() && GetGame().IsClient())
        {
            ClearEventMask(EntityEvent.POSTFRAME|EntityEvent.INIT);
        }
    }

    override void EOnInit(IEntity other, int extra)
    {
        super.EOnInit(other, extra);
        if (!GetGame().IsMultiplayer() || GetGame().IsServer())
        {
            SetScale(m_new_scale); //server
        }
    }
    
    void EOnFrame(IEntity other, float timeSlice) // | EntityEvent.FRAME
    {
        if (!GetGame().IsClient())
            return;

        SetYawPitchRoll(Vector(GetYawPitchRoll()[0], 0, 0));
    }

    void EOnPostFrame(IEntity other, int extra) //!EntityEvent.POSTFRAME
    {
        if (!GetGame().IsClient())
            return;

        SetScale(m_new_scale);
    }
};

Event Timeline

mdc created this task.Apr 2 2022, 4:29 AM
Geez changed the task status from New to Assigned.Apr 4 2022, 1:40 PM