Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Macro Not Working On Functions

A topic by Posho created Sep 25, 2021 Views: 276 Replies: 1
Viewing posts 1 to 2
(1 edit)

Hello,

First of all, thank you very much for this tool! I’m really juicing the most of it 🙂. So far I’ve gotten live events and rooms to work. With events I just put a macro LIVE at the very beginning of an event:

#macro LIVE     if (live_call()) return live_result;

However, when I use it on a function it simply doesn’t work. To test it out, I made a simple GML function inside a Script file “func.gml”.

function func() {
    LIVE
    show_debug_message("Change Me!");
}

This is what appears on the GMLive log:

[[01eb62e6|127.0.0.1:60499]] updating...Couldn't find func in `[project_dir]/scripts/func/func.gml`

But doing this instead works:

function func() {
    if (live_call()) return live_result;
    show_debug_message("Change Me!");
}

This isn’t exactly the worst thing ever, but I’m starting to get annoyed by it. Do you know why this may be happening? 🤔

Developer (1 edit)

Shouldn’t break, but it’s worth mentioning that you’ll generally have to run the actual live_call due to having to pass function arguments into it.

Setting up live_call as a snippet can help.