Wow! Thanks a lot.
Seems like there is more diversity now.
I fixed a small error (line 48)
p1stateno = ifelse(fvar(38) <= 249, 810, (ifelse(fvar(38) <= 499, 805, (ifelse(fvar(38) <= 749, 806,860)))))
Now it works.
But still I have the feeling AI use more "punch throw"
Perhaps it's just my feeling.
But if you're sure about how the random values works here, I'm keeping it.
Also, I try to do the same with air throw.
This time no need for transition states.
Only a throw attempt and Punch throw success 50% and Kick throw success 50%
The fact there is both p1stateno and p2stateno that have to "match", I'm not sure how to do it with the random stuff.
player version
[State 900, Button Detect]
type = VarSet
trigger1 = !Time
var(10) = (helper(10371), var(3)) && (helper(10371), var(4)) || (helper(10371), var(4)) && (helper(10371), var(5)) || (helper(10371), var(3)) && (helper(10371), var(5))
[State 900, Throw 1]
type = HitDef
triggerall = !AILevel ;; we need to make the AI not use this
trigger1 = AnimElem = 1
attr = A,NT
hitFlag = AF
priority = 3,Miss
getPower = 35 * !var(20)
givePower = 35,35
numhits = 0
sparkno = -1
p1facing = 1
p2facing = 1
p1stateno = 910
p2stateno = 920
p2getp1state = 1
hitsound = s800, 0
fall = 1
fall.recover = 0
[State 900, Throw 2]
type = HitDef
triggerall = !AILevel ;; we need to make the AI not use this
trigger1 = AnimElem = 1 && var(10)
attr = A,NT
hitFlag = AF
priority = 3,Miss
getPower = 35 * !var(20)
givePower = 35,35
numhits = 0
sparkno = -1
p1facing = 1
p2facing = 1
p1stateno = 930
p2stateno = 940
p2getp1state = 1
hitsound = s800, 0
fall = 1
fall.recover = 0
AI version (WIP)
[State 900, AI Only]
type = HitDef
triggerall = AILevel ;; Here you go, AI. Use this.
trigger1 = AnimElem = 1 && var(10)
attr = A,NT
hitFlag = AF
priority = 3,Miss
getPower = 35 * !var(20)
givePower = 35,35
numhits = 0
sparkno = -1
p1facing = 1
p2facing = 1
p1stateno = 930;------I don't know how to set this part
p2stateno = 940;------I don't know how to set this part
p2getp1state = 1
hitsound = s800, 0
fall = 1
fall.recover = 0
I'm thinking if using some random var would make it...
Something based on that...
[State 800, Button Detect (AI)]
type = VarSet
trigger1 = !Time && AILevel
var(10) = (Random < 500)
OK this one seems to work well. (air throw)
I did it this way.
[State 900, AI Only throw 1]
type = HitDef
triggerall = AILevel ;; Here you go, AI. Use this.
trigger1 = AnimElem = 1
attr = A,NT
hitFlag = AF
priority = 3,Miss
getPower = 35 * !var(20)
givePower = 35,35
numhits = 0
sparkno = -1
p1facing = 1
p2facing = 1
p1stateno = 910
p2stateno = 920
p2getp1state = 1
hitsound = s800, 0
fall = 1
fall.recover = 0
[State 900, AI Only throw 2]
type = HitDef
triggerall = AILevel ;; Here you go, AI. Use this.
trigger1 = AnimElem = 1 && var(10)
attr = A,NT
hitFlag = AF
priority = 3,Miss
getPower = 35 * !var(20)
givePower = 35,35
numhits = 0
sparkno = -1
p1facing = 1
p2facing = 1
p1stateno = 930
p2stateno = 940
p2getp1state = 1
hitsound = s800, 0
fall = 1
fall.recover = 0