YesNoOk
avatar

A Helper Problem (Read 312 times)

Started by Pringles, April 30, 2009, 12:18:15 am
Share this topic:
A Helper Problem
#1  April 30, 2009, 12:18:15 am
  • avatar
I have a move which shoots off 4 bullets. When I use the move against itself it counts as 4 hits.
Is there anyway to make it so when it hits another helper the amount of hits is zero?
Here's the code:
[mcode]
;---------------------------------------------------------------------------
; Shoot
; CNS difficulty: Meh.
[StateDef 200]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 200
poweradd = 20

[State 0, VarBlah]
type = VarSet
trigger1 = !time
var(1) = ((random%9)<2)

[State 0, VarAdd]
type = VarAdd
triggerall = var(0) < 8
trigger1 = AnimElem = 1
v = 0     ;fv =
value = 1

[State 0, Helper]
type = Helper
triggerall = numhelper(200)=0
trigger1 = AnimElem= 1
helpertype = normal ;player
name = "Bullet"
ID = 200
stateno = 201
pos = 18,-22
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
triggerall = numhelper(201)=0
trigger1 = AnimElem= 1
helpertype = normal ;player
name = "Bullet2"
ID = 201
stateno = 201
pos = 18,-22
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
triggerall = numhelper(202)=0
trigger1 = AnimElem= 1
helpertype = normal ;player
name = "Bullet3"
ID = 202
stateno = 201
pos = 18,-22
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper]
type = Helper
triggerall = numhelper(203)=0
trigger1 = AnimElem= 1
helpertype = normal ;player
name = "Bullet4"
ID = 203
stateno = 201
pos = 18,-22
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(1) = 0
trigger1 = AnimElem = 1
value = 0,0
volume = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(1) = 1
trigger1 = AnimElem = 1
value = 200,0
volume = 0

[State 200, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Bullet Helper
; CNS difficulty: Meh.
[Statedef 201]
type= S
movetype=A
physics = N
velset = 0,0
ctrl = 0
anim = 201

[State 0, HitOverride]
type=HitOverride
trigger1= 1
time=-1
attr=SCA,AA,AP,AT
stateno=203
ignorehitpause=1

[State 0, HitBy]
type=HitBy
trigger1= 1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = (8+random%2)
y = ((1+random%2))/(1+(random%3))

[State 1005, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1

[State 0, HitDef]
type = HitDef
trigger1 = 1
attr = S,NP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MLA         ;HLA
getpower = 0,0
givepower = 0,0
animtype = light          ;light,medium,hard,back,up,diagup
air.animtype = light
priority = 4,Hit   ;Hit,Miss,Dodge
damage = 15 + (root,var(1)*15),2
pausetime = 8,8
sparkno = 0
guard.sparkno = 0
sparkxy = 0,0
hitsound = 5,0
guardsound = 6,0
ground.type = High      ;Low,Trip,None
ground.slide = 5
ground.hittime = 10
air.hittime = 12
ground.velocity = -4,0
air.velocity = -1.4,-3
sprpriority = 1
numhits = 1

[State 0, DestroySelf]
type = ChangeState
trigger1 = MoveContact
trigger2 = Pos Y + Vel Y >= 0
value = 203
;ignorehitpause =
;persistent =

[Statedef 203]
type = S
physics = N
velset = 0,0
ctrl = 0
anim = 201
movehitpersist=1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = !AnimTime
;ignorehitpause =
;persistent =[/mcode]
Re: A Helper Problem
#2  April 30, 2009, 10:12:57 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
This will cut down on your combo counter.

Helpers count hits while they are alive, and the hits are only passed over to the next one if the helper is still alive when the next movecontact occurs

The only way around this is to have the helpers destroyself as soon as they hit, and use an explod to display their removal animation.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.