GML Replacing loop names with jojo memes?

XirmiX

Member
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
 

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