Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Direct references to specific instances break on reload

A topic by cookiedraggy created Dec 23, 2023 Views: 137 Replies: 1
Viewing posts 1 to 2

I am referencing specific named instances in code.

After I do some changes in the code and restart the game, the instances cannot be found anymore.

Error I get: [GMLive][23.12.2023 10:26:38][ERROR] Runtime error: [error] ref instance 103612 (obj_some_obj) does not have a variable `inst_cutscene_move_target`.

I reload the game via game_restart()

Developer

I would generally recommend against using game_restart - doing so does not properly clear most of the game state (like global variables, data structures, and so on), and can cause a wide variety of unwanted effects.

For GMLive in particular, this means that a new obj_gmlive is created and has to re-acquire code snippets from the server.