Ender570

Villager
Member
Joined
Jan 24, 2021
Messages
16
Reaction score
4
First Language
English
Primarily Uses
RMMZ
I'm trying to do a conditional branch to determine the amount of days in that month

I have my game variables set as:
0001 Day of Week
0002 Week (number of weeks passed)
0003 Month
0004 Day of Month

0003 ranges from 1-12
I know months 1, 3, 5, 7, 8, 10, and 12 have 31 Days
Month 2 has 28
Everything else has 30

So i first wanted to set conditions for the months with 31 days

I thought that
if $gameVariables.value(0003) == [1,3,5,7,8,10,12]

would mean "If the value of variable 0003 is equal to one of these numbers..."
but, I'm not getting that result

I'm very new to java script, so any help would be appreciated!
 

TSR

The Northern Frog
Regular
Joined
Nov 14, 2019
Messages
538
Reaction score
991
First Language
French (Canada)
Primarily Uses
RMMZ
Hello! Try to write it like this:
const ar = [1,3,5,7,8,10,12];
if (ar.includes($gameVariables.value(3))) {...}
 

Ender570

Villager
Member
Joined
Jan 24, 2021
Messages
16
Reaction score
4
First Language
English
Primarily Uses
RMMZ
Hello! Try to write it like this:
const ar = [1,3,5,7,8,10,12];
if (ar.includes($gameVariables.value(3))) {...}
Awesome! Thank you!
I actually tried to use the includes() function before, but i did it wrong lol
 
  • Like
Reactions: TSR

Latest Threads

Latest Posts

Latest Profile Posts

Man, the game jam seems like fun, but also I've already been putting off working on my bigger project, and I have an artist alley to prep for by March, which may as well be tomorrow with mail times... and I have my actual job, ugh.
Twitch! At it with some game development for a short while! Feel free to drop by~
I figured since I've been using MZ for a year now I should update my primary uses finally. Doubt I will use ACE again unless it is to finish up a couple small ACE projects I still got going.
image.png

work in progress

Found some images of the original production drawings from the 1995 GitS movie.
The style I always aimed for but was never able to reach - until now xD
But now I have to rework all the character art.
Again...
Life is easier with cheeseburgers. And beer battered fries. I don't want to cook tonight, but if I'm going to, I'm going to eat like a junk food king!

Forum statistics

Threads
136,587
Messages
1,267,873
Members
180,277
Latest member
Puzzlecube
Top