collapse

Author Topic: Mugen character flying code  (Read 1169 times)

0 Members and 1 Guest are viewing this topic.

Offline Ryo Hazaki

  • Initiate
  • **
  • Posts: 179
  • Country: United States us
  • Last Login:June 24, 2022, 03:38:07 AM
Mugen character flying code
« on: November 20, 2016, 11:46:43 AM »
Greetings all,

I'm assisting a creator in making a character. The character is supposed to fly. He's been able to figure out some of the code to get the character to fly and attack in the air; however, he wants to add to the code to make the character come down after re-entering the flying command? What does he need to add?

Here's the code:

From CMD:

;-------------------------------------------------------------------------
;Fly

[Command]
name = "Fly"
command = ~D,DB,B, a

[Command]
name = "Fly"
command = ~D,DB,B, a

[Command]
name = "Fly"
command = ~D,DB,B, a

;---------------------------------------------------------------------------
;Commands
;---------------------------------------------------------------------------
[Statedef -1]
;---------------------------------------------------------------------------
;Fly

[State -1]
type = Changestate
trigger1 = command = "Fly"
trigger1 = statetype = S
trigger1 = ctrl = 1
value = 4999

[State -1]
type = Changestate
trigger1 = command = "Fly"
trigger1 = statetype = A
trigger1 = ctrl = 1
value = 4999
------------------------------------------------------------------
From the CNS:

[Statedef 4999]
type    = S
movetype= I
physics = S
anim =41
ctrl = 0

[State 4999, 1]
type = Explod
trigger1 = Time = 1
trigger1 = statetype != A
anim = F62
pos= 0,0
postype= p1
sprpriority = 3

[State 4999, 2]
type = PlaySnd
trigger1 = Time = 0
value = 6, 3

[State 5000, stand in the air]
type = Velset
trigger1= time = 0
y=-9

[State 5000, define var]
type = Varset
trigger1= time = 0
v = 4
value = 0

[State 5000, stand in the air]
type = Changestate
trigger1= time = 10
value = 4998

;===============================================================================
;Flying
;===============================================================================

[Statedef 4998]
type    = A
movetype= I
physics = A
ctrl = 0

[State 5000, 0]
type = Varset
trigger1 = time = 0
v=5
value = 5000

[State 5000, stand in the air]
type = Changeanim
trigger1= vel x =0
trigger1= vel y >= 0
trigger1= anim != 6000
value = 6000

[State 5000, stop in the air]
type = Velset
trigger1= command != "holdfwd"
trigger1= command != "holdback"
trigger1= command != "holdup"
trigger1= command != "holddown"
x=0
y=0

[State 5000, stand in the air]
type = Velset
trigger1= command = "holdfwd"
trigger2= command = "holdback"
y=0

[State 5000, stand in the air]
type = Velset
trigger1= command = "holdup"
trigger2= command = "holddown"
x=0

[State 5000, to turn aroud]
type = Turn
trigger1 = p2dist X < -5

[State 5000, fly forward]
type = Velset
trigger1= command = "holdfwd"
x = 4.3

[State 5000, fly back]
type = Velset
trigger1= command = "holdback"
x = -4.3

[State 5000, fly up]
type = Velset
trigger1= command = "holdup"
trigger1= command != "holdback"
trigger1= command != "holdfwd"
trigger1= pos y > -220
y = -3.5

[State 5000, fly diagonally forward and upward]
type = Velset
trigger1 = command = "holdfwd"
trigger1 = command = "holdup"
x = 4.3
y = -3.5

[State 5000, fly diagonally up and back]
type = Velset
trigger1 = command = "holdback"
trigger1 = command = "holdup"
x = -4.3
y = -3.5

[State 5000, stop flying up]
type = Velset
trigger1= command = "holdup" || command != "holdback" || command != "holdfwd"
trigger1= pos y < -220
y=0

[State 5000, stop flying up]
type = Velset
trigger1= command = "holdup" || command = "holdfwd" || command != "holdback"
trigger1= pos y < -220
y=0

[State 5000, fly down]
type = Velset
trigger1= command = "holddown"
trigger1= command != "holdback"
trigger1= command != "holdfwd"
trigger1= pos y <= -40
y = 2.9

[State 5000, fly back down diagonal]
type = Velset
trigger1= command = "holddown"
trigger1= command = "holdback"
trigger1= pos y <= -40
x = -4.3
y = 2.9

[State 5000, fly diagonal front low]
type = Velset
trigger1= command = "holddown"
trigger1= command = "holdfwd"
trigger1= pos y <= -40
x = 4.3
y = 2.9

[State 5000, stop flying down]
type = Velset
trigger1= command = "holddown"
trigger1= pos y >= -40
y=0

[State 5000, fly up]
type = Changeanim
trigger1= vel y < 0
trigger1= pos y >= -220
trigger1= command != "holdfwd"
trigger1= command != "holddown"
trigger1= command != "holdback"
trigger1= command = "holdup"
trigger1= anim != 6003
value = 6003

[State 5000, fly forward]
type = Changeanim
trigger1 = command = "holdfwd"
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1= anim != 6001
value = 6001

[State 5000, fly diagonally up front]
type = ChangeAnim
trigger1 = command = "holdfwd" && command = "holdup"
trigger1 = command != "holddown"
trigger1 = anim != 6004
value = 6004

[State 5000, fly back]
type = Changeanim
trigger1 = command = "holdback"
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1 = anim != 6002
value = 6002

[State 5000, fly diagonally backwards up]
type = Changeanim
trigger1 = command = "holdup"
trigger1 = command = "holdback"
trigger1 = command != "holddown"
trigger1 = anim != 6002
value = 6002

[State 5000, fly down]
type = Changeanim
trigger1= vel y > 0
trigger1= anim != 6000
trigger1 = command != "holddown"
value = 6000

[State 5000, fly back down diagonal]
type = Changeanim
trigger1= command = "holddown"
trigger1= command = "holdback"
trigger1 = anim != 6002
value = 6002

[State 5000, fly diagonal front low]
type = Changeanim
trigger1= command = "holddown"
trigger1= command = "holdfwd"
trigger1 = anim != 6001
value = 6001

[State 5000, Manual order]
type = VarSet
trigger1 = command = "Fly"
trigger2 = command = "Fly"
trigger3 = command = "Fly"
v = 4
value = 458

[State 5000, Land if fight ends]
type = Changestate
trigger1 = Win = 1
trigger2 = lose = 1
value = 50

[State 5000, weak punch]
type = ChangeState
value = 6010
trigger1= command = "x"

[State 5000, medium punch]
type = ChangeState
value = 6011
trigger1 = command = "y"

[State 5000, strong punch]
type = ChangeState
value = 6012
trigger1 = command = "z"

[State 5000, weak kick]
type = Changestate
trigger1= command = "a"
value = 6013

[State 5000, medium kick]
type = ChangeState
value = 6014
trigger1= command = "b"

[State 5000, strong kick]
type = ChangeState
value = 6015
trigger1= command = "c"

[State 5000, land]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = Var(5) != 5000
value = 50

;-------------------------------------------------------------------------------
;Flying light punch

[Statedef 6010]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
anim = 6010
poweradd = 15
sprpriority = 2
velset = vel x, 0

[State 6010, PlaySnd]
type = PlaySnd
trigger1 =  AnimElem = 1
value = 8400,0

[State 6010, HitDef]
type = HitDef
trigger1 = time = 0
attr = A,NA
damage = 15,1
givepower = 15
getpower = 20
animtype = Light
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11,11
sparkno = s7710
sparkxy = -10, -63
guard.sparkno = s6767
hitsound = s8000,0
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 25
ground.velocity = -6
air.fall = 0
air.velocity = -3.2, -10.5

[State 6010, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = prevstateno

;-------------------------------------------------------------------------------
;Flying medium punch

[Statedef 6011]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
anim = 6011
poweradd = 35
sprpriority = 2

[State 6011, PlaySnd]
type = PlaySnd
trigger1 =  AnimElem = 1
value = 8400,1

[State 6011, HitDef]
type = HitDef
trigger1 = time = 0
attr = A,NA
damage = 35,1
givepower = 30
getpower = 40
animtype = medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11,11
sparkno = s7711
sparkxy = -10,-68
guard.sparkno = s6767
hitsound = s8000,1
guardsound = 6,0
ground.type = High
ground.slidetime = 25
ground.hittime  = 20
ground.velocity = -8
air.fall = 0
air.velocity = -3.2, -7.5

[State 6011, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = prevstateno

;-------------------------------------------------------------------------------
;Flying strong punch

[Statedef 6012]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
anim = 6012
poweradd = 55
sprpriority = 2

[State 6012, PlaySnd]
type = PlaySnd
trigger1 =  AnimElem = 1
value = 8400,2

[State 6012, HitDef]
type = HitDef
trigger1 = time = 0
attr = A,NA
damage = 45,1
givepower = 50
getpower = 70
animtype = High
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11,11
sparkno = s7712
sparkxy = -10, -53
guard.sparkno = s6767
hitsound = s8000,2
guardsound = 6,0
ground.type = High
ground.slidetime = 18
ground.hittime  = 25
ground.velocity = -10
air.velocity = -12,10
air.hittime = 25
air.fall = 1

[State 6012, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = prevstateno

;-------------------------------------------------------------------------------
;Flying light kick

[Statedef 6013]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
anim = 6013
poweradd = 15
sprpriority = 2

[State 6013, PlaySnd]
type = PlaySnd
trigger1 =  AnimElem = 1
value = 8400,0

[State 6013, HitDef]
type = HitDef
trigger1 = time = 0
attr = A,NA
damage = 15,1
givepower = 15
getpower = 20
animtype = Light
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11,11
sparkno = s7710
sparkxy = -10, -63
guard.sparkno = s6767
hitsound = s8000,3
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -6
air.fall = 0
air.velocity = -3.2, -10.5
air.hittime = 25

[State 6013, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = prevstateno

;-------------------------------------------------------------------------------
;Flying medium kick
[Statedef 6014]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
anim = 6014
poweradd = 35
sprpriority = 2

[State 6014, PlaySnd]
type = PlaySnd
trigger1 =  AnimElem = 1
value = 8400,1

[State 6014, HitDef]
type = HitDef
trigger1 = time = 0
attr = A,NA
damage = 35,1
givepower = 30
getpower = 40
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11,11
sparkno = s7711
sparkxy = -10,-68
guard.sparkno = s6767
hitsound = s8000,4
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -8
air.fall = 0
air.velocity = -3.2, -7.5
air.hittime = 25

[State 6014, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = prevstateno

;-------------------------------------------------------------------------------
;Flying strong kick

[Statedef 6015]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
anim = 6015
poweradd = 55
sprpriority = 2

[State 6015, PlaySnd]
type = PlaySnd
trigger1 =  AnimElem = 1
value = 8400,2

[State 6015, HitDef]
type = HitDef
trigger1 = time = 0
attr = A,NA
damage = 45,1
givepower = 50
getpower = 70
animtype = High
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11,11
sparkno = s7712
sparkxy = -10, -53
guard.sparkno = s6767
hitsound = s8000,5
guardsound = 6,0
ground.type = High
ground.slidetime = 18
ground.hittime  = 25
ground.velocity = -10
air.velocity = -12,10
air.fall = 1
air.hittime = 25

[State 6015, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = prevstateno



Offline Cyanide

  • MUGEN Content Architect
  • *****
  • Posts: 813
  • Last Login:March 29, 2019, 06:52:34 AM
    • Mugen Obscurity
Re: Mugen character flying code
« Reply #1 on: November 21, 2016, 01:07:22 AM »
Assuming that this only works when the character isn't doing anything else?

[State -1]
type = changestate
triggerall = stateno = 4998 && command = "fly"
trigger1 = statetype = A
value = 50

Basic enough.

Offline Ryo Hazaki

  • Initiate
  • **
  • Posts: 179
  • Country: United States us
  • Last Login:June 24, 2022, 03:38:07 AM
Re: Mugen character flying code
« Reply #2 on: November 21, 2016, 12:57:26 PM »
Thank you for your response. :Terry I'm a noob, so I'm learning as I go  :rules: so I can't call it "basic" at the moment. In time though, this will become easier. As always, thank you for your knowledge. If for some reason it doesn't work, I'll request the author to post any other part of the code(s) that I may've missed. Thanks again. 

Tags:
 


* IMT Facebook

Help us by Donating!

IMT Discord

Join us at our Discord! Click the image below!

* IMT Shoutbox

Sorry, this shoutbox does not exist.

* Recent Posts

SPIDER-VERSE THE AMAZING MUGENSTORY©EPISODE 10 "THE OTHERVERSE" 1080P BY REB3LTV by Rage
[March 27, 2024, 02:44:21 PM]


D2TD VS Showcase Thread by D2TD
[March 24, 2024, 11:09:37 AM]


Tree Of Erebus Stage 1.1 & 1.0 by MatreroG
[March 22, 2024, 08:13:48 AM]


.Batzarro's. Sprite Edits by MatreroG
[March 20, 2024, 07:58:08 AM]


World Heroes 2 Shura Stage by Vegaz by LightFlare
[March 19, 2024, 12:44:28 PM]


MOVED: Prepare your ****! ***** Soldier gets his **** ready in MUGEN! by Rage
[March 18, 2024, 11:08:23 AM]


[WIP] Pocket Dimensional Clash 2 by O Ilusionista
[March 14, 2024, 01:34:08 PM]


R.I.P. Akira Toriyama "Dragonball Legend" by Rage
[March 12, 2024, 03:01:39 PM]


DBFZ Rocky Field (noon) by jafar
[March 10, 2024, 11:59:23 PM]


World Heroes 2 Neo Geegus Stage by Vegaz by LightFlare
[March 09, 2024, 11:04:56 AM]

* IMT Calendar

March 2024
Sun Mon Tue Wed Thu Fri Sat
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 [29] 30
31

SimplePortal 2.3.5 © 2008-2012, SimplePortal