Infinity MUGEN Team
IMT Main => M.U.G.E.N Help => Topic started by: A! on December 17, 2012, 06:01:13 PM
-
Not sure how to explain this...but i'm sure there's a simple answer to this which i cant figure out. I see people like Pots and Rajaa code there projectiles attacks in this way.
I'm using Rajaa's method for this, though my character only has 4 buttons. I'm wondering how to make this work for a 4 button character. I did remove the 2 but couldn't figure out how to end it.
[state 1000, Varset]
type = varset
trigger1 = !time
var(10) = ifelse(command="QCF_x",0,ifelse(command="QCF_y",1,2))
[state 1090,Velset]
type = velset
trigger1 = !time
x = (3.5*(var(10)=0))+(6.5*(var(10)=1))
y = 0
If you didn't understand anything just ask.
-
Change the ifelse statement
var(10) = ifelse(command = "QCF_x", 0,1)
That's it. You only need the 0 and 1 values. Without the 2 part of the equation nothing will happen in the velset. For the hell of it, let's assume you have used QCF+y and we apply it to the velset
(3.5*(var(10)=0))+(6.5*(var(10)=1))
Becomes
(3.5*(0))+(6.5*(1))
Becomes
(0)+(6.5)
Becomes
6.5
If it was set to 0, the 6.5 would multply by 0, and you would get a vel of 3.5. Anyway, alter the ifelse in the varset and you'll get the result you want.
-
Thanks Cyanide, I'll try it out later.
-
That velSet can be simplified to:
[state 1090,Velset]
type = velset
trigger1 = !time
x = 3.5*(3*var(10))
or
[state 1090,Velset]
type = velset
trigger1 = !time
x = ifElse(Var(10),6.5,3.5)
Also, since you're coding a projectile, I beg you not to use Phantom.of.the.Server's projectile code. It's flawed and it requires a lot of stupid workarounds in order to properly interact with them.
You can do this by having the hitdef interact ONLY with the opponent (hitflag = MAF), and then using a projectile SCTRL to cancel out other projectiles. You can look at Vans's Robert to see what I mean here.