News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Explod

Started by Tyrannosaurus rex, February 26, 2015, 05:46:09 AM

Previous topic - Next topic

Tyrannosaurus rex

I have one short question regarding Explod types. I read in earlier posts that they cannot be rotated by angleset and angledraw like helpers so animations are required.

Suppose my helper moves in two directions (up and down), and he has an explod state.

[State 9327, explod]
type = Explod
trigger1 = time = 0
anim = [color=red]????[/color]
sprpriority = 0
bindtime = -1
removetime = -1
ID = 1010
ownpal = 1


Is there someway I can make one explod state use more than one animations depending on velocity or direction? I got the idea of utilizing variables here but I'm confused on how they variable can be used like in this scenario. More to the point, one of the earlier topic in this section indicated that the facing is inverted when using anim related functions and facing = -1 is needed.

Would anyone have a working example of any snippet of code to help? Thanks.

Bannana

Let me just get this straight, you want something like

[state set var velx]
type = varset
trigger1 = vel x >= a
v = 99999
value = 1 ;make more depending on the various velocities I guess

[state remove var velx]
type = varset
trigger1 = vel x = 0
v = 99999
value = 0

to be the triggers for the animation of the helper/explod, correct?

I'm not sure what order MUGEN reads the code, but it parses it rather quickly so you can probably set up those variables and have the animation in the next tick. I don't have the time to test it, but I would hope MUGEN could do so.

What do you mean by direction by the way? Facing? You can't set your variable back to zero to stop the animation since I would assume you would want to use both facing = 1 and facing = -1. Angle draw on your helper would probably suffice though.

Алексей

It's probably best to just use a Helper if you require those things as forcing it with an Explod can be tedious and annoying. In order to change the animation of an Explod, you have to remove it first (RemoveExplod) and spawn the new animation in its place. It's important to note that Explodes don't have "States" either. You have the Explod StateController and the ModifyExplod StateController to work with and that's it. Is there any particular reason you want to do this with an Explod?

-[Все слова это только слова.]-

Odb718

Make it a helper, make it so it has changeanim with triggers for velocity.
I'd add stuff to make sure it's unhitable.

It also sounds like you're going to want to make it do other things later so a helper is probably best. Otherwise, what ever ups and downs you're doing could be done in the animation. (I'd imagine)
vVv Gouken718 vVv SabreTooth718 vVv


Tyrannosaurus rex

Urghh.. helpers. I heard that they are responsible for slowing down characters so I don't want to use them if unnecessary specially when the problem is related to animation only.

Basically, I was looking for an expression (algebraic/trigger based) that can be put to connect animation events.

[State 1000, upwards]
type = varset
trigger1 = time = 0
v = 13
value = something right here that would play the animation between  1110 (a one frame animation) to 1112(another one frame animation).


and

[State 1000, downwards]
type = varset
trigger1 = time = 0
v = 14
value = something right here that would play the animation between 1114 (a one frame animation) and 1115(another one frame animation).


That is linked to:

[State 9000, explod]
type = Explod
trigger1 = time = 0
anim = var(13)
sprpriority = 0
bindtime = -1
removetime = -1
ID = 1010
ownpal = 1




Алексей

Poorly coded characters with memory leaks of any kind will slow characters down. Using one for your animation needs will not. See, the trouble you'll face with this method is this:
anim=var(13)

Explods are created the time they are triggered and CANNOT change their animation without dying first and re-spawning as new instances. Use a Helper in conjunction with ChangeAnim StateControls for the best time solving your problem.

-[Все слова это только слова.]-

Odb718

Is the timing of the up and down going to vary or be controlled by anything? If No, make the animations 1 animation.
If yes, you'll probably need a helper in the long run.

And unless youre on an ancient PC 1 extra helper isnt going to slow things down noticeably. 1 helper posting 1 frame anim is negligible.


Btw those varsets would only be set 1 time so whatever's triggering them originally can control which value is loaded.
Otherwise you'd need to set the trigger(s) to make the values change.
and say you're doing 2 speeds for up and down, a slow and a fast
You can still use 1 variable with 4 values to keep track
0 and 10 would be your slow values
1 and 11 would be your fast values

vVv Gouken718 vVv SabreTooth718 vVv


Tyrannosaurus rex

Alright. Thank you guy. I will use helper then.