helper problem

Started by sgn15, August 15, 2011, 05:02:21 PM

Previous topic - Next topic

sgn15

Spoiler (click to show)
;---------------------------------------------------------------------------
;IDLE
[Statedef 900]
type    = S
movetype= A
physics = N
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 900
sprpriority = 6

[State 0, HitOverride]
type = HitOverride
trigger1 = 1       ;gethitvar(damage)
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
;slot = -1
stateno = 903
time = -1
;forceair = 0
;ignorehitpause =
persistent = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = ishelper(1)  && var(3) != 1
x = 0
y = 110 - ScreenPos Y
ignorehitpause = 1
persistent = 1

[State 0, VelSet]
type = VelSet
trigger1 = Time = 0
x = 0
y = 1
;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
trigger1 = Time = 20
x = 0
y = 0
;ignorehitpause =
;persistent =

[State 0, Explod]
type = Explod
trigger1 = time = 0 && numexplod(901) < 1 && stateno = 900
anim = 901
ID = 901
pos = -1,-6
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
supermove
pausemove
scale = 1,1
sprpriority = 5
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
;ignorehitpause =
persistent = 0

[State 0, Explod]
type = Explod
trigger1 = time = 0 && numexplod(902) < 1 && stateno = 900
anim = 902
ID = 902
pos = 0,-15
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
supermove
pausemove
scale = 1,1
sprpriority = 7
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 1
;ignorehitpause =
persistent = 0

[State 0, 2]
type = assertspecial
trigger1 = 1
flag = noshadow

[State 0, ChangeState]
type = ChangeState
trigger1 = gametime = 40
value = 904
ctrl = 0
;anim =
;ignorehitpause =
persistent =  0

;---------------------------------------------------------------------------
;DAMAGE CHECKER
[Statedef 903]
type    = S
movetype= A
physics = N
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 903
sprpriority = 6

[State 0, VarAdd]
type = VarAdd
trigger1 = 1
v = 2   
value = gethitvar(damage)
;persistent =

[State 0, ChangeState]
type = ChangeState
trigger1 = var(2) <= 299
value = 900
ctrl = 0
persistent = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = var(2) >= 300
value = 904
ctrl = 0
persistent = 0

;---------------------------------------------------------------------------
;ATTACK
[Statedef 904]
type    = S
movetype= A
physics = N
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 904
sprpriority = 6

[State 0, VarSet]
type = VarSet
trigger1 = Time = 0
v = 3
value = 1
;ignorehitpause =
;persistent =

[State 0, PosAdd]
type = PosAdd
trigger1 = time = 0
x = 0
y = 200
;ignorehitpause =
persistent = 0

[State 0, 3]
type = HitDef
trigger1 = timemod = 5,0
attr = S, NA
animtype  = Light
damage    = 10
guardflag = NA
priority = 2, Hit
pausetime = 5,3
sparkno = s6008
sparkxy = -10,15
hitsound   = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 51
ground.velocity = -1
air.velocity = -1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1

[State 0, 4]
type = Destroyself
trigger1 = Animtime = 0


;---------------------------------------------------------------------------
[Statedef -2]

[State 0, 2]
type = helper
;triggerall = p2name != "Laxus"
trigger1 = (stateno = 190 && animelem = 4 || roundstate = 2) && numhelper(1) < 1
trigger1 = var(3) != 1
helpertype = normal
stateno = 900
ID = 1
postype = p1
pos = 0,0
ownpal = 1
ontop = 1
persistent = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =  stateno != 900  && numexplod(901) = 1
id = 901
;ignorehitpause =
;persistent =

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 =  stateno != 900 && numexplod(902) = 1
id = 902
;ignorehitpause =
;persistent =

900 - helper idle
903 - helper damage checker
904 - helper attack

what i plan to do:
1. call several helpers (one per ID) at 4th animelem of intro which is state 190 or start of match or when intro is skipped)
2. helper stays on screen throughout the match
3. when hit, it goes to state 903, gets damage then counts and adds in to var(2), if at least 300 total, go to state 904
if not at least 300, go back to state 900
4. when gametime has elapsed 40 ticks (regardless of the situation about the helper being hit and its damage counter), it will go to 904
5. when it has gone to state 904, after that it should destroyself after its animtime. (destroyself should happen to helper of per each specific ID)

problems so far:
1. when i press any button to skip intro, the state goes to 904 once then goes back to state 900 at start of match
2. when i hit the helper with a hitdef with a single hit damage of at least 300, yes it goes to 904 but it goes back to 900 afterwards and stays on screen, then the explods 901 and 902 doubles or is being spammed

I havent tested the accumulating damage counter.

the var(3) im not really sure what it is for. I tried it to make the helper not go back to the idle state 900 when it already went to the attack state (904) once (per ID). but i guess it didnt work

I also need correct triggers for the explod and removeexplod. they spam still.

apologizing in advance in case there were some stupid mistakes there. i always have short time free to code. but not taking excuses.

Rajaa Retired

Your problem s are not because the helper is going back to 900, it's because the helper is being re-summoned after it destroys itself in statedef 904. You need to limit its summoning. Gametime = 40 is pretty early, less than a second into the match.

sgn15

i misunderstood the definition of gametime trigger in the docs. now i have fixed it. sorry
so how do i limit the helper to be summoned only once per ID ?
so is the idea of a "switch" variable like i did with var(3) wrong?

i put the var(3) = 1 in state 904 so when its attacking, it should destroyself and not go back anymore
then in helper sctrl in state -2, i put var(3) != 1 as trigger

can you tell me how to improve that? or another way?

Cyanide

Helper and player have their own set of variables. Use parentvarset if you want to send a variable back to the parent.


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.

sgn15

ok thanks

i have a problem with the position. so i have made the helper to work like i want. now i want to call more helpers of the same state with different IDs

i am using this

[State 0, PosAdd]
type = PosAdd
trigger1 = ishelper(1)
x = 0
y = 65 - ScreenPos Y
ignorehitpause = 1
persistent = 1

that makes the helper always on sky level. but want to make the multiple helpers to be all in the sky level but not overlapping each other. i tried posset but when i try the char against himself, it overlaps their own set of helpers in the same position on screen.

is it possible to do what i want?

Алексей

ScreenPos does not take facing or side into consideration. It is purely the position on screen.

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