bkacjios / m-overlay

A controller input display/overlay for Dolphin
MIT License
165 stars 44 forks source link

Player codes not being passed to memory.slippi #202

Closed noahpodgurski closed 3 months ago

noahpodgurski commented 3 months ago

https://github.com/bkacjios/m-overlay/blob/6dbc28926d567da550c469316582c35bb34fd52c/source/modules/games/GALE01-2.lua#L162

Even when uncommented I'm not seeing the code appear under memory.slippi.players.1.code

bkacjios commented 3 months ago

I don't use that for anything in the overlay. It used to work, since I was thinking about adding player ranks to the overlay.

Not sure what to tell you.

noahpodgurski commented 3 months ago

Well it worked back when I submitted my MR but slippi must've been updated to change where it's stored in the data or something...

Actually I used memory.slippi.players[1].code, which doesn't work anymore either

bkacjios commented 3 months ago

It's possible this string matching method I made isn't working properly. It's supposed to match any characters up until a NULL character.

https://github.com/bkacjios/m-overlay/blob/6dbc28926d567da550c469316582c35bb34fd52c/source/modules/memory/init.lua#L258-L261

bkacjios commented 3 months ago

Yeah, the data is 100% there, just not being parsed correctly I guess.

image

bkacjios commented 3 months ago

Changing this line from

return convertJisStr(value:match("(.-)%z*") or value) 

to

return convertJisStr(value:match("(.-)%z+") or value) 

Somehow allows it to work right. Doesn't really make sense, but I guess that should help you.

noahpodgurski commented 3 months ago

Thank you

bkacjios commented 3 months ago

Actually.. I think this is a better pattern.

^(.-)%z-$

The anchors are what allows it to work correctly.

bkacjios commented 3 months ago

image And confirmed it works.

bkacjios commented 3 months ago

https://github.com/bkacjios/m-overlay/commit/c14d293d8a4f0842aa19bceae0fd1df325020d80