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

Occassionally Selects Wrong Player #31

Closed
derekShaheen opened this issue Nov 11, 2021 · 7 comments
Closed

Occassionally Selects Wrong Player #31

derekShaheen opened this issue Nov 11, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@derekShaheen
Copy link

Sometimes seems to select wrong player to display.

image

@soarqin
Copy link
Owner

soarqin commented Nov 11, 2021

this is a known bug and currently there is no approach to detect which Unit(PlayerData) is controlled by yourself
so in multiplayer game it will select a random player when there are more than one in this map level(area)

@Jarboy87
Copy link

Jarboy87 commented Nov 11, 2021

For now let players specify the player name within D2RMH.INI if this is a suitable workaround for multiplayer. (if this is possible with what can currently be read)

@derekShaheen
Copy link
Author

For now let players specify the player name within D2RMH.INI if this is a suitable workaround for multiplayer. (if this is possible with what can currently be read)

Personally I'm switching characters so often, I'm not sure this would be very effective - at least for me. It would be interesting to see all of the players on the map though. Then it would only be a matter of a different character being highlighted temporarily.

@Jarboy87
Copy link

For now let players specify the player name within D2RMH.INI if this is a suitable workaround for multiplayer. (if this is possible with what can currently be read)

Personally I'm switching characters so often, I'm not sure this would be very effective - at least for me. It would be interesting to see all of the players on the map though. Then it would only be a matter of a different character being highlighted temporarily.

I know its not ideal, but if theres no way to differentiate which Unit is controlled by you in multiplayer games, but player names are available in PlayerData or some other means, it's probably the best workaround at this stage. You could list all your character names in the config, separated by commas, assigned to strings or an array etc.

Im only saying all this because I'm wanting to use this in Multiplayer games, and its currently an issue for me as well.

@soarqin
Copy link
Owner

soarqin commented Nov 12, 2021

think can add a hotkey to switch between players

@soarqin soarqin added the bug Something isn't working label Nov 12, 2021
@derekShaheen
Copy link
Author

Hello @soarqin, love the change so we can see all players now. Thank you for that. One suggestion for you is offset 0x70 from the player unit should be the pointer to the inventory. I believe this offset returns 0x00 when checked against a non-local player. If it returns a value, then you've selected the current local player.

@soarqin
Copy link
Owner

soarqin commented Nov 16, 2021

actually inventoryPtr is player unit offset 0x90(see https://github.com/soarqin/D2RMH/blob/master/src/d2rdefs.h#L598), and it is not 0x00 for all players.
I have found a new way to check for current player, which is the offset 0x10 in PlayerData, right after the player's name, this value is always 0 for local player and non-zero for other players.

close this first, you are welcome to reopen the issue if there's anything wrong within this solution

@soarqin soarqin closed this as completed Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants