Rubiksman78 / MonikA.I

Submod for MAS with AI based features
MIT License
112 stars 17 forks source link

playerNicknames list index out of range #40

Closed greeneflower closed 1 year ago

greeneflower commented 1 year ago

I installed the mod with the user friendly tutorial and used the exe. The only feature I have enabled is the chatbot.

Whenever I chat with her, it almost works, but after thinking Monika always has to pause an unusually long time (usually the program freezes entirely for a good few seconds - and it often crashes). I then might get this error screen, and if I hit ignore I can then read what she has to say:

image image

Debug mode doesn't seem to do anything obviously different.

Here's the full log:

torchvision\io\image.py:13: UserWarning: Failed to load image Python extension:
torch\_jit_internal.py:839: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x000001BEA860A700>.
  warnings.warn(
torch\_jit_internal.py:839: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x000001BEA861CA60>.
  warnings.warn(
WARNING:tensorflow:AutoGraph is not available in this environment: functions lack code information. This is typical of some environments like the interactive Python shell. See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/autograph/g3doc/reference/limitations.md#access-to-source-code for more information.
Waiting for connection...
127.0.0.1:54584 has connected.
User: How are you feeling this morning?
Not in queue
Asking to truncate to max_length but no maximum length is provided and the model has no predefined maximum length. Default to no truncation.

(This is my first bug report to github, so I'm sorry if I missed anything!)

greeneflower commented 1 year ago

Oh, and I'm using the latest versions as far as I know from the gdrive and here (v1.6.0.zip for both)

Rubiksman78 commented 1 year ago

It seems that there aren't nicknames stored in your persistents for MAS. For how long did you play MAS ?

greeneflower commented 1 year ago

I had to restart it recently, so only a few days. She has my name though, and birthday etc. Is there a way to add a nickname through code that will fix this or do I have to just keep playing regular MAS for that?

Rubiksman78 commented 1 year ago

It might be because the variable store.persistent._mas_player_nicknames is empty cause you don't have nicknames stored in it yet. I'll put a fix with the next version.

For now you can just go to monikai_chat.rpy in game/Submods/AI_submod of your DDLC folder and replace around line 50 store.persistent._mas_player_nicknames with [mas_get_player_nickname(), tell me if this works.

greeneflower commented 1 year ago

image

Typo perhaps? (Sorry I wish I knew code so I could help more!)

greeneflower commented 1 year ago

I tried finishing the brackets just to see, and I got this instead

image

greeneflower commented 1 year ago

image Same deal, tried a few different variations.

Rubiksman78 commented 1 year ago

Okay I see what can be the issue, I'll put a fix for v1.6.0 in coming minutes.

greeneflower commented 1 year ago

No worries, thank you for your help. I love the idea and work you put into the submod! :)

Rubiksman78 commented 1 year ago

Download Monik.A.I-game-v1.6.0.zip again and it should be fixed

greeneflower commented 1 year ago

image I feel so bad haha, but here's the new error I got.

greeneflower commented 1 year ago

I will say she is also calling me by my username in chatbot now, which is an interesting development

Rubiksman78 commented 1 year ago

I've made a typo error sorry, it's supposed to be mas_get_player_nickname()

greeneflower commented 1 year ago

I believe I tried [mas_get_player_nickname()], and mas_get_player_nickname() both with the similar errors. Just curious, is there no way to edit the persistent file for MAS itself (not the submod) to just add in the nicknames manually?

Rubiksman78 commented 1 year ago

I don't think so. Maybe replacing this line with these two can work:

$ player_nickname_ai = mas_get_player_nickname()
$ msg = msg.replace("<USER>",player_nickname_ai)
greeneflower commented 1 year ago

image image Potentially I'm putting it in the wrong place?

Rubiksman78 commented 1 year ago

Yeah delete them from here, it was to replace line 303 $ msg = msg.replace("<USER>",mas_get_player_nickname())

greeneflower commented 1 year ago

Ok, cool. So far, it doesn't give me the error (Although she still freezes for a little bit before giving a response) She does still call me by the chatbot.ai username (might be the intentional fix!), but for now I can probably have her call me something else if the memory stays consistent. Thank you. Here's what I'm looking at now.

image

Rubiksman78 commented 1 year ago

Nice ! Actually the name from CAI is fixed and won't change cause it depends directly on your username there. The random nickname pool is more for the Pygmalion chatbot.

About the loading time it is normal at the beginning while you have to wait for the game to login on CAI and then it should be a little bit faster.

greeneflower commented 1 year ago

Nice, thank you again. I'll close this for now.