Halflife: [CS] Add the ability to rotate shell ejection movement [Feature Request]

Created on 22 May 2019  路  8Comments  路  Source: ValveSoftware/halflife

You know many modders wanted this for so long. when you make a skin for an AK for instance that uses a set of animations that puts the shell ejection port on the right side (as viewed in right handed) and while using it in-game with proper shell ejection attachment position. Still the shells somehow flies to the left and breaks the whole thing.
Is it possible to have the ability to change the ejected shell's direction?

Counter-Strike Feature Request

Most helpful comment

This will be the last issue from me today, sorry for flooding the issues page. But kisak asked me to make individual issues for each fix.. I just love this game and want to see some ugly stuff being patched out officially.
Again excuse me for flooding the page, I may be looking a bit annoying but I don't really have the time to make gaps between the reports so I did them all in once..

All 8 comments

This will be the last issue from me today, sorry for flooding the issues page. But kisak asked me to make individual issues for each fix.. I just love this game and want to see some ugly stuff being patched out officially.
Again excuse me for flooding the page, I may be looking a bit annoying but I don't really have the time to make gaps between the reports so I did them all in once..

Shells are spawned by the client side event functions which have no way of knowing if a model has the ejection port on the right side.

For example, this is the Glock's shell ejection code from Half-Life: https://github.com/ValveSoftware/halflife/blob/c76dd531a79a176eef7cdbca5a80811123afbbe2/cl_dll/ev_hldm.cpp#L481-L483

What you could do is use a named attachment to indicate whether the ejection is left or right, and where the ejection should occur.

There are a few problems with that however:

  • While attachments can have names the compiler doesn't support it, so all attachments are unnamed right now
  • Models that don't have attachments defined for either ejection point will need a fallback (existing code should suffice)
  • Models that have named attachments that happen to match the names of either ejection side could malfunction. It's unlikely since no existing compiler can name them, and no model viewer supports editing names as far as i know
  • The ejection position and direction will need to be mirrored if cl_righthand is enabled. This already seems to be the case so that should work fine

cl_righthand may fix some but not all, Famas, Aug, and M249 already ejects shells to the right. So using all flipped models but those wouldn't be the right choice.
I guess updating current compilers to include attachment names would be the best action.

And btw how could the Dual Elites eject at both sides correctly?

Use multiple attachments.

Well I tried to use attachments no.2 and no.3 that are used in the dualies for the Galil. In-game it doesn't do anything. Maybe because they're not valuable for other weapons.

That's because the attachments aren't currently used. All shell ejection positions are hardcoded.

@SamVanheer Well maybe we can turn this bug https://github.com/ValveSoftware/halflife/issues/2499 into a feature somehow. The shells are rotated while model isn't...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  4Comments

LuckyStrikeOriginal picture LuckyStrikeOriginal  路  4Comments

perforatorRU picture perforatorRU  路  3Comments

BlackShadow picture BlackShadow  路  3Comments

perforatorRU picture perforatorRU  路  3Comments