# time% wont work unless it equals 0? (Read 1711 times)

Started by supercain, January 26, 2021, 05:33:59 PM

#### supercain

##### time% wont work unless it equals 0?
#1  January 26, 2021, 05:33:59 PM
Hi,

I have this explod:

Code:
`[State 90]type = explodtrigger1 = time%3 = 0trigger1 = numexplod(4439) < 10anim = F69removetime = -1postype = p1pos = 0+random%70,0+random%10ID = 4439`

this works fine because it produces multiple instances of the same explod at different positions at once. Except that I need it to appear after 230 ticks so I changed the first line to this time%3 = 230 and now NOTHING happens. As a matter of fact it will only work with values from 0 to 2 but nothing bigger. Why is that?

Thank you.
Last Edit: January 26, 2021, 06:21:55 PM by supercain

#### XGargoyle

##### Re: time% wont work unless it equals 0?
#2  January 26, 2021, 07:40:30 PM
• Hedgehog Whisperer
• Red Bull addict
That's because you don't know mathematics.

%3 means modulus of 3, so the only possible results are 0,1 and 2

For example, %5 will give you possible results of 0,1,2,3 and 4

If you want something to trigger on time 230, you'll need to use time=230 instead
 XGargoyle: Battle posing since 1979http://xgargoyle.mgbr.nethttp://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that linkhttp://paypal.me/XGargoyle  <-- Donations welcome!

#### supercain

##### Re: time% wont work unless it equals 0?
#3  January 27, 2021, 02:03:08 AM
time=230 is exactly what Im using from the beginning, genius...

#### DarkWolf13

##### Re: time% wont work unless it equals 0?
#4  January 27, 2021, 02:55:07 AM
• Vs Style Debuts Tag Project CEO
• The Dark Wolf Returns
time%230=0 also works
Beware the Dark Wolf once more!

#### Cyanide

##### Re: time% wont work unless it equals 0?
#5  January 27, 2021, 05:40:55 AM
• Legendary XIII
• I am the eye of the storm to come!
Insults are not necessary and a really good way to stop people helping you.

Trigger1 = time > 230
Trigger1 = time%3 = 0

In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

#### supercain

##### Re: time% wont work unless it equals 0?
#6  January 27, 2021, 07:13:44 AM
He insulted me first. Sentences beginning with "You dont know" something are offensive. Besides his answer was not helpful at all. But thank you 2 for your replies. I think I got it now.

#### airforce111

##### Re: time% wont work unless it equals 0?
#7  January 27, 2021, 08:38:27 AM
agree, saying "That's because you don't know mathematics" is unecessary, literally the rest of the comment besides that would've done fine.

#### XGargoyle

##### Re: time% wont work unless it equals 0?
#8  January 27, 2021, 10:08:39 AM
• Hedgehog Whisperer
• Red Bull addict
How is an insult when you didn't know what is a modulus function?
 XGargoyle: Battle posing since 1979http://xgargoyle.mgbr.nethttp://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that linkhttp://paypal.me/XGargoyle  <-- Donations welcome!

#### supercain

##### Re: time% wont work unless it equals 0?
#9  January 27, 2021, 05:01:01 PM
Do I have to spell it out for you? You dont say people things like "you dont know this". Its rude whether its true or not.

Besides guess what? You gave A WRONG ANSWER. So you dont know mathematics as much as you think you do...

#### XGargoyle

##### Re: time% wont work unless it equals 0?
#10  January 27, 2021, 06:43:23 PM
• Hedgehog Whisperer
• Red Bull addict
1) If you don't know the modulus function in mathematics, then it's not an insult to say "you don't know mathematics" because modulus is taught to 8 years old kids. Your question was as if you asked "why am I getting an error when I put 2+2=5?"

2) I didn't give you the answer to your problem, I gave you an explanation on how the modulus function worked

3) "If you want something to trigger on time 230, you'll need to use time=230 instead", this is a true fact and in no way a wrong answer. From there, you are supposed to extrapolate that you can also use time<230 or time>230 depending on your needs. Again, Mathematics 101

4) How were you supposed to learn something if I had given you the direct copy&paste code?
So, apologies if I wanted to get you into learning and understanding the root problem you had in your code.

5) So, you think I'm bad at mathematics? Fine if you do, I don't care. My works and creations tell otherwise, as well as my multiple COTM and COTY awards
 XGargoyle: Battle posing since 1979http://xgargoyle.mgbr.nethttp://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that linkhttp://paypal.me/XGargoyle  <-- Donations welcome!

#### 2OS

##### Re: time% wont work unless it equals 0?
#11  January 27, 2021, 07:00:20 PM
• 608 Wannabe
• Ich schicke dich zur HOELLE!! STIRB DU FEIGLING!!
That's because you don't know mathematics.

i wouldn't particularly say that this is provocative but it's not exactly hard to see how someone would take it that way.

%3 means modulus of 3, so the only possible results are 0,1 and 2

For example, %5 will give you possible results of 0,1,2,3 and 4

this is the explanation to your thread title.

while it's most common for the value of an expression that uses modulus to equal 0 you can use any value that's lower than the number you define (the reason it's lower than and not equal to is because "0 is 1 and 1 is 2 etc").

(gametime%400)<200

this for example would play for the first half of every 400 game ticks.

#### Odb718

##### Re: time% wont work unless it equals 0?
#12  January 28, 2021, 03:55:17 AM
• Shame on you!
trigger1 = time%3 = 0
time=230 is exactly what Im using from the beginning, genius...
These two things are not the same.
If XGargoyle had said
That's because you don't know THE mathematics.
the slight dig would have been even less.

With that said, you two are now friends. Right? We try to play nice in here, and beat each-other up in game.

The modulus function can be a little tricky to sort out. I try not to use it as often as I can. You should be able to get the same results using other triggers. Cyanide's response should be everything you need. If it's still not perfect, just ask.
vVv Mauru Mauru Released vVv

#### supercain

##### Re: time% wont work unless it equals 0?
#13  January 28, 2021, 06:29:11 PM
XGargoyle you were rude and you made a MISTAKE and thats final. Just be a man and accept it. If you talk to people like that all the time you are going to get a lot of trouble.

Thats my advice so take it or leave it.