Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

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

How to get live_call() work in Script files

A topic by Stevie created Nov 08, 2022 Views: 243 Replies: 1
Viewing posts 1 to 2

As I'm tinkering with how to get my ideal workflow going, I plan on using a number of Script functions (either single or multiple in one file) and I was wondering how to get ` if (live_call()) return live_result;` to work?

I created a script called `PlayerAnimateSprite` with the code:

if (live_call()) return live_result;
function PlayerAnimateSprite( ){
    show_debug_message("animate a sprite sample text");
}

Yet when I update the code in this file, I'm getting this warning:

Warning: live_call outside of named scope in `C:/Users/Username/Desktop/Game Dev/GameMaker/ActionRPG/scripts/PlayerAnimateSprite/PlayerAnimateSprite.gml` [L1,c6]

Is there a clever way to get this to work the way other live_call() spots work?

Thanks!

Developer

You’re supposed to put it inside the function, not outside.