You should consider joining our Discord to ask for support.

We created a support channel using the new Discord Forum feature!

You can also visit our new website, it has a help section in English and French

0 like 0 dislike
705 views
in Script help by (520 points)
closed by
So I added different language frames to the various menus but the one that doesn't work is the loading screen one. When transitioning into the loading screen, the game crashes and I get "undefined method `language' for nil:NilClass (Type : NoMethodError) at line 7 of the following script:

https://imgur.com/a/g5ty2iX

Is there a script within PSDK which I can study to help guide me to helping fix this script?
closed with the note: Script Help Complete

1 Answer

0 like 0 dislike
by (28.0k points)
selected by
 
Best answer

You don't have to do this, by default PSDK will load {filename}{languagecode}.png if it exists and $options is not nil.

Regardless for some reason $options is not loaded in the Load menu (because no game is actually loaded). In order to fix it you'd need to do this:

module GamePlay
  class Load
    alias psdk_initialize initialize
    def initialize
      psdk_initialize
      $options = @all_saves.compact.first&.options
    end
  end
end

This should use the options of the first save and then try to load load/frameload{language} or load/frameload

EDIT: actually $options is not set when you skip title ^^'

by (520 points)
So the naming scheme for a different load frame would be: frameload{fr} ?
by (28.0k points)
If your game is in french it'll try to load frameloadfr then frameload if not found.
by (520 points)
Thank you. Could have avoided all my headaches if I had just asked from the beginning the naming scheme [frame_loadfr / frame_savefr / etc]. Didn't see any in the load folder so I figured it was up to us to make it.

Your script works like a charm.

Not sure if this a bug but when switching languages and saving right away, the language of the previous frame still stays until you save.
by (28.0k points)
Switching language is still kind of tricky because the whole state doesn't change to new language right away (example texts remains in previous language in options). It indeed require some save/loading to ensure that everything works. I guess that's the reason why you can't change language at all in official games after choosing ^^
...