Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMEdit

A high-end code editor for all things GameMaker · By YellowAfterlife

[Solved] #mfunc limitations

A topic by Dragonite created Sep 12, 2020 Views: 252 Replies: 2
Viewing posts 1 to 3

I’m trying to go all-out with macro function magic, and it seems that I’m not allowed to nest them inside each other.

The compile error is less than helpful but GameMaker seems to take issue with the fact that the second one effectively unwraps to some god-awful recursive monster that I’m not going to try to type out by hand.

I can work around this (going the long way around with some arrays should still be way faster than making them functions and calling them constantly), but it seems to be a limitation of the preprocessor, correct?

Developer

You are not going to be able to nest that specific case because your resulting statement contains

[x, y][0]

which is not only redundant code (you create an array and immediately discard it), but also not allowed - not even in 2.3

Sounds about right. Other scripting languages like js and ruby and python let you do that kind of thing, but since most of my vector functions expand to an array it would probably create more problems than it would solve here.