YesNoOk
avatar

AI Code Question (Read 229 times)

Started by MUGENforever, July 06, 2010, 07:32:10 am
Share this topic:
AI Code Question
#1  July 06, 2010, 07:32:10 am
  • avatar
  • ***
[State -1, Combo Two Hit Two]
type = Changestate
value = 230
triggerall = (var(59)=random%2+1) && (ctrl=0) && (P2life !=0)
trigger1 = (Stateno = 200) && (Movehit)

[State -1, Combo Two Hit Two]
type = Changestate
value = 230
triggerall = (var(59)=random%2+1) && (ctrl=0) && (P2life !=0)
trigger1 = (Stateno = 202) && (Movehit)

[State -1, Combo Two Hit Two]
type = Changestate
value = 230
triggerall = (var(59)=random%2+1) && (ctrl=0) && (P2life !=0)
trigger1 = (Stateno = 205) && (Movehit)

I can figure out what everything does except the part in red.


var(59) is the AI I know that.
Random% means to randomy select one I think.
Is the number 2 the number of states I have to activate my AI or the number of options the AI can choose from?
What's it exactly doing here?
The number +1 is just something that has to be there if I remember correctly.
Re: AI Code Question
#2  July 06, 2010, 08:53:07 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
That just reads

var(59) = 1
var(59) = 2

every second tick. Did you code that? Did someone else code that who wanted to turn their AI off every second tick? I don't understand the point. if your AI var is 59, it should be set to 1 to say it's on. If your AI has difficulty levels it should be set to a solid value. It shouldn't flick between 2 values pointlessly.

Also, you should be using AIlevel in 1.0 cos it's faster and more customisable.


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.
Re: AI Code Question
#3  July 06, 2010, 06:29:47 pm
  • avatar
  • ***
It was for an AI I coded a while back. I was using different States to allow my character to choose between different options in the same situation.
Re: AI Code Question
#4  July 07, 2010, 02:57:12 am
  • ****
    • www.justnopoint.com/Masters/
You could try doing the same thing you did but instead of using random%#, make a VarRandom with x amount of values for x amount of situations.
Re: AI Code Question
#5  July 07, 2010, 06:57:38 am
  • avatar
  • ***
I used a Random Trigger to make it vary on what attacks she chooses, it doesn't work the best, but it does what it needs too.

Now a couple of questions:

1. How do I return the number of opposing projectiles for a trigger?

2. Is it possible to add something to a character that will increase the damage of all attacks with ChangeState = TargetLifeAdd when the characters actual attack is increased for balancing purposes?