News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

AI Code moveguard

Started by The BajanFlash, May 29, 2009, 12:39:19 AM

Previous topic - Next topic

The BajanFlash

I'm still trying @ this AI patch for cvsguile. I want to execute state 300 ONLY IF his sonic boom hits the opponent from a certain range. Here's my code. Before I added "trigger1 != MoveGuarded", it worked, but also executed when state 1000 was guarded (not wise). So, what should i do?

[State -1]
type = ChangeState
value = 300
triggerall = var(59) = 1
triggerall = roundstate = 2
triggerall = statetype != A
triggerall = P2StateType != L
triggerall = P2StateType != A
triggerall = P2stateno != 5120
triggerall = P2stateno != 5201
trigger1 = StateNo = 1000
trigger1 != MoveGuarded ;The opponent didn't guard the attack.. well that's what i think
trigger1 = animtime = 0
trigger1 = P2bodydist X = [10,70]
        trigger1 = random <= 700 ;can someone explain the percentage
:Is the lower number has a more better chance of executing?
ignorehitpause = 0
Remember people
Yes! Life is unfair, people will cry you down
but don't ever give up, keep reaching for the stars
Doesn't matter whether you crawl, drag or limp to your goals
prove a dropout can beat a genius

Love and Peace

p.s 4M

Rajaa Retired

#1
Does that work? "trigger1 != moveguard"  ???

either way, it should be:

trigger1 = moveguarded = 0 or trigger1 = !moveguarded


random ranges from 0-999, I think; 1000 numbers.

random =< 700, means you have about a 70% of that move happening but it'll seem like more since it is in a negative statedef.

Cyanide

Rajaa: Sonic Boom = projectile.

Moveguarded isn't going to function cos it's not guile who's doing the hitting. You either need to check the existence of a helper, or the projectile depending which is used.

trigger1 = projguarded

or
trigger1 = numhelper(ID)  >= 1
trigger1 = helper(ID), moveguarded

Either of those will redirect to the thing that's doing the hitting.


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.

aokmaniac13

Noob translation:

The first one is if it's a normal projectile.
The second one is if it's a helper projectile.  And "ID" in parenthesis is supposed to be whatever the helper's ID is (in the attributes of the state controller)

The BajanFlash

Ok, kool, thanks alot

I think I understanding a little better
Remember people
Yes! Life is unfair, people will cry you down
but don't ever give up, keep reaching for the stars
Doesn't matter whether you crawl, drag or limp to your goals
prove a dropout can beat a genius

Love and Peace

p.s 4M