Skip to main content

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

Live Re-load variable definitions?

A topic by LionArc created Oct 06, 2023 Views: 161 Replies: 2
Viewing posts 1 to 2

Hi,  I just started using GMLive today and enjoying it so far.

Short of using live room functions and changing instance variables, is it possible to live-re-load variable definitions of objects? (the variables created in the object "Variable Definitions" section, not in create code or otherwise.)

I have several object stats set this way throughout my project, and am curious if there's a way to change them during runtime using GMLive.

I suppose I could just execute a block of live code while the game is running to change those variables, but really only works for testing a change, not applying a change. 

Just curious what workflow you might recommend! Thanks

Developer(+1)

Variable definitions form a hidden “PreCreate” event - even though it exists in some code-like form at some point during compilation, GameMaker doesn’t really let you anywhere near it, less so break out of it (which you kind of have to with if live_call() return live_result).

For purposes of playing around with variables, the common way is to have a live-coded Step event where you change those and move the values to their original spots after you’re done.

(+1)

okay, sounds good. Thanks for your help!