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 playerMove event with "usercmd" and "movedata" types and getter functions #2779

Merged
merged 9 commits into from
Oct 9, 2023

Conversation

Mikey-Mikey
Copy link
Contributor

This adds a multitude of functions:

  • xuc:getMouseDeltaX()
  • xuc:getMouseDeltaY()
  • xuc:getForwardMove()
  • xuc:getSideMove()
  • xuc:getUpMove()
  • xmv:getForwardSpeed()
  • xmv:getSideSpeed()
  • xmv:getUpSpeed()
  • xmv:getMaxSpeed()
  • xmv:getMoveAngles()

And with an event to go alongside:

  • playerMove(Player:entity, MoveData:movedata, Command:usercmd)

Example:

event playerMove(P:entity, M:movedata, C:usercmd) {
    if(P == owner()) {
        print(C:getMouseDeltaX(), C:getMouseDeltaY())
    }
}

Copy link
Member

@Vurv78 Vurv78 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need E2Helper descriptions, add to lua/wire/client/e2descriptions.lua

lua/entities/gmod_wire_expression2/core/player.lua Outdated Show resolved Hide resolved
lua/wire/client/e2descriptions.lua Outdated Show resolved Hide resolved
@Vurv78 Vurv78 merged commit 56ee9b9 into wiremod:master Oct 9, 2023
@Denneisk
Copy link
Member

Denneisk commented Nov 4, 2023

What happened to mouse scroll?

@Vurv78
Copy link
Member

Vurv78 commented Nov 4, 2023

Looks like he forgot to include it here, although I thought you could already detect mouse scroll with keyPressed

@Denneisk
Copy link
Member

Denneisk commented Nov 4, 2023

Looks like he forgot to include it here, although I thought you could already detect mouse scroll with keyPressed

In the suggestion, he noted that this event allows you to get the precise amount scrolled.

@Vurv78
Copy link
Member

Vurv78 commented Nov 4, 2023

Looks like he forgot to include it here

https://wiki.facepunch.com/gmod/CUserCmd:GetMouseWheel

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

Successfully merging this pull request may close these issues.

3 participants