YoYoGames / GMEXT-FMOD

Repository for GameMaker's FMOD Extension
Apache License 2.0
52 stars 2 forks source link

game_restart() error #12

Closed searoopy closed 1 month ago

searoopy commented 1 month ago

Description

var _num_drivers = fmod_system_get_record_num_drivers()

Calling fmod_system_get_record_number_drivers after game_restart() always results in undefined

error code----- ERROR in action number 1 of Create Event for object o_home_recorder2: Variable .num_drivers(102953, -2147483648) cannot be resolved. at gml_Object_o_home_recorder2_Create_0 (line 22) - if (_num_drivers.num_drivers == 0) ############################################################################################ gml_Object_o_home_recorder2_Create_0 (line 22)

image

Expected Change

No response

Steps To Reproduce

  1. Start GameMaker
  2. fmod_system_get_record_num_drivers() call
  3. game_restart() call
  4. See the issue

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

Monthly

Which platform(s) are you seeing the problem on?

Windows

Compiler Log File

Sample .yyz File

jzavala-YYG commented 1 month ago

Hi @searoopy

Personally I don't recommend use _gamerestart().

You can still using Fmod and game_restart() using the next code: (if you are using Fmod Studio you should include a equivalent code)

show_debug_message("FMOD CLOSE")
fmod_system_close(fmod_main_system)
show_debug_message(fmod_last_result())

show_debug_message("FMOD RELEASE")
fmod_system_release(fmod_main_system)
show_debug_message(fmod_last_result())

game_restart()

Regards