• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Replacing loop names with jojo memes?

X

XirmiX

Guest
Okay, this might seem really stupid, but I thought I'd ask anyway...

I thought it would be fun to just change the names of some loops just to make programming a game a little more fun for myself. You can create custom functions through scripts essentially and give them your own names, but is there some ways to do that for loops, like, instead of:
Code:
do{

}while([condition]);
I can insted use:
Code:
du{

}wang([condition]);
Or may be instead of:
Code:
try{

}
catch([condition]){

}
I could be:
Code:
wood{

}
stupid{

}
And though I haven't really used this one:
Code:
repeat([number]){

}
It could be:
Code:
reatard([number]){

}
Let me know if there's any way I could do this, thanks in advance!
 

Paskaler

Member
You can use macros since they are checked before compilation:

Capture.PNG

I replaced if with condition here. If you do it this way, forget about proper linting. You'll also want to disable line numbers, too, so GameMaker doesn't annoy you too much. For small games go for it. If you're experienced enough the errors you get will most likely be logical and not syntax related.

With line numbers on:
line_numbers.PNG
 
X

XirmiX

Guest
@Paskaler so, in other words, there's no way to do this as errors will appear because macros can't replace loop/statement names?
upload_2018-2-14_1-23-29.png
 

Paskaler

Member
I haven't actually tried doing this before. Your question made want to see if it could be done. I only tried replacing the if statement and I was on GM 1.4.1760.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
A code editor I made allows to do this kind of thing via #import preprocessor:
upload_2018-2-14_12-11-3.png
remapped identifiers are replaced with their original names upon saving, so this has no effect on what's actually to be compiled.
 
Top