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

thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', src\main.rs:35:24 #5

Open
TeriosSonic opened this issue Feb 13, 2022 · 6 comments

Comments

@TeriosSonic
Copy link

I have set the engine to GZDoom (since that's what I'm using), and every time I try to boot the RPC exe, it spits out this error and exits.
After some further testing, this only seems to happen with Snap the Sentinel (a GZDoom game). As for Doom and Doom II (my other two games), this only seems to happen in the title screen (which is bound to happen considering the instructions state to load into a level for the script to work).
I'm almost sure it's just the game not being supported by the script, but I wanted to post this issue anyways to see if there's any fix, or if you could possibly add support to said game.

@Phate6660
Copy link
Owner

Phate6660 commented Feb 13, 2022

Sorry for the late reply! Looking at the code, I see where the issue is at.
Basically, when the window title is parsed, it expects level - game or level - mod format.
Most things support this (with the exception of LZDoom (which is already handled) and a few mods), and will often work.
But sometimes said mod will only use level, mod, or game.
Could you launch Snap the Sentinel, go into a level, and let me know what the title of the window is?


As a side note, I plan on coming back to developing this more eventually.
IRL stuff is keeping me pretty busy, but looking through the program I can see tons of areas of improvement.
Especially with the error handling. (I'll also make it so it detects errors in the window title, and offer possible solutions while gracefully exiting.)
Of course I can add better support too!
If the game has a custom logo or icon, let me know and I can add it to the discordrpc!

@TeriosSonic
Copy link
Author

It's really weird, because the title for the game matches this format perfectly:
image
In fact, Snap also has a map for its titlescreen, therefore it shouldn't even be needed to load into a level:
image
However, it still spits the same error.

BTW, the game does have a custom logo, the image I have doesn't have a background so I'm not sure if it's really useful, but I could try to find (or make) one with a background if needed:
image

@Phate6660
Copy link
Owner

Sorry about the late reply again. I just woke up.
I found the game. Give me a little bit to look into it.
I should have the issue figured out pretty quickly.
Especially since I know exactly where the error is at.
But I need some caffeine first lol.

@Phate6660
Copy link
Owner

I found the issue. The regex wasn't matching for the title of the window. :D
In the meantime, I'll create an easy fix by adding "Snap the Sentinel" to the regex.
But for a more long-term fix, I'll have to make the window matching more robust.
I'll get that logo added and apply the fix, then ping you when done.

@Phate6660
Copy link
Owner

@TeriosSonic Added the logo and pushed the changes! Make sure to git pull in the repo.
Can you build the program? If not, I can build it for you and make a new release.

@Phate6660
Copy link
Owner

Phate6660 commented Feb 14, 2022

Side note: How the hell haven't I heard of Snap the Sentinel?
Tried it out a little, it has an amazing OOTB experience and has a great soundtrack.
Thanks to this issue I have something to play. :D

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

No branches or pull requests

2 participants