YesNoOk
avatar

p2name, enemyname, enemynear trigger issues! Team Modes (Read 604 times)

Started by junkerde, February 21, 2019, 09:48:06 am
Share this topic:
p2name, enemyname, enemynear trigger issues! Team Modes
#1  February 21, 2019, 09:48:06 am
  • avatar
  • **
I want to make a character changestates ONLY IF the character specified in the trigger is the one hitting/grabbing them. but the problem is in team mode this breaks and I'm not sure how to approach this! Is there a way to say for example:

type = changeanim
Trigger = enemy,name = "RODAN", and only if "RODAN" is doing "attack state 870" on me <------Is this part possible somehow?
value = 880

I have  made it so my character changes different animations depending on the character putting him into a custom state, problem is these other characters share the same state #'s so once they're on a team, it just defaults to whoever the 2nd player on the the enemy team is. So say RODAN is on a team with GODZILLA, and GODZILLA has

Trigger = enemy,name = Godzilla && enemy,stateno = 870
value = 890

Its the same stateno as rodans move, but the animation value is different with him, so it defaults to the 2nd teammate and breaks the changeanim on my character when rodan actually grapples me. Does this make sense? Basically how do I go about doing "enemy,name = RODAN && "RODAN" stateno = 870" instead of using "enemy,stateno" which then gets the stateno of all the enemies on that team?  because saying "enemy,stateno" makes mugen choose both enemies onthe same side, i cant specify which.

Sorry its hard to explain.
Last Edit: February 21, 2019, 09:51:43 am by junkerde
Re: p2name, enemyname, enemynear trigger issues! Team Modes
#2  February 21, 2019, 09:58:54 am
  • *****
  • Shame on you!
    • USA
vVv Wheat Stage Released vVv
Re: p2name, enemyname, enemynear trigger issues! Team Modes
#3  February 21, 2019, 07:46:00 pm
  • avatar
  • **
interesting. I still cant quite get it yet, so the code I have now in the -2 state is:

[state -2, animchange]
type = Changestate
triggerall = numenemy
triggerall = var(0)
triggerall = movetype=H
triggerall = enemynear,name = "RODAN"
trigger1 = anim = 880
value = 2222
ignorehitpause = 1

How do I go about implementing those triggers to that -2 state I made? Or is there something already wrong with my code to start with? (the var(0) trigger is for detecting if my character is in his transformed state or not, and yes I know, transformations are a pain in the butt when it comes to custom states, luckily hes only being used in a custom full game)
Re: p2name, enemyname, enemynear trigger issues! Team Modes
#4  February 21, 2019, 08:11:41 pm
  • avatar
  • **
It just really doesnt make sense, im reading hte mugen docs and enemynear SHOULD return that of the nearest enemy anyway, which is what I want the function to do, the nearest enemy who is going to grapple my character will trigger my character to change animation based on their name. Im gonna pull my hair out!! Why doesnt enemy,near work as it should in team mode? Its irrational that in team mode enemynear is BOTH enemy1 and 2, so it doesnt matter who goes into a grapple state, it will always default to player 2's custom animation change for my character which then messes up enemy 1's custom states enormously, because its detecting them as 1 thing!
Re: p2name, enemyname, enemynear trigger issues! Team Modes
#5  February 22, 2019, 04:41:08 am
  • ***
  • The Illusionary Wanderer
  • I have a dream
    • Vietnam

  • Online
It just really doesnt make sense, im reading hte mugen docs and enemynear SHOULD return that of the nearest enemy anyway, which is what I want the function to do, the nearest enemy who is going to grapple my character will trigger my character to change animation based on their name. Im gonna pull my hair out!! Why doesnt enemy,near work as it should in team mode? Its irrational that in team mode enemynear is BOTH enemy1 and 2, so it doesnt matter who goes into a grapple state, it will always default to player 2's custom animation change for my character which then messes up enemy 1's custom states enormously, because its detecting them as 1 thing!

MUGEN is wack. Coming from experience, you should never use enemy or enemynear (unless you decide to abandon Simul Mode). In your case, I suggest you to find some workaround with enemy(0) and enemy(1) instead.
Re: p2name, enemyname, enemynear trigger issues! Team Modes
#6  February 22, 2019, 05:04:24 pm
  • avatar
  • **
Dang, now I'm just getting rid of that code in a few of the characters I had, didnt know it was buggy in simul mode or more like I hadnt noticed yet. Ended up deleting the pile of code from my character, and having a custom state written and added in the animation file for the rest of the characters. Its a convoluted solution, but its a solution and its working fine. Yikes!
Re: p2name, enemyname, enemynear trigger issues! Team Modes
#7  February 22, 2019, 10:14:10 pm
  • avatar
  • **
Have to reopen this again, Im going to go BALD from pulling out my hair!!! I have absolute video proof of my method working yesterday as I had streamed to a friend, using "target,name =" on each character, with my video CELARLY showing the animations working. Turn on my laptop today to see literally everything breaking. Any thoughts on why "target,name" would not work? I have literally done nothign to these characters since then, it just baffles me that I have clear video proof of everything working. Target,name is no longer working.

[Statedef 2110]
type    = S
movetype= H
physics = N
velset = 0,0

[State 3000, PalFXWiz]
type = PalFX
trigger1 = Time = 0
time = 130
add = 0,70,0
mul = 256,256,256
sinadd = 70,90,70,5
invertall = 0
color = 256

[State 2110, 1]
type = ChangeState
Trigger1 = Time = 90
value = 2120

[State 2110, 1]
type = ChangeAnim2
triggerall = target,name != "super_mechagodzilla"
Trigger1 = Time = 0
value = 2110

[State 2110, 1]
type = ChangeAnim2
triggerall = target,name = "super_mechagodzilla"
Trigger1 = Time = 0
value = 2111

Target code seems to put my characters animation at 0, for everyone. Not sure what hte problem is.

heres a screenshot of literally the same code working in my stream, working as it should


and today booting up my computer to this crap, im getting a lot of flooding code, something about my character in state 0 has no target id of -1


Losing my mind here, does mugen have a mind of its own and just not work some days? Losin it. Maybe I've finally met the limitation of this engine, doing TAG AND a transformation code at the same time, I guess its just too much. But it literally worked yesterday with the code above, I tried from scratch again today and now its exhibiting abnormal behavior.
Last Edit: February 22, 2019, 10:52:25 pm by junkerde
Re: p2name, enemyname, enemynear trigger issues! Team Modes
#8  February 22, 2019, 11:13:06 pm
  • avatar
  • **
Ok here,s something new I thought I'd add, so I went back to the drawing board yet again, reset everything to how it was, and figured out something interesting. heres some sample code now of Super-Mechagodzill'a -2 states:

[state -2, animchange]
type = Changestate
triggerall = var(0)
triggerall = movetype=H
triggerall = enemynear,name = "RODAN"
trigger1 = anim = 880
value = 2222 ;had to make a custom state on rodan, it was quick and dirty
ignorehitpause = 1

[state -2, animchange]
type = Changeanim
triggerall = var(0)
triggerall = enemynear,name="mothra_A"
;triggerall = movetype=H
;trigger1 = stateno = 2210
trigger1 = stateno = 2020
value = 15000
ignorehitpause = 1

[state -2, animchange]
type = Changeanim
triggerall = var(0)
triggerall = enemynear,name="mothra_A"
;triggerall = movetype=H
;trigger1 = stateno = 2210
trigger1 = stateno = 2210
value = 15000

anything look wrong?
Last Edit: February 22, 2019, 11:19:09 pm by junkerde
Re: p2name, enemyname, enemynear trigger issues! Team Modes
#9  February 23, 2019, 02:40:30 am
  • avatar
  • **
Ok I hope I dont have to open this topic again, but I found an even more complicated convoluted way to do this to work in simul. Literally, make sure every single 26 of my characters all have custom states that dont have the same number. And make sure those state numbers dont exist for any other move for any other character or that it doesnt exist in MG2's own states. And make sure certain animation#' do not have the same number as the rest of the 26 characters. So this means when enemynear sees the enarest enemy, or in this case in Simul, BOTH of them for some stupid reason, it wont mess up if both characters have the same custom state #'s it sends you in. Because now they wont have the same numbers. Its a terrible workaround, but it works, because enemy,near is so damn broken. Goddamnit elecbyte. Solved.
Re: p2name, enemyname, enemynear trigger issues! Team Modes
#10  February 23, 2019, 03:28:13 am
  • ******
    • www.justnopoint.com/
Since you're making a full game you could make the gethit animations and states part of the chars. So when they are getting hit you're just self stating them.
Re: p2name, enemyname, enemynear trigger issues! Team Modes
#11  March 05, 2019, 10:16:19 am
  • *****
  • Shame on you!
    • USA
vVv Wheat Stage Released vVv
Re: p2name, enemyname, enemynear trigger issues! Team Modes
#12  March 05, 2019, 05:55:44 pm
  • avatar
  • **
yeah oops the changeanim wasnt supposed to be in the copy paste. just the changestate. I ended up solving it out another way (renumbering some state numbers). But thank you for the link that's helpful! same with throws when some characters are coded with P2Stateno in simul mode, just changed it to targetstate instead and no more of that buggy behavior in simul.