YesNoOk
avatar

AI Hesitation (Read 4322 times)

Started by BC, July 30, 2008, 05:45:29 pm
Share this topic:

BC

AI Hesitation
#1  July 30, 2008, 05:45:29 pm
  • avatar
  • ****
    • UK
;randomly uses either strong or medium hadouken
[State -1, Gou Hadoken decider]
type = ChangeState
value = ifelse((random=[100,250]),1000,ifelse((random=[251,501]),1001,1002))
triggerall = var(7) = 1 && roundstate = 2 && statetype != A
trigger1 = ctrl && p2bodydist x >= 100 && p2movetype != A
trigger1 = p2statetype !=A && p2statetype !=L
trigger1 = random <= 70
trigger2 = (MoveContact) && (Var(9) > 0)
trigger2 = random <= 100
trigger3 = stateno = 440 && animelemtime(4)>= 4
trigger3 = movehit && random <= 950

[State -1, powercharge]
type=changestate
value=740
triggerall=var(7)=1 && roundstate = 2  && random = [600,750]
triggerall = power<powermax&&ctrl
triggerall = enemynear, movetype !=A
triggerall = statetype != A
trigger1 = p2bodydist X > 130 && !enemy,numproj
trigger2 = enemynear, p2statetype = L


recently added these AI codes.


not sure whats causing it, but when at a certain distance.....prob X around 100-150

akuma like hesitates a few times then does the hadouken.
(plays first couple of frames in the animation then repeats)

i removed ctrl from the triggerall to allow combos into the hadouken

but just wondering whats making him glitch like that.


EDIT: just worked out it isnt the hadouken frames, its the powercharge....it keeps hesitating

EDIT2: i removed the powercharge AI code and now it works fine, BUT i added triggerall var(7)!=1 to the human only part of the move and it still does the move when in watch mode(my AI is coded in a sperate .cns file) and the non AI part is in state -1


edit3: lol yea found out why it still done the move while not given AI, because i had var(7)!=1 as a trigger1 instead of triggerall whoops  lets see if the hesitation goes away.

Accepting commissions
Last Edit: July 30, 2008, 06:11:44 pm by blackchaos07

Aadmi

Re: AI Hesitation
#2  July 30, 2008, 06:10:58 pm
the triggers for your charge to activate for the AI must be the opposite of the ending in your cns.


for example you want him to charge when the opponent is down and not when he is up

you wouldn't have a changeanim/state trigger in the cns, that tells him to not charge whne the oppoenent is down or else he will end up glitching out of confusion. of which one to follow.

BC

Re: AI Hesitation
#3  July 30, 2008, 06:20:03 pm
  • avatar
  • ****
    • UK
[State -1, powercharge]
type=changestate
value=740
triggerall=var(7)=1 && roundstate = 2  && random = [600,750]
triggerall = power<powermax&&ctrl
triggerall = p2bodydist X > 130 && !enemy,numproj
triggerall = statetype != A
triggerall = p2stateno != 52
trigger1 = p2statetype = S

[State -1, powercharge]
type=changestate
value=740
triggerall=var(7)!=1
triggerall = command="hold_z" && command="hold_c"
trigger1 = statetype!=A&&power<powermax&&ctrl



works fine  but he is charging near the opponent, is the dist wrong?


fixed the distance, removed body


still hesitating, shall i use the p2statetype = s as a triggerall?
Accepting commissions
Last Edit: July 30, 2008, 06:26:55 pm by blackchaos07

Aadmi

Re: AI Hesitation
#4  July 30, 2008, 06:27:14 pm
With that he should not charge unless his dist is greater than 130, try a further distance :-\

BC

Re: AI Hesitation
#5  July 30, 2008, 06:30:25 pm
  • avatar
  • ****
    • UK
hmmm thats really odd, ive tried p2bodydist x > 130 and ive tried p2dist x > 130 and he is charging right next to p2 ill try a further distance, but 130 really is enough, unless there is something in the cns code, i adapted it from pots charge code ages ago



could be the cns code ill double check, i think somehow the default AI is leaking through and confusing things



im gonna re-code the powercharge my way.
Accepting commissions
Last Edit: July 30, 2008, 06:37:42 pm by blackchaos07

Aadmi

Re: AI Hesitation
#6  July 30, 2008, 06:42:10 pm
the default I will not mess with your commands, unless the ai hasn't activated the AI yet.

It is best to code the charge your own way, if you want it your way, what you just copied and pasted without understanding it..shame on you. :P

BC

Re: AI Hesitation
#7  July 30, 2008, 07:01:49 pm
  • avatar
  • ****
    • UK
well in my defense the weather was hot so it reacted with the electrons in my brain which malfinctioned and then...........................ok ok  i was being lazy lol :P


Accepting commissions

BC

Re: AI Hesitation
#8  July 30, 2008, 07:23:59 pm
  • avatar
  • ****
    • UK
hey one last thing, i wanna use charging effects for my animation using explod, but the animation is only 12 gameticks and needs to be repeated to look like a charging aura..but once the animations time is over it stops, and even if i use time > 10(animelem = 3) and persistent = 0 it still stops, how do i keep playing that animation?


ive tried supermovetime but doesnt work.
Accepting commissions

BC

Re: AI Hesitation
#9  July 30, 2008, 07:42:31 pm
  • avatar
  • ****
    • UK
its ok i figured it out.

[State 740]
type = Explod
trigger1 = Anim = 770 && (command = "hold_z" && command = "hold_c") && Time = 10
anim = 8400
ID = 8400
postype = p1
sprpriority = 4
ownpal = 1
persistent = 1
removetime = -1
bindtime = -1
removeongethit = 1


[State 740, RemoveExplod]
type = RemoveExplod
trigger1 = power>=powermax  || command!="hold_z" || command!="hold_c"
id =  8400




Accepting commissions