The Mugen Fighters Guild

Help => M.U.G.E.N Development Help => Code Library => Topic started by: 2OS on July 25, 2012, 09:05:59 am

Title: Custom Auto Turn ( Never face player type helpers )
Post by: 2OS on July 25, 2012, 09:05:59 am
[Statedef -2]

[State P2Dist X]
type=varset
trigger1=numenemy
var(0)=ceil(pos x-enemynear(ifelse(enemynear(0),stateno!=5150,0,numenemy=2)),pos x)*-facing
ignorehitpause=1

[State P2Dist Y]
type=varset
trigger1=numenemy
var(1)=ceil(pos y-enemynear(ifelse(enemynear(0),stateno!=5150,0,numenemy=2)),pos y)*-1
ignorehitpause=1

[State ]
type=assertspecial
trigger1=1
flag=noautoturn
ignorehitpause=1

[State ]
type=turn
triggerall=stateno=0||stateno=11||stateno=20
trigger1=var(0)<-5
ignorehitpause=1

[State FaceP2]
type=turn
triggerall=stateno=  ;;  states that have facep2=1 ( null facep2=1 )
trigger1=var(0)<-5
trigger1=time=1
ignorehitpause=1

[State ]
type=changeanim
triggerall=stateno=0||stateno=11||stateno=20
trigger1=var(0)<-5
value=5+(stateno=11)
ignorehitpause=1


replace and avoid using p2 p3 p4 triggers (they're stupid as hell anyway) and use enemy(near) redirects instead.


enemynear(0),  ;;  closest
enemynear(numenemy=2),  ;;  furthest
enemy(0),  ;;  p2
enemy(numenemy=2),  ;;  p4


extremely dumb alternative — code all player helpers exclusively in state 5150.