News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Coding some effects [SOLVED]

Started by Lord Mike, October 06, 2010, 10:33:50 PM

Previous topic - Next topic

Lord Mike

Hello.
As i've learned to code some new effects, i have encountered some new problems.

What i want to do for some of my chars now is to give a nice effect to the "star gauge" they all have (spoiler below).
Spoiler (click to show)

I want to give that effect whenever a star disappears from that meter.
My problem is the following: there are 3 chars that have the meter going down when it's assigned var goes from 7 to 0 before being able to perform a one shot kill move, unlike most of the others that have the assigned var going from 0 to 7.
Upon using this code for it:

;====================star effect============================================
;====================star gauge=============================================
;---------------------------------------------------------------------------
;޵¯ƒQ[ƒW
[State -2, ˜g]
type = Explod
triggerall = NumExplod(78000) = 0
trigger1 = roundstate > 1
anim = 78000
ID = 78000
postype = left
pos = ifelse(TeamSide = 1,228-var(18)*8,92+var(18)*7),30-var(18)*12;237//44//83
facing = ifelse(TeamSide = 1,1,-1)
removetime = -1
bindtime = -1
ownpal = 1
scale = 0.5,0.5
sprpriority = -100;98
pausemovetime = -1
supermovetime = -1

[State -2, š1]
type=Explod
triggerall = NumExplod(78001) = 0
trigger1 = roundstate > 1 && var(20) = 7
anim = 78001
ID=78001
postype = left
pos = ifelse(TeamSide = 1,277-var(18)*8,43+var(18)*7),35-var(18)*12;286//34
facing = ifelse(TeamSide = 1,1,-1)
removetime = -1
bindtime = -1
ownpal = 1
scale = 0.5,0.5
sprpriority = -99
pausemovetime = -1
supermovetime = -1

[State -2, š1Á–ŃAƒjƒ]
type = Helper
triggerall = NumExplod(78001) = 1
trigger1 = roundstate > 1 && var(20) < 7
ID = 68015
stateNo = 68015
name = "star effects"
postype = left
pos = ifelse(TeamSide = 1,240,80),0
helpertype = Normal
keyctrl = 0
ownpal = 1
persistent = 0
ignorehitpause = 1

[State -2, š2]
type=Explod
triggerall = NumExplod(78002) = 0
trigger1 = roundstate > 1 && var(20) = 6
anim = 78001
ID=78002
postype = left
pos = ifelse(TeamSide = 1,272-var(18)*8,48+var(18)*7),30-var(18)*12;281//39
facing = ifelse(TeamSide = 1,1,-1)
removetime = -1
bindtime = -1
ownpal = 1
scale = 0.5,0.5
sprpriority = -99
pausemovetime = -1
supermovetime = -1

[State -2, š2Á–ŃAƒjƒ]
type = Helper
triggerall = NumExplod(78002) = 1
trigger1 = roundstate > 1 && var(20) < 6
ID = 68015
stateNo = 68015
name = "star effects"
postype = left
pos = ifelse(TeamSide = 1,240,80),0
helpertype = Normal
keyctrl = 0
ownpal = 1
persistent = 0
ignorehitpause = 1

[State -2, š3]
type=Explod
triggerall = NumExplod(78003) = 0
trigger1 = roundstate > 1 && var(20) = 5
anim = 78002
ID=78003
postype = left
pos = ifelse(TeamSide = 1,263-var(18)*8,57+var(18)*7),30-var(18)*12;272//48
facing = ifelse(TeamSide = 1,1,-1)
removetime = -1
bindtime = -1
ownpal = 1
scale = 0.5,0.5
sprpriority = -99
pausemovetime = -1
supermovetime = -1

[State -2, š3Á–ŃAƒjƒ]
type = Helper
triggerall = NumExplod(78003) = 1
trigger1 = roundstate > 1 && var(20) < 5
ID = 68015
stateNo = 68015
name = "star effects"
postype = left
pos = ifelse(TeamSide = 1,240,80),0
helpertype = Normal
keyctrl = 0
ownpal = 1
persistent = 0
ignorehitpause = 1

[State -2, š4]
type=Explod
triggerall = NumExplod(78004) = 0
trigger1 = roundstate > 1 && var(20) = 4
anim = 78002
ID=78004
postype = left
pos = ifelse(TeamSide = 1,258-var(18)*8,62+var(18)*7),35-var(18)*12;267//53
facing = ifelse(TeamSide = 1,1,-1)
removetime = -1
bindtime = -1
ownpal = 1
scale = 0.5,0.5
sprpriority = -99
pausemovetime = -1
supermovetime = -1

[State -2, š4Á–ŃAƒjƒ]
type = Helper
triggerall = NumExplod(78004) = 1
trigger1 = roundstate > 1 && var(20) < 4
ID = 68015
stateNo = 68015
name = "star effects"
postype = left
pos = ifelse(TeamSide = 1,240,80),0
helpertype = Normal
keyctrl = 0
ownpal = 1
persistent = 0
ignorehitpause = 1

[State -2, š5]
type=Explod
triggerall = NumExplod(78005) = 0
trigger1 = roundstate > 1 && var(20) = 3
anim = 78001
ID=78005
postype = left
pos = ifelse(TeamSide = 1,250-var(18)*8,70+var(18)*7),35-var(18)*12;259//61
facing = ifelse(TeamSide = 1,1,-1)
removetime = -1
bindtime = -1
ownpal = 1
scale = 0.5,0.5
sprpriority = -99
pausemovetime = -1
supermovetime = -1

[State -2, š5Á–ŃAƒjƒ]
type = Helper
triggerall = NumExplod(78005) = 1
trigger1 = roundstate > 1 && var(20) < 3
ID = 68015
stateNo = 68015
name = "star effects"
postype = left
pos = ifelse(TeamSide = 1,240,80),0
helpertype = Normal
keyctrl = 0
ownpal = 1
persistent = 0
ignorehitpause = 1

[State -2, š6]
type=Explod
triggerall = NumExplod(78006) = 0
trigger1 = roundstate > 1 && var(20) = 2
anim = 78002
ID=78006
postype = left
pos = ifelse(TeamSide = 1,241-var(18)*8,79+var(18)*7),35-var(18)*12;250//70
facing = ifelse(TeamSide = 1,1,-1)
removetime = -1
bindtime = -1
ownpal = 1
scale = 0.5,0.5
sprpriority = -99
pausemovetime = -1
supermovetime = -1

[State -2, š6Á–ŃAƒjƒ]
type = Helper
triggerall = NumExplod(78006) = 1
trigger1 = roundstate > 1 && var(20) < 2
ID = 68015
stateNo = 68015
name = "star effects"
postype = left
pos = ifelse(TeamSide = 1,240,80),0
helpertype = Normal
keyctrl = 0
ownpal = 1
persistent = 0
ignorehitpause = 1

[State -2, š7]
type=Explod
triggerall = NumExplod(78007) = 0
trigger1 = roundstate > 1 && var(20) = 1
anim = 78002
ID=78007
postype = left
pos = ifelse(TeamSide = 1,236-var(18)*8,84+var(18)*7),30-var(18)*12;245//75
facing = ifelse(TeamSide = 1,1,-1)
removetime = -1
bindtime = -1
ownpal = 1
scale = 0.5,0.5
sprpriority = -99
pausemovetime = -1
supermovetime = -1

[State -2, š7Á–ŃAƒjƒ]
type = Helper
triggerall = NumExplod(78007) = 1
trigger1 = roundstate > 1 && var(20) < 1
ID = 68015
stateNo = 68015
name = "star effects"
postype = left
pos = ifelse(TeamSide = 1,240,80),0
helpertype = Normal
keyctrl = 0
ownpal = 1
persistent = 0
ignorehitpause = 1

[state -2, šÁ–Å]
type = removeexplod
trigger1 = var(20) < 7
ID = 78001
ignorehitpause = 1
[state -2]
type = removeexplod
trigger1 = var(20) < 6
ID = 78002
ignorehitpause = 1
[state -2, ]
type = removeexplod
trigger1 = var(20) < 5
ID = 78003
ignorehitpause = 1
[state -2, ]
type = removeexplod
trigger1 = var(20) < 4
ID = 78004
ignorehitpause = 1
[state -2, ]
type = removeexplod
trigger1 = var(20) < 3
ID = 78005
ignorehitpause = 1
[state -2]
type = removeexplod
trigger1 = var(20) < 2
ID = 78006
ignorehitpause = 1
[state -2]
type = removeexplod
trigger1 = var(20) < 1
ID = 78007
ignorehitpause = 1

[State -2, Ž€'›š]
type=Explod
triggerall = NumExplod(78010) = 0
trigger1 = roundstate > 1 && var(20) <= 0
anim = 78003
ID=78010
postype = left
pos = ifelse(TeamSide = 1,241-var(18)*8,77+var(18)*7),ifelse(TeamSide = 1,41-var(18)*12,41-var(18)*12)
facing = ifelse(TeamSide = 1,1,-1)
scale=.5,.5
sprpriority=-60
bindtime=-1
removetime=-1
ownpal=1
supermovetime=999999999
pausemovetime=999999999

[State -2, Ž€'›š"_""]
type=Explod
triggerall = NumExplod(78011) = 0
trigger1 = roundstate > 1 && var(20) <= 0
anim = 78010
ID=78011
postype = left
pos = ifelse(TeamSide = 1,247-var(18)*8,71+var(18)*7),ifelse(TeamSide = 1,43-var(18)*12,43-var(18)*12)
facing = ifelse(TeamSide = 1,1,-1)
scale=.5,.5
sprpriority=-50
trans=add
bindtime=-1
removetime=-1
ownpal=1
supermovetime=999999999
pausemovetime=999999999

[state -2, Ž€'›šÁ–Å]
type = removeexplod
trigger1 = var(20) > 0
ID = 78010
ignorehitpause = 1
[state -2]
type = removeexplod
trigger1 = var(20) > 0
ID = 78011
ignorehitpause = 1

i get what i want for the first star.

But when another star disappears (var(20)=6) the effect for the first star is displayed too.
When a third one disappears, i get that effect for all 3 stars, and so on. When var(20)=0 i get all 7 effects displayed.
Which makes sense, since var(20) is <7 when var(20)=5.
My point is that these star effects are meant only to be displayed once, and not when var(20)=4 to have the effects for var(20)=7, var(20)=6, var(20)=5 displayed too.
Spoiler (click to show)
Is there a way to correct this?
I have tried to use var(20)>=6 and have the star effect displayed with var(20)<6 and the effect is displayed infinitely...
何故諦める必要がある? 何を迷うことがある奪い取れ。今は悪魔が微笑む時代なんだ。

Cyanide

Use some static values rather than the < > stuff. The stars should only be displayed WHEN the var is a value, not also if it's below that value.

What are the helpers for?


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.

Lord Mike

#2
The helper is used to get that ring shaped effect shown in the first picture.

I have thought about using static values. But how do i do it? i want the first effect to be displayed when var(20) is no longer 7, effect number 2 when var(20) is no longer 6 and so on.
If i use != won't it trigger all the helpers at once?
Suppose i go and change the code to var(20)=7....var(20)=0, and the helpers to be displayed like var(20)!=7....var(20)!=1, will this not get me right were i started (spoiler no.2)?
Just to clarify my problem: i have the stars coded and displayed, what i'm trying to do is adding an effect when 1 star disappears.
何故諦める必要がある? 何を迷うことがある奪い取れ。今は悪魔が微笑む時代なんだ。

Cyanide

This is a horrible method then. Use the helper to manage each explod. When the variable changes the helper detects it, removes it's own personal effect and then displays the removal one. Then it blows itself up.

So

helper
trigger1 = var(20) = value
trigger1 = numhelper(helper) = 0
id = helper

inside the state you have

explod
time = 0
ID = ID

removeexplod
trigger1 = root, var(20) != value
ID = ID

explod
trigger1 = root, var(20) != value
persistent = 0

destroyself

That's all cut down, i hope it makes sense but i hate just giving people code they can copy paste. Basically you're spawning a helper when the variable is the right value. It then manages the creation of the first explod and continues to live until the players variable is changed. When that happens it removes explod 1 and creates explod 2 followed by doing destroyself to be removed.


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.

Lord Mike

Uhm...i don't think i get it all that good.

I tried to follow yours instructions, and went for this (i'm gonna use only the explod and helper for the first star):
[State -2, ]
type=Explod
triggerall = NumExplod(78001) = 0
trigger1 = roundstate > 1 && var(20) = 7
anim = 78001
ID=78001
postype = left
pos = ifelse(TeamSide = 1,277-var(18)*8,43+var(18)*7),35-var(18)*12;286//34
facing = ifelse(TeamSide = 1,1,-1)
removetime = -1
bindtime = -1
ownpal = 1
scale = 0.5,0.5
sprpriority = -99
pausemovetime = -1
supermovetime = -1

[State -2, ]
type = Helper
triggerall = NumExplod(78001) = 0
trigger1 = roundstate > 1 && root,var(20) = 7
ID = 68015
stateNo = 68015
name = "star effects"
postype = left
pos = ifelse(TeamSide = 1,240,80),0
helpertype = Normal
keyctrl = 0
ownpal = 1
persistent = 0
ignorehitpause = 1
[state -2, ]
type = removeexplod
trigger1 = var(20) != 7
ID = 78001
ignorehitpause = 1


And in the helper state:

[State 6002, š1]
type = Explod
trigger1 = root,var(20)=7 &&time = 0
ID = 78015
anim = 78005
postype = left
pos = ifelse(TeamSide = 1,280-root,var(18)*8,40+root,var(18)*7),36-root,var(18)*12;-9//+9
facing = ifelse(TeamSide = 1,1,-1)
removetime = 21
bindtime = -1
scale = .1,.1
ownpal = 1
ontop=1
pausemovetime = -1
supermovetime = -1
[state a]
type=removeexplod
trigger1 = root, var(20) != 7
ID = 78015
[state a]
type=explod
trigger1 = root, var(20) != 7
persistent = 0
[state a]
type=destroyself
trigger1=root, var(20) != 7

[State 6002, š1]
type = Explod
trigger1 = root,var(20)=7 && time = 12
ID = 78016
anim = 78006
postype = left
pos = ifelse(TeamSide = 1,280-root,var(18)*8,40+root,var(18)*7),36-root,var(18)*12
facing = ifelse(TeamSide = 1,1,-1)
removetime = 30
bindtime = -1
scale = .01,.01
ownpal = 1
ontop=1
pausemovetime = -1
supermovetime = -1
[state a]
type=removeexplod
trigger1 = root, var(20) != 7
ID = 78015
[state a]
type=explod
trigger1 = root, var(20) != 7
persistent = 0
[state a]
type=destroyself
trigger1=root, var(20) != 7

[State 6002, š1]
type = Explod
trigger1 = root,var(20)=7 && time = 15
ID = 78017
anim = 78007
postype = left
pos = ifelse(TeamSide = 1,280-root,var(18)*8,40+root,var(18)*7),36-root,var(18)*12
facing = ifelse(TeamSide = 1,1,-1)
removetime = 30
bindtime = -1
scale = .01,.01
ownpal = 1
ontop=1
pausemovetime = -1
supermovetime = -1
[state a]
type=removeexplod
trigger1 = root, var(20) != 7
ID = 78015
[state a]
type=explod
trigger1 = root, var(20) != 7
persistent = 0
[state a]
type=destroyself
trigger1=root, var(20) != 7

There are 3 explods in that helper you asked me about.
何故諦める必要がある? 何を迷うことがある奪い取れ。今は悪魔が微笑む時代なんだ。

Cyanide

Don't use explods to manage helper spawning. JUST spawn the helper. It can then display the explods. State -2 being executed every tick just means you have to keep locking things off. Using a helper you can display the explod once with ease and then remove it without worrying about OTHER things in state -2 interfering. Helper is created. Helper creates effect 1, parent changes variable, helper knows it should no longer exist, displays removal explod, helper destroyself

Use a new one if you want. Your previous comment made me think that helper was involved in this.


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.

Lord Mike

I just did that. Left in statedef -2 only the helpers ("star_effects").
Moved in the stars gauge code in that helper. It is displayed properly.
But now the effect for a disappearing star is not displayed at all, only the stars gauge is displayed.
何故諦める必要がある? 何を迷うことがある奪い取れ。今は悪魔が微笑む時代なんだ。

Cyanide

the helper should remove the old explod when var(20) != value helper expects.

THEN the helper should display the removal explod when var(20) != value helper expects

THEN the helper should do destroyself.

Above should be the same sequence you do as code inside the helper state

removeexplod

explod

destroyself


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.

Lord Mike

#8
Made it work properly.
Thank you, Cyanide!
何故諦める必要がある? 何を迷うことがある奪い取れ。今は悪魔が微笑む時代なんだ。