Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

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

[Solved] Slightly ambiguous gmlive limitation documentation (it might be me!)

A topic by Synthasmagoria created Jun 12, 2020 Views: 416 Replies: 2
Viewing posts 1 to 3
(1 edit)

It says in the gmlive documentation that dynamic expressions in switch statements are iffy.
But, to me it was unclear to which degree this was the case. Quote from the documentation:

"Needless to say, that does get a little nastier with fall-through cases, and GMLive currently

may not agree to compile a "case" if it's expression cannot be computed compile-time (things like ord("A") are fine though)."

I wrote some code for a state machine-like object. A very simplified example of the code would be something like this:

Example code
I was going to add an actual enum to the game later to use in the switch statement but, first i did it like this for convenience's sake.
Subsequently, gmlive stops live-updating the script for this object. It doesn't crash, it doesn't give any warnings, the server clock is still ticking. The documentation doesn't mention this sort of behavior. It was first when I changed the code to use the enum instead of the temporary dynamic variables that I made the connection between what was stated in the manual and what had happened.

The working code looks kinda like this now:
example code 2

I saw someone who had made a thread here 18 days ago to write about how they were frustrated with gmlive not working for them. Seeing how they wrote about how they had followed each tutorial "to a T" got me to think that they may have tried to use gmlive in one of their already existing projects that may have code that runs into one of gmlive's slightly ambiguous limitations.
I think gmlive would benefit from having some sort of warning system for some of its limitations. This way it would be way clearer to me and other people when and where they might have screwed up.

Other than that I have greatly enjoyed my first week with gmlive and, I'm looking forward to be using it in future projects.
- Cheers
Developer

You should be getting a "compilation" error in your Output tab whenever you try to update a snippet that contains something that has an error. GameMaker does not support coloring in the output log, so I don't believe I could make it substantially more obvious.

This only happens if you are trying to live-update a snippet with such a construct - it would not error if it's just "somewhere".

The other person's issue for now remains a mystery - they are yet to reply (on discussions or via some other contact method) nor have requested a refund.

Wowie, can't believe I didn't see that. I was always looking at the server window, not the output log. Welp.
Alright, in that case it's all good.