Skip to content

Conversation

@Kein
Copy link
Contributor

@Kein Kein commented Apr 20, 2025

Missing global functions for Types.lua

Kein added 3 commits April 21, 2025 00:11
`ModRef` roo
This is misleading and incorrect. "Player" in the context of UE is a completely different to a pawn object. You always have a player on a client, be it `LocalPlayer` or `NetClient`, but there are plenty of games that never use Pawn, nor for PlayerController nor for any of the other entities.
This should be removed in major release or rewritten to return actual player Object
@Kein Kein changed the title Update Types.lua Fixed for LUA helpers and types Apr 21, 2025
@igromanru
Copy link
Contributor

igromanru commented Apr 23, 2025

Why is GetPlayer deprecated and replaced by GetPawn?
I just added the function recently.
Have you guys decided it in Discord?
I understand that GetPawn might sound more logical, since a APawn from AController can be basically anything like a vehicle.
But in 90% of the time it's the player pawn and a new mod author who don't know Unreal Engine specifics won't know what GetPawn even does.
So the same way GetPlayerController can actually return a AController type instead, I find it much more user-friendly to call it GetPlayer.

@UE4SS
Copy link
Collaborator

UE4SS commented Apr 23, 2025

Why is GetPlayer deprecated and replaced by GetPawn? I just added the function recently. Have you guys decided it in Discord? I understand that GetPawn might sound more logical, since a APawn from AController can be basically anything like a vehicle. But in 90% of the time it's the player pawn and a new mod author who don't know Unreal Engine specifics won't know what GetPawn even does. So the same way GetPlayerController can actually return a AController type instead, I find it much more user-friendly to call it GetPlayer.

As far as I know it wasn't decided on Discord, but regardless, Player is distinctly different from Pawn in UE so I think this change makes sense.
I think people need to learn the correct names for things, or else a lot more confusion and frustration will arise.
I don't have a problem with GetPlayerPawn if you think that makes more sense than just GetPawn.

@Kein
Copy link
Contributor Author

Kein commented Apr 23, 2025

GetPlayerPawn does not make any sense in the context of UE. What Player Pawn? Which Player it belongs to? Actually does not belong to any Player, only AController can own a Pawn in this context. And there can be dozens of Player/AI Controllers in [online] games, the concept of THE PlayerController is incorrect, even if this assumption works as it is in majority of cases ("default UE singleplayer games").

GetPawn should be then GetFirstPawn. Being essentially static it does not behave behave the way GetControlledPawn does. Right now it fetches the first PC with StaticFind which does not guarantee order, where as UPlayer array that holds all players - does.

@Kein Kein changed the title Fixed for LUA helpers and types Fixes for LUA helpers and types May 22, 2025
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