[Solved] Code for "and"

0 Members and 1 Guest are viewing this topic.

*
The Hero of Rhyme
Rep:
Level 82
( ͡° ͜ʖ ͡°)
2014 Best RPG Maker User - StoryProject of the Year 20142014 Queen of RMRK2011 Best Newbie2014 Best RPG Maker User - Creativity2014 Kindest Member2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
Hopefully this is a quick question. ;9

I know that || is "and/or", but is there a way to just say "and" in RGSS3?




I want to use script calls to combine and simplify the conditional branches for my time events, like so:

$game_variables[12] == 8 || $game_variables[11] >= 30 || $game_variables[11] <= 40

Variable 12 = Hour and Variable 11 = Minute. So, the condition is supposed to occur between 8:30 and 8:40. The only thing not working about that is the || means "and/or" and runs the events even when all three aren't met. ;9
« Last Edit: September 06, 2015, 05:21:51 PM by yuyu! »
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
Rep:
Level 102
2014 Best Non-RM Creator2014 Biggest Forum Potato2014 Biggest Narcissist Award2013 Best IRC Chatterbox2013 Best Game Creator (Non-RM)Participant - GIAW 112012 Best Use Of Avatar and Signature space2012 Funniest Member2012 Most Successful Troll2012 Best IRC ChatterboxSecret Santa 2012 ParticipantProject of the Month winner for November 2009For being a noted contributor to the RMRK Wiki2010 Best IRC Chatterbox2010 Biggest Forum Couch Potato2010 Most Successful Troll

*
The Hero of Rhyme
Rep:
Level 82
( ͡° ͜ʖ ͡°)
2014 Best RPG Maker User - StoryProject of the Year 20142014 Queen of RMRK2011 Best Newbie2014 Best RPG Maker User - Creativity2014 Kindest Member2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
Ahhhh! That's perfect, thank you!! :gracie:

I tried "&" to no avail. Didn't think about "&&". ;o
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
Rep:
Level 102
2014 Best Non-RM Creator2014 Biggest Forum Potato2014 Biggest Narcissist Award2013 Best IRC Chatterbox2013 Best Game Creator (Non-RM)Participant - GIAW 112012 Best Use Of Avatar and Signature space2012 Funniest Member2012 Most Successful Troll2012 Best IRC ChatterboxSecret Santa 2012 ParticipantProject of the Month winner for November 2009For being a noted contributor to the RMRK Wiki2010 Best IRC Chatterbox2010 Biggest Forum Couch Potato2010 Most Successful Troll
Yeah it's doubled like == and || (though I never understood why > and < are single characters)

*
A-pow 2015
Rep:
Level 80
2014 Best RPG Maker User - GraphicsFor frequently finding and reporting spam and spam bots2013 Most Unsung MemberSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.a^2 + b^2 = c^2How can I help you? :DSecret Santa 2012 ParticipantSilver - GIAW 10Silver - GIAW 9Bronze - GIAW HalloweenGold - Game In A Week VII
They're doubled because single equal signs are usually used to assign variables. The other singular signs most likely have different uses as well.
In C and C++, << and >> are used as bit shifts. I don't know if it's a common thing in other languages. It seems like bitwise operations are more on the extreme technical side of things.
« Last Edit: September 06, 2015, 05:58:01 PM by Acolyte »

*
The Hero of Rhyme
Rep:
Level 82
( ͡° ͜ʖ ͡°)
2014 Best RPG Maker User - StoryProject of the Year 20142014 Queen of RMRK2011 Best Newbie2014 Best RPG Maker User - Creativity2014 Kindest Member2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
Yeah it's doubled like == and || (though I never understood why > and < are single characters)

Ohhh, duh! I can't believe I missed that! :sadmoonfacefromthatthreadss:

In C and C++, << and >> are used as bit shifts. I don't know if it's a common thing in other languages. It seems like bitwise operations are more on the extreme technical side of things.

That's right, I did notice that from my C++ class. :D I didn't know exactly what it meant until now, though.
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Zero to Hero2014 Best IRC Quote2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
you could also write 'and' if you're feeling boring

*
The Hero of Rhyme
Rep:
Level 82
( ͡° ͜ʖ ͡°)
2014 Best RPG Maker User - StoryProject of the Year 20142014 Queen of RMRK2011 Best Newbie2014 Best RPG Maker User - Creativity2014 Kindest Member2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
you could also write 'and' if you're feeling boring

huh? That's a thing? o.o

Just curious, but...does this mean there is also a code for just plain "or"?
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Zero to Hero2014 Best IRC Quote2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
there are some very slight differences, but yes. several english syntax words spill in to ruby syntax - 'if,' 'then,' 'wait,' 'end,' for example. conjunctions like 'and' and 'or' do exactly what you'd think. in some senses writing some lines of code can be like writing a sentence. don't expect the interpreter to understand the socio-political implications of your prose though.

*
( ´ิ(ꈊ) ´ิ) ((≡^⚲͜^≡)) (ી(΄◞ิ౪◟ิ‵)ʃ)
Rep:
Level 102
(っ˘ڡ˘ς) ʕ•̼͛͡•ʕ-̺͛͡•ʔ•̮͛͡•ʔ (*ꆤ.̫ꆤ*)
2014 Avast Ye Merry Pirate!2013 Avast Ye Merry Pirate Award2012 Avast Ye Merry Pirate AwardFor frequently finding and reporting spam and spam bots2011 Avast Ye Merry Pirate2011 Most Unsung Member2010 Avast Ye Merry Pirate Award

bringing sexy back

*
The Hero of Rhyme
Rep:
Level 82
( ͡° ͜ʖ ͡°)
2014 Best RPG Maker User - StoryProject of the Year 20142014 Queen of RMRK2011 Best Newbie2014 Best RPG Maker User - Creativity2014 Kindest Member2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
Oh, neat! I tried "or" and it works. :-) Pretty rad!
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]