YesNoOk
avatar

AI ignoring variables (Read 866 times)

Started by Swanky, January 24, 2021, 05:20:40 pm
Share this topic:
AI ignoring variables
New #1  January 24, 2021, 05:20:40 pm
  • **
Having a little issue here with AI using specific attacks tied to variables.
Basically the character sets up variables 20 and 30 depending on wall bounce and ground bounce. Variables are set and reset in Statedef -2 (reset when hitcounter = 0).
Now, I want the ai to do alter their attacks based on the variables active, for example when var(30)=0 I want the AI to perform a jHP to bounce the enemy off of the floor, but when var(30)>0, I want it to use a super attack instead (if the character has power).
Problem is, so far the AI seems to ignore these variables altogether. It doesn't switch to 650 when var(30)>=1, for example.

[state -1]
type = changestate
value = 620
triggerall = var(59) = 1 && roundstate =2
trigger1 = var(30)=0
trigger1 = stateno = 610
trigger1 = movecontact


[state -1]
type = changestate
value = 650
triggerall = var(59) = 1 && roundstate =2
trigger1 = var(30)>=1
trigger1 = stateno = 610
trigger1 = movecontact


[State -1, Nova ai]
type = ChangeState
value = Ifelse(statetype =s, 3100,3150)
triggerall = power >= 1000 && var(59) && p2bodydist X <= 70
triggerall = MoveType != H && RoundState = 2
triggerall = P2StateType != L
trigger1 = P2Statetype = A && random <= 150
trigger1 = p2MoveType = H && p2bodydist Y = [-25,50]
trigger1 = (P2Stateno != [5120,5160]); && (P2Stateno != 5160)
trigger1 = ctrl
trigger2 = var(30)>=1
trigger2 = (Stateno = 610) && MoveHit && random <= 500

What do I have to do to make the AI not ignore those variables?

€ Nvm. I've set up additional variables to check whether the AI has used the attack before and act accordingly.
Last Edit: January 26, 2021, 11:37:27 am by Swanky