Explod doesn't spawn

Started by WastedCoder, January 24, 2022, 12:32:44 AM

Previous topic - Next topic

WastedCoder

I tried to make a thing when my char throws a knife and if it hits the 'wall' (edge of the stage) it stays there for some time, but the thing is it doesn't spawn an explod of the knife. My knife simply disappears.

The knife in the wall state
Spoiler (click to show)
[Statedef 638]
type    = A
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 636

[State 638, RemoveExplod]
type = RemoveExplod
trigger1 = time = 0
id = 632

[State 638, RemoveExplod]
type = RemoveExplod
trigger1 = time = 0
id = 580

[State 638, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 999999999
ignorehitpause = 1

[state , knife in the wall]
type = explod
trigger1 = time = 0
anim = 638
id = 638
pos = 0,0
postype = p1
facing = 1
bindtime = -1
removetime = -2
removeongethit = 0
supermovetime = 9999999999999999999999999999
pausemovetime = 9999999999999999999999999999
scale = .9,.9
sprpriority = 3
ownpal = 1
angle = -47

[state end]
type = destroyself
trigger1 = time = 70

This sends the knife from its state into this one.

Spoiler (click to show)
[state 631 end 3]
type = changestate
trigger1 = frontedgebodydist <= 1
trigger2 = moveguarded ; I put it here to test, maybe the explod spawns in the wrong place, that is how I figured out it does not spawn at all
value = 638


So, id 632 is the flying knife explod which should disappear and it does, id 580 is just a wind effects, which also disappears as it should. Anim 636 is the same anim with just a red hitbox my knife uses to hit the opponent, because I want this explod to appear exactly where the knife hits. Dont look at the statedef type, movetype etc. I started messing those up, because I thought it might be the reason why the explod doesn't spawn. The knife itself is a helper and works perfectly fine. Btw, I have the same state, like literally, but in case my knife strikes the ground. And it may, because it's an attack performed in the air and it works perfectly. I just copypasted it and changed the animation etc., but it does not spawn the explod. The hitbox, at the same time, is there, near the wall for 70 ticks, which means, the code does its job. And debug is clean, no errors. The animation does exist, it lasts 70 ticks, the numbers are right.


EDIT: I fixed it. Super weird thing, but I fixed it. What I did? I copied the code of this animation(click the spoiler to see it), deleted this animation, then created a new one, with the same number(638), pasted the same code changing nothing, opened the game, and it worked... Idk how that helped me. I guess, weird bugs have a place to be sometimes.

Spoiler (click to show)
[Begin Action 638]
632,1, 0,0, 47, , ,
632,1, 0,0, 4, , AS256D30,
632,1, 0,0, 4, , AS256D60,
632,1, 0,0, 4, , AS256D85,
632,1, 0,0, 4, , AS256D140,
632,1, 0,0, 4, , AS256D199,
632,1, 0,0, 3, , AS256D250,

JJkoolaid

Removetime should be the same as destroyself  or probably longer so the knife stays for a bit after helper is destroyed. Maybe a trigger1 = Numexplod(638) = 0 should be added so multiple knifes don't appear if move is used again.
Your Successor in Netherrealm Service!!!

WastedCoder

Quote from: JJkoolaid on January 24, 2022, 12:42:04 AM
Removetime should be the same as destroyself  or probably longer so the knife stays for a bit after helper is destroyed. Maybe a trigger1 = Numexplod(638) = 0 should be added so multiple knifes don't appear if move is used again.

I tried it and it did nothing. Thanks for help anyways. Btw, this move cannot be activated if there is any explod of the knife on the map, so I cannot spam it.