Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

Livecoding for GameMaker: Studio / GameMaker Studio 2 · By YellowAfterlife

[Fixed in 1.0.54+] "instance_count" causing the game to freeze

A topic by K.Blank created Aug 17, 2021 Views: 205 Replies: 2
Viewing posts 1 to 2
(2 edits)

Whenever i refer the variable "instance_count" within a live code, the game freezes.

Sometimes no errors thrown at all, sometime it shows "DoAdd :2: Malformed variable"

Tested on multiple projects, occurs everytime.

Developer

It would seem like this variable also cannot be read with variable_ functions, and not just that, but it’s also falsely flagged as an instance variable in fnames file, which caused my existing workaround generator to not make a function for it

object_index*@
id*@
solid@
persistent@
mask_index@
instance_count*@
instance_id*@
instance_find(obj,n)
instance_exists(obj)

A workaround would be to do

gml_var_add("instance_count*", function(l_set, l_val) {
		return instance_count;
});

on game start.

Got it. thanks for the quick reply!