Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CS] Add the ability to rotate shell ejection movement [Feature Request] #2447

Open
CS-PRO1 opened this issue May 22, 2019 · 8 comments
Open

Comments

@CS-PRO1
Copy link

CS-PRO1 commented May 22, 2019

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?

@CS-PRO1
Copy link
Author

CS-PRO1 commented May 22, 2019

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..

@SamVanheer
Copy link

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:

halflife/cl_dll/ev_hldm.cpp

Lines 481 to 483 in c76dd53

EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20, -12, 4 );
EV_EjectBrass ( ShellOrigin, ShellVelocity, angles[ YAW ], shell, TE_BOUNCE_SHELL );

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

@CS-PRO1
Copy link
Author

CS-PRO1 commented May 22, 2019

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.

@CS-PRO1
Copy link
Author

CS-PRO1 commented May 22, 2019

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

@SamVanheer
Copy link

Use multiple attachments.

@CS-PRO1
Copy link
Author

CS-PRO1 commented May 22, 2019

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.

@SamVanheer
Copy link

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

@CS-PRO1
Copy link
Author

CS-PRO1 commented Jun 3, 2019

@SamVanheer Well maybe we can turn this bug #2499 into a feature somehow. The shells are rotated while model isn't...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants