YesNoOk
avatar

An "auto tracking" move. (Read 481 times)

Started by GMONEY, December 14, 2009, 07:10:16 pm
Share this topic:
An "auto tracking" move.
New #1  December 14, 2009, 07:10:16 pm
  • **
I tried.......

[State 522, VelSet]
type = VelSet
triggerall = P2bodydist x>6
trigger1 = 1
x = 12

[State 522, ChangeState]
type = ChangeState
trigger1 = Movehit
trigger2 = P2bodydist y>4
trigger3 = P2statetype = H ;hurt
value = 523
ctrl = 0
Last Edit: June 19, 2012, 07:57:07 pm by GMONEY
Re: An "auto tracking" move.
#2  December 14, 2009, 09:48:49 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You are actually close there.

You need a hitdef in order to damage p2, you've got one right?

p2statetype = H won't work. That's not a valid value. You're after p2movetype = H

If that isn't working, what's going wrong? No state change?


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.
Re: An "auto tracking" move.
#3  December 14, 2009, 11:43:55 pm
  • ****
  • HAHAHAHAHAHAHAHA
    • Chile
I suposse this is a helper, right?

You should post the full estate, maybe you´re missing something (hitdef, destroyself, changeanim, etc)


Notice also that

[State 522, VelSet]
type = VelSet
triggerall = P2bodydist x>6
trigger1 = 1  <=== Why this line?
x = 12

you should use

[State 522, VelSet]
type = VelSet
trigger1 = P2bodydist x>6
x = 12
Re: An "auto tracking" move.
New #4  December 18, 2009, 10:11:27 pm
  • **
Yeah, I know my coding is medicore
Code:
;----------------------------------------------------------------------------
;Jump

[StateDef 524]
type = A
movetype= A
physics = A
velset = 0,-12
ctrl = 0
anim = 524
poweradd = 20
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = S1,4
volume = 100

[State 0, VelSet]
type = VelSet
triggerall = P2bodydist X > 24
trigger1 = 1
x = 19

[State 0, VelSet]
type = VelSet
trigger1 = P2bodydist x>11
x = 12

[State 523, 1]
type = HitDef
trigger1 = AnimElem = 1
attr = S, NA
damage = 0
animtype = Light
;guardflag = MA
hitflag = MFLD
priority = 7, Hit
pausetime = 0, 0
sparkno = -1
sparkxy = 9999, 9999
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 0
p2stateno = 526

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Movehit
value = S2,7
volume = 100
freqmul = 1.3
loop = 0
pan = 0

[State 523, end ChangeState]
type = ChangeState
triggerall = Movehit
trigger1 = P2bodydist y>4
trigger2 = P2movetype = H
value = 525
ctrl = 0

;--------------------------------------------
;Stompeing
[StateDef 525]
type = A
movetype= I
physics = A
ctrl = 0
anim = 525

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 5
value = S2,8
volume = 100
freqmul = .7

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 60
value = 42
ctrl = 0
;--------------------------------------------
;The victim get hit
[StateDef 526]
type = S
movetype= H
physics = S
anim = 525

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = Time = 1
value = 526

[State 0, LifeAdd]
type = LifeAdd
trigger1 = AnimElem = 1
value = -25
kill = 1
absolute = 1

[State 0, SelfState]
type = SelfState
trigger1  = Time = 90
value = 5120
anim = 5120  ;gets back up
;ctrl =
;ignorehitpause = 0
;persistent = 1

[State 0, SelfState]
type = SelfState
trigger1 = life = 0
value = 5110
anim = 5110

[State 0, VelSet]
type = VelSet
trigger1 = life = 0
x = 4

I want to make him jump very far if the victim is far away, But if they are nearby, I want him to jump a short distance.
Last Edit: June 19, 2012, 07:57:32 pm by GMONEY
Re: An "auto tracking" move.
#5  December 18, 2009, 10:56:57 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
What is state 42? That doesn't exist as far as i know. Try 50 instead.

As for jumping towards him.

x = floor(p2dist X*.027)

triggered once. Increase the .027 if you wanna go faster, you'll have to decrease the animation speed as well if you do that though. Set that ONCE. Like, time = 10 or something. Don't set it every tick.

Your method is OK, but it's a bit awkward when you deal with nearby distances.



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.
Re: An "auto tracking" move.
#6  December 27, 2009, 03:46:40 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I keep forgetting you're not good at this

type = velset
trigger1 = time = 0
x = floor(p2dist X*.027)


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.
Re: An "auto tracking" move.
New #7  December 28, 2009, 03:15:55 am
  • **
It works. Thanks.
Last Edit: June 19, 2012, 07:57:58 pm by GMONEY