YesNoOk
avatar

Can i create a trigger that detects when a value is odd or even? (Read 755 times)

Started by DonuTs, December 29, 2008, 11:34:42 am
Share this topic:
Can i create a trigger that detects when a value is odd or even?
#1  December 29, 2008, 11:34:42 am
  • avatar
  • ***
never heard of it being done, is it possible? would save me a lot of triggers and text. thanks for any tips.
Re: Can i create a trigger that detects when a value is odd or even?
#2  December 29, 2008, 11:43:55 am
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
well, there is a way using a variable.have variable set to as many even number you want, then set one to as many odd numbers you will use, then trigger using the variable. or maybe you could use time% ? i'm not really sure, never really tried this out, what do you need this effect for?
Re: Can i create a trigger that detects when a value is odd or even?
#3  December 29, 2008, 11:49:45 am
  • avatar
  • ***
some random back and forth movement it would save a lot of time triggers if i just had the capability to do this
Re: Can i create a trigger that detects when a value is odd or even?
#4  December 29, 2008, 12:01:21 pm
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
you mean, like dhalsims up and down floating motion, but on a horizontal axis?

Re: Can i create a trigger that detects when a value is odd or even?
#5  December 29, 2008, 12:11:43 pm
  • avatar
  • ***
indeed but more rapid so it gives a blur effect.

the way i got it now uses multiple time triggers which i dnt mind doing but if what im asking is possible i would like to know, it could be useful in other ways to me.
Re: Can i create a trigger that detects when a value is odd or even?
#6  December 29, 2008, 12:22:05 pm
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
you can use these triggers


cos , tan, sin

test them out, and see how they work. you can also look in my dhalsim win states for how i triggered it because it takes ome extra math to tame the speed of those. :P
Re: Can i create a trigger that detects when a value is odd or even?
#7  December 29, 2008, 12:39:26 pm
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
To answer the initial question, you should be able to use "number"%2.

%2 will give you the rest of the euclidian division of the "number" by 2.
So if the result of number%2 is 0, it means the number is even. If the result of number%2 is 1, it means the number is odd.
Re: Can i create a trigger that detects when a value is odd or even?
#8  December 29, 2008, 12:42:49 pm
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
that's an actual trigger? unmentioned i guess.  :P
Re: Can i create a trigger that detects when a value is odd or even?
#9  December 29, 2008, 12:49:04 pm
  • ******
  • Limited time to use Infinite power !
    • France
    • network.mugenguild.com/cybaster/
[mcode]
trigger1 = var(1)%2
[/mcode]
looks like a valid trigger to me. :P
Re: Can i create a trigger that detects when a value is odd or even?
#10  December 29, 2008, 12:54:29 pm
  • avatar
  • ***
[mcode]
trigger1 = var(1)%2
[/mcode]

so if var(1) = 10 then the value of that trigger will equal 0?
Re: Can i create a trigger that detects when a value is odd or even?
#11  December 29, 2008, 12:54:57 pm
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
oh, lol. excuse me while i bang my head against the wall. :gonkgoi:.
Last Edit: December 29, 2008, 01:12:06 pm by Rajaa
Re: Can i create a trigger that detects when a value is odd or even?
#12  December 29, 2008, 01:07:10 pm
  • avatar
  • ***
no i understand how it works now after reading the docs but the question is how to put this into use. from what im gathering this can only be useful to determine the value of a another var based on the current var im % and then using that var to create my randomnes.

for instance i set up var(1) to count up by 1 as time passes
then i set another var to change depending on tha value of var(1) such as this

[State 0, VarSet]
type = VarSet
trigger1 = time
v = 2
value = var(1)%2

that means as var 1 counts up it will constantly keep changing between 1 and 0

and if that is all correct then im over the moon. thanks Anger.

and it works hallelujah
Last Edit: December 29, 2008, 01:18:10 pm by Donuts
Re: Can i create a trigger that detects when a value is odd or even?
#13  December 29, 2008, 03:45:49 pm
  • ******
  • I'm a fuffy.
    • USA
    • www.trinitymugen.net
You could just use Time%2 and save a few vars.
Re: Can i create a trigger that detects when a value is odd or even?
#14  December 29, 2008, 04:32:18 pm
  • avatar
  • ***
Re: Can i create a trigger that detects when a value is odd or even?
#15  December 29, 2008, 04:43:08 pm
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
that's what i said first >:(

 j/k :)

BC

Re: Can i create a trigger that detects when a value is odd or even?
#16  December 29, 2008, 09:49:21 pm
  • ****
    • UK
    • www.mugenevolution.co.uk/Forum
sparkno = S799+(random%8)

pause = (gametime%2) 

trigger used often actually lol
click the image to join my forum ;)
Re: Can i create a trigger that detects when a value is odd or even?
#17  December 30, 2008, 03:37:32 am
  • avatar
  • ***
used often but i had no idea what it ever meant