How do variables work

Started by ArSoNiSt_JoE, October 29, 2007, 06:27:08 PM

Previous topic - Next topic

ArSoNiSt_JoE

I have been trying to make the AI for my character (Ken from Street Fighter II Turbo) a little more competitive. I am not quite clear on how variables work :-\. Can someone at least eplain how variables work so I can make a proper AI for my character? :)
Mugen's greatest creator, Street fighter's greatest character, my greatness is UNLIMITED!!

aokmaniac13

Variables store numbers, and that's it.

Coding AI (Aside from AI detection) has very little to do with manipulating variables, and a whole lot to do with "when should I use this move?"

Here's a simple way to get started:
Find Winane's AI activation code, and follow the directions on how to add it in the readme.
Suppose you have a hadouken type move, you might have something like this

[State -1, Hadouken AI]
type = changestate
value = HADOUKEN STATE
triggerall = var(1)   ;Or whatever variable will tell whether or not the character is AI controlled
triggerall = ctrl  ; Typical trigger
trigger1 = statetype = S ; typical trigger
trigger1 = p2dist x > 150  ; Don't want to be too close
trigger1 = p2state != A ; Make sure they're not jumping
trigger1 = random = [0, 500] ; Add some randomness to this move

That's all there is to it.  When programming an AI, you're telling the character how to respond to certain situations, the usage of variables is not crucial here.

Liquid27

#2
Ok, so how do you plant the variables on characters based on the situation?

Nevermind, read....

http://mugenguild.com/forumx/index.php?topic=16797.0