YesNoOk
avatar

so I was trying to recode a projectile as an helper but I seem to have an issue (Read 313 times)

Started by Mark85, April 06, 2020, 07:09:54 PM
Share this topic:
so I was trying to recode a projectile as an helper but I seem to have an issue
New #1  April 06, 2020, 07:09:54 PM
  • ****
  • Pixels are atom's of resolution,Low-res or Hi-res
    • Turkey
    • metekervan26@gmail.com
so I was trying to recode a projectile as an helper but I seem to be getting an issue https://streamable.com/9a38sv


I used Pots Ryu and Jmorphman Ken as a reference

here's the code
Code:
;------------------------------------------------------------------------------
;-| ƒŒƒbƒhƒŒƒCƒWEŽã |---------------------------------------------------------
;------------------------------------------------------------------------------
[Statedef 1000]
type    = S
movetype = A
physics = S
poweradd = 60
velset = 0,0
ctrl = 0
anim = 1000
juggle = 8
facep2 = 1

[State 1000, Strength]
type = varset
trigger1 = !time && !AIlevel
var(10) = ifelse(command = "qcfz", 3, ifelse(command = "qcfy", 2, 1))

[State 1000, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = ifElse(var(10) = 0, 1000, ifElse(var(10) = 1, 1025, 1050))

[State 1000, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 5
value = 60,0

[State 1000, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 6
value = 60,1

[State 1000, Explod]
type = Explod
trigger1 = AnimElem = 2
anim = 20000
ID = 20000
pos = 0,0
postype = p1
ownpal = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1
ignorehitpause = 1
scale = .5,.5

[State 1000, width]
type = width
trigger1 = animelemtime(5) = 0
value = 30, 0

[State 1000, Helper]
type = Helper
trigger1 = animelem=5
id = 20001
name = "Red Rage"
pos = 30,-70
postype = P1
stateno = 20001
helpertype = normal
ownpal = 1
size.xscale = .5
size.yscale = .5

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

;---------------------------------------------------
;Red Rage
[Statedef 20001]
type    = S
movetype = A
physics = N
ctrl = 0
velset = 0,0
anim = 20001
sprpriority = 4
 
[State 1005, HitOverride]
type = hitoverride
trigger1 = 1
time = -1
attr = SCA, AA, AP, AT
stateno = 20003
ignorehitpause = 1
[State 1005, HB]
type = hitby
trigger1 = 1
time = -1
value = SCA, NP, SP, HP
ignorehitpause = 1
 
[State 1005, Button Detect]
type = VarSet
trigger1= !Time && !PrevStateNo
var(10) = Root, var(10)

[State 1005, Vel]
type = velset
trigger1 = 1
x = ifelse(var(10) = 3, 5.5, ifelse(var(10) = 2, 4.5, 3))
y = 0

[State 1005, Transparency]
type = Trans
trigger1 = 1
trans = AddAlpha
alpha = 256, 256
ignoreHitPause = 1

[State 1005, Miss]
type = HitDef
trigger1 = 1
attr = S,SP
hitFlag =
sparkXY = -10,0

[State 20001, Hitdef]
type = hitdef
trigger1 = !(root,var(16)) && root,var(15)<1
attr = S, SP
damage = 55
animtype = Heavy
hitflag = MAF
guardflag = MA
pausetime = 0,6
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkxy = 10, 0
ground.type = Low
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -7.5,0
guard.velocity = -5.5
air.velocity = -4, -5.5
ground.cornerpush.veloff = 0
fall.recover = 1
fall.recovertime = 120
getpower = 30
palFX.time = 36
palFX.mul = 128, 128, 128
palFX.sinAdd = 96, 96, 96, 4
envshake.time = 14
envshake.freq = 120
envshake.ampl = 4
sprpriority = 4
yaccel = 0.5
fall = 0
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1

[State 1005, End]
type = changestate
trigger1 = movecontact
value = 20002
ignorehitpause = 1

[State 1005, ChangeState]
type = ChangeState
trigger1 = MoveReversed
value = 20003
ignoreHitPause = 1

[State 1010, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100
trigger2 = Anim = 20002 && !AnimTime

;Hit Pause
[StateDef 20002]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3
moveHitPersist = 1

[State 1011, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 1

[State 1006, HitSound]
type = playsnd
trigger1 = movecontact = 1 && numtarget
trigger1 = !(target, hitshakeover)
value = S4, 5
channel = 2
ignorehitpause = 1

[State 1005, Sparks]
type = explod
trigger1 = movehit && numtarget
trigger1 = (target, movetype = H) && !(target, time)
anim = 7020 + (random % 8)
ID = 7000
sprpriority = 5
postype = left
pos = ceil((target, pos x) -((target, const(size.ground.front) -10) * facing) + 160), ceil(screenpos y)
removetime = -2
ownpal = 1
facing = -1
ignorehitpause = 1
persistent = 0
pausemovetime = 100
supermovetime = 100

[State 1005, Parent Hit Count]
type = ParentVarAdd
trigger1 = MoveContact && NumTarget
var(13) = 1
[State 1005, Self Hit Count]
type = VarAdd
trigger1 = MoveContact && NumTarget
var(13) = 1
[State 1005, Juggle Points]
type = ParentVarAdd
trigger1 = MoveContact && NumTarget
var(15) = 1

[State 1011, End]
type = ChangeState
trigger1 = Time >= 0
value = 20003

;Disappear
[Statedef 20003]
type = A
movetype = A
physics = N
anim = 20002
velset = 0, 0
ctrl = 0
sprpriority = 4

[State 1006, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

[State 1007, End]
type = ChangeState
trigger1 = !AnimTime
value = 20004
;Wait
[StateDef 20004]
type = A
physics = N
moveType = I
anim = 1
ctrl = 0
velSet = 0,0

[State 1008, End]
type = DestroySelf
trigger1 = !NumTarget
trigger2 = NumTarget
trigger2 = Target, Time <= 1 && !(Target, HitShakeOver)
Last Edit: April 07, 2020, 03:58:56 PM by Mark85
Re: so I was trying to recode a projectile as an helper but I seem to have an issue
#2  April 06, 2020, 08:09:37 PM
  • ******
You might want to understand or explain the variables the root uses, I think that's where you should look. Check the triggers of the helper's HitDef.
If you copied and pasted verbatim, the helper may have problems working. ;)
Re: so I was trying to recode a projectile as an helper but I seem to have an issue
#3  April 06, 2020, 08:38:07 PM
  • ****
  • Pixels are atom's of resolution,Low-res or Hi-res
    • Turkey
    • metekervan26@gmail.com
I have copy pasted like everything from Pots Ryu,but I dont really understand why it doesnt work,I got all vars set
var(15) and var(16) for juggle
var(13) for hitcount

I also rearranged code to see if it would work but it didnt
I might not really be getting what trigger1 = !(root,var(16)) && root,var(15)<1 means
idk
Re: so I was trying to recode a projectile as an helper but I seem to have an issue
#4  April 07, 2020, 01:35:33 AM
  • ****
  • Objection! Sustained!
    • Russia
    • mitia.pogorelov1@yandex.ru
So, your problem goes un because THIS code stands LOWER than the main HitDef in your projectile:
Code:
[State 1005, Miss]
type = HitDef
trigger1 = 1
attr = S,SP
hitFlag =
sparkXY = -10,0
Put it higher than the main HitDef, better to put it right over that- and the projectile will hit.