StrataSource / FGD

The FGD + Hammer resource files for games built on Strata Source.
20 stars 15 forks source link

refactor: filter_velocity #203

Closed BIRD311 closed 11 months ago

BIRD311 commented 1 year ago

didn't test

jason-e commented 1 year ago

Instead of those individual suggestions, here's the whole thing:

@FilterClass base(filter_base)
= filter_velocity : "Filter that checks the player's velocity"
    [
    SpeedThreshold(float) : "Speed Threshold" : 500 : ""
    Dimension[engine](integer) : "Dimension" : 0    
    Dimension(choices) : "Dimension" : 0 : "Which component of the entity's velocity to check" =
        [
        0 : "Horizontal Speed (Actual)"
        1 : "Horizontal Speed (Along Specified Yaw Angle)"
        2 : "Vertical Speed"
        3 : "All Axes"
        ]
    MatchMode[engine](integer) : "Match Mode" : 0
    MatchMode(choices) : "Match Mode" : 0 : "How the entity's speed should be compared to the threshold" =
        [
        0 : "Match when above speed"
        1 : "Match when below speed"
        ]
    YawAngle(float) : "Check Horizontal Speed Along Yaw Angle" : 0 : "In Specified Yaw Angle mode, compare against the component of the entity's horizontal velocity in this direction."
    ]

I changed some keys so make sure to update the implementation to match. Also definitely make sure to test this.

BIRD311 commented 1 year ago

thanks .. I've tested this now with your changes .. do we even what YawAngle or should we use this thing? image

jason-e commented 1 year ago

Yeah I wasn't sure if it would be better to use that or not. To activate that I think the field has to be called angles and then you also have pitch and roll components, which don't do anything for this entity. I was thinking maybe we just stick with a manually entered float and add support for a new single-value angle selector in Hammer later. There's at least one other entity that could use it already (light_environment's pitch value).