Charas-Project

Game Creation => Requests => RPG Maker Programming => Topic started by: Meiscool on August 04, 2012, 11:31:18 PM

Title: Can someone explain the Modulus option for me?
Post by: Meiscool on August 04, 2012, 11:31:18 PM
RPGM 2003. I tried reading up on what modulus mathematics are on wikipedia, but that kind of confused me even more than I already was about it. If someone could give me a simple explanation on how it would work in relation to variables, I would appreciate it.
Title: Re: Can someone explain the Modulus option for me?
Post by: greenraven on August 04, 2012, 11:40:20 PM
I can give you the definition of the word, but I'm not entirely sure what you are talking about.

Can you explain what you're trying to do? (What event you're trying to created?) :)
Title: Re: Can someone explain the Modulus option for me?
Post by: Meiscool on August 04, 2012, 11:44:18 PM
Nothing particular, just trying to see what it does so that I can utilize it if required.
Title: Re: Can someone explain the Modulus option for me?
Post by: fruckert on August 05, 2012, 12:14:12 AM
Mod is apparently usually used to find if a number is a multiple of another.
It's mostly described as "remainder of division", but I don't understand how the actual math behind it works.
Ed: http://en.wikipedia.org/wiki/Modulo_operation (http://en.wikipedia.org/wiki/Modulo_operation)
Title: Re: Can someone explain the Modulus option for me?
Post by: fruckert on August 05, 2012, 12:27:51 AM
The "absolute value" thing in computing is called "Abs", a totally different thing.
I know I'm right on this, because every programming language I've seen has called this specific thing Modulus.
Title: Re: Can someone explain the Modulus option for me?
Post by: Meiscool on August 05, 2012, 12:35:48 AM
Yeah, I think fruckert is on the right track here. Still don't know how it is usable though.
Title: Re: Can someone explain the Modulus option for me?
Post by: fruckert on August 05, 2012, 01:36:28 AM
The results of Modulo are very random if you don't know how it works.
Abs just returns the absolute value of a number.
It might be that, considering how many different moduli there are, but y'know.
Title: Re: Can someone explain the Modulus option for me?
Post by: fruckert on August 05, 2012, 01:43:57 AM
It's what I said, then.
Try 12 mod 48.
It should equal 12.
Title: Re: Can someone explain the Modulus option for me?
Post by: fruckert on August 05, 2012, 01:55:34 AM
^ what he said
Title: Re: Can someone explain the Modulus option for me?
Post by: Meiscool on August 05, 2012, 03:24:43 AM
Ah. That will help a lot for collision detection with pixel movement and trig equations. Glad I asked.
Title: Re: Can someone explain the Modulus option for me?
Post by: fruckert on August 05, 2012, 03:36:22 AM
For the record, the math behind it is a - ( n * round( a / n ) )
Title: Re: Can someone explain the Modulus option for me?
Post by: Archem on August 05, 2012, 06:14:02 AM
God, it's like a nerd convention up in here.
Title: Re: Can someone explain the Modulus option for me?
Post by: fruckert on August 05, 2012, 06:22:59 AM
Figuring it out gave me a geekasm.

Granted, it's useless for what I'm working on right now, but the knowledge is very helpful for the future.
Title: Re: Can someone explain the Modulus option for me?
Post by: Archem on August 05, 2012, 06:29:33 AM
Do you mean "geekgasm", or perhaps the more common "nerdgasm"?

This comment gives me a grammar-boner.
Title: Re: Can someone explain the Modulus option for me?
Post by: fruckert on August 05, 2012, 06:33:54 AM
Nope.
Geek-gasm.

Nerdgasm is, in my personal definition, gasm'ing over some sort of fiction.
Geekgasm is gasm'ing over technical ****.
I may have that backwards from normal, but that's what I usually define as the difference between nerds and geeks.
Title: Re: Can someone explain the Modulus option for me?
Post by: Prpl_Mage on August 05, 2012, 06:55:53 AM
Hey I'm glad you guys managed to figure this out without me. Saw the title and started to scroll through some of my notes about this ready to write this big fancy reply on it.
Title: Re: Can someone explain the Modulus option for me?
Post by: A Forgotten Legend on August 05, 2012, 03:05:07 PM
I remember using Mod a lot in Day/Night events and when separating numbers for pictures.  I haven't used it in a while so I don't remember its other uses.
Title: Re: Can someone explain the Modulus option for me?
Post by: Archem on August 05, 2012, 07:51:20 PM
Nope.
Geek-gasm.

Nerdgasm is, in my personal definition, gasm'ing over some sort of fiction.
Geekgasm is gasm'ing over technical ****.
I may have that backwards from normal, but that's what I usually define as the difference between nerds and geeks.
I suppose you have me there. In the world of internet-lingo, they're mostly interchangeable, but if we're here for semantics, you are correct.