I'm having problems in terms of coding the AI such that it charges up to full power. It's able to charge but not consistently. It charges for about 1 second (which doesn't really garner any chakra/energy) then stops. It does this about 3 times in a row then rushes in to attack. What I want is for the AI to charge consistently until either the power is max or the distance parameter has stopped being met. I am using mugen version 1.0 and the character is Onoki from Naruto.
His AI portion for his charge looks like this:
[State -1, Power Charge]
type = changestate
triggerall = var (59) = 0
triggerall = RoundState = 2 && ailevel > 0
triggerall = power < 3000
triggerall = StateType = S
triggerall = (p2statetype = S) || (p2statetype = C)|| (p2statetype = A)
triggerall = Ctrl
triggerall = P2BodyDist X >= 100
trigger1 = power < 1000 && Random = [600,800]
trigger2 = power < 2000 && power > 1000 && Random = [300,500]
trigger3 = power < 3000 && power > 2000 && Random = [100,200]
value = 500
The Normal CNS portion looks like this:
; Power Charge:
;-------------------------------------------------------------------------------
; Power Charge - Start
[Statedef 500]
type = S
movetype= I
physics = S
juggle = 1
velset = 0,0
ctrl = 0
anim = 500
sprpriority = 2
[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 7014
ID = 550
pos = -1,0
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = .3,.3
sprpriority = 1
ontop = 0
ownpal = 1
removeongethit = 1
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 7014
ID = 550
pos = -1,0
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = .5,.5
sprpriority = 1
ontop = 0
ownpal = 1
removeongethit = 1
ignorehitpause = 1
[State 0, EnvShake]
type = EnvShake
trigger1 = time%5 = 0
time = 5
ampl = 2
[State 0, PowerAdd]
type = PowerAdd
trigger1 = 1
value = 10
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0||time = 100||time = 200
value = S5,27
volume = 20
channel = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,26
volume = 999
channel = 2
[State 200, End]
type = ChangeState
triggerall = var (59) = 0
triggerall = RoundState = 2 && ailevel > 0
triggerall = time >= 6
trigger1 = time = 100+random%900
trigger2 = power = 3000
trigger3 = p2bodydist x >= 50
value = 501
[State 200, End]
type = ChangeState
Triggerall = var(9) = 0
triggerall = time >= 6
trigger1 = command != "hold_s"
trigger2 = power = 3000
value = 501
I'd like to know what I am missing or what wasn't done properly. Any help is greatly appreciated.
Var(9) = 0 indeed represents AI lvl. And I've tried adjusting the body distance. While he does charge from further away, he still does it intermittently in the fashion described at the beginning and not consistently. I tried looking at another char who charges properly and noticed some helper string in their AI code looking like this : trigger4 = numhelper(1120) = 1 Should thee be a helper string added to get smooth consistent charging?