[SOLVED] VarSet issue and red clsn's hitting the floor

Started by Maistral, July 26, 2011, 10:47:16 AM

Previous topic - Next topic

Maistral

made a new post since the problems in the last thread were solved already (as per the thread title)

anyway, these:


1) i have this certain varset issue.

;---------------------------------------------------------------------------
;Satetsu Kaihou Puppet Prepare
[Statedef 50000]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 0
ctrl = 0
velset = 0,0
anim = 55000
sprpriority = 1

[State 2303, HitOverride]
type = hitoverride
trigger1 = 1
attr = SCA, NT, ST, HT, NA, SA, HA,NP,SP,HP
stateno = 2020
time = 1

[State 1000, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = S9,2
volume = 600

[State 1000, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S9,14
volume = 800

[State 50000, parentvarset]
type = parentvarset
trigger1 = animelem = 1
v = 31
value = 1

[State 0, VarRandom]
type = VarRandom
trigger1 = animelem = 1
v = 29
range = -80,-120
;ignorehitpause =
;persistent =

;Summon Spear
[State 8060, 2]
type = helper
trigger1 = animelem = 4
helpertype = normal
stateno = 55100
pos = -20,var(29)
postype = front
ontop = 1
ID = 1602

;Summon Hammer
[State 8060, 3]
type = helper
trigger1 = animelem = 4
helpertype = normal
stateno = 56100
pos = -300,var(29)
postype = front
ontop = 1
ID = 1603

[State 2030, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 50001
ctrl = 1

[State 2030, 4]
type = changestate
trigger1 = parent, command = "s"
trigger2 = parent, life = 0
value = 2099

;---------------------------------------------------------------------------
;Satetsu Kaihou Puppet Release
[Statedef 50001]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 0
ctrl = 0
velset = 0,0
anim = 55001
sprpriority = 1

[State 2030, HitOverride]
type = hitoverride
trigger1 = 1
attr = SCA, NT, ST, HT, NA, SA, HA,NP,SP,HP
stateno = 2020
time = 1

;;;;;;;;;;;;;;;;;;;;THE PROBLEM;;;;;;;;;;;;;;;;
[State 50001, VarSet]
type = VarSet
trigger1 = animelem = 1
v = 39    ;fv = 10
value = 1
;;;;;;;;;;;;;;;;;;;;THE PROBLEM;;;;;;;;;;;;;;;;


[State 2030, parentvarset]
type = parentvarset
trigger1 = animtime = 0
v = 31
value = 0

[State 2030, parentvarset]
type = parentvarset
trigger1 = parent, command = "s"
v = 20
value = 5

[State 45000, parentvarset]
type = parentvarset
trigger1 = animtime = 0
v = 31
value = 0

[State 2030, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 2000
ctrl = 1

[State 2030, 4]
type = changestate
trigger1 = parent, command = "s"
trigger2 = parent, life = 0
value = 2099


;------------------------------------------------------------------------
;------------SATETSU STRUCTURES SPAWNED START HERE. PUPPET CODE ENDS HERE
;Spear Summon
[StateDef 55100]
type = S
movetype= A
physics = S
juggle  = 3
velset = 0,0
ctrl = 0
anim = 40006
poweradd = 0
sprpriority = 0

[State 8060, 2]
type = explod
trigger1 = time = 0
trigger2 = time + 1
helpertype = normal
anim = 7910
pos = var(59),var(58)
vel = 0,-5
postype = p1
ontop = 1

[State 8060, 2]
type = explod
trigger1 = time = 0
trigger2 = time + 1
helpertype = normal
anim = 7910
pos = var(57),var(56)
vel = 0,-5
postype = p1
ontop = 1

[State 8060, 2]
type = explod
trigger1 = time = 0
trigger2 = time + 1
helpertype = normal
anim = 7910
pos = var(55),var(54)
vel = 0,-5
postype = p1
ontop = 1

[State 8060, 2]
type = explod
trigger1 = time = 0
trigger2 = time + 1
helpertype = normal
anim = 7910
pos = var(53),var(52)
vel = 0,-5
postype = p1
ontop = 1

[State 8060, 2]
type = explod
trigger1 = time = 0
trigger2 = time + 1
helpertype = normal
anim = 7910
pos = var(51),var(50)
vel = 0,-5
postype = p1
ontop = 1

[State 7010, varrandom]
type = varrandom
trigger1 = 1
v = 59
range = -70,70

[State 7010, varrandom]
type = varrandom
trigger1 = 1
v = 58
range = 60,-130
;range = -120,-200

[State 7010, varrandom]
type = varrandom
trigger1 = 1
v = 57
range = -70,70

[State 7010, varrandom]
type = varrandom
trigger1 = 1
v = 56
range = 60,-130
;range = -120,-200

[State 7010, varrandom]
type = varrandom
trigger1 = 1
v = 55
range = -70,70

[State 7010, varrandom]
type = varrandom
trigger1 = 1
v = 54
range = 60,-130
;range = -120,-200

[State 7010, varrandom]
type = varrandom
trigger1 = 1
v = 53
range = -70,70

[State 7010, varrandom]
type = varrandom
trigger1 = 1
v = 52
range = 60,-130
;range = -120,-200

[State 7010, varrandom]
type = varrandom
trigger1 = 1
v = 51
range = -60,60

[State 7010, varrandom]
type = varrandom
trigger1 = 1
v = 50
range = 60,-130
;range = -120,-200


;;;;;;;;;;;;;;;;;;;;THE PROBLEM;;;;;;;;;;;;;;;;
[State 55100, 4]
type = ChangeState
trigger1 = var(39) = 1
value = 55200
;;;;;;;;;;;;;;;;;;;;THE PROBLEM;;;;;;;;;;;;;;;;


;Spear Ram
[StateDef 55200]
type = S
movetype= A
physics = S
juggle  = 3
velset = 0,0
ctrl = 0
anim = 50020
poweradd = 0
sprpriority = 0

[State 55200, VelSet]
type = VelSet
trigger1 = time > 0
x = -13

[State 55200, ChangeState]
type = ChangeState
trigger1 = time >= 10
value = 55300 ; to spear blast
ctrl = 0



the puppet would spawn an immobile striker-helper in the first stage.

if the puppet is finished preparing the attack (the puppet would then go to the second state), he will "release" the attack, setting var(39) to 1. then, the attack should start moving since the trigger for the spawned helper to start moving is if var(39) = 1.

the problem is, it won't. any ideas?




2) how do i say: "if the CLSN of this attack hits the floor" in a trigger?


MUGEN CHARACTERS
Sabaku no Temari [100%] = RELEASED!
Akasuna no Sasori [100%] = RELEASED!
Namikaze Minato [5%] = ON HOLD
Uzumaki Naruto [5%] = Coding basic attacks


Maistral

nvm question 1, i apparently forgot about the redirection again, silly me  ;D

anyway, the second question, if anyone knows?


MUGEN CHARACTERS
Sabaku no Temari [100%] = RELEASED!
Akasuna no Sasori [100%] = RELEASED!
Namikaze Minato [5%] = ON HOLD
Uzumaki Naruto [5%] = Coding basic attacks


Алексей

There's no way to do that using CLSN collision. Technically, if you hit the floor, you missed and and that's all that counts for, nothing really. MoveHit, nor MoveContact would be able to detect that. I'm guessing you an animation that hits the floor? Such as punching the ground? If so, then just check if you did not make contact with your move on the AnimElem where your CLSN is hitting the ground. If that's not your case, then there's no generic way to detect if you CLSN is touching the ground. That's really up to position and knowing your own animations. As for detecting this for P2 as P1, I'm thinking it's impossible.

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

Maistral

#3
so, i guess there is no other workaround this other than using explods w/ postype at front/back/left/right. i mean, i program the attack such that if it "hits" the ground (based on the animation) it would trigger the explods. O.o


MUGEN CHARACTERS
Sabaku no Temari [100%] = RELEASED!
Akasuna no Sasori [100%] = RELEASED!
Namikaze Minato [5%] = ON HOLD
Uzumaki Naruto [5%] = Coding basic attacks


Алексей

That would be easier for you that detecting CLSN contact with the ground anyways. To do that just trigger the Explod(s) when your AnimElem is equal to one that is "hitting the ground."

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

Cyanide

Math. If you're making the thing bigger (based on your other topic you're using angledraw to increase it in size) simply use an fvar to establish that value to match your increasing sprite. When pos Y>= that value. changestate. Pretty simple really. Aside from the equation itself. But as you know your axis is 0, all you need to do probably is copy the angledraw equation to get something sensible.

And of course, clsn doesn't change in size when you use angledraw.


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.

Maistral

#6
err, nope sir. i didn't use angledraw this time - it's a different attack now, have this animation that is increasing in size (thus the areas with red clsns are getting bigger too).


MUGEN CHARACTERS
Sabaku no Temari [100%] = RELEASED!
Akasuna no Sasori [100%] = RELEASED!
Namikaze Minato [5%] = ON HOLD
Uzumaki Naruto [5%] = Coding basic attacks


Cyanide

Still math. Is it increasing by a certain amount? Something like

pos Y>= animelemtime(animelemno(0))*value of increase

For example.


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.

Maistral

nope sir. it's increasing in an inconsistent amount. i'm no math buff :(


MUGEN CHARACTERS
Sabaku no Temari [100%] = RELEASED!
Akasuna no Sasori [100%] = RELEASED!
Namikaze Minato [5%] = ON HOLD
Uzumaki Naruto [5%] = Coding basic attacks


Алексей


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

Maistral



MUGEN CHARACTERS
Sabaku no Temari [100%] = RELEASED!
Akasuna no Sasori [100%] = RELEASED!
Namikaze Minato [5%] = ON HOLD
Uzumaki Naruto [5%] = Coding basic attacks


Cyanide

Meh, be slack then.

animelemtime(2) = 0 && pos Y< -10
animelemtime(3) = 0 && pos Y< -20

and so on. Ugly, but it will work fine if you can't condense it with a consistent mathmatical equation.


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.

Maistral

i do pick up the animelem part sir, but i don't seem to get the purpose of the pos tags O.o

i mean, the helper is immobile. it just expands there in the middle of the screen..


MUGEN CHARACTERS
Sabaku no Temari [100%] = RELEASED!
Akasuna no Sasori [100%] = RELEASED!
Namikaze Minato [5%] = ON HOLD
Uzumaki Naruto [5%] = Coding basic attacks


Алексей

You said you're not using AngleDraw? If the "expanding" is just happening as a result of sprites changing size in the animation itself, then just trigger when AnimElem is equal to the one that it "hitting the ground." This will work as long as the move never changes animations in the middle and that things are consistent. Also, if the move is ever done in the air, it will kind of defeat the purpose of this. In that case, you could also trigger when statetype != A && pos y = 0 or something like that.

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

Maistral

uh, it's this. check the screenies.









there, so attack goes in all directions randomly, i wanted an effect that would detect if the clsn hits the floor, it would create random and massive explosions across it (the floor).

i just don't know what tag to use. i thought of

explod, blah blah
trigger1 = animelem = 3 ;anim element reaches the floor already
pos = x, y;have to randomize x, y = 0


and something like that. but i think it's too "technical" since i wanted to spawn the pyramid and the block at random heights (ex: varrandom, range = -80, -110) and with that, animelem = 3 trigger is ugly already..

i guess sir cyanide knows what effect i really want (i assume he watches naruto too, since i saw his mugen character creations and i saw sasuke and sakura in there XD)

that, and thanks guys.





and oh, a side question:
how do you say in a trigger: animtime = 0 (MINUS ONE TICK) ? or do i have to place the time manually (ie. time = some random crap number)


MUGEN CHARACTERS
Sabaku no Temari [100%] = RELEASED!
Akasuna no Sasori [100%] = RELEASED!
Namikaze Minato [5%] = ON HOLD
Uzumaki Naruto [5%] = Coding basic attacks


Алексей

Ok, well that would have avoided a lot of question had it been posted in the first place. Since you said this helper is stationary, I assume that the animation is expanding downwards, as are the CLSN. Pos Y isn't going to help you that case because Pos Y is never going to change if your helper is immobile.

trigger1 = AnimElem = 3
is too technical?

That's the simplest way to go about what you want to do. And given your code is set up the way I think it is, the only way. Also, If you're going to be spawning things at random locations, something like
random/500.0*100-50 would fit your needs better. Don't use Variables unless you absolutely need to. Cyanide has taught me that and it's an excellent rule to go by.

Quoteand oh, a side question:
how do you say in a trigger: animtime = 0 (MINUS ONE TICK) ? or do i have to place the time manually (ie. time = some random crap number)
"AnimTime = 0 - OneTick" would be AnimTime = -1. What are you trying to do? AnimTime returns negative values unless you mask it with abs().

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

Maistral

oops, wrong english.
too simple rather, that it's too limited. XD

yeah, guess animelem = 3 is the thing to go.. helper spawn postype is front anyway, so prolly i'll have consistent distances to work with.

i ended up with varset because they have to have the same y-position such that the two satetsu blocks would collide perfectly (and the shockwave effect would jive in perfectly too).

anyway, about the animtime, i wanted to trigger a varset one tick before the animelem ends. guess i'll try that tomorrow, it's 3AM here @_@

and thanks sir :D


MUGEN CHARACTERS
Sabaku no Temari [100%] = RELEASED!
Akasuna no Sasori [100%] = RELEASED!
Namikaze Minato [5%] = ON HOLD
Uzumaki Naruto [5%] = Coding basic attacks


Cyanide

Yes, pos Y IS going to help. Your pos Y may not change but the clsn boxes position alters. If the clsn is 10 pixels away from your axis and the floor is 10 pixels or less away, pos Y> -10 will pick up on that. If the clsn is 50 pixels away from you and pos Y> -50 then the clsn is touching the floor. Your pos may not change, but you're not using it to check position like that, you're using it as a guide for the clsn boxes.

How else are you going to know how big they are? Magic?


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.

Алексей

Sorry Cyanide, I didn't think that CLSN affected the value of pos y since position isn't changing. They should really specify that in the Documents under the "pos" trigger.

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

Cyanide

It doesn't. But the size of the clsn's touching the ground will be dependant on your pos Y.

If your pos Y is -160, and the clsn box is only 100 pixels below your axis on frame 2, then it won't trigger. If your pos is STILL -160 on frame 3, but the clsn box is 170 below you then it WILL trigger.


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.