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

Add a way to find out whether a player is sneaking or not #126

Closed
halvors opened this issue Jun 16, 2015 · 26 comments
Closed

Add a way to find out whether a player is sneaking or not #126

halvors opened this issue Jun 16, 2015 · 26 comments
Labels

Comments

@halvors
Copy link
Contributor

halvors commented Jun 16, 2015

Add a way to find out whether a player is sneaking or not, this should probatly be a plugin?

Any suggestions?

@gjgfuj
Copy link
Contributor

gjgfuj commented Jun 16, 2015

Sneaking is a pretty MC specific thingy.

@RX14
Copy link
Contributor

RX14 commented Jun 16, 2015

Games which don't support sneaking can just have it set to false all the time...

@gjgfuj
Copy link
Contributor

gjgfuj commented Jun 16, 2015

oh yeah that's true, in that case it doesn't need to be a plugin at all.
just have something in Entity that determines whether they're sneaking or not.
(entities can sneak even if they're not players.)

@RX14
Copy link
Contributor

RX14 commented Jun 16, 2015

and a way to see if the game support it, we could have an enum for sneaking, not sneaking and not supported... this could be a generic enum too... or just Optional<Boolean>?

@magik6k
Copy link
Contributor

magik6k commented Jun 16, 2015

+1 to Optional<Boolean>

@gjgfuj
Copy link
Contributor

gjgfuj commented Jun 16, 2015

Optional<Boolean> would be good I think.

@RX14
Copy link
Contributor

RX14 commented Jun 16, 2015

Ok, we are decided

@RX14 RX14 added ready This is ready to be worked on feature labels Jun 16, 2015
@calclavia
Copy link
Member

Just do something like: inputManager.isKeyDown(SHIFT)

@halvors
Copy link
Contributor Author

halvors commented Jun 17, 2015

But then i essentially implement this for all voxel engines...

@gjgfuj
Copy link
Contributor

gjgfuj commented Jun 17, 2015

Noooooo.... Don't rely on specific keybindings seriously! There is NO
REASON TO ASSUME THAT. Even in Minecraft.

On Wed, 17 Jun 2015 4:01 pm Halvor Lyche Strandvoll <
[email protected]> wrote:

But then i essentially implement this for all voxel engines...


Reply to this email directly or view it on GitHub
#126 (comment)
.

@RX14
Copy link
Contributor

RX14 commented Jun 17, 2015

@calclavia that's a horrible idea...

@ghost
Copy link

ghost commented Jun 17, 2015

inputManager.isKeyDown(keybindManager/or something/.sneakKey) - is a bit better, but still horrible =/

@gjgfuj
Copy link
Contributor

gjgfuj commented Jun 17, 2015

Why test for if the sneak key is pressed as opposed to actually seeing if
the player is sneaking..... Plus that'd work on both sides.

On Wed, 17 Jun 2015 9:14 pm anti344 [email protected] wrote:

inputManager.isKeyDown(keybindManager.sneakKey) - is a bit better, but
still horrible =/


Reply to this email directly or view it on GitHub
#126 (comment)
.

@Victorious3
Copy link
Contributor

Say, what would this be used for? I only see sneaking being used as a key bind for giving additional interaction methods, but never with "sneaking" in mind.

@calclavia
Copy link
Member

Because it's a more general implementation. Not all games have sneak, but all keyboards have shift.

@RX14
Copy link
Contributor

RX14 commented Jun 17, 2015

you can change the keybinds...

@Victorious3
Copy link
Contributor

@RX14 And what? I would make it a key binding as well, why would there be an extra "sneaking" flag?

@halvors
Copy link
Contributor Author

halvors commented Jun 17, 2015

The user could have remapped the SHIFT key to something else, statically setting it to SHIFT is not a solution in that matter.

@RX14
Copy link
Contributor

RX14 commented Jun 17, 2015

Because sometimes you actually want to know if a player is sneaking instead of holding shift. Not ALL the time it is used for an extra modifier...

@gjgfuj
Copy link
Contributor

gjgfuj commented Jun 17, 2015

Yeah. There is reasons why you'd want to know if the player's sneaking.

On Wed, 17 Jun 2015 9:21 pm Chris Hobbs [email protected] wrote:

Because sometimes you actually want to know if a player is sneaking
instead of holding shift. Not ALL the time it is used for an extra
modifier...


Reply to this email directly or view it on GitHub
#126 (comment)
.

@Victorious3
Copy link
Contributor

Indeed, if he maps the shift key to something else your key binding would also change. That's the thing about key bindings. @gjgfuj What reasons?

@calclavia
Copy link
Member

MC Plugin maybe?

@gjgfuj
Copy link
Contributor

gjgfuj commented Jun 17, 2015

As an example... OpenBlocks elevators. Sneak to go down, jump to go up.
Plus, it makes MUUCH more sense. Say sneaking becomes a toggle or anything
else. That'd break the keybinding thing. You shouldn't rely on keybinds for
anything except when you really need it. I.e. your mod's stuff.

On Wed, 17 Jun 2015 9:30 pm Vic Nightfall [email protected] wrote:

Indeed, if he maps the shift key to something else your key binding would
also change. That's the thing about key bindings. @gjgfuj
https://github.com/gjgfuj What reasons?


Reply to this email directly or view it on GitHub
#126 (comment)
.

@Victorious3
Copy link
Contributor

@gjgfuj Then again, other games might not have it so that you can't rely on it anyways.

@gjgfuj
Copy link
Contributor

gjgfuj commented Jun 17, 2015

Optional?

On Wed, 17 Jun 2015 9:34 pm Vic Nightfall [email protected] wrote:

@gjgfuj https://github.com/gjgfuj Then again, other games might not
have it so that you can't rely on it anyways.


Reply to this email directly or view it on GitHub
#126 (comment)
.

@RX14
Copy link
Contributor

RX14 commented Jun 17, 2015

Put this in MC plugin. See NOVA-Team/NOVA-Minecraft#5

@RX14 RX14 closed this as completed Jun 17, 2015
@RX14 RX14 removed the ready This is ready to be worked on label Jun 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants