YesNoOk
avatar

Can't seem to detect an enemy variable correctly for a special intro (Read 183 times)

Started by Víctorys, December 17, 2014, 09:09:08 pm
Share this topic:
Can't seem to detect an enemy variable correctly for a special intro
#1  December 17, 2014, 09:09:08 pm
  • ***
  • Jijiji
    • Chile
    • yiazmatomegavictorys.wix.com/mugenvictorys
I'm trying to add a custom intro for my character against P.o.t.S. Ryu, but I just want to trigger that intro while that Ryu is only at Normal or Master mode, so I used this code

Code:
[State 5900, Intro vs Ryu]
type = ChangeState
trigger1 = NumEnemy
trigger1 = RoundNo = 1 || (!(TeamMode = Simul) && !(Enemy, TeamMode = Simul))
trigger1 = Enemy, AuthorName = "Phantom.of.the.Server" && Enemy, Name = "Ryu" && Enemy, Var(1) != 2 ;<--- That way it shouldn't trigger if Ryu's var(1) value is 2, since Evil Mode is triggered if that variable has that value.
value = 194

The problem is that the intro triggers even if Enemy, Var(1) = 2, and the funny thing is that if I press F4 to restart the round while the special intro is happening and Enemy, Var(1) = 2, then the special intro won't trigger anymore and my normal intros will trigger unless I select those characters again, so I don't really know what is going on here, I probably missed something.

This is the Initialize code that I am using to trigger my intros
Spoiler, click to toggle visibilty

Any help would be appreciated :)

Re: Can't seem to detect an enemy variable correctly for a special intro
#2  December 17, 2014, 09:17:02 pm
  • ****
  • Hey.
    • Ukraine
    • mugencoder.com

  • Online
Hmm, it's only a hunch, but I have a feeling that you're trigging your intro too early. Usually stuff like that should go in the intro or pre-intro state (190 or 191) and then be decided from there. 191 -> 194.

-[Все слова это только слова.]-
Re: Can't seem to detect an enemy variable correctly for a special intro
#3  December 18, 2014, 05:01:29 pm
  • ***
  • Jijiji
    • Chile
    • yiazmatomegavictorys.wix.com/mugenvictorys
I tried that but the problem persists.

What other thing could be going wrong? I'm really clueless this time, as P.o.t.S. Ryu can detect my character mode variable without any problem.

Re: Can't seem to detect an enemy variable correctly for a special intro
#4  December 18, 2014, 05:34:45 pm
  • ******
  • Christmas isn't about getting into clubs, Zorak!
    • USA
    • network.mugenguild.com/jmorphman

  • Online
I ran into the same problem (I think); you're reading Ryu/P2's variables and then selecting the intro state in state 5900/5901, right? If you have Ryu be P1, and your character be P2, you'll notice it works properly (and as you've mentioned, the intro will behave properly if you restart the match).

The reason for all this is because P2 hasn't entered its own state 5900 (which is where Ryu's mode selection variable is set), so when your character checks that variable, it will always read it as 0. Unless of course you restart the round (because the variable will have been set then), or you make Ryu P1 (in which case by the time your character is doing the checking, Ryu's will have entered 5900 and had the variable set).

My solution to this was pretty messy and inelegant (but it's MUGEN so I didn't really care that much lol god I'm terrible) and basically consisted of inserting changestates to all relevant into states in order to redirect to the correct intro. So, for this character, in the intro you would put one change state in the vs. normal/master Ryu intro state, changing to the other intro states if Ryu's mode was set to evil. I'm probably explaining things badly so I would recommend you check my Ken if you want to use my shitty solution.

There was another way around this that DivineWolf used that I thought involved doing all the intro decision stuff be determined in state 190 (but introduced a minor, barely noticeable animation change, or something) but you've already said that it didn't work, so I dunno. It might've been 191 instead of 190 that made the difference, but I don't remember.
Re: Can't seem to detect an enemy variable correctly for a special intro
#5  December 18, 2014, 08:24:38 pm
  • ***
  • Jijiji
    • Chile
    • yiazmatomegavictorys.wix.com/mugenvictorys
Well, I used your method and it seems like it's working correctly now.

Thank you both for your help :)