#Is this safe to use?

46 messages · Page 1 of 1 (latest)

magic jacinth
#

to use them like:

if i = T,

if i = F,

if not i = F

small wagon
# magic jacinth

The only thing that makes it unsafe, is if you happen to try and use them as normal keywords (like variables)

#

Which sure, you might never do that

#

But if you happen to use a library or other kind of resource that does, that has a chance of affecting those in drastic ways

small wagon
#
for(var T = 0; T < 10; ++T) {
  show_debug_message(T);
}
// Or
self.T = 32;
// Or
inst.T = 32;
// Or
with(inst) {
  T = 32;
}
#

Macros will automatically replace keywords, even variables accessed via the dot operator, as the macro equivalent

magic jacinth
#

so i simply won't be able to declare a variable with this name?

small wagon
#

Sort of yeah

#

2024.14 and whatnot should be more acceptable in those cases as they will treat the normally restricted keywords "as is" in those versions.

#

So the macros would just replace them as self.true/ var true = 0;/inst.true = 32;

#

The only one which might not work is the implicit self true (since it'll just be a constant at that point)

#

But I'm also saying this because even if you avoid it, it doesn't mean everyone else is in their own code

#

And if you happen to take in a resource that does use T or F as variables, you may get a conflict, or an unexpected crash

magic jacinth
#

oh

small wagon
#

This is pretty much the same case if you were to name an asset T or F

#

It's a constant namespace conflict

magic jacinth
#

so You're saying that if I declare a macro in an object, it'll be accessible everywhere?

small wagon
#

That is correct

#

Macros are find + replace global

#

Every single instance and script will have access to the same macro

#

Because it'll just find + replace it

magic jacinth
#

okay I get it now

#

thank You Tabby Fax

small wagon
#

If you want them locally or just temporarily, I would do var T = true and var F = false

#

(Though imo I don't like shortening those keywords)

magic jacinth
#

that's a personal choice yeah

small wagon
#

Yeah haha

magic jacinth
#

not sure what Your nickname is similar to... j_BATMAN_hmm

small wagon
#

I am the one and only

#

I made Overtale and Nablarune

#

I don't know who you are talking about

magic jacinth
#

I knew that You're the creator of Life by Glamour

#

cool song

small wagon
#

Yup that's me

#

I'm glad someone recognises me for who I am and not for some other person who doesn't exist

magic jacinth
#

good

#

I made a death by glamour song for a fangame that other people make and they said that they didn't need it bruh

small wagon
#

Wow 😔

#

Well you know what, they don't deserve your masterpieces!

magic jacinth
#

Idc bout them actually, it'll stay for my portfolio

small wagon
#

Heck yeah sunglasses

#

That's the spirit

magic jacinth
#

okay thank yew

small wagon
#

No worries, happy gamedeving!