flying attack codes and homing projectile with detonator

Started by sgn15, July 28, 2010, 06:37:29 AM

Previous topic - Next topic

sgn15

i used this flying codes that i got from searching in google and the flying code works

Spoiler (click to show)
start flying(1800)
fly stand(1900)
fly fwd(1901)fly back(1902)
fly up(1903)
fly down(1904)

cns
;---------------------------------------------------------------------------
;fly
[Statedef 1900]
type = S
ctrl = 0
anim = 1900
velset = 0,0

[State 1900, para1]
type = VelSet
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1 = Var(2) = 0
trigger2 = Pos Y < -405
x = 0
y = 0

[State 1900, para2]
type = ChangeAnim
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1 = Anim != 1900
value = 1900

[State 1900,fuwaVar(1)]
type = VarSet
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1 = var(2) != 2
trigger2 = var(2) = 2
trigger2 = Vel Y >= 1.4
v = 2
value = 1

[State 1900,fuwaVar(2)]
type = VarSet
trigger1 = Var(2) = 1
trigger1 = Vel Y <= -1.4
trigger2 = P2BodyDist Y > 405
trigger2 = Vel Y < 0
v = 2
value = 2

[State 1900,fuwaUp]
type = VelAdd
trigger1 = Var(2) = 1
y = -0.2

[State 1900,fuwaDown]
type = VelAdd
trigger1 = Var(2) = 2
y = 0.2

[State 1900,fuwaEnd]
type = VelSet
triggerall = Var(2) != 0
trigger1 = command = "holdfwd"
trigger2 = command = "holdback"
trigger3 = command = "holdup"
trigger4 = command = "holddown"
y = 0

[State 1900,fuwaEndVar]
type = VarSet
trigger1 = command = "holdfwd"
trigger2 = command = "holdback"
trigger3 = command = "holdup"
trigger4 = command = "holddown"
v = 2
value = 0

[State 1900, UpBorder]
type = PosSet
trigger1 = Pos Y < -405
y = -405

[State 1500, UpBorder2a]
type = PosAdd
trigger1 = P2BodyDist Y > 405
trigger1 = Vel Y < 0
y = 1

[State 1500, UpBorder2b]
type = VelSet
trigger1 = P2BodyDist Y > 405
trigger1 = Vel Y < 0
y = 0

[State 1900, GoDown1]
type = VelAdd
trigger1 = command = "holddown"
y = 0.3

[State 1900,GoDown2]
type = VelSet
trigger1 = command = "holddown"
trigger1 = Vel Y < 0
y = 0

[State 1900, GoUpAnim]
type = ChangeAnim
trigger1 = Anim != 1904
trigger1 = command = "holddown"
value = 1904

[State 1900, GoUp1]
type = VelAdd
trigger1 = command = "holdup"
y = -0.3

[State 1900,GoUp2]
type = VelSet
trigger1 = command = "holdup"
trigger1 = Vel Y > 0
y = 0

[State 1900, GoUpAnim]
type = ChangeAnim
trigger1 = Anim != 1903
trigger1 = command = "holdup"
value = 1903

[State 1900, GoBack1]
type = VelAdd
trigger1 = command = "holdback"
x = -0.3

[State 1900,GoBack2]
type = VelSet
trigger1 = command = "holdback"
trigger1 = Vel X > 0
x = 0

[State 1900, GoBackAnim]
type = ChangeAnim
triggerall = Anim != 1902
trigger1 = command = "holdback"
;trigger2 = command = "holddown"
value = 1902

[State 1900, GoFwd1]
type = VelAdd
trigger1 = command = "holdfwd"
x = 0.3

[State 1900,GoFwd2]
type = VelSet
trigger1 = command = "holdfwd"
trigger1 = Vel X < 0
x = 0

[State 1900, GoFwdAnim]
type = ChangeAnim
trigger1 = Anim != 1901
trigger1 = command = "holdfwd"
value = 1901

[State 1900,Turn]
type = Turn
trigger1 = P2dist X < 0

[State 1900,Land]
type = ChangeState
trigger1 = Pos Y >= 0
value = 50
ctrl = 1

[State 2000,End]
type = ChangeState
trigger1 = command = "hold_x"
trigger1 = command = "hold_y"
trigger1 = command = "holddown"
value = 50
ctrl = 1

[State 2000,WinALose]
type = ChangeState
trigger1 = Win = 1
trigger2 = Lose = 1
value = 50
------------------------------------------

start flying(1800)
;-------------------------------------------------------------------------
; fly start
[Statedef 1800]
type = A
movetype = A
physics = A
juggle = 0
velset = 0, -8, 0
ctrl = 0
anim = 1800

[State 1300, Super D]
type = AfterImage
trigger1 = Time = 0
trans = add1
TimeGap = 1
FrameGap = 6
time = 20
length = 15
PalBright = 0, 0, 0
PalContrast = 128,128,128
PalAdd = 0, 0, 0
PalMul = 1,1,1;.9, .9, .9

[State 410, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 3, 0

[State 410, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 1900
ctrl = 1

cmd
[Command]
name = "fly"
command = z
time = 1

;---------------------------------------------------------------------------
; fly
[State -1]
type = ChangeState
value = 1800
triggerall = command = "fly"
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; fly when jumping
[State -1]
type = ChangeState
value = 1900
triggerall = command = "fly"
trigger1 = statetype = A
trigger1 = ctrl = 1

[State -1]
type = ChangeState
value = 50
triggerall = command = "fly"
trigger1 = stateno = 1900
trigger1 = statetype = S
trigger1 = ctrl = 0

[State -1, Fly]
type = ChangeState
triggerall = Var(15)= 1 && movetype != H && (p2statetype = A || p2statetype = S)
trigger1 = ctrl = 1 && alive = 1 && p2dist Y< -30 && p2movetype != A && pos Y= 0 && random = 850
trigger1 = P2Life > 0 && p2stateno != 40 && p2stateno != 45 && p2stateno != 50 && p2stateno != 51 && p2stateno != 52
trigger2 = random = 200 && ctrl = 1
value = 1800

[State -1, Fly]
type = ChangeState
triggerall = Var(15)= 1 && movetype != H && (p2statetype = A || p2statetype = S)
trigger1 = ctrl = 1 && alive = 1 && p2dist Y< -30 && p2movetype != A && pos Y <-50
trigger1 = P2Life > 0 && p2stateno != 40 && p2stateno != 45 && p2stateno != 50 && p2stateno != 51 && p2stateno != 52
trigger2 = random = 200 && ctrl = 1
value = 1900

[State -1, Fly]
type = ChangeState
triggerall = Var(15)= 1 && movetype != H && stateno = 1900
trigger1 = alive = 1 && p2statetype = S && p2dist Y> 100
trigger1 = P2Life > 0 && p2stateno = 0 || p2stateno = 20 || p2stateno = 11
trigger2 = p2statetype != A && time > 90 && pos Y!= 0
value = 50

[State -3, AirGuard]
type = ChangeState
triggerall = (Var(0) = 1) && (StateType = A) && (Pos Y < 0) && (P2BodyDist Y >= -120)
triggerall = (StateType = A) && (P2MoveType = A)
trigger1 = ((P2BodyDist X <= 120) && (Ctrl)) || (StateNo = [140, 155])
value = 132

anyone here can give me codes for attacking while flying that is compatible to the flying codes i used (above)?


2. i want to make my char throw something to the opponent that will stay in the air and follow the enemy around (while staying flying in the air) then my char can detonate those as bombs by using another button.

i used this tutorial for homing projectiles (coded as helper)

Spoiler (click to show)


===================
Homing Projectiles
===================
---------------------------------------------------------------------------
This creates a projectile that follows the opponent where ever they go.
---------------------------------------------------------------------------

To accomplish this, a Helper must be used. If you wish to add
any Projectile Effects, simply add them to this state.

[Statedef ****]
type = A
movetype = A
physics = N
anim = ****

This is needed, so that the projectile cannot be hit, and turn into a
copy of the main character. This is what I use, but alternatively, you
can put in a HitOverride, or just forget about the Clsn2 boxes. =)

[State ****: NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

These next pieces are needed to follow the opponent, and to turn if the
opponent somehow gets behind it. The turning is not required, but it depends
on the type of anim you are using for the projectile.

All the VelSet and VelAdd values should can be changed accordingly.

The triggers "Vel X > -6", "Vel Y < 6" and "Vel Y > -6" are used to limit the speed of the projectile.

[State ****: Turn]
type = Turn
trigger1 = (P2Dist X < 10)

[State ****: VelSet]
type = VelSet
trigger1 = (!Time)
x = 3

[State ****: VelAdd]
type = VelAdd
trigger1 = (P2Dist X < 0) && (Vel X > -6)
x = -0.2

[State ****: VelAdd]
type = VelAdd
trigger1 = (P2Dist X > 0) && (Vel X < 6)
x = 0.2

[State ****: VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y > Pos Y) && (Vel Y < 6)
y = 0.2

[State ****: VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y <= Pos Y) && (Vel Y > -6)
y = -0.2

Of course, a HitDef controller is needed. Everything here is up to you, but the "attr" parameter must
be set to a projectile type. Eg "S, SP"

[State ****: HitDef]
type = HitDef
trigger1 = 1
attr = S, SP
[etc...]

This last piece is used to destroy the Helper when it makes contact with the opponent, or when it has
floating around for a period of time, to reduce cheapness.

Alternatively you can put the Projectile into another state, if you want something else to occur before
it is removed.

[State ****: DestroySelf]
type = DestroySelf
trigger1 = (MoveContact) || (Time > 200)
ignorehitpause = 1


credits to FlowaGirl for the tutorial..

Cyanide

Most of the time flight is a hack of the standing state, so if you enter state 0 and you're above ground level you return back to flight.

Most of the time you just swap the requirement of ctrl for stateno = 1900, or add a trigger2 = stateno = 1900 for standing states. If you don't wanna use standing states, just set up more changestates with the above trigger instead of ctrl and statetype.


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

im sorry i didnt got what you said quite clear... so if i want to use the standing attacks i have so far, i dont have to make new states in animations and new statedefs in cns? is that what you mean by "swapping ctrl requirement for state no = 1900 or ......." ?

and about the second option you mentioned (not using standing states), can you give me a very simple sample code (no need for the hitdef)... i think i prefer this option better... i want to add new statedefs (my flying attacks have different animations from standing attacks)

this is my first time coding a flying char.. and this is my third char overall... so i guess im still a noob in coding.. further help would be much appreciated. thanks   :)

Cyanide

Make an attack.

Make it possible to do that attack from state 1900.

That is all.


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

Spoiler (click to show)

CNS codes

[Statedef 2001]
type    = S
ctrl = 0
velset = 0,0
anim = 2001

[state 2001, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA         ;Attribute: Standing, Normal Attack
damage = 23, 0         ;Damage that move inflicts, guard damage
animtype = Light         ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA         ;Flags on how move is to be guarded against
hitflag = MAF         ;Flags of conditions that move can hit
priority = 3, Hit         ;Attack priority: 0 (least) to 7 (most), 4 default
               ;Hit/Miss/Dodge type (Def: Hit)
pausetime = 8, 8         ;Time attacker pauses, time opponent shakes
sparkno = 0            ;Spark anim no (Def: set above)
sparkxy = -10, -76      ;X-offset for the "hit spark" rel. to p2,
               ;Y-offset for the spark rel. to p1
hitsound = 5, 0         ;Sound to play on hit
guardsound = 6, 0         ;Sound to play on guard
ground.type = High      ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5      ;Time that the opponent slides back
ground.hittime  = 12      ;Time opponent is in hit state
ground.velocity = -6      ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8   ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High         ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3      ;X-velocity at which opponent is pushed,
               ;Y-velocity at which opponent is pushed
air.hittime = 12         ;Time before opponent regains control in air

[State 2001, 60]
type = ChangeState
trigger1 = AnimTime = 0
value = 1900
ctrl = 1

CMD codes

[command]
name = "fly - negative"
command = x
time = 15

;fly - negative
[State -1, fly - negative]
type = ChangeState
value = 2001
triggerall = command = "fly - negative"
triggerall = command = "x"
trigger1 = (statetype = S) && ctrl
trigger1 = stateno = 1900

not working. what do i need to change or add to my codes?

Cyanide

You don't have ctrl in state 1900. Remove it as a trigger in your cmd.


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

thanks... i got it to work! thanks a lot!

btw i edited the title of the thread so i wont be making another thread to help ease the job of moderators a bit by one thread less

i edited the first post too..

for the homing projectile with detonator problem:

my states:
230 - char releasing/throwing the helper (default standing light kick)
501 - helper (follows the enemy around, can be detonated)
250 - char detonating the helper (default standing strong kick)
251 - explosion effects animation (didnt add a statedef of this because i also dont know how to code this)

Spoiler (click to show)

i used the default Standing light kick statedef

[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 22
ctrl = 0
velset = 0,0
anim = 230

[State 230, 2]
type = helper
trigger1 = animelem = 3
helpertype = normal
stateno = 501
postype = p1
pos = 0, -15
ownpal = 1
ontop = 1

[State 230, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

HELPER that my char throws and i can detonate (already added the homing projectile codes)

[Statedef 501]
type    = A
movetype= A
physics = N
juggle  = 4
poweradd= 500
keyctrl = 1
velset = 4,0
anim = 501
sprpriority = 2

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

[State 501, sprpriority]
type = sprpriority
trigger1 = 1
value = 5

;=======THIS PART IS FROM CODEDOCS============================

[State 501, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 501, Turn]
type = Turn
trigger1 = (P2Dist X < 10)

[State 501, VelSet]
type = VelSet
trigger1 = (!Time)
x = 3

[State 501, VelAdd]
type = VelAdd
trigger1 = (P2Dist X < 0) && (Vel X > -6)
x = -0.2

[State 501, VelAdd]
type = VelAdd
trigger1 = (P2Dist X > 0) && (Vel X < 6)
x = 0.2

[State 501, VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y > Pos Y) && (Vel Y < 6)
y = 0.2

[State 501, VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y <= Pos Y) && (Vel Y > -6)
y = -0.2

;====END OF PARTS FROM CODEDOCS======================================

[State 501, 3]
type = HitDef
trigger1 = hitcount < 1
attr = S, SP
;====attr = S, NA
animtype  = Light
damage    = 75
guardflag = NA
priority = 7, Hit
pausetime = 3,3
sparkno = 0
sparkxy = -10,-5
hitsound   = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 11
ground.velocity = -4,-2
air.velocity = -4,-2
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1
palfx.time = 60
palfx.add = -100, -100, 7
palfx.sinadd = 30, 30, 0, 44
palfx.color = 0
palfx.invertall = 1

[State 501, 4]
type = Destroyself
trigger1 = command = "c"

[State 501, ChangeState]
type = ChangeState
trigger1 = command = "c"
value = 250
ctrl = 1
;anim =
;ignorehitpause =
;persistent =

DETONATOR (default standing strong kick code, didnt put anything here because i dont know how to code the detonator)

[Statedef 250]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 65
ctrl = 0
velset = 0,0
anim = 250

[State 250, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


right now this code.. the helper follows the enemy for some time (time = 120 in the destroyself code)... how do i code the detonator and also the explosion effects animations?

Cyanide

In your helper alter this

Quote[State 501, 4]
type = Destroyself
trigger1 = command = "c"

[State 501, ChangeState]
type = ChangeState
trigger1 = command = "c"
value = 250
ctrl = 1
Destroyself needs a new trigger. You mentioned time = 120, use that. Changestate, alter it to read

trigger1 = parent, stateno = 250
value = 251

then create a state where the helper blows up. Just use a destroyself here. This state is EXACTLY the same as a normal attack, no different in any way.


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

Spoiler (click to show)


;---------------------------------------------------------------------------
; Standing Light Kick
; CNS difficulty: easy

[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 22
ctrl = 0
velset = 0,0
anim = 230

[State 230, 2]
type = helper
trigger1 = animelem = 3
helpertype = normal
stateno = 501
postype = p1
pos = 0, -15
ownpal = 1
ontop = 1

[State 230, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;---------------------------------------------------------------------------
;Mini Hollow  (Standing Light Kick)

[Statedef 501]
type    = A
movetype= A
physics = N
juggle  = 4
poweradd= 500
keyctrl = 1
velset = 4,0
anim = 501
sprpriority = 2

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

[State 501, sprpriority]
type = sprpriority
trigger1 = 1
value = 5

;=======THIS PART IS FROM CODEDOCS============================

[State 501, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 501, Turn]
type = Turn
trigger1 = (P2Dist X < 10)

[State 501, VelSet]
type = VelSet
trigger1 = (!Time)
x = 3

[State 501, VelAdd]
type = VelAdd
trigger1 = (P2Dist X < 0) && (Vel X > -6)
x = -0.2

[State 501, VelAdd]
type = VelAdd
trigger1 = (P2Dist X > 0) && (Vel X < 6)
x = 0.2

[State 501, VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y > Pos Y) && (Vel Y < 6)
y = 0.2

[State 501, VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y <= Pos Y) && (Vel Y > -6)
y = -0.2

;====END OF PARTS FROM CODEDOCS======================================

[State 501, 3]
type = HitDef
trigger1 = hitcount < 1
attr = S, SP
;====attr = S, NA
animtype  = Light
damage    = 75
guardflag = NA
priority = 7, Hit
pausetime = 3,3
sparkno = 0
sparkxy = -10,-5
hitsound   = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 11
ground.velocity = -4,-2
air.velocity = -4,-2
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1
palfx.time = 60
palfx.add = -100, -100, 7
palfx.sinadd = 30, 30, 0, 44
palfx.color = 0
palfx.invertall = 1

[State 501, 4]
type = Destroyself
trigger1 = time = 120
trigger1 = command = "c"

[State 501, ChangeState]
type = ChangeState
trigger1 =  parent, stateno = 250
value = 251
; command = "c"
;value = 250
ctrl = 1

;---------------------------------------------------------------------------
; DETONATOR

; Standing Strong Kick
; CNS difficulty: easy

[Statedef 250]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 65
ctrl = 0
velset = 0,0
anim = 250

[State 250, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0

[State 250, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Explosion effects

[Statedef 251]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 65
ctrl = 0
velset = 0,0
anim = 251

[State 251, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0
trigger1 = command = "c"

;[State 251, 5]
;type = ChangeState
;trigger1 = AnimTime = 0
;value = 0
;ctrl = 1

it worked but the explosion effects dont dissapear after i detonate the helper.. and do i add red collision boxes to animation states 501 and 251? how do i make the enemy fall or the enemy's body fly up after i detonate the helper (helper explodes)?

Cyanide

Why does the detonation have a command requirement as well?

I told you, the detonation is an ATTACK. Code it as if it is one.


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

thanks i added red collision boxes to animation 251 and added hitdef to statedef of 251 and it works now...

is it possible for the button c to not do the animation for state 250 if i have not thrown any helpers at the enemy? if possible, how?

and how can i limit the helpers i can throw before i detonate them?
for example: i can only throw 5 helpers at maximum before detonating them (5 max) all at the same time?

Cyanide

Your helper should have an ID. State 250 needs the requirement

trigger1 = numhelper(ID you specified for the helper) >= 1

Your release a helper state should also make use of that trigger

triggerall = numhelper(ID you're going to specify for the helper) < 5


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

codes included in the problem
Spoiler (click to show)

[State 230, 2]
type = helper
trigger1 = animelem = 3
trigger1 = ID >= 1
helpertype = normal
ID = 50
stateno = 501
postype = p1
pos = 0, -15
ownpal = 1
ontop = 1

[State 250, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0
trigger1 = ID >= 1
triggerall = ID < 5

not working... i tried changing all "ID" with 50 but also didnt worked...

btw, if i want to make another helper (new and different sprites and state) that i want to code the same way as this first helper (homing projectile and with detonator) can i still use the old detonator state (state 250) i used for first helper? or i need a new detonator state?

Cyanide

I did give you the format

trigger1 = numhelper(50) = 0

etc. These should both be in the cmd.


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

oh i thought the "numhelper" was supposed to be replaced with an integer value (i misunderstood the parentheses) my bad
ok thanks i got it to work now... how about this?   :)

Quote from: sgn15 on July 29, 2010, 03:27:42 PM
btw, if i want to make another helper (new and different sprites and state) that i want to code the same way as this first helper (homing projectile and with detonator) can i still use the old detonator state (state 250) i used for first helper? or i need a new detonator state?

Cyanide



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

I tried it and it doesnt work? am i right? i tried it using this way (the new helper is state 505, same homing projectile and detonating style) the releasing of the new helper is state 210

Spoiler (click to show)


CNS

[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
velset = 0,0
anim = 210

[State 210, 2]
type = helper
trigger1 = animelem = 3
helpertype = normal
ID = 51
stateno = 505
postype = p1
pos = 25, 7
ownpal = 1
ontop = 1

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[Statedef 505]
type    = S
movetype= A
physics = N
juggle  = 4
poweradd= 50
ctrl = 0
velset = 4,0
anim = 505
sprpriority = 2

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

[State 505, sprpriority]
type = sprpriority
trigger1 = 1
value = 5

;=======THIS PART IS FROM CODEDOCS============================

[State 505, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 505, Turn]
type = Turn
trigger1 = (P2Dist X < 10)

[State 505, VelSet]
type = VelSet
trigger1 = (!Time)
x = 3

[State 505, VelAdd]
type = VelAdd
trigger1 = (P2Dist X < 0) && (Vel X > -6)
x = -0.2

[State 505, VelAdd]
type = VelAdd
trigger1 = (P2Dist X > 0) && (Vel X < 6)
x = 0.2

[State 505, VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y > Pos Y) && (Vel Y < 6)
y = 0.2

[State 505, VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y <= Pos Y) && (Vel Y > -6)
y = -0.2

;====END OF PARTS FROM CODEDOCS======================================

[State 505, 3]
type = HitDef
trigger1 = hitcount < 3
attr = S, NA
animtype  = Light
damage    = 75
guardflag = NA
priority = 7, Hit
pausetime = 3,3
sparkno = 0
sparkxy = -10,-5
hitsound   = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 11
ground.velocity = -4,-2
air.velocity = -4,-2
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1

palfx.time = 60
palfx.add = -100, -100, 7
palfx.sinadd = 30, 30, 0, 44
palfx.color = 0
palfx.invertall = 1

[State 505, 4]
type = Destroyself
trigger1 = Time = 120
trigger1 = command = "c"

[State 505, ChangeState]
type = ChangeState
trigger1 =  parent, stateno = 250
value = 251
ctrl = 1

CMD

detonator (still state 250)

[State -1, Standing Strong Kick]
type = ChangeState
value = 250
triggerall = command = "c"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = numhelper(50) >= 1
trigger1 = numhelper(51) >= 1

release of 1st helper

[State -1, Stand Light Kick]
type = ChangeState
value = 230
triggerall = command = "a"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
triggerall = numhelper(50) < 10

release of 2nd helper (new helper)

[State -1, Stand Medium Punch]
type = ChangeState
value = 210
triggerall = command = "y"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
triggerall = numhelper(51) < 10


i want my char when i release the 1st helper (with limit of 10 ), i can still release the 2nd helper (with limit of 10 too) then i can detonate them both (2 different helpers) at the same time using the same detonator (state 250)

is it possible to code? or i need both a new detonator and a new explosion effects (for the new helper) ?

EDIT:
i used trigger2 for the second helper instead of trigger1 and it works now..

i want to change the icon but i dont see a solve/unsolve button at the bottom of this thread while i am logged in). should I or you lock this thread if my problems are solved already?

and i want to thank you, Cyanide, for helping me with my coding problems.  thanks a lot.   ;D

sgn15

sorry to bump this but i found a bug in my char and its the same concern as this topic:

i made these style (throwing helper that follows the enemy, then i can detonate the helpers) also for flying mode. but one helper is not working. it works when i used it first before using the 2nd and the 3rd helpers. but it doesnt work if i throw the 2nd and the 3rd helpers first before throwing the 1st helper. it works for the standing mode

states (all in flying mode):
2000 detonator:
2001: 2nd helper (working)
2003: 3rd helper (working)
2004: 1st helper (not working if not thrown first before the the 2001 and 2002 helpers)
2100: explosion effect for both 2001 and 2003
2200: explosion effect for 2004

codes:
Spoiler (click to show)

CNS

;=== FLY - DETONATOR

[Statedef 2000]
type    = S
ctrl = 0
velset = 0,0
anim = 2000

[State 2000, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0

[State 2000, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 1900
ctrl = 1

;==This is for throwing the 1st helper which has the problem=============
[Statedef 2004]
type    = S
ctrl = 0
velset = 0,0
anim = 2004

[State 2004, Explod]
type = Explod
trigger1 = animelem = 2
anim = 506
;ID =
pos = 3, -7
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermove
pausemove
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 2003, 2]
type = helper
trigger1 = animelem = 4
helpertype = normal
stateno = 510
ID = 63
postype = p1
pos = 2, 10
ownpal = 1
ontop = 1

[State 2004, 60]
type = ChangeState
trigger1 = AnimTime = 0
value = 1900
ctrl = 1

;====1st helper================

[Statedef 510]
type    = S
movetype= A
physics = N
juggle  = 4
poweradd= 0
ctrl = 0
velset = 4,0
anim = 510
sprpriority = 2

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

[State 503, sprpriority]
type = sprpriority
trigger1 = 1
value = 5

;=======THIS PART IS FROM CODEDOCS============================

[State 503, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 503, Turn]
type = Turn
trigger1 = (P2Dist X < 10)

[State 503, VelSet]
type = VelSet
trigger1 = (!Time)
x = 3

[State 503, VelAdd]
type = VelAdd
trigger1 = (P2Dist X < 0) && (Vel X > -6)
x = -0.2

[State 503, VelAdd]
type = VelAdd
trigger1 = (P2Dist X > 0) && (Vel X < 6)
x = 0.2

[State 503, VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y > Pos Y) && (Vel Y < 6)
y = 0.2

[State 503, VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y <= Pos Y) && (Vel Y > -6)
y = -0.2

;====END OF PARTS FROM CODEDOCS======================================

[State 510, 3]
type = HitDef
trigger1 = hitcount < 3
attr = S, NA
animtype  = Light
damage    = 75
guardflag = NA
priority = 7, Hit
pausetime = 3,3
sparkno = 0
sparkxy = -10,-5
hitsound   = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 11
ground.velocity = -4,-2
air.velocity = -4,-2
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1

palfx.time = 60
palfx.add = -100, -100, 7
palfx.sinadd = 30, 30, 0, 44
palfx.color = 0
palfx.invertall = 1

[State 510, 4]
type = Destroyself
trigger1 = Time = 120
trigger1 = command = "c"

[State 510, ChangeState]
type = ChangeState
trigger1 =  parent, stateno = 2000
value = 2200
ctrl = 1

CMD

;the ID 61 and 62 are the ID of the other 2 helpers. i tried interchanging the order of 61,62,63 but the same problem of helper (state 2004) is still there

;fly - detonator
[State -1, fly - detonator]
type = ChangeState
value = 2000
triggerall = command = "fly - detonator"
triggerall = command = "c"
trigger1 = (statetype = S)
trigger1 = stateno = 1900
trigger1 = numhelper(63) >= 1
trigger2 = numhelper(61) >= 1
trigger3 = numhelper(62) >= 1

;======this is for throwing the 1st helper
;fly - sepcial
[State -1, fly - special]
type = ChangeState
value = 2004
triggerall = command = "fly - special"
triggerall = command = "a"
trigger1 = (statetype = S)
trigger1 = stateno = 1900
triggerall = numhelper(63) < 1


Cyanide

Quotetrigger1 = command = "c"
Change to

trigger1 = parent, command = "c"

This is the same solution as earlier in the topic...


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

it doesnt work. i tried changing  into trigger1 = parent, command = "c" for the helper with the problem. then i tried changing that line of code in the other 2 working helpers's statedefs as well. its still the same problem.

codes of the other 2 helpers (working)
Spoiler (click to show)

CNS
throwing the 2nd helper (working)
[Statedef 2001]
type    = S
ctrl = 0
velset = 0,0
anim = 2001

[State 210, 2]
type = helper
trigger1 = animelem = 2
helpertype = normal
ID = 63
stateno = 509
postype = p1
pos = 25, 7
ownpal = 1
ontop = 1

[State 2001, 60]
type = ChangeState
trigger1 = AnimTime = 0
value = 1900
ctrl = 1

2nd helper

[Statedef 509]
type    = A
movetype= A
physics = N
juggle  = 4
poweradd= 0
keyctrl = 1
velset = 4,0
anim = 509
sprpriority = 2

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

[State 509, sprpriority]
type = sprpriority
trigger1 = 1
value = 5

;=======THIS PART IS FROM CODEDOCS============================

[State 509, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 509, Turn]
type = Turn
trigger1 = (P2Dist X < 10)

[State 509, VelSet]
type = VelSet
trigger1 = (!Time)
x = 3

[State 509, VelAdd]
type = VelAdd
trigger1 = (P2Dist X < 0) && (Vel X > -6)
x = -0.2

[State 509, VelAdd]
type = VelAdd
trigger1 = (P2Dist X > 0) && (Vel X < 6)
x = 0.2

[State 509, VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y > Pos Y) && (Vel Y < 6)
y = 0.2

[State 509, VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y <= Pos Y) && (Vel Y > -6)
y = -0.2

;====END OF PARTS FROM CODEDOCS======================================

[State 509, 3]
type = HitDef
trigger1 = hitcount < 1
attr = S, SP
;====attr = S, NA
animtype  = Light
damage    = 100
guardflag = NA
priority = 7, Hit
pausetime = 3,3
sparkno = 0
sparkxy = -10,-5
hitsound   = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 11
ground.velocity = -4,-2
air.velocity = -4,-2
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1
palfx.time = 60
palfx.add = -100, -100, 7
palfx.sinadd = 30, 30, 0, 44
palfx.color = 0
palfx.invertall = 1

[State 509, 4]
type = Destroyself
trigger1 = time = 120
trigger1 = parent, command = "c"

[State 509, ChangeState]
type = ChangeState
trigger1 =  parent, stateno = 2000
value = 2100
ctrl = 1

throwing the 3rd helper (working)

[Statedef 2003]
type    = S
ctrl = 0
velset = 1,0
anim = 2003

[State 2003, 2]
type = helper
trigger1 = animelem = 3
helpertype = normal
stateno = 509
ID = 62
postype = p1
pos = 25, 7
ownpal = 1
ontop = 1

[State 2003, 2]
type = helper
trigger1 = animelem = 5
helpertype = normal
stateno = 509
ID = 62
postype = p1
pos = 25, 7
ownpal = 1
ontop = 1

[State 2003, 2]
type = helper
trigger1 = animelem = 7
helpertype = normal
stateno = 509
ID = 62
postype = p1
pos = 25, 7
ownpal = 1
ontop = 1

[State 2003, 2]
type = helper
trigger1 = animelem = 9
helpertype = normal
stateno = 509
ID = 62
postype = p1
pos = 25, 7
ownpal = 1
ontop = 1

[State 2003, 2]
type = helper
trigger1 = animelem = 11
helpertype = normal
stateno = 509
ID = 62
postype = p1
pos = 25, 7
ownpal = 1
ontop = 1

[State 2003, 2]
type = helper
trigger1 = animelem = 13
helpertype = normal
stateno = 509
ID = 62
postype = p1
pos = 25, 7
ownpal = 1
ontop = 1

[State 2003, 2]
type = helper
trigger1 = animelem = 15
helpertype = normal
stateno = 509
ID = 62
postype = p1
pos = 25, 7
ownpal = 1
ontop = 1

[State 2003, 2]
type = helper
trigger1 = animelem = 17
helpertype = normal
stateno = 509
ID = 62
postype = p1
pos = 25, 7
ownpal = 1
ontop = 1

[State 2003, 2]
type = helper
trigger1 = animelem = 19
helpertype = normal
stateno = 509
ID = 62
postype = p1
pos = 25, 7
ownpal = 1
ontop = 1

[State 2003, 2]
type = helper
trigger1 = animelem = 21
helpertype = normal
stateno = 509
ID = 62
postype = p1
pos = 25, 7
ownpal = 1
ontop = 1

[State 2003, 60]
type = ChangeState
trigger1 = AnimTime = 0
value = 1900
ctrl = 1

[State 2003, 61]
type = ChangeState
trigger1 = parent, command = "c"
value = 2000
ctrl = 1

the helper state is still 509. this attack just throws the same helper of state 509 10 times instead of once

CMD

[State -1, fly - mini]
type = ChangeState
value = 2001
triggerall = command = "fly - mini"
triggerall = command = "x"
trigger1 = (statetype = S)
trigger1 = stateno = 1900
triggerall = numhelper(63) < 10


[State -1, fly - multi mini]
type = ChangeState
value = 2003
triggerall = command = "fly - multi mini"
triggerall = command = "z"
trigger1 = (statetype = S)
trigger1 = stateno = 1900
triggerall = numhelper(62) < 1



i think i did the same thing for these 2 attacks. why is it the 1st helper is the only one with the problem.