Skip to main content

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

Constructors with inheritance: Expected a statement, got ident

A topic by Terry DuBois created 18 hours ago Views: 16 Replies: 1
Viewing posts 1 to 2

Hello! I'm trying to use GMLive on a constructor with inheritance, and I keep getting "Expected a statement, got ident"

Here is some test code:

function TestBase(_x) constructor {

    x = _x;

}

function TestDerived(_x, _y) : TestBase(_x) constructor { 

    if (live_call(_x, _y)) return live_result;

    y = _y;

}


When trying to update anything in TestDerived, I get:

[ERROR] Error in TestDerived:

[ERROR] TestDerived [line 2, col 45]: Expected a statement, got ident


Not sure if I'm doing something wrong here, but please let me know if you can!

Developer

That doesn’t work right now (technical complications), but you can call a live-coded function (located in a separate script) inside the constructor