How to make ai taunt after each combo? (Read 6996 times)

Started by FinesseFui, November 22, 2023, 12:02:43 am

FinesseFui

How to make ai taunt after each combo?
#1  November 22, 2023, 12:02:43 am
So I'm using beterhans chunli and I'm trying to make her taunt either in-between the round or when match over here the code. Also I'm new so don't beat me up ;-c

[State -1,Taunted]
type = Changestate
triggerall = AIlevel && Numenemy && Statetype !=A && p2statetype !=A
triggerall = Roundstate = 2
triggerall = Alive
trigger1 = Enemy,P2life = 0
trigger1 = ctrl
trigger1 = Random = 999 * (AIlevel ** 2 / 64.0)
value = 196

WastedCoder

Re: How to make ai taunt after each combo?
#2  November 23, 2023, 09:51:43 am
So I'm using beterhans chunli and I'm trying to make her taunt either in-between the round or when match over here the code. Also I'm new so don't beat me up ;-c

[State -1,Taunted]
type = Changestate
triggerall = AIlevel && Numenemy && Statetype !=A && p2statetype !=A
triggerall = Roundstate = 2
triggerall = Alive
trigger1 = Enemy,P2life = 0
trigger1 = ctrl
trigger1 = Random = 999 * (AIlevel ** 2 / 64.0)
value = 196

You mean, this block doesn't work? If so, the reason might be roundstate = 2. When someone is dead and the other one is in ctrl, roundstate should proceed to 3 and on(?)
Anyways, roundstate = 2 means the fight has started and players can attack each other.
I suspect, deleting this line 'roundstate = 2' might actually cause some bugs during intros tho, so maybe you should try roundstate > 1. And 999 random value is too high, will result into spam.

PotS

Re: How to make ai taunt after each combo?
#3  November 23, 2023, 03:40:15 pm
The main problems are here:
Code:
`trigger1 = Random = 999 * (AIlevel ** 2 / 64.0)trigger1 = Enemy,P2life = 0`

In the first one, you're checking if random is equal to 999, which gives you a 1/1000 chance that it will happen. And that's if the AIlevel calculation returns a whole number, because if it's a decimal it will never trigger.

In the second one, you're checking if the enemy's P2 (i.e. your char) is dead.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.

WastedCoder

Re: How to make ai taunt after each combo?
#4  November 23, 2023, 09:05:25 pm
The main problems are here:
Code:
`trigger1 = Random = 999 * (AIlevel ** 2 / 64.0)trigger1 = Enemy,P2life = 0`

In the first one, you're checking if random is equal to 999, which gives you a 1/1000 chance that it will happen. And that's if the AIlevel calculation returns a whole number, because if it's a decimal it will never trigger.

In the second one, you're checking if the enemy's P2 (i.e. your char) is dead.

Good Lord, I can't believe I didn't notice all that. I am so inattentive. `:D

FinesseFui

Re: How to make ai taunt after each combo?
#5  November 24, 2023, 12:06:00 am
The main problems are here:
Code:
`trigger1 = Random = 999 * (AIlevel ** 2 / 64.0)trigger1 = Enemy,P2life = 0`

In the first one, you're checking if random is equal to 999, which gives you a 1/1000 chance that it will happen. And that's if the AIlevel calculation returns a whole number, because if it's a decimal it will never trigger.

In the second one, you're checking if the enemy's P2 (i.e. your char) is dead.

So, Do I change the random value to trigger1 = random < 100 and also for the second how can I fix that?

Re: How to make ai taunt after each combo?
#6  November 24, 2023, 12:52:46 am
• Life is not daijobu
Enemy,Life = 0 instead of P2

FinesseFui

Re: How to make ai taunt after each combo?
#7  November 24, 2023, 05:59:12 pm

PotS

Re: How to make ai taunt after each combo?
#8  November 24, 2023, 07:04:39 pm
That will make you only taunt if P2 is KO. But because you also check if roundstate = 2, that will make the taunt only happen in simul mode.

It's probably easier if you check how other character AI's taunt. Most AI's probably do that (all of mine do).

Good Lord, I can't believe I didn't notice all that. I am so inattentive. `:D
Happens to me too.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.

FinesseFui

Re: How to make ai taunt after each combo?
#9  November 25, 2023, 12:03:02 am
That will make you only taunt if P2 is KO. But because you also check if roundstate = 2, that will make the taunt only happen in simul mode.

It's probably easier if you check how other character AI's taunt. Most AI's probably do that (all of mine do).

Good Lord, I can't believe I didn't notice all that. I am so inattentive. `:D
Happens to me too.

Tell me what I need to change or is this good? Also can you give me a reference if this is wrong like your verison of this code?

[State -1,Taunted]
type = Changestate
triggerall = AIlevel && Numenemy && Statetype = L
triggerall = roundstate=[2,3]
trigger1 = enemynear,ctrl
trigger1 = enemy,life = 0
trigger1 = ctrl
trigger1 = Random < ((50 * (AIlevel ** 2 / 64.0)))
value = 196

SteelHammers

Re: How to make ai taunt after each combo?
#10  November 25, 2023, 01:33:53 am
Quote
[State -1,Taunted]
type = Changestate
triggerall = AIlevel && Numenemy && Statetype = L
triggerall = roundstate=[2,3]
trigger1 = enemynear,ctrl
trigger1 = enemy,life = 0
trigger1 = ctrl
trigger1 = Random < ((50 * (AIlevel ** 2 / 64.0)))
value = 196

You have conflicting triggers,
1. Statetype=L and ctrl cant't happen at the same time since you shouldn't have ctrl when statetype=L (for Chun Li anyway).
2. Enemynear,ctrl and enemy,life=0 can't happen at the same time unless it's in simultaneous mode so will never trigger in a 1 v 1 match.

DeathScythe

Re: How to make ai taunt after each combo?
#11  November 25, 2023, 02:43:10 pm
• a

AIlevel: must be controlled by the AI, which is correct.

Numenemy: There must be an enemy, which is correct

Statetype = L: The character (not the enemy) must be in a lie down state, which is INCORRECT. Why would you want the character to be lying down before performing the taunt? Maybe you wanted the enemy to be lying down, but there are better ways to check that and I'd just delete this.

roundstate=[2,3] : Using RoundState >= 2 is way better in this case. It will trigger if the fight has already started and not in the intros.

enemynear,ctrl : The nearest enemy can move, which is INCORRECT. You want to taunt when the enemy is down, and do not have control, so remove this.

enemy,life = 0 : Enemy's life is empty, this is correct, but I think would be better to use "!Enemy, Alive" instead. It's just safer.

ctrl : The character needs to have control and be able to move, this is correct.

Random < ((50 * (AIlevel ** 2 / 64.0))) : this is a 5% chance to perform the move when the AI is at difficulty 8, this is ok if you don't want the taunt to be spammed.

SteelHammers

Re: How to make ai taunt after each combo?
#12  November 26, 2023, 01:26:09 am
Random < ((50 * (AIlevel ** 2 / 64.0))) : this is a 5% chance to perform the move when the AI is at difficulty 8, this is ok if you don't want the taunt to be spammed.

To elaborate, at AILevel=8, that would a 5% success rate per tick, so for e.g. in half a second (30 ticks), the chance will actually be about 77% for random to succeed.  Conditioning it with other triggers, the chance of the move occurring will be significantly lower so it'll be okay.

beterhans

Re: How to make ai taunt after each combo?
#13  November 27, 2023, 07:48:22 pm
if you are using latest version of my chun li it should work

try

Code:
`[State -1,Taunt_after_win]type = Changestatetriggerall = AIlevel && Numenemytriggerall = roundstate = 3 && Alive && StateType != Atrigger1 = win && ctrltrigger1 = Random < ((500 * (AIlevel ** 2 / 64.0)))value = 195`
Last Edit: November 27, 2023, 07:57:13 pm by beterhans

FinesseFui

Re: How to make ai taunt after each combo?
#14  December 03, 2023, 05:48:25 am
if you are using latest version of my chun li it should work

try

Code:
`[State -1,Taunt_after_win]type = Changestatetriggerall = AIlevel && Numenemytriggerall = roundstate = 3 && Alive && StateType != Atrigger1 = win && ctrltrigger1 = Random < ((500 * (AIlevel ** 2 / 64.0)))value = 195`

Ty I will take this as a reference also ty guys for ty help