Hello everybody, follow bellow a box break/throw showcase, and I take the opportunity to ask help with a issue I had (shown in this video):VIDEO As you can see I have a challenge here: He only throws the boxes created in order. If I want to throw the secound box I need to throw/destroy the first box first. I need help to make him throw the nearest box - not following helpr creation order. Follow some codes: CMD:;Block Throw - XYZ [State -1, Block Throw - XYZ] type = ChangeState value = 1501 triggerall = NumHelper(15000) > 0 triggerall = command = "Block_Throw_XYZ" triggerall = command = "holddown" ;trigger1 = var(35) = 2 ;trigger1 = helper(15000),Anim = 15200 || helper(15000),Anim = 15201 trigger1 = (helper(15000),rootdist X = [-40,25])*facing ;ifelse((facing = -1),(helper(15000),rootdist X = [0,45]),(helper(15000),rootdist X = [-45,0])) && (rootdist y = [-45,45]) trigger1 = statetype = C trigger1 = ctrl Throw box State:; Block Throw - Star Box [Statedef 1501] type = S movetype= A physics = S juggle = 5 velset = 0,0 ctrl = 0 anim = 1501 poweradd = 70 sprpriority = 2 [State 1501, 3] type = PlaySnd trigger1 = AnimElem = 8 ;7 value = 10, 2 ;[State 1501, 3] ;type = PlaySnd ;trigger1 = AnimElem = 8 ;value = 40, 2 [State 1501, 7] type = ChangeState trigger1 = AnimTime = 0 value = 0 ctrl = 1 Box helper state:; Star Box: Helper [Statedef 15000] type = A movetype= A physics = N anim = 15000 sprpriority = 3 [State 15000, 1] type = PosSet trigger1 = Time = 0 ;x = -40 + random%70 y = 0 ;50 ;random%130 [State 15000, 1] type = PosAdd triggerall = Time = 0 trigger1 = ScreenPos X >= GameWidth / 2 && Facing trigger2 = ScreenPos X < GameWidth / 2 && root,Facing = -1 x = -50 + random%100 [State 15000, 1] type = PosAdd triggerall = Time = 0 trigger1 = ScreenPos X < GameWidth / 2 && Facing trigger2 = ScreenPos X >= GameWidth / 2 && root,Facing = -1 x = 0 + random%200 [State 15000, 1] type = VelSet trigger1 = Time = 4 ;0 x = ifelse(RootDist X < -5, 1 + random%3, -1 - random%2) y = -10 ;- random%10 [State 15000, 1] ;Jump Up Dust type = Explod trigger1 = Time = 0 persistent = 0 anim = 7100 postype = p1 pos = -8, 3 ;16, 3 velocity = 0, 0 accel = 0, 0 removetime = -2 sprpriority = 4 ownpal = 1 shadow = -1,0,0 trans = addalpha alpha = 256, 256 [State 15000, 0] ;Ground Crack type = Explod trigger1 = Time = 0 persistent = 0 anim = 8415 postype = p1 pos = -12, -8 ;12, -8 velocity = 0, 0 accel = 0, 0 removetime = -2 sprpriority = -5 ownpal = 1 ;supermovetime = 1000 ignorehitpause = 1 scale = 0.5,0.5 [State 15000, 1] ;start gravity type = StateTypeSet trigger1 = Pos Y < -20 trigger1 = Vel Y < 0 statetype = A movetype = A physics = A ignorehitpause = 1 [state 15000, 2] type = VelAdd ;trigger1 = Time > 7 trigger1 = Pos Y < -20 trigger1 = Vel Y < 0 y = 0.40 [State 15000, 1] ;fall type = StateTypeSet ;trigger1 = Time > 50 trigger1 = Vel Y > 0 trigger1 = Pos Y >= -10 && Pos Y < 0 statetype = A movetype = A physics = N ignorehitpause = 1 [State 15000, 3] ;hit floor sound type = PlaySnd trigger1 = Vel Y > 0 trigger1 = Pos Y >= -5;0 value = 18, 5 persistent = 0 [State 15000, 1] ;Ground Land Dust type = Explod ;trigger1 = Time > 50 trigger1 = Vel Y > 0 trigger1 = Pos Y >= 0 persistent = 0 anim = 7102 postype = p1 pos = -4, 0 ;20, 0 ;11, 2 velocity = 0, 0 accel = 0, 0 removetime = -2 sprpriority = -2 ;4 ownpal = 1 supermovetime = -1 removeongethit = 1 shadow = -1,0,0 trans = addalpha alpha = 256, 256 scale = 0.5,0.5 [State 15000, 1] ;hit floor type = VelSet ;trigger1 = Time > 50 trigger1 = Vel Y >= 0 trigger1 = Pos Y >= 0 x = 0 y = 0 [State 15000, 1] ;hit floor type = PosSet ;trigger1 = Time > 50 trigger1 = Vel Y >= 0 trigger1 = Pos Y >= 0 y = 5 [State 15000, 1] ;hit floor type = StateTypeSet ;trigger1 = Time > 50 trigger1 = Vel Y > 0 trigger1 = Pos Y >= 0 statetype = S movetype = I physics = N ignorehitpause = 1 [State 15000, 1] ;hit floor type = StateTypeSet ;trigger1 = Time > 50 trigger1 = Vel X = 0 trigger1 = Vel Y = 0 trigger1 = Pos Y = 5 statetype = S movetype = I physics = N ignorehitpause = 1 ;[State 15000, 3] ;type = PlaySnd ;trigger1 = Time > 7 ;;trigger1 = Vel Y > 0 ;trigger1 = Pos Y >= 0 ;value = 18, 5 ;persistent = 0 [State 15000, 6] type = HitBy trigger1 = 1 value = SCA, AA,AT,AP [State 15000, 7] type = HitOverride trigger1 = 1 attr = SCA, AA,AT,AP,NA,NP,SP,HP stateno = 15001 time = -1 [State 15000, 2] type = HitDef trigger1 = root,P2Dist X >= -5 ;< -5 ;trigger1 = Anim != 15200 || Anim != 15201 trigger1 = Time % 50 = 0 && P2BodyDist X <= 40 attr = A, SP damage = floor(50/(1+(root,Var(19)/5.0))), 8 animtype = Hard guardflag = MA hitflag = MAF priority = 2, Hit sprpriority = 3 pausetime = 8, 8 ;0, 4 ;0, 8 ;8, 8 ;2, 2 guard.sparkno = s8300 ;S8200 sparkno = s8310+(random%8) ;S8220 sparkxy = -2, -40 hitsound = S15, 4 guardsound = S16, 0 ground.type = High ground.slidetime = 15 ground.hittime = 25 ground.velocity = ifelse(root,facing = -1,3,-3), -2 ;-3, -2 airguard.velocity = -1 air.type = High air.velocity = ifelse(root,facing = -1,2,-2), 0 ;-2, 0 air.hittime = 25 fall = 1 air.fall = 1 ;p2stateno = 225 ;palfx.time = 31 ;palfx.add = 160,240,140 ;palfx.mul = 80,120,220 ;palfx.sinadd = 80, 80, 80, 5 [State 15000, 3] type = HitDef trigger1 = root,P2Dist X >= -5 ;< -5 ;trigger1 = Anim != 15200 || Anim != 15201 trigger1 = Time % 50 = 0 && P2BodyDist X > 40 attr = A, SP damage = floor(50/(1+(root,Var(19)/5.0))), 9 animtype = Hard guardflag = MA hitflag = MAF priority = 2, Hit sprpriority = 3 pausetime = 8, 8 ;0, 4 ;0, 8 ;8, 8 ;3, 3 guard.sparkno = s8300 ;S8200 sparkno = s8310+(random%8) ;S8220 sparkxy = -2, -40 hitsound = S15, 4 guardsound = S16, 0 ground.type = High ground.slidetime = 20 ground.hittime = 25 ground.velocity = ifelse(root,facing = -1,4,-4) ;-4 airguard.velocity = ifelse(root,facing = -1,5,-5) ;-5 air.type = High air.velocity = -3, 0 air.hittime = 25 fall = 0 air.fall = 1 ;p2stateno = 225 ;fall = 1 ;air.fall = 1 ;palfx.time = 31 ;palfx.add = 160,240,140 ;palfx.mul = 80,120,220 ;palfx.sinadd = 80, 80, 80, 5 [State 15000, 2] type = HitDef trigger1 = root,P2Dist X < -5 ;trigger1 = Anim != 15200 || Anim != 15201 trigger1 = Time % 50 = 0 && P2BodyDist X <= 40 attr = A, SP damage = floor(50/(1+(root,Var(19)/5.0))), 8 animtype = Hard guardflag = MA hitflag = MAF priority = 2, Hit sprpriority = 3 pausetime = 8, 8 ;0, 4 ;0, 8 ;8, 8 ;2, 2 guard.sparkno = s8300 ;S8200 sparkno = s8310+(random%8) ;S8220 sparkxy = -2, -40 hitsound = S15, 4 guardsound = S16, 0 ground.type = High ground.slidetime = 15 ground.hittime = 25 ground.velocity = ifelse(root,facing = -1,-3,3), -2 ;-3, -2 airguard.velocity = -1 air.type = High air.velocity = ifelse(root,facing = -1,-2,2), 0 ;-2, 0 air.hittime = 25 fall = 1 air.fall = 1 ;p2stateno = 225 ;palfx.time = 31 ;palfx.add = 160,240,140 ;palfx.mul = 80,120,220 ;palfx.sinadd = 80, 80, 80, 5 [State 15000, 3] type = HitDef trigger1 = root,P2Dist X < -5 ;trigger1 = Anim != 15200 || Anim != 15201 trigger1 = Time % 50 = 0 && P2BodyDist X > 40 attr = A, SP damage = floor(50/(1+(root,Var(19)/5.0))), 9 animtype = Hard guardflag = MA hitflag = MAF priority = 2, Hit sprpriority = 3 pausetime = 8, 8 ;0, 4 ;0, 8 ;8, 8 ;3, 3 guard.sparkno = s8300 ;S8200 sparkno = s8310+(random%8) ;S8220 sparkxy = -2, -40 hitsound = S15, 4 guardsound = S16, 0 ground.type = High ground.slidetime = 20 ground.hittime = 25 ground.velocity = ifelse(root,facing = -1,-4,4) ;-4 airguard.velocity = ifelse(root,facing = -1,-5,5) ;-5 air.type = High air.velocity = -3, 0 air.hittime = 25 fall = 0 air.fall = 1 ;p2stateno = 225 ;fall = 1 ;air.fall = 1 ;palfx.time = 31 ;palfx.add = 160,240,140 ;palfx.mul = 80,120,220 ;palfx.sinadd = 80, 80, 80, 5 [State 15000, 3] ;allways facing right type = Turn trigger1 = root,facing = -1 trigger1 = facing = -1 [State 15000, destroy helper when hit box] type = ParentVarSet trigger1 = root,NumHelper(1123) > 0 && IsHelper(15000) ;GEN Power Bracelet X trigger1 = ifelse((Helper(1123),facing = -1), ((rootdist X) + (Helper(1123),rootdist X) = [-25,25]),((rootdist X) - (Helper(1123),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1123),rootdist Y) = [-65,65]) trigger1 = helper(1123),StateNo = 1123 trigger2 = root,NumHelper(1124) > 0 && IsHelper(15000) ;GEN Power Bracelet Y trigger2 = ifelse((Helper(1124),facing = -1), ((rootdist X) + (Helper(1124),rootdist X) = [-25,25]),((rootdist X) - (Helper(1124),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1124),rootdist Y) = [-65,65]) trigger2 = helper(1124),StateNo = 1124 trigger3 = root,NumHelper(1125) > 0 && IsHelper(15000) ;GEN Power Bracelet Z trigger3 = ifelse((Helper(1125),facing = -1), ((rootdist X) + (Helper(1125),rootdist X) = [-25,25]),((rootdist X) - (Helper(1125),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1125),rootdist Y) = [-65,65]) trigger3 = helper(1125),StateNo = 1125 trigger4 = root,NumHelper(1133) > 0 && IsHelper(15000) ;Magic Star X trigger4 = ifelse((Helper(1133),facing = -1), ((rootdist X) + (Helper(1133),rootdist X) = [-25,25]),((rootdist X) - (Helper(1133),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1133),rootdist Y) = [-45,45]) trigger4 = helper(1133),StateNo = 1133 trigger5 = root,NumHelper(1134) > 0 && IsHelper(15000) ;Magic Star Y trigger5 = ifelse((Helper(1134),facing = -1), ((rootdist X) + (Helper(1134),rootdist X) = [-25,25]),((rootdist X) - (Helper(1134),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1134),rootdist Y) = [-45,45]) trigger5 = helper(1134),StateNo = 1134 trigger6 = root,NumHelper(1135) > 0 && IsHelper(15000) ;Magic Star Z trigger6 = ifelse((Helper(1135),facing = -1), ((rootdist X) + (Helper(1135),rootdist X) = [-25,25]),((rootdist X) - (Helper(1135),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1135),rootdist Y) = [-45,54]) trigger6 = helper(1135),StateNo = 1135 trigger7 = root,NumHelper(1143) > 0 && IsHelper(15000) ;Dash Attack X trigger7 = ifelse((Helper(1143),facing = -1), ((rootdist X) + (Helper(1143),rootdist X) = [-25,25]),((rootdist X) - (Helper(1143),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1143),rootdist Y) = [-45,45]) trigger7 = helper(1143),StateNo = 1143 trigger8 = root,NumHelper(1144) > 0 && IsHelper(15000) ;Dash Attack Y trigger8 = ifelse((Helper(1144),facing = -1), ((rootdist X) + (Helper(1144),rootdist X) = [-25,25]),((rootdist X) - (Helper(1144),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1144),rootdist Y) = [-45,45]) trigger8 = helper(1144),StateNo = 1144 trigger9 = root,NumHelper(1145) > 0 && IsHelper(15000) ;Dash Attack Z trigger9 = ifelse((Helper(1145),facing = -1), ((rootdist X) + (Helper(1145),rootdist X) = [-25,25]),((rootdist X) - (Helper(1145),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1145),rootdist Y) = [-45,54]) trigger9 = helper(1145),StateNo = 1145 var(35) = 1 ignorehitpause = 1 [State 15000, Box break Changestate] ;code by DarkCipherLucius (a.k.a. Space(DCL)) type = ChangeState trigger1 = IsHelper(15000) > 0 trigger1 = ifelse((root,facing = -1),(rootdist X = [-3,55]),(rootdist X = [-52,0])) && (rootdist y = [-45,45]) ;rootdist y can be optional trigger1 = root,StateNo = 200 trigger1 = root,AnimElem > 1 && root,AnimElem <= 3 trigger2 = IsHelper(15000) > 0 trigger2 = ifelse((root,facing = -1),(rootdist X = [-3,55]),(rootdist X = [-52,5])) && (rootdist y = [-45,45]) ;trigger2 = (rootdist X = [-50,50])*facing && (rootdist y = [-45,45]) trigger2 = root,StateNo = 210 trigger2 = root,AnimElem > 3 && root,AnimElem <= 5 trigger3 = IsHelper(15000) > 0 trigger3 = ifelse((root,facing = -1),(rootdist X = [-3,50]),(rootdist X = [-48,0])) && (rootdist y = [-45,45]) ;trigger3 = (rootdist X = [-45,45])*facing && (rootdist y = [-45,45]) trigger3 = root,StateNo = 221 || root,StateNo = 222 || root,StateNo = 223 trigger3 = root,AnimElem > 5 && root,AnimElem <= 6 trigger4 = IsHelper(15000) > 0 trigger4 = ifelse((root,facing = -1),(rootdist X = [-3,55]),(rootdist X = [-52,0])) && (rootdist y = [-45,45]) ;trigger4 = (rootdist X = [-50,50])*facing && (rootdist y = [-45,45]) trigger4 = root,StateNo = 230 trigger4 = root,AnimElem > 3 && root,AnimElem <= 5 trigger5 = IsHelper(15000) > 0 trigger5 = ifelse((root,facing = -1),(rootdist X = [-3,55]),(rootdist X = [-52,0])) && (rootdist y = [-45,45]) ;trigger5 = (rootdist X = [-50,50])*facing && (rootdist y = [-45,45]) trigger5 = root,StateNo = 240 trigger5 = root,AnimElem > 6 && root,AnimElem <= 7 trigger6 = IsHelper(15000) > 0 trigger6 = ifelse((root,facing = -1),(rootdist X = [-3,65]),(rootdist X = [-62,0])) && (rootdist y = [-45,45]) ;trigger6 = (rootdist X = [-60,60])*facing && (rootdist y = [-45,45]) trigger6 = root,StateNo = 250 trigger6 = root,AnimElem > 7 && root,AnimElem <= 9 trigger7 = IsHelper(15000) > 0 trigger7 = ifelse((root,facing = -1),(rootdist X = [-3,55]),(rootdist X = [-52,0])) && (rootdist y = [-45,45]) ;trigger7 = (rootdist X = [-50,50])*facing && (rootdist y = [-45,45]) trigger7 = root,StateNo = 400 trigger7 = root,AnimElem > 1 && root,AnimElem <= 3 trigger8 = IsHelper(15000) > 0 trigger8 = ifelse((root,facing = -1),(rootdist X = [-3,50]),(rootdist X = [-48,0])) && (rootdist y = [-45,45]) ;trigger8 = (rootdist X = [-45,45])*facing && (rootdist y = [-45,45]) trigger8 = root,StateNo = 410 trigger8 = root,AnimElem > 3 && root,AnimElem <= 5 trigger9 = IsHelper(15000) > 0 trigger9 = ifelse((root,facing = -1),(rootdist X = [-3,55]),(rootdist X = [-52,0])) && (rootdist y = [-45,45]) ;trigger9 = (rootdist X = [-50,50])*facing && (rootdist y = [-45,45]) trigger9 = root,StateNo = 421 || root,StateNo = 422 || root,StateNo = 423 trigger9 = root,AnimElem > 5 && root,AnimElem <= 6 trigger10 = IsHelper(15000) > 0 trigger10 = ifelse((root,facing = -1),(rootdist X = [-3,58]),(rootdist X = [-54,0])) && (rootdist y = [-45,45]) ;trigger10 = (rootdist X = [-52,52])*facing && (rootdist y = [-45,45]) trigger10 = root,StateNo = 430 trigger10 = root,AnimElem > 1 && root,AnimElem <= 3 trigger11 = IsHelper(15000) > 0 trigger11 = ifelse((root,facing = -1),(rootdist X = [-3,60]),(rootdist X = [-57,0])) && (rootdist y = [-45,45]) ;trigger11 = (rootdist X = [-55,55])*facing && (rootdist y = [-45,45]) trigger11 = root,StateNo = 440 trigger11 = root,AnimElem > 3 && root,AnimElem <= 5 trigger12 = IsHelper(15000) > 0 trigger12 = ifelse((root,facing = -1),(rootdist X = [-3,60]),(rootdist X = [-57,0])) && (rootdist y = [-45,45]) ;trigger12 = (rootdist X = [-55,55])*facing && (rootdist y = [-45,45]) trigger12 = root,StateNo = 450 trigger12 = root,AnimElem > 2 && root,AnimElem <= 4 trigger13 = root,NumHelper(1113) > 0 && IsHelper(15000) ;SMS Power Bracelet X trigger13 = ifelse((Helper(1113),facing = -1), ((rootdist X) + (Helper(1113),rootdist X) = [-25,25]),((rootdist X) - (Helper(1113),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1113),rootdist Y) = [-60,60]) trigger13 = helper(1113),StateNo = 1113 trigger14 = root,NumHelper(1114) > 0 && IsHelper(15000) ;SMS Power Bracelet Y trigger14 = ifelse((Helper(1114),facing = -1), ((rootdist X) + (Helper(1114),rootdist X) = [-25,25]),((rootdist X) - (Helper(1114),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1114),rootdist Y) = [-60,60]) trigger14 = helper(1114),StateNo = 1114 trigger15 = root,NumHelper(1115) > 0 && IsHelper(15000) ;SMS Power Bracelet Z trigger15 = ifelse((Helper(1115),facing = -1), ((rootdist X) + (Helper(1115),rootdist X) = [-25,25]),((rootdist X) - (Helper(1115),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1115),rootdist Y) = [-60,60]) trigger15 = helper(1115),StateNo = 1115 trigger16 = root,NumHelper(1123) > 0 && IsHelper(15000) ;GEN Power Bracelet X trigger16 = ifelse((Helper(1123),facing = -1), ((rootdist X) + (Helper(1123),rootdist X) = [-25,25]),((rootdist X) - (Helper(1123),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1123),rootdist Y) = [-65,65]) trigger16 = helper(1123),StateNo = 1123 trigger17 = root,NumHelper(1124) > 0 && IsHelper(15000) ;GEN Power Bracelet Y trigger17 = ifelse((Helper(1124),facing = -1), ((rootdist X) + (Helper(1124),rootdist X) = [-25,25]),((rootdist X) - (Helper(1124),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1124),rootdist Y) = [-65,65]) trigger17 = helper(1124),StateNo = 1124 trigger18 = root,NumHelper(1125) > 0 && IsHelper(15000) ;GEN Power Bracelet Z trigger18 = ifelse((Helper(1125),facing = -1), ((rootdist X) + (Helper(1125),rootdist X) = [-25,25]),((rootdist X) - (Helper(1125),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1125),rootdist Y) = [-65,65]) trigger18 = helper(1125),StateNo = 1125 trigger19 = root,NumHelper(1133) > 0 && IsHelper(15000) ;Magic Star X trigger19 = ifelse((Helper(1133),facing = -1), ((rootdist X) + (Helper(1133),rootdist X) = [-25,25]),((rootdist X) - (Helper(1133),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1133),rootdist Y) = [-45,45]) trigger19 = helper(1133),StateNo = 1133 trigger20 = root,NumHelper(1134) > 0 && IsHelper(15000) ;Magic Star Y trigger20 = ifelse((Helper(1134),facing = -1), ((rootdist X) + (Helper(1134),rootdist X) = [-25,25]),((rootdist X) - (Helper(1134),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1134),rootdist Y) = [-45,45]) trigger20 = helper(1134),StateNo = 1134 trigger21 = root,NumHelper(1135) > 0 && IsHelper(15000) ;Magic Star Z trigger21 = ifelse((Helper(1135),facing = -1), ((rootdist X) + (Helper(1135),rootdist X) = [-25,25]),((rootdist X) - (Helper(1135),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1135),rootdist Y) = [-45,54]) trigger21 = helper(1135),StateNo = 1135 trigger22 = root,NumHelper(1143) > 0 && IsHelper(15000) ;Dash Attack X trigger22 = ifelse((Helper(1143),facing = -1), ((rootdist X) + (Helper(1143),rootdist X) = [-25,25]),((rootdist X) - (Helper(1143),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1143),rootdist Y) = [-45,45]) trigger22 = helper(1143),StateNo = 1143 trigger23 = root,NumHelper(1144) > 0 && IsHelper(15000) ;Dash Attack Y trigger23 = ifelse((Helper(1144),facing = -1), ((rootdist X) + (Helper(1144),rootdist X) = [-25,25]),((rootdist X) - (Helper(1144),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1144),rootdist Y) = [-45,45]) trigger23 = helper(1144),StateNo = 1144 trigger24 = root,NumHelper(1145) > 0 && IsHelper(15000) ;Dash Attack Z trigger24 = ifelse((Helper(1145),facing = -1), ((rootdist X) + (Helper(1145),rootdist X) = [-25,25]),((rootdist X) - (Helper(1145),rootdist X) = [-25,25])) && ((rootdist Y) - (Helper(1145),rootdist Y) = [-45,54]) trigger24 = helper(1145),StateNo = 1145 value = 15001 ignorehitpause = 1 [State 15000, Reset Hit when get the box] type = MoveHitReset trigger1 = Anim != 15200 && Anim != 15201 trigger1 = MoveContact || MoveHit ;AnimElem = 1, = 0 [State 15000, Box break Changestate] type = ChangeState ;trigger1 = ifelse((root,facing = -1),(rootdist X = [-3,55]),(rootdist X = [-52,0])) && (rootdist y = [-45,45]) ;;trigger1 = (rootdist X = [-50,50])*facing && (rootdist y = [-45,45]) ;trigger1 = root,StateNo = 1501 ;|| root,StateNo = 422 || root,StateNo = 423 ;trigger1 = root,AnimElem > 5 && root,AnimElem <= 6 trigger1 = MoveContact ;ifelse(root,facing = -1,GetHitVar(xvel) <= -11,GetHitVar(xvel) >= 11) ;GetHitVar(xvel) >= 11 ;MoveHit trigger1 = enemynear, movetype = H || enemynear, MoveGuarded trigger1 = Anim = 15200 || Anim = 15201 trigger1 = AnimElem = 9, > 0 || AnimElem = 10, >= 0 ;trigger1 = Vel X = ifelse(root,facing = -1,-11,11) ;trigger1 = (root,(enemy, Pos X) - Pos X = [-40,40])*facing trigger2 = Anim = 15200 || Anim = 15201 trigger2 = BackEdgeDist < -105 || FrontEdgeDist < -105 trigger3 = Anim = 15200 || Anim = 15201 trigger3 = AnimElem = 9, > 0 || AnimElem = 10, >= 0 trigger3 = Vel X = 0 && Vel Y = 0 value = 15001 [State 15000, Throw Box] ;Throw Box type = ChangeAnim trigger1 = IsHelper(15000) trigger1 = helper(15000),anim != 15200 && helper(15000),anim != 15201 trigger1 = ifelse((root,facing = -1),(rootdist X = [-25,40]),(rootdist X = [-40,25])) && (rootdist y = [-45,45]) ;rootdist y can be optional trigger1 = root,StateNo = 1501 trigger1 = root,AnimElem = 2 value = ifelse(root,facing = -1, 15201, 15200) ;[State 15000, reset var 35] ;Throw Box ;type = ParentVarSet ;trigger1 = root,StateNo = 1501 ;trigger1 = root,AnimTime = 0 ;v = 35 ;value = 0 [State 1500, 4] ;Throw Box type = BindToRoot trigger1 = Anim = 15200 || Anim = 15201 trigger1 = AnimElem = 2, = 0 ;8, = 0 time = 1 [State 15000, 1] ;Throw Box type = PosSet trigger1 = Anim = 15200 || Anim = 15201 trigger1 = AnimElem = 2, = 0 ;8, = 0 x = 0 y = 0 [State 15000, 1] ;Throw Box type = PosAdd trigger1 = Anim = 15200 || Anim = 15201 trigger1 = AnimElem = 9;8 x = ifelse(root,facing = -1,-14,14) ;14 y = -56 [State 15000, 1] ;Throw Box type = VelSet trigger1 = Anim = 15200 || Anim = 15201 trigger1 = AnimElem = 9;8 x = ifelse(root,facing = -1,-11,11) y = -1.9 [state 15000, 2] type = VelAdd trigger1 = Anim = 15200 || Anim = 15201 trigger1 = AnimElem = 9;8 y = 0.40 [State 15000, 1] ;fall type = StateTypeSet trigger1 = Anim = 15200 || Anim = 15201 trigger1 = AnimElem = 9;8 statetype = A movetype = A physics = A ignorehitpause = 1 [State 15000, 8] type = DestroySelf trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105