AI coding?

Started by sgn15, October 11, 2010, 08:45:58 AM

Previous topic - Next topic

sgn15

i saw this video but i still dont get it to work
http://www.youtube.com/watch?v=iCi9Tta1_Bk

i used his codes and tried to make a group of codes for example state 200

[state -1, Standing Light Punch]
.
.
.
.
.

then i made an AI version like he did in the video

[State -1, Stand Light Punch AI]
type = ChangeState
value = 200
triggerall = command = "x"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

i used this method in many states
then i tried it in watch mode the char AI still sucks

so is there a better tutorial for AI coding?

i want my char's AI to charge then attack. because right now my char always charging even if power is already full

Cyanide

Labeling it "stand light punch AI" doesn't make it AI. You could label it "hyper mega kick" when it was in fact a taunt and it would have no effect on the move itself. It's JUST an identifier to make debugging easier.

In winmugen AI involves setting a variable in such a way that a human is incapable of doing. In 1.0 AI means using the AIlevel trigger (easier and 100% more reliable)

Once you know the AI is on (or have detected it) you can then trigger moves on that variable/value rather than command.

For example, my AI variable is var(59) and if it is 1 my AI is turned on

[state -1]
type = changestate
triggerall = var(59) = 1 && roundstate = 2
trigger1 = ctrl
trigger1 = statetype != A
trigger1 = random < 80 && p2dist X< 90
value = 200

That is basic and what AI should look like. You'll note there is no command in there. I have also used Random to decrease how much it happens and p2dist to prevent it being thrown out if p2 is too far away.

Also, if the dude in the video told you to do what you've actually done, please don't use any more of his videos.


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.

2OS

#2
Quote from: Cyanide on October 11, 2010, 09:45:23 PM
If the dude in the video told you to do what you've actually done, please don't use any more of his videos.
^ Disregard this


I learned AI from that particular video, actually watch the entire thing and take your time, you'll eventually get it

The little bit that I learned from this video enabled me to do variant adjustable AI levels with WINmugen [ Which I'm still using cos 1.0's sound system disappoints the everloving shit out of me ]









Part of the video says to make a fuckload of ""Impossible commands"" [ 35 to 50 will do ]


Spoiler: AI Commands (click to show)

[Command]
name = "CPU_001"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_002"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_003"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_004"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_005"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_006"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_007"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_008"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_009"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_010"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_011"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_012"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_013"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_014"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_015"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_016"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_017"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_018"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_019"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_020"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_021"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_022"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_023"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_024"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_025"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_026"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_027"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_028"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_029"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_030"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_031"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_032"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_033"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_034"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_035"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_036"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_037"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_038"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_039"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_040"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_041"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_042"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_043"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_044"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_045"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_046"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_047"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_048"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_049"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_050"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

Then, make a variable using those commands


Spoiler: AI Variable (click to show)

[State 2OS]
type=varset
triggerall=roundstate=2&&!ishelper
trigger1=command="CPU_001"||command="CPU_002"||command="CPU_003"||command="CPU_004"||command="CPU_005"||command="CPU_006"||command="CPU_007"||command="CPU_008"||command="CPU_009"||command="CPU_010"
trigger2=command="CPU_011"||command="CPU_012"||command="CPU_013"||command="CPU_014"||command="CPU_015"||command="CPU_016"||command="CPU_017"||command="CPU_018"||command="CPU_019"||command="CPU_020"
trigger3=command="CPU_021"||command="CPU_022"||command="CPU_023"||command="CPU_024"||command="CPU_025"||command="CPU_026"||command="CPU_027"||command="CPU_028"||command="CPU_029"||command="CPU_030"
trigger4=command="CPU_031"||command="CPU_032"||command="CPU_033"||command="CPU_034"||command="CPU_035"||command="CPU_036"||command="CPU_037"||command="CPU_038"||command="CPU_039"||command="CPU_040"
trigger5=command="CPU_041"||command="CPU_042"||command="CPU_043"||command="CPU_044"||command="CPU_045"||command="CPU_046"||command="CPU_047"||command="CPU_048"||command="CPU_049"||command="CPU_050"
var(9)=3  ;; Re-Evaluate the variable number to whatever number you desire between 0 and 59, Re-Evaluate it's value to anything
ignorehitpause=1
persistent=1
pausemovetime=9999999
supermovetime=9999999

THEN start creating your AI


Spoiler: Powercharge for AI (click to show)


[ Values used are for example, obviously Re-Evaluate them to suit you ]


[State 2OS]
type=changestate
value=3000
triggerall=var(9) ;;  AI Variable is active ^
triggerall=statetype!=a&&ctrl  ;; Not in an aerial state and has control [ Control = States where you have actual control ( Walk and Crouch states being examples ) ]
triggerall=power!=powermax  ;; Power isn't at maximum
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2  ;; Players 2 and 4 are not too aggressive in terms of horizontal speed
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0  ;; Players 2 and 4 have no existing projectiles on screen
triggerall=p2movetype!=a  ;; Players 2 and 4 are not in an attack state
trigger1=p2dist x>=175  ;; Players 2 and 4 are distant enough for you to charge safely


EDIT — With Mugen 1.0 you can skip the first two spoilers [ Holy shit right ? ], but only if you choose to [ You probly will ], since my own personal AI Code and Levels are more complex than average, I choose not to use this feature / method / w.e


You'd first need to add or edit a line in your .DEF

[Info]
name          = "Name"
displayname   = "DisplayName"
versiondate   = 10/11/2010
mugenversion  = 1.0
author        = "2OS"
pal.defaults  = 1,2



Spoiler: Powercharge for AI ( Mugen 1.0+ Only ) (click to show)


[ Values used are for example, obviously Re-Evaluate them to suit you ]


[State 2OS]
type=changestate
value=3000
triggerall=ailevel>=0  ;;  Self Explanatory
triggerall=statetype!=a&&ctrl  ;; Not in an aerial state and has control [ Control = States where you have actual control ( Walk and Crouch states being examples ) ]
triggerall=power!=powermax  ;; Power isn't at maximum
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2  ;; Players 2 and 4 are not too aggressive in terms of horizontal speed
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0  ;; Players 2 and 4 have no existing projectiles on screen
triggerall=p2movetype!=a  ;; Players 2 and 4 are not in an attack state
trigger1=p2dist x>=175  ;; Players 2 and 4 are distant enough for you to charge safely

Cyanide

Couldn't watch it i was at work. As such it was IF it told him to do that. As it didn't he can continue can't he.


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.

sgn15

#4
im coding for winmugen btw, not 1.0

2os, i used your first 2 spoilers to replace bovery23's codes (impossible commands and AI variable)
then for power charging, its like this?
my charging is state 8000
Quote
[State charging]
type=changestate
value=8000
triggerall=var(9)
triggerall=statetype!=a&&ctrl
triggerall=power!=powermax
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
trigger1=p2dist x>=175

for a normal attack its like this?   [i removed all commands as cyanide stated]

Quote
[State -1, Stand Light Punch AI]
type = ChangeState
value = 200
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a

for button mashing attacks, i did the same and added the "trigger1 = time >= 10 && stateno = 203 && movecontact" style for button-mashing but when i tried my char in watch mode it only uses the first attack (of button mashing attacks)

for attacks with power requirements i added the power requirement then i tried my char in watch mode it can spam the special attack (which has power requirements) even if the power is 0,

Cyanide

Does it do what you want it to? That's really the important question. His code is functional but that's just for one attack and MIGHT not be what you want to achieve.

You still need the impossible commands to turn the AI on. That's what it's for. If you don't have them then var(9) is never 1 unless you put it there manually, at which point you lose control of the character. Rewatch the video, do the whole thing from start to finish and pay attention.


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.

2OS

Yea the charging looks good to go


You're gonna wanna stop the charging with some opposite conditions tho [ You'd put this one IN the charge state itself, you'd also put ""triggerall=!var(9)"" in the changestate that's already there ]


[State stop charging]
type=changestate
triggerall=!var(9) ;;  AI Variable isn't active
trigger1=command!="hold z"&&command!="hold c"  ;; Not holding charge commands
value=0
ctrl=1

[State stop charging AI]
type=changestate
triggerall=var(9) ;;  AI Variable is active
triggerall=statetype!=a&&ctrl  ;; Not in an aerial state and has control [ Control = States where you have actual control ( Walk and Crouch states being examples ) ]
trigger1=power=powermax  ;; Power is at maximum
trigger2=enemy,vel x>2||enemy(enemy,teammode=simul),vel x>2  ;; Players 2 and / or 4 are somewhat aggressive in terms of horizontal speed
trigger3=enemy,numproj>0||enemy(enemy,teammode=simul),numproj>0  ;; Players 2 and / or 4 have existing projectiles on screen
trigger4=p2movetype=a  ;; Players 2 and / or 4 are in an attack state
value=0
ctrl=1

sgn15

im getting confused.
heres all i have done so far

Spoiler (click to show)
Quote
[Command]
name = "CPU_001"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_002"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_003"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_004"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_005"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_006"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_007"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_008"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_009"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_010"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_011"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_012"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_013"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_014"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_015"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_016"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_017"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_018"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_019"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_020"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_021"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_022"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_023"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_024"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_025"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_026"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_027"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_028"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_029"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_030"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_031"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_032"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_033"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_034"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_035"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_036"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_037"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_038"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_039"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_040"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_041"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_042"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_043"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_044"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_045"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_046"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_047"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_048"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_049"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_050"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

Spoiler (click to show)
Quote[State -1]
type=varset
triggerall=roundstate=2&&!ishelper
trigger1=command="CPU_001"||command="CPU_002"||command="CPU_003"||command="CPU_004"||command="CPU_005"||command="CPU_006"||command="CPU_007"||command="CPU_008"||command="CPU_009"||command="CPU_010"
trigger2=command="CPU_011"||command="CPU_012"||command="CPU_013"||command="CPU_014"||command="CPU_015"||command="CPU_016"||command="CPU_017"||command="CPU_018"||command="CPU_019"||command="CPU_020"
trigger3=command="CPU_021"||command="CPU_022"||command="CPU_023"||command="CPU_024"||command="CPU_025"||command="CPU_026"||command="CPU_027"||command="CPU_028"||command="CPU_029"||command="CPU_030"
trigger4=command="CPU_031"||command="CPU_032"||command="CPU_033"||command="CPU_034"||command="CPU_035"||command="CPU_036"||command="CPU_037"||command="CPU_038"||command="CPU_039"||command="CPU_040"
trigger5=command="CPU_041"||command="CPU_042"||command="CPU_043"||command="CPU_044"||command="CPU_045"||command="CPU_046"||command="CPU_047"||command="CPU_048"||command="CPU_049"||command="CPU_050"
var(9)=3  ;; Re-Evaluate the variable number to whatever number you desire between 0 and 59, Re-Evaluate it's value to anything
ignorehitpause=1
persistent=1
pausemovetime=9999999
supermovetime=9999999

Spoiler (click to show)
Quote[State -1, Stand Light Punch AI]
type = ChangeState
value = 200
;triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a


[State -1, Stand Light Punch AI]
type = ChangeState
value = 201
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
trigger1 = time >= 10 && stateno = 200 && movecontact


[State -1, Stand Light Punch AI]
type = ChangeState
value = 202
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
trigger1 = time >= 10 && stateno = 201 && movecontact

[State -1, Stand Light Punch AI]
type = ChangeState
value = 203
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
trigger1 = time >= 10 && stateno = 202 && movecontact


[State -1, Stand Light Punch AI]
type = ChangeState
value = 204
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
trigger1 = time >= 10 && stateno = 203 && movecontact


[State -1, Stand Light Punch AI]
type = ChangeState
value = 210
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a


[State -1, Stand Light Punch AI]
type = ChangeState
value = 220
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a


[State -1, Stand Light Punch AI]
type = ChangeState
value = 230
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
triggerall = power >= 1000


[State -1, Stand Light Punch AI]
type = ChangeState
value = 250
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a

[State -1, Stand Light Punch AI]
type = ChangeState
value = 400
triggerall=var(9)
trigger1 = statetype = C
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
triggerall = power >= 2000


[State -1, Stand Light Punch AI]
type = ChangeState
value = 410
triggerall=var(9)
trigger1 = statetype = C
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
triggerall = power >= 1000


[State -1, Stand Light Punch AI]
type = ChangeState
value = 600
triggerall=var(9)
trigger1 = statetype = A
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a


[State -1, Stand Light Punch AI]
type = ChangeState
value = 610
triggerall=var(9)
trigger1 = statetype = A
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a


[State -1, Stand Light Punch AI]
type = ChangeState
value = 620
triggerall=var(9)
trigger1 = statetype = A
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a












[State Charging AI]
type=changestate
value=8000
triggerall=var(9) ;;  AI Variable is active ^
triggerall=statetype!=a&&ctrl  ;; Not in an aerial state and has control [ Control = States where you have actual control ( Walk and Crouch states being examples ) ]
triggerall=power!=powermax  ;; Power isn't at maximum
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2  ;; Players 2 and 4 are not too aggressive in terms of horizontal speed
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0  ;; Players 2 and 4 have no existing projectiles on screen
triggerall=p2movetype!=a  ;; Players 2 and 4 are not in an attack state
trigger1=p2dist x>=175  ;; Players 2 and 4 are distant enough for you to charge safely

[State stop charging]
type=changestate
triggerall=!var(9) ;;  AI Variable isn't active
trigger1=command!="hold_b"  ;; Not holding charge commands
value=0
ctrl=1

[State stop charging AI]
type=changestate
triggerall=var(9) ;;  AI Variable is active
triggerall=statetype!=a&&ctrl  ;; Not in an aerial state and has control [ Control = States where you have actual control ( Walk and Crouch states being examples ) ]
trigger1=power=powermax  ;; Power is at maximum
trigger2=enemy,vel x>2||enemy(enemy,teammode=simul),vel x>2  ;; Players 2 and / or 4 are somewhat aggressive in terms of horizontal speed
trigger3=enemy,numproj>0||enemy(enemy,teammode=simul),numproj>0  ;; Players 2 and / or 4 have existing projectiles on screen
trigger4=p2movetype=a  ;; Players 2 and / or 4 are in an attack state
value=0
ctrl=1

results:
1. when i play as my char, its always moving (without me controlling it) i cant do anything
2. in watch mode, it only does state 200 and power charging repeatedly. it doesnt even walk or jump

Cyanide

2OS: You've gone too complicated. He's got no clue at all and all the optimisation and fancy shit is taking over the important things.

Your commands look fine. I would say if he's doing things even under YOUR control you are already using var(9) somewhere else. Your AI variable should be spare and not in use by the character.

[State -1, Stand Light Punch AI]
type = ChangeState
value = 200
;triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a

This has no random component and no command, and your AI version has no random either even though it has some combo stuff to it. So whenever all that is true you'll spam state 200. Try my code instead. You will still need a version of this that requires you to press X though.

[state -1]
type = changestate
triggerall = var(9) = 3 && roundstate = 2
trigger1 = ctrl
trigger1 = statetype != A
trigger1 = random < 80 && p2dist X< 90
value = 200
That says your AI is on (and i've chosen to pick the value 3 rather than just non zero as that's what you've set) roundstate = 2 means the fight portion of the battle rather than intro/winpose. Just a safeguard
ctrl means you mustn't already be doing something
statetype != A means not in the air. You must be in stand or crouch. Good for comboing off crouching moves
The LAST trigger is the one most important to you. Random < 80. This is evaluated every tick and gives a different value no matter how many randoms you have. What i have there is an 8% chance of him doing LP every tick.
The next part of it ensures he only makes use of that 8% chance if P2 is close.

This will create something that works. After you have something that works you put extra things in place like whether P2 is in the air or if he's attacking with a projectile. Stuff that you don't want your character to attack for.

Slow down a wee bit. Nobody really does everything with AI all at once, they do it in bits and confirm the AI is doing the move with the frequency required in the correct situations. Build it up. Get a move activating and then string it round with safeguards and intelligence.


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.

sgn15

#9
Quote from: sgn15 on October 12, 2010, 09:27:17 AM
im getting confused.
heres all i have done so far

Spoiler (click to show)
Quote
[Command]
name = "CPU_001"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_002"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_003"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_004"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_005"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_006"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_007"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_008"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_009"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_010"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_011"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_012"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_013"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_014"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_015"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_016"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_017"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_018"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_019"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_020"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_021"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_022"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_023"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_024"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_025"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_026"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_027"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_028"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_029"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_030"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_031"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_032"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_033"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_034"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_035"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_036"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_037"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_038"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_039"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_040"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_041"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_042"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_043"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_044"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_045"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_046"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_047"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_048"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_049"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

[Command]
name = "CPU_050"
command = y,a,B,b,a, D,a,B,b,a, D,U,U
time = 1

Spoiler (click to show)
Quote[State -1]
type=varset
triggerall=roundstate=2&&!ishelper
trigger1=command="CPU_001"||command="CPU_002"||command="CPU_003"||command="CPU_004"||command="CPU_005"||command="CPU_006"||command="CPU_007"||command="CPU_008"||command="CPU_009"||command="CPU_010"
trigger2=command="CPU_011"||command="CPU_012"||command="CPU_013"||command="CPU_014"||command="CPU_015"||command="CPU_016"||command="CPU_017"||command="CPU_018"||command="CPU_019"||command="CPU_020"
trigger3=command="CPU_021"||command="CPU_022"||command="CPU_023"||command="CPU_024"||command="CPU_025"||command="CPU_026"||command="CPU_027"||command="CPU_028"||command="CPU_029"||command="CPU_030"
trigger4=command="CPU_031"||command="CPU_032"||command="CPU_033"||command="CPU_034"||command="CPU_035"||command="CPU_036"||command="CPU_037"||command="CPU_038"||command="CPU_039"||command="CPU_040"
trigger5=command="CPU_041"||command="CPU_042"||command="CPU_043"||command="CPU_044"||command="CPU_045"||command="CPU_046"||command="CPU_047"||command="CPU_048"||command="CPU_049"||command="CPU_050"
var(9)=3  ;; Re-Evaluate the variable number to whatever number you desire between 0 and 59, Re-Evaluate it's value to anything
ignorehitpause=1
persistent=1
pausemovetime=9999999
supermovetime=9999999

Spoiler (click to show)
Quote[State -1, Stand Light Punch AI]
type = ChangeState
value = 200
;triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a


[State -1, Stand Light Punch AI]
type = ChangeState
value = 201
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
trigger1 = time >= 10 && stateno = 200 && movecontact


[State -1, Stand Light Punch AI]
type = ChangeState
value = 202
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
trigger1 = time >= 10 && stateno = 201 && movecontact

[State -1, Stand Light Punch AI]
type = ChangeState
value = 203
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
trigger1 = time >= 10 && stateno = 202 && movecontact


[State -1, Stand Light Punch AI]
type = ChangeState
value = 204
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
trigger1 = time >= 10 && stateno = 203 && movecontact


[State -1, Stand Light Punch AI]
type = ChangeState
value = 210
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a


[State -1, Stand Light Punch AI]
type = ChangeState
value = 220
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a


[State -1, Stand Light Punch AI]
type = ChangeState
value = 230
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
triggerall = power >= 1000


[State -1, Stand Light Punch AI]
type = ChangeState
value = 250
triggerall=var(9)
trigger1 = statetype = S
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a

[State -1, Stand Light Punch AI]
type = ChangeState
value = 400
triggerall=var(9)
trigger1 = statetype = C
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
triggerall = power >= 2000


[State -1, Stand Light Punch AI]
type = ChangeState
value = 410
triggerall=var(9)
trigger1 = statetype = C
triggerall=statetype!=a&&ctrl
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a
triggerall = power >= 1000


[State -1, Stand Light Punch AI]
type = ChangeState
value = 600
triggerall=var(9)
trigger1 = statetype = A
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a


[State -1, Stand Light Punch AI]
type = ChangeState
value = 610
triggerall=var(9)
trigger1 = statetype = A
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a


[State -1, Stand Light Punch AI]
type = ChangeState
value = 620
triggerall=var(9)
trigger1 = statetype = A
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0
triggerall=p2movetype!=a












[State Charging AI]
type=changestate
value=8000
triggerall=var(9) ;;  AI Variable is active ^
triggerall=statetype!=a&&ctrl  ;; Not in an aerial state and has control [ Control = States where you have actual control ( Walk and Crouch states being examples ) ]
triggerall=power!=powermax  ;; Power isn't at maximum
triggerall=enemy,vel x<2||enemy(enemy,teammode=simul),vel x<2  ;; Players 2 and 4 are not too aggressive in terms of horizontal speed
triggerall=enemy,numproj<=0||enemy(enemy,teammode=simul),numproj<=0  ;; Players 2 and 4 have no existing projectiles on screen
triggerall=p2movetype!=a  ;; Players 2 and 4 are not in an attack state
trigger1=p2dist x>=175  ;; Players 2 and 4 are distant enough for you to charge safely

[State stop charging]
type=changestate
triggerall=!var(9) ;;  AI Variable isn't active
trigger1=command!="hold_b"  ;; Not holding charge commands
value=0
ctrl=1

[State stop charging AI]
type=changestate
triggerall=var(9) ;;  AI Variable is active
triggerall=statetype!=a&&ctrl  ;; Not in an aerial state and has control [ Control = States where you have actual control ( Walk and Crouch states being examples ) ]
trigger1=power=powermax  ;; Power is at maximum
trigger2=enemy,vel x>2||enemy(enemy,teammode=simul),vel x>2  ;; Players 2 and / or 4 are somewhat aggressive in terms of horizontal speed
trigger3=enemy,numproj>0||enemy(enemy,teammode=simul),numproj>0  ;; Players 2 and / or 4 have existing projectiles on screen
trigger4=p2movetype=a  ;; Players 2 and / or 4 are in an attack state
value=0
ctrl=1

results:
1. when i play as my char, its always moving (without me controlling it) i cant do anything
2. in watch mode, it only does state 200 and power charging repeatedly. it doesnt even walk or jump

k i remove all codes in the 3rd spoiler here and tried cyanide's codes and added the button mashing

Spoiler (click to show)
Quote[state -1]
type = changestate
triggerall = var(9) = 3 && roundstate = 2
trigger1 = ctrl
trigger1 = statetype != A
trigger1 = random < 80 && p2dist X< 90
value = 200


[state -1]
type = changestate
triggerall = var(9) = 3 && roundstate = 2
trigger1 = ctrl
trigger1 = statetype != A
trigger1 = random < 80 && p2dist X< 90
trigger1 = time >= 10 && stateno = 200 && movecontact
value = 201


[state -1]
type = changestate
triggerall = var(9) = 3 && roundstate = 2
trigger1 = ctrl
trigger1 = statetype != A
trigger1 = random < 80 && p2dist X< 90
trigger1 = time >= 10 && stateno = 201 && movecontact
value = 202


[state -1]
type = changestate
triggerall = var(9) = 3 && roundstate = 2
trigger1 = ctrl
trigger1 = statetype != A
trigger1 = random < 80 && p2dist X< 90
trigger1 = time >= 10 && stateno = 202 && movecontact
value = 203



[state -1]
type = changestate
triggerall = var(9) = 3 && roundstate = 2
trigger1 = ctrl
trigger1 = statetype != A
trigger1 = random < 80 && p2dist X< 90
trigger1 = time >= 10 && stateno = 203 && movecontact
value = 204

its not doing the button mashing attacks. and for the power charging (i removed the AI now), in the CNS for the power charging i made it so that it cant charge if the power is full like this:

Spoiler (click to show)
Quote;Charge
[Statedef 8000]
type = S
movetype= I
physics = S
velset = 0,0
anim = 8000
ctrl = 0


[State 431, EnvShake]
type = EnvShake
;trigger1 = AnimElem = 1
trigger1=time>=0&&timemod=5,1
triggerall = command = "hold_b"
time=5
freq = 60
ampl = -18
phase = 90




[State 8000, Explod]
type = Explod
trigger1 = time = 2
triggerall = command = "hold_b"
triggerall = command != "holddown"
trigger1 = statetype = S
anim = 7002
ID = 7002
pos = 11,175
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
scale = 2.7,4.0
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1


[State 7000, RemoveExplod]
type = RemoveExplod
trigger1 = Command != "hold_b" || power >= 2999
id = 7002

[State 7000, 5]
type = ChangeState
trigger1 = Command != "hold_b" || power >= 2999
value = 0
ctrl = 1





[State 8000, PowerAdd]
type = PowerAdd
trigger1 = ((GameTime%1) = 0)
value = 10

[State 8000, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = S0, 17
loop = 0
pan = 0
volume = 100

[State 8000, 2]
type = PlaySnd
trigger1 = animelem = 1
value = S0, 21
loop = 0
pan = 0
volume = 100

[State 8000, StopSnd]
type = StopSnd
trigger1 = (command != "hold_b")
channel = -1
volume = -100
;ignorehitpause =
;persistent =

[State 8000, 1]
type = CtrlSet
trigger1 = Command != "hold_b"
value = 1

[State 8000, end]
type = ChangeState
trigger1 = (command != "hold_b")
value = 0

in watch mode, the char has many instances where it does not do anything at all. it likes to charge its power still (after i made the change in CNS)

btw i still have this and the same for states 201 to 204
Spoiler (click to show)
Quote;---------------------------------------------------------------------------
; Stand Light Punch
[State -1, Stand Light Punch]
type = ChangeState
value = 200
triggerall = command = "x"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

supergarrocha

Is there any "free" or open source Ai code or Ai coding tutorial?

Hero

Watch for Winane`s one. Pretty nice and gives you a good control over AI activations.

Rajaa Retired

Or switch to Mugen 1.0 and use the ailevel trigger.

sgn15

[quote author=[Ooops]Hero link=topic=121378.msg1209837#msg1209837 date=1286901824]
Watch for Winane`s one. Pretty nice and gives you a good control over AI activations.
[/quote]

where can i watch the tutorial? thanks for helping btw 

Hero


supergarrocha

Quote from: Rajaa on October 12, 2010, 07:42:18 PM
Or switch to Mugen 1.0 and use the ailevel trigger.

And is there any tutorial on how to use the ailevel trigger in Mugen 1.0?

BC

#16
Quote from: 2OS on October 12, 2010, 05:27:56 AM
Quote from: Cyanide on October 11, 2010, 09:45:23 PM
If the dude in the video told you to do what you've actually done, please don't use any more of his videos.
^ Disregard this


I learned AI from that particular video, actually watch the entire thing and take your time, you'll eventually get it

The little bit that I learned from this video enabled me to do variant adjustable AI levels with WINmugen [ Which I'm still using cos 1.0's sound system disappoints the everloving shit out of me

That was actually my video I made in 2008 lol, I was learning myself then but as basic as it was it does show you how to program AI into your character. It's not the best tutorial for AI I'll admit that, I'll have to make a better one in the future now I know alot more.
Accepting commissions