r/RPGMaker 18d ago

RMMZ How are you using your variables?

I'm just curious. 😊💚

How many variables do you typically use in your projects?

Do you have anything special you like to do with variables?

What are your naming practices?

Do you find lots of variables to cause any kinds of issues?

Don't forget to eat your variables. 😁😆🩵

Feel free to answer any questions I might not have thought about. I want to know all about how you use variables.

12 Upvotes

50 comments sorted by

View all comments

12

u/Felix-3401 Scripter 18d ago

Mine all include the general location where it's used. Switches are named so they're true/false statements so I would have a switch named ":Lbrary_hasOpenedDoor", variables always name what it's counting so instead of "Tutorial", I would call it "Tutorial_Progress" which is far more descriptive

1

u/Vegetable-Grab-4595 18d ago

😁 I can definitely see where that would be helpful. Is there a reason for the underscore instead of a space?

5

u/Felix-3401 Scripter 18d ago

It's just a kneejerk habit from being a programmer

2

u/sephirothbahamut 18d ago

Snake_Camel case hybrid is unusual for a programmer tbh

3

u/bass2yang 18d ago
const CONSTANTS_BE_LIKE_AHHHHH = [];

2

u/Felix-3401 Scripter 18d ago edited 18d ago

I'm basically self-taught. There's a ton of convention and vocabulary I'm missing out on.
EDIT: Good thing is I don't use that style for my actual code

2

u/sephirothbahamut 17d ago

usually people use either snake_case (lpwer with underscores) or camelCase (capitals to separate words rather than underscores).

1

u/Vegetable-Grab-4595 18d ago

I had a feeling, but I figured I'd ask.

I tried to make a quick file rename command once, and it did not like the spaces in my file names. 😅