YesNoOk
avatar

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

Started by supercain, January 26, 2021, 05:33:59 pm
Share this topic:
time% wont work unless it equals 0?
#1  January 26, 2021, 05:33:59 pm
  • avatar
  • **
    • Germany
Hi,

I have this explod:

Code:
[State 90]
type = explod
trigger1 = time%3 = 0
trigger1 = numexplod(4439) < 10
anim = F69
removetime = -1
postype = p1
pos = 0+random%70,0+random%10
ID = 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
Re: time% wont work unless it equals 0?
#2  January 26, 2021, 07:40:30 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
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 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: time% wont work unless it equals 0?
#3  January 27, 2021, 02:03:08 am
  • avatar
  • **
    • Germany
time=230 is exactly what Im using from the beginning, genius...
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
    • USA
time%230=0 also works
Beware the Dark Wolf once more!
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!
    • New Zealand
    • network.mugenguild.com/cyanide/
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.
Re: time% wont work unless it equals 0?
#6  January 27, 2021, 07:13:44 am
  • avatar
  • **
    • Germany
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.
Re: time% wont work unless it equals 0?
#7  January 27, 2021, 08:38:27 am
  • avatar
  • **
    • USA
agree, saying "That's because you don't know mathematics" is unecessary, literally the rest of the comment besides that would've done fine.
Re: time% wont work unless it equals 0?
#8  January 27, 2021, 10:08:39 am
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
How is an insult when you didn't know what is a modulus function?
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: time% wont work unless it equals 0?
#9  January 27, 2021, 05:01:01 pm
  • avatar
  • **
    • Germany
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...
Re: time% wont work unless it equals 0?
#10  January 27, 2021, 06:43:23 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
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 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://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!!
    • Egypt
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.
Re: time% wont work unless it equals 0?
#12  January 28, 2021, 03:55:17 am
  • *****
  • Shame on you!
    • USA
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 Ryuko718 Updated 10/31/22 vVv
Re: time% wont work unless it equals 0?
#13  January 28, 2021, 06:29:11 pm
  • avatar
  • **
    • Germany
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.