- Spoiler:
- Copy-pasted because im a lazy fucker.
AI Programming Tutorial
========================
Author: FlowaGirl
flowergirl@cutey.com
http://blargh.i-xcell.com
---------------------------------------------------------------------------
Programming a character's custom AI is something extra; It's not needed in any
character, but most people seem to want to do it anyway, whether it is to kick
another character's arse, increase the gameplay of the character, or just for
watch mode.
---------------------------------------------------------------------------
When programming an AI, it is recommended that you have completed most of
the character. It will makes things easier, so you won't have to go back and change
anything in the script if you decide to add in more stuff.
Think about the moves for your character; How you want it to use a projectile,
when to guard, and when to attempt to throw the opponent? It's up to you. A well
planned AI is important, as poorly made AI's can end up extremely glitchy.
This example shows how your character will attempt to throw the opponent, only
when it is close to the opponent, and when the opponent is on the floor. I choose
to do the AI programming under StateDef -3, but this can be done under StateDef -2, or
even StateDef -1 of the CMD file.
[State -3: ChangeState]
type = ChangeState
trigger1 = (Var(0) > 0)
trigger1 = (Random <= 499)
trigger1 = (StateType != A) && (Ctrl)
trigger1 = (P2BodyDist X <= 40) && (P2StateType = S)
value = ****
The 1st trigger, "(Var(0) > 0)" means that the move can only be read by the AI.
Remember, the AI Activation sets the value of Var(0) to 1.
2nd trigger, "(Random <= 499)" means that the AI will make an attempt to throw the
opponent, but only half the time. This should be used, so your character
is not too predictable.
3rd trigger, is simply used, so that the character can only make the throw attempt
when he is on the ground, (StateType != A) and is able to do so. (Ctrl)
Finally, the 4th trigger, "(P2BodyDist X <= 40) && (P2StateType = S)" means that
the character will throw the opponent, only when the opponent is close, (P2BodyDist X <= 40)
and when the opponent is on the ground as well. (P2StateType = S)
Given this idea as how it is done, you can come up with your own character AI's.