Skip to main content

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

ENUMs

A topic by spidernest created Oct 15, 2019 Views: 442 Replies: 6
Viewing posts 1 to 3

Hey there! I was just wondering if anyone else has come into issues when using ENUMs at all? Any part I try to update that contains an enum field, I always get back an error along the lines of this: 

[live][1:52:26 PM] obj_profile:Draw_0[L8,c89] Enum `playerdatastorage` does not contain field `totalessence`

I generally will just comment out ENUM sections when use GMLive to layout UI stuff, and then just cut them back in when I know the layout is all good and I've shut off GMLive. I figured it may be worth a shot however to see if anyone else has had this issue. 

For the record as well - it isn't just that Enum value - it's pretty much any/all. And I can confirm that "playerdatastorage" does contain that field as well. 

Thanks very much - other than this minor issue this extension has been a major help!! 

Thanks again! 

Hi!

I don't have that probem, because I have all enums in separate script.

So, I dont scatter macros and enums all across the code, but keep them in two scripts "macros" and "enums".  I could also put them together in one script.

And you don't have to call those scripts anywhere, because enums and macros are set by a pre-processor.  When compiler kicks in, your macros and enums are already set.

If you reorganize your project like this, you won't have this issue.

Hope it helps.

Hi Drindilica - I actually have all my enums/macros declared in one init script called at the start of the project. I'm not setting enum in this case, I'm only trying to reference them :) 

Ah sorry!

Just to test it I put one usage of an enum value into one Draw event which has live_enabled. It works for me. I don't get any errors on saving the file:

I'm using the latest stable GMS2 IDE and the lastest runtime.  (2.2.4.459 / 2.2.4.366)

Yeah - it hasn't always been the case, I had it working just fine at the start, it's strange how it's started recently.

Although, my enum/macro init script is close to 900 lines now, as the project is very large. It shouldn't be the issue though - I'm trying to replicate with new project so I can establish more details around what could be causing it. 

Developer

Hello! I'll need a small sample project to reproduce this

No problem, - let me try and pull things out and see if I still have the issue in a new project and send it over. Thanks!