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
735 views
in Crash by (120 points)
I edited the mining game code to activate the events self switch instead of deleting it.

================================Erreur de script================================

Message :

undefined method `refresh' for nil:NilClass

Type : NoMethodError

Script : 00700 PSDK Event Interpreter/01200 Interpreter_Shortcut.rb (PSDK)

Ligne : 147

Date : 23/06/2022 10:10:53

Game Version : 256

Logiciel : Pokémon SDK 25.16

Script used by eval command :

mining_game(2+rand(3))

===================================Backtraces===================================

[27] : 00700 PSDK Event Interpreter/01200 Interpreter_Shortcut.rb (PSDK) | ligne 147 set_self_switch

[26] : 00700 PSDK Event Interpreter/01200 Interpreter_Shortcut.rb (PSDK) | ligne 320 mining_game

[25] : (eval) (RMXP) | ligne 1 eval_script

[24] : 00600 Script_RMXP/03000 Interpreter_7.rb (PSDK) | ligne 247 eval

[23] : 00600 Script_RMXP/03000 Interpreter_7.rb (PSDK) | ligne 247 eval_script

[22] : 00600 Script_RMXP/03000 Interpreter_7.rb (PSDK) | ligne 237 command_355

[21] : 00600 Script_RMXP/02500 Interpreter_2.rb (PSDK) | ligne 15 execute_command

[20] : 00600 Script_RMXP/02400 Interpreter_1.rb (PSDK) | ligne 132 update

[19] : 00600 Script_RMXP/02400 Interpreter_1.rb (PSDK) | ligne 100 loop

[18] : 00600 Script_RMXP/02400 Interpreter_1.rb (PSDK) | ligne 100 update

[17] : 01450 Systems/00003 Map Engine/00003 GamePlay/00200 Scene_Map.rb (PSDK) | ligne 168 auto_transfert_update

[16] : 01450 Systems/00003 Map Engine/00003 GamePlay/00200 Scene_Map.rb (PSDK) | ligne 165 loop

[15] : 01450 Systems/00003 Map Engine/00003 GamePlay/00200 Scene_Map.rb (PSDK) | ligne 165 auto_transfert_update

[14] : 01450 Systems/00003 Map Engine/00003 GamePlay/00200 Scene_Map.rb (PSDK) | ligne 18 update

[13] : 00700 Ajout_PSDK/00002 FPSBalancer.rb (PSDK) | ligne 44 times

[12] : 00700 Ajout_PSDK/00002 FPSBalancer.rb (PSDK) | ligne 44 run

[11] : 01450 Systems/00003 Map Engine/00003 GamePlay/00200 Scene_Map.rb (PSDK) | ligne 18 update

[10] : 01450 Systems/00000 General/00003 GamePlay__Base/00000 GamePlay__Base.rb (PSDK) | ligne 260 main_process

[9] : 01450 Systems/00000 General/00003 GamePlay__Base/00000 GamePlay__Base.rb (PSDK) | ligne 153 main

[8] : tools/GameLoader/Z_main.rb (PSDK) | ligne 17 <top (required)>

[7] : tools/GameLoader/3_load_extensions.rb (PSDK) | ligne 51 rgss_main

[6] : tools/GameLoader/50_load_game_uncompiled.rb (PSDK) | ligne 32 <top (required)>

[5] : ScriptLoad.rb (PSDK) | ligne 147 require

[4] : ScriptLoad.rb (PSDK) | ligne 147 load_tool

[3] : tools/GameLoader/Z_load_uncompiled.rb (PSDK) | ligne 14 <top (required)>

[2] : ScriptLoad.rb (PSDK) | ligne 147 require

[1] : ScriptLoad.rb (PSDK) | ligne 147 load_tool

[0] : Game.rb (RMXP) | ligne 8 <main>

===================================Fin du log===================================

1 Answer

0 like 0 dislike
by (14.8k points)
Have you edited the core PSDK scripts?
by (120 points)
edited by
Not anything other than the mining game script

def mining_game(param = nil, music_filename = GamePlay::MiningGame::DEFAULT_MUSIC, delete_after: true)
    message_id = $game_map.events[@event_id].event.name.downcase.include?('miningrock') ? 2 : 0
    if PFM.game_state.bag.contain_item?(:explorer_kit)
      if yes_no_choice(ext_text(9005, message_id))
        $game_system.bgm_memorize
        $game_system.bgm_fade(0.2)
        $scene.call_scene(GamePlay::MiningGame, param, music_filename, fade_out_params: [:mining_game, 0])
        $game_system.bgm_restore
        @wait_count = 2
        delete_this_event_forever if delete_after
        set_self_switch(true, "A", @event_id, @map_id)  #here
      end
    else
      message(ext_text(9005, message_id + 1))
    end
  end
by (17.1k points)
Can you try to change delete_after: true to delete_after: false in the parameters of the method? I'm mostly sure it is the problem. But in any case, your change will always crash in the case you ask the event to be deleted forever.
by (120 points)
Its still crashing. Idk why studio changed it but before it was working fine.
by (28.0k points)
Your log is wrong. It states .25.16, you should be on .26.0 while using studio.

If you use git, you forgot to watch our tutorials. Please watch them carefully.
by (14.8k points)
Plus, you have to create a script in the Scripts folder, and NEVER edit the PSDK core ones.
...