Posted by WastedCoder
in How can I make a ground bounce? (Started by Rabano September 05, 2022, 01:30:42 am
Board: M.U.G.E.N Development Help
Board: M.U.G.E.N Development Help
You can try Seravy's AI guide or video tutorials on the AI that Beterhans from Beterwork channel did. To my mind they are pretty useful. Good luck.
I'll check it out. Thanks
HOWEVER
My other brain cell woke up and realized I had a stupid typo in the next move. I did a dumb, lol.
For anyone who reads this in the future: Remember to not only check your code line by line, but also double check your integers and operators.
Welp, SteelHammers, you solved my dang AI issues. Thanks much!
Backedgedist was indeed what you wanted. You may want to try with a lower value because 50 is still a bit far from the corner.
Sadly I don't think there's a way to find the actual corner of the stage instead of the corner of the screen, so you can exploit that combo in Simul if your partner is locking the camera. Not a big deal in my opinion.
I'm just going to chime in real quick comment.
From my experience, I occasionally ran into bugs when float and int values were not handled properly.
Velocity is a float, so you should always try to make the values express as floats.
ex: Vel y > -5.0
trigger1 = cond(enemynear, vel y < 0.0, (p2bodydist y = [-85,10]), (p2bodydist y = [-33,10]))
You probably don't have any bugs with your examples.
There's just certain combinations of triggers/parameters that will not process correctly unless the values are expressed properly... and it will drive you insane trying to figure out what the heck is causing this bug?!
So, it's just a good habit to get into.
Yes. The operators works the same as one would expect in maths. So you are right in that y >-5 means -4,-3,-2,-1,0,1,2,etc..
Negative velocities are in the upward directions. Keep in mind though that velocity is a vector so, vel= -4 is greater than vel= -2 but numerically, -4 is less than -2. Operators such as < and > only look at the numeric value.
Also, You code looks like it's to intercept p2 while you are in the air regardless of whether p2 is on the ground or in the air. It's all good if that's what you want but you'll have to re-state the range if you want it to trigger only when p2 is exclusively in the air.
trigger1 = cond(enemynear, vel y < 0, (p2bodydist y = [-85,10]), (p2bodydist y = [-33,10]))
Vel y > -5mean -4, -3,-2 and so on, like in mathematics, or is it -6, -7, -8? It may sound like a stupid question, 'cause it is, but I wouldn't mind hearing the answer to that just to make sure.
That feeling when people make money off of your work while you yourself didn't. I guess some things never change.
What are the vels of your projectiles?
You should be able to just factor them together for a ratio… for instance if the vel is x=10 y=10 then you’ll want this to tigger when the enemy’s pos x/y = 1…. because regardless of their distance this ratio will be in target.
You could have a tolerance like enemy,pos x/enemy,pos y = [0.9,1.1] or something. I’m wayyy out of practice
Edit, another example… assuming a variation of your projectile has a velocity of x=10 y=3 (10/3=3.33)
triggerall=enemy,pos x/enemy,pos y = [3.0 , 3.6]
Maybe add something else along the lines of
trigger1= enemy,pos x/enemy,pos y >= 3.3
trigger1= enemy,vel x >= 0
trigger2= enemy,pos x/enemy,pos y < 3.3
trigger2= enemy,vel x < 0