YesNoOk
avatar

hit only 1 oppponent (Read 532 times)

Started by hamza, May 31, 2012, 02:47:11 pm
Share this topic:
hit only 1 oppponent
#1  May 31, 2012, 02:47:11 pm
  • **
  • fire burns everything
    • csmugen.ucoz.com/forum
how do i make a move  that can hit only one player in teammode?
Re: hit only 1 oppponent
#2  May 31, 2012, 06:26:36 pm
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.
Re: hit only 1 oppponent
#3  May 31, 2012, 06:45:23 pm
  • **
  • fire burns everything
    • csmugen.ucoz.com/forum
but after it hits one opponent it will hit the other too i want to hit only one
Last Edit: June 02, 2012, 06:19:54 pm by hamza
Re: hit only 1 oppponent
#4  June 03, 2012, 03:40:36 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
It deals 2 hits? Hitonce means if there are 2 characters in range of the hit, only one will be affected.


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: hit only 1 oppponent
#5  June 03, 2012, 09:49:58 am
  • **
  • fire burns everything
    • csmugen.ucoz.com/forum
i have a helper with a red clsn box that goes on p2 and stay for some time and if p4 goes over p2 it hits p4 too i want it to hit only p2
Re: hit only 1 oppponent
#6  June 03, 2012, 09:52:17 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I don't understand the logic behind that, aren't both players your opponent? Why only 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.
Re: hit only 1 oppponent
#7  June 03, 2012, 10:05:18 am
  • **
  • fire burns everything
    • csmugen.ucoz.com/forum
I don't understand the logic behind that, aren't both players your opponent? Why only one?
yeah i know it's strange well i have a move the put a helper on p2 to control him but i want to control only p2 and use it against p4
Re: hit only 1 oppponent
#8  June 03, 2012, 10:22:43 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
type = hitdef
trigger1 = teammode = simul
trigger1 = enemynear(0), ID < enemynear(1), ID
And any other triggers you need.

Basically the hitdef should only activate if the lowest ID is also the closest. Pretty sure hitonce will take effect on the nearest opponent although it's not something i've ever tested.


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.

2OS

Re: hit only 1 oppponent
#9  June 03, 2012, 10:32:02 am
  • ****
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
use numenemy=2 instead of teammode=simul.

teammode=simul is technically wrong anyway.


[ 052012 ] Inazumachi 181/256  /  deviantART   /  2OS Grafphicsxz  Dead Anims ( Orochi/Mizuchi )  /  608's FX Volume 3
Re: hit only 1 oppponent
#10  June 03, 2012, 11:02:23 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
enemy, teammode = simul

Numenemy would probably work better though. I keep thinking of old mugen where simul was ALWAYS 2v2 rather than the 1v2 it can do now.


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.

2OS

Re: hit only 1 oppponent
#11  June 03, 2012, 11:36:32 am
  • ****
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
ultimately it has the same effect but numenemy=2 for debug prevention.

really you'll only see an error for not having numenemy if you put enemy/enemynear redirects in negative states but it's better to just put it on everything that uses them just like numhelper and numtarget.


[ 052012 ] Inazumachi 181/256  /  deviantART   /  2OS Grafphicsxz  Dead Anims ( Orochi/Mizuchi )  /  608's FX Volume 3
Re: hit only 1 oppponent
#12  June 04, 2012, 08:49:00 am
  • ***
just a question about this topic, won't simply using hitcount < 1 do the trick ?
Re: hit only 1 oppponent
#13  June 04, 2012, 09:01:47 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
nope, he wants it to hit P2 only, not p4 at all. Hitcount < 1 will allow it to hit either in a 1 opponent situation.


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: hit only 1 oppponent
#14  June 05, 2012, 03:12:58 pm
  • **
  • fire burns everything
    • csmugen.ucoz.com/forum
it didn't work

i made a helper with  stateno = ifelse(numenemy = 2,2004,2003)

and in state 2004 i put
Code:
[State 0,HitDef]
type = HitDef
triggerall = enemynear(0),ID < enemynear(1),ID
trigger1 = root,command!= "holdfwd"
trigger1 = root,command!= "holdback"
trigger1 = root,command!= "holddown"
trigger1 = root,command!= "fwd"
trigger1 = root,command!= "back"
trigger1 = root,command!= "down"
trigger1 = root,command!= "up"
trigger1 = root,command!= "a"
trigger1 = root,command!= "b"
trigger1 = p2stateno!=2011
trigger1 = p2stateno!=2012
trigger1 = p2stateno!=2040
trigger1 = p2stateno!=2050
trigger1 = p2stateno!=2100
trigger1 = p2stateno!=2105
trigger1 = p2stateno!=2200
trigger1 = p2stateno!=2210
trigger1 = p2stateno!=2400
trigger1 = p2stateno!=2410
trigger1 = p2stateno!=2600
trigger1 = p2stateno!=2610
attr = S, NA
damage = 0,0
animtype = light         
air.animtype = light
priority = 4,Hit
sparkno = S-1
guard.sparkno = S-1
ground.type = High
hitonce = 1
ground.velocity = 0
air.velocity = 0,0
airguard.velocity = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2stateno = 2005

but p4 still get hit and now p2 get hit but he can control himself
Re: hit only 1 oppponent
#15  June 05, 2012, 07:17:15 pm
  • ***
hmmm, what do you mean "1 opponent" situation ? like 1 on 1 or 2 on 1 ( i mean as long as the opponent is only 1) ? i have not tried if a long thin red clsn will affect both p2 and p4. from what i can understand, it is a "hit and then custom state mode already for p2" kind of thing. p1 would have a control mode as well. continuous state i mean. at least that is how i thought i would code it.

ID should be a number if i understood that correctly. also, multiple trigger1 means all of them should trigger.
Re: hit only 1 oppponent
#16  June 05, 2012, 07:42:58 pm
  • **
  • fire burns everything
    • csmugen.ucoz.com/forum
well the goal of the move is to control the enemy i have to different ways :one for vs 1 and another for vs 2
i already made all the custom states and the vs 1 works
now i work on vs 2 and i want to control 1 opponent and use it against the other so i use a red clsn box to put p2 in the custom state, but when p4 goes over p2's body the helper with the red box leaves p2 and goes on p4 and i want  the box to remain on p2
Re: hit only 1 oppponent
#17  June 05, 2012, 07:54:44 pm
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com
Perhaps the most important question is; is it hitting one or both at the same time?

If you're using this helper to control p2's movements through custom states, it sounds alot like you're trying to accomplish something that can be utilized through a bug in reversaldef. Check here for how it's done

Additionally, once it hits once you wont ever have to hit p2 again to call the effects of changestate, so long as the helper still exists, so you don't ever have to worry about hitting p4.

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.

2OS

Re: hit only 1 oppponent
#18  June 05, 2012, 08:26:14 pm
  • ****
  • Ich schicke dich zur HOELLE ! ¡ ! ¡
    • Egypt
    • deuceovspadez.webs.com/
reversaldefs cause more bugs than you think.

jussayin.


[ 052012 ] Inazumachi 181/256  /  deviantART   /  2OS Grafphicsxz  Dead Anims ( Orochi/Mizuchi )  /  608's FX Volume 3
Re: hit only 1 oppponent
#19  June 05, 2012, 08:46:09 pm
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com
Was saying it because it sounded like he wanted to specifically target a single opponent and control it at will, but that p4 being too close would cause it to retarget.

A video demonstration of what he's trying to accomplish and whats occuring would help greatly, since his description is difficult to understand.

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.
Re: hit only 1 oppponent
#20  June 07, 2012, 05:58:07 pm
  • **
  • fire burns everything
    • csmugen.ucoz.com/forum
seems like it difficult to hit only p2
and it's possible to make a move so thay if the move hits p2 then it can't hit p4 ,if it hits p4 it can't hit p2 ?
no hitonce
Re: hit only 1 oppponent
#21  June 08, 2012, 06:23:40 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Lets have all the code please. I don't understand at this point how your whole system works. Is p2 in a custom state the whole time that's owned by the helper? Is he in his own states and the helper hits him over and over?

I think we need more BG info right now.


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: hit only 1 oppponent
#22  June 08, 2012, 09:19:49 am
  • **
  • fire burns everything
    • csmugen.ucoz.com/forum
here is the helper code
Code:
;----------------------------------------------------------------------------------
;enemy
[Statedef 2003]
type    = S
movetype = A
physics = S
ctrl = 0
anim = 2003

[State 0,Posset]
type = Posset
triggerall = numenemy
trigger1=1
x = enemynear,pos x
y = enemynear,pos y

[State 0,HitDef]
type = HitDef
triggerall = numenemy = 1
trigger1 = root,command!= "holdfwd"
trigger1 = root,command!= "holdback"
trigger1 = root,command!= "holddown"
trigger1 = root,command!= "fwd"
trigger1 = root,command!= "back"
trigger1 = root,command!= "down"
trigger1 = root,command!= "up"
trigger1 = root,command!= "a"
trigger1 = root,command!= "b"
trigger1 = p2stateno!=2011
trigger1 = p2stateno!=2012
trigger1 = p2stateno!=2040
trigger1 = p2stateno!=2050
trigger1 = p2stateno!=2100
trigger1 = p2stateno!=2105
trigger1 = p2stateno!=2200
trigger1 = p2stateno!=2210
trigger1 = p2stateno!=2400
trigger1 = p2stateno!=2410
trigger1 = p2stateno!=2600
trigger1 = p2stateno!=2610
attr = S, NA
damage = 0,0
animtype = light         
air.animtype = light
priority = 4,Hit
sparkno = S-1
guard.sparkno = S-1
ground.type = High
ground.velocity = 0
air.velocity = 0,0
airguard.velocity = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2stateno = 2005


[State 0,HitDef]
type = HitDef
triggerall = enemy,statetype = S
triggerall = p2stateno!= 2011
trigger1 = root,command = "holddown"
attr = S, NA
damage = 0,0
animtype = light         
air.animtype = light
priority = 4,Hit
sparkno = S-1
guard.sparkno = S-1
ground.type = High
ground.velocity = 0
air.velocity = 0,0
airguard.velocity = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2stateno = 2011

[State 0,HitDef]
type = HitDef
triggerall = enemy,statetype = S
triggerall = p2stateno!= 2040
trigger1 = root,command = "up"
attr = S, NA
damage = 0,0
animtype = light         
air.animtype = light
priority = 4,Hit
sparkno = S-1
guard.sparkno = S-1
ground.type = High
ground.velocity = 0
air.velocity = 0,0
airguard.velocity = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2stateno = 2040

[State 0,HitDef]
type = HitDef
triggerall = enemy,statetype = S
triggerall = p2stateno!= 2100
trigger1 = root,command = "back"
attr = S, NA
damage = 0,0
animtype = light         
air.animtype = light
priority = 4,Hit
sparkno = S-1
guard.sparkno = S-1
guardsound = S2,0
ground.type = High
ground.velocity = 0
air.velocity = 0,0
airguard.velocity = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2stateno = 2100

[State 0,HitDef]
type = HitDef
triggerall = enemy,statetype = S
triggerall = p2stateno!= 2105
trigger1 = root,command = "fwd"
attr = S, NA
damage = 0,0
animtype = light         
air.animtype = light
priority = 4,Hit
sparkno = S-1
guard.sparkno = S-1
guardsound = S2,0
ground.type = High
ground.velocity = 0
air.velocity = 0,0
airguard.velocity = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2stateno = 2105

[State 0,HitDef]
type = HitDef
triggerall = p2stateno!= 2600
triggerall = p2stateno!= 2400
triggerall = p2stateno!= 2200
trigger1 = root,command = "a"
attr = S, NA
damage = 0,0
animtype = light         
air.animtype = light
priority = 4,Hit
sparkno = S-1
guard.sparkno = S-1
ground.type = High
ground.velocity = 0
air.velocity = 0,0
airguard.velocity = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2stateno = ifelse(p2statetype = A,2600,2200)

[State 0,HitDef]
type = HitDef
triggerall = p2stateno!= 2610
triggerall = p2stateno!= 2410
triggerall = p2stateno!= 2210
trigger1 = root,command = "b"
attr = S, NA
damage = 0,0
animtype = light         
air.animtype = light
priority = 4,Hit
sparkno = S-1
guard.sparkno = S-1
ground.type = High
ground.velocity = 0
air.velocity = 0,0
airguard.velocity = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2stateno = ifelse(p2statetype = A,2610,2210)

[state 0,Destroyself]
type = Destroyself
trigger1 = root,stateno!= 2001
trigger2 = root,command = "c"
trigger3 = root,power = 0
trigger4 = p2life = 0

all the costum states have been made
what i want is to make another hitdef like the first one for teammode but it has to hit only one opponent
Re: hit only 1 oppponent
#23  June 08, 2012, 04:16:00 pm
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com
[State 0,Posset]
type = Posset
triggerall = numenemy
trigger1=1
x = enemynear,pos x
y = enemynear,pos y

[State 0,HitDef]
type = HitDef
triggerall = numenemy = 1
trigger1 = root,command!= "holdfwd"
trigger1 = root,command!= "holdback"
trigger1 = root,command!= "holddown"
trigger1 = root,command!= "fwd"
trigger1 = root,command!= "back"
trigger1 = root,command!= "down"
trigger1 = root,command!= "up"
trigger1 = root,command!= "a"
trigger1 = root,command!= "b"
trigger1 = p2stateno!=2011
trigger1 = p2stateno!=2012
trigger1 = p2stateno!=2040
trigger1 = p2stateno!=2050
trigger1 = p2stateno!=2100
trigger1 = p2stateno!=2105
trigger1 = p2stateno!=2200
trigger1 = p2stateno!=2210
trigger1 = p2stateno!=2400
trigger1 = p2stateno!=2410
trigger1 = p2stateno!=2600
trigger1 = p2stateno!=2610
attr = S, NA
damage = 0,0
animtype = light         
air.animtype = light
priority = 4,Hit
sparkno = S-1
guard.sparkno = S-1
ground.type = High
ground.velocity = 0
air.velocity = 0,0
airguard.velocity = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
p2stateno = 2005
hitonce = 1 ;<-- add this

That posset controller might be contributing to the issue as well. If p4 gets too close, it may consider him the closer of the two enemies and switch onto him. Instead of using enemynear, use either enemynear(0) or playerid(var(x)) and set var(x) to the playerid of the nearest enemy on the first tick, that way you dont have to worry about it switching targets.

I also suspect that the size of the red (CLSN1) box may be causing it to hit p4 if he gets to close, so I would try making it as small as possible.

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.
Re: hit only 1 oppponent
#24  June 08, 2012, 06:51:11 pm
  • **
  • fire burns everything
    • csmugen.ucoz.com/forum

That posset controller might be contributing to the issue as well. If p4 gets too close, it may consider him the closer of the two enemies and switch onto him. Instead of using enemynear, use either enemynear(0) or playerid(var(x)) and set var(x) to the playerid of the nearest enemy on the first tick, that way you dont have to worry about it switching targets.

I also suspect that the size of the red (CLSN1) box may be causing it to hit p4 if he gets to close, so I would try making it as small as possible.
i tried both but they don't work also p4 goes through p2
Re: hit only 1 oppponent
#25  June 09, 2012, 12:06:21 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
All your "additional" attacks have no check on them. They'll hit both people. With what you want to achieve, you can't even limit it by using a target ID in the hitdefs as p2 will lose the state...

By any chance once you have DONE the action, does p2 leave the control state or go back again? If he just regains control and it's like a "hit then choose action" move, we CAN use ID's, if it's a constant thing, that lasts a little while, then we can't. ChainID will be your friend here if it's the first option.


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: hit only 1 oppponent
#26  June 09, 2012, 10:00:48 am
  • **
  • fire burns everything
    • csmugen.ucoz.com/forum
All your "additional" attacks have no check on them. They'll hit both people. With what you want to achieve, you can't even limit it by using a target ID in the hitdefs as p2 will lose the state...

By any chance once you have DONE the action, does p2 leave the control state or go back again? If he just regains control and it's like a "hit then choose action" move, we CAN use ID's, if it's a constant thing, that lasts a little while, then we can't. ChainID will be your friend here if it's the first option.
what do you mean by go back again?
Re: hit only 1 oppponent
#27  June 09, 2012, 11:06:32 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
If i'm hit and in state 2005, then you press Up, do i jump and regain control, or do i jump then go back to state 2005?


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: hit only 1 oppponent
#28  June 09, 2012, 11:22:15 am
  • **
  • fire burns everything
    • csmugen.ucoz.com/forum
If i'm hit and in state 2005, then you press Up, do i jump and regain control, or do i jump then go back to state 2005?
during the move p2 has control over himself
both players controls him