YesNoOk
avatar

Running AI code (Read 5628 times)

Started by DNZRX768, September 12, 2010, 05:05:32 am
Share this topic:
Running AI code
#1  September 12, 2010, 05:05:32 am
  • *****
  • Hug Pikachus!
    • USA
I posted a topic in the MUGEN discussion forums if I should release a modified version of an AI code design that belong to someone else in the first place.

Now, I will release the code as open source.

This code will make the AI to run towards you to give you a beat up. While it would certainly make the AI more aggressive, it will cause the AI to run recklessly into projectiles and such, making them weaker in a way.

But the code I will be releasing will be very basic. Improve the area as you see fit.

Insert this into your .cmd file:
Code:
; =============================
; AI Runs
; =============================
[State -1, RUnning AI]
type = ChangeState
value = 6000
triggerall = var(13) = 1
triggerall = roundstate = 2 && alive = 1
triggerall = StateType != A
triggerall = stateno != 101
triggerall = ctrl
triggerall = roundstate = 2
trigger1 = p2bodydist X > 150
trigger1 = random <= 150
trigger1 = p2movetype != A

and put this somewhere in the .cns file:
Code:
; RUn Towards Enemy
[Statedef 6000]
type    = S
physics = S
anim = 100
sprpriority = 1
ctrl = 0

[State 100, 1]
type = VelSet
trigger1 = 1
x = const(velocity.run.fwd.x)

[State 100, 2]
type = AssertSpecial
trigger1 = 1
flag = NoWalk
flag2 = NoAutoTurn

[State 100, 4]
type = ChangeState
triggerall = roundstate = 2
trigger1 = p2bodydist X <= 50
value = 1500

This is really basic stuff.
Enjoy...
Hug the Pikachus!

Hug A Pikachu Today!