Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Seems to be failing when trying to reload constructor usage with new

A topic by WanderlustInTheEnd created 10 days ago Views: 42 Replies: 2
Viewing posts 1 to 3
(1 edit)

I'm using code editor 2 and contructors, eg, new item(x, y, z) , and it fails saying   Expected a statement, got construct     I saw another post on here from very recently that I swear talked about the same thing in the google results preview but when I click it I can't find the post anywhere.. Maybe I'm missing something obvious. I did see that live_auto_nr was a thing but that's for the constructor decleration, not the usage else where but I have to assume this is a known and fixed issue already. Thanks for reading, and thanks for making gmlive <3

Developer

Sounds like you are doing just

new item(x, y, z);

without assigning it anywhere..?

I might not be handling this specific case so it’d have to be var temp = new item(...) or anything;

Yup that did seem to fix it, I'm calling the constructors with no assignment because i put all the things made in that way into one specific list so I just do it in the constructor and thus don't need to output them for anything, maybe I shouldn't do that but for now it seems fine... But yes, setting them to a dummy var fixes the crash. Cheers.