YesNoOk
avatar

MoveContact (Triggers) (Read 5162 times)

Started by Odb718, September 14, 2015, 02:19:19 am
Share this topic:
MoveContact (Triggers)
New #1  September 14, 2015, 02:19:19 am
  • *****
  • Shame on you!
    • USA
This trigger is valid only when the player is in an attack state. MoveContact gives a non-zero value if P2 has either been hit, or has guarded P1's attack. It gives 0 otherwise. P1 is the player, and P2 is his opponent. Typically used with the "StateNo" and "Command" triggers for detecting move-interrupts in the CMD file.

Format:
MoveContact
Arguments:
none
Return type:
int
Error conditions:
none
Example:

Code:
trigger1 = MoveContact
  True if P1's attack did not miss P2.

Code:
trigger1 = MoveContact != 0
  True from the time P1's attack came in contact with P2, until just after P1's pausetime wears off.

Details:

    On attack contact, MoveContact returns 1. After contact, MoveContact's return value will increase by 1 for each game tick that P1 is not paused (P1 gets paused on contact; see pausetime parameter in HitDef controller). The values of MoveGuarded, MoveHit and MoveReversed increment in the same fashion.

    Note 1: the values of MoveContact, MoveGuarded, MoveHit and MoveReversed are set simultaneously. For example, if one HitDef in a move hits successfully, MoveHit will return non-zero. If a following HitDef in the same move is guarded, MoveGuarded will return non-zero, and the other three triggers will return 0.

    Note 2: the values of the four Move* triggers reset to 0 and stop incrementing after a state transition. See "movehitpersist" parameter for StateDefs (CNS docs) for how to override this behavior.

vVv Wheat Stage Released vVv
Last Edit: April 11, 2016, 09:10:47 pm by Odb718
Re: MoveContact (Triggers)
#2  September 15, 2015, 03:00:17 pm
  • avatar
  • *****
  • Sr. Black Person
  • Mess with the chuchu you get the pewpew
    • USA
    • network.mugenguild.com/kamekaze/
movecontact/movehit=1 seems to have weird issues in 1.1 I've noticed that my triggers that use that do not activate whatsoever. Any idea as to why?
Want to feel useful for a useless show? click here
118/150 Chars, I'm not dead yet....the true surprise is in my thread.
Hahahah fuck you photobucket.
Re: MoveContact (Triggers)
#3  September 18, 2015, 05:51:44 am
  • avatar
  • ****
movecontact/movehit = 1 is for the dos Mugen era only. The only code that works for newer Mugen is movecontact/movehit.
<- I exercise and dance like that regularly!
Last Edit: September 18, 2015, 06:17:54 am by tehdevil
Re: MoveContact (Triggers)
#4  September 18, 2015, 06:41:41 am
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
Uh, no? It works in 1.0.
Re: MoveContact (Triggers)
#5  September 18, 2015, 06:57:02 am
  • ******
  • Just a butcher on a mission.
    • www.justnopoint.com/lbends
movecontact/movehit = 1 is for the dos Mugen era only. The only code that works for newer Mugen is movecontact/movehit.

At face value this is not correct.  I'm going to assume that you tried to use movecontact/movehit as a trigger for cancelling moves, and found that it was nearly impossible to do or needed frame-perfect timing.
Is DOSmugen, movecontact and movehit were indeed boolean values, but because mugen expressions are based on the C language the true/false is actually 1/0.  In fact, any nonzero (positive? I forgot) number counts as a true value, which leads us to the current, more useful movecontact/movehit which ticks up over time.

There are plenty of good use cases for checking if movecontact/movehit are numbers other than 1 or 0, they're just not common.
Re: MoveContact (Triggers)
#6  September 18, 2015, 09:44:16 am
  • *****
  • Shame on you!
    • USA
MoveHit and MoveContact are both registering fine for me in Mugen 1.0 and 1.1.
As Davod Sirloin posted the values tic up with time during which they're active.

With that being the actual case, my original thought would be,
movecontact/movehit=1
would need to become
movecontact/movehit != 0

I've edited the original post changing =1 to !=0. Please let me know if anyone runs into problems using this code.
vVv Wheat Stage Released vVv
Last Edit: September 18, 2015, 09:50:30 am by Odb718
Re: MoveContact (Triggers)
#7  September 18, 2015, 10:14:55 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Writing it without a value also returns true

Trigger1 = movecontact
is the same as
Movecontact != 0
Movecontact > 0

Best to use values if you want to delay when something occurs. Movecontact = 8, therefore spawn specific helper/explod or whatever. Uncommon to some extent but useful still.

Also to be noted. Movecontact triggers on Guard OR on Hit. If you have an action, like a recoil or whatever you want to occur whether the attack hits or is guarded, you can use movecontact instead of movehit || moveguarded


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: MoveContact (Triggers)
#8  September 18, 2015, 02:40:48 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
movecontact/movehit=1 seems to have weird issues in 1.1 I've noticed that my triggers that use that do not activate whatsoever. Any idea as to why?

Are you talking about literally dividing "movecontact" by "movehit=1?" If so, since "movehit=1" is an expression, wrap it in parentheses, though you'll likely be dividing by 0 at some point.

If that's not what you meant and you meant just "movecontact=1" or "movehit=1," I can't really say. I've had no such issues with them in Mugen 1.0 nor 1.1.

-[Все слова это только слова.]-
Re: MoveContact (Triggers)
#9  September 18, 2015, 03:35:22 pm
  • avatar
  • *****
  • Sr. Black Person
  • Mess with the chuchu you get the pewpew
    • USA
    • network.mugenguild.com/kamekaze/
I'm not referring to actual division lol. I was saying interchangeably they weren't working. How do I know this? Well I have a null sctrl in my .cmd file for a few of my chars and they all depend on movehit=1 to be true. This happens seamlessly on 1.0 but does not happen at all on 1.1. I have not changed a single line of code. But if you want to know in specific, it's why my AI isn't nearly as strong in 1.1 as it is in 1.0.
Want to feel useful for a useless show? click here
118/150 Chars, I'm not dead yet....the true surprise is in my thread.
Hahahah fuck you photobucket.

Bea

Re: MoveContact (Triggers)
#10  September 18, 2015, 03:59:33 pm
  • *****
  • MUGEN Grandma
    • Brazil
    • www.smeenet.org
Do those null sctrls have ignorehitpause = 1 on them?
Elecbyte likely screwed things up, as usual, when they updated their code, so now to trigger movehit = 1 or movecontact = 1 you may need to use ignorehitpause = 1.

Not sure as I don't have 1.1 here nor I plan to download it.
Princess Adora: "My friend saw She-Ra take her dress off in the shower. She said she has an 8 pack. She said She-Ra is shredded."

SF2NES is dead. Long live SF2NES.
Re: MoveContact (Triggers)
#11  September 18, 2015, 04:11:04 pm
  • ****
  • play more SNK games
  • I FUCKING LOVE PLATINUM!
    • South Africa
    • www.trinitymugen.net/
Well I have a null sctrl in my .cmd file for a few of my chars and they all depend on movehit=1 to be true. This happens seamlessly on 1.0 but does not happen at all on 1.1. I have not changed a single line of code. But if you want to know in specific, it's why my AI isn't nearly as strong in 1.1 as it is in 1.0.

I've never had problems like this before and I've been using 1.1 exclusively for a while. Are you sure you're not imagining things kame? :P your problem is kinda vague
Re: MoveContact (Triggers)
#12  September 18, 2015, 04:33:11 pm
  • avatar
  • *****
  • Sr. Black Person
  • Mess with the chuchu you get the pewpew
    • USA
    • network.mugenguild.com/kamekaze/
Do those null sctrls have ignorehitpause = 1 on them?
Elecbyte likely screwed things up, as usual, when they updated their code, so now to trigger movehit = 1 or movecontact = 1 you may need to use ignorehitpause = 1.

Not sure as I don't have 1.1 here nor I plan to download it.

I use the following
Spoiler: AI route (click to see content)
I'm aware I should be using cond here and I do for anything after this char but the same problem occured.

The last time I ran my stuff in 1.1 it was using beta 4 and var(31) never changed to 93 as it should have which told me that none of these null sctrls were working as they should in this particular build.


I've never had problems like this before and I've been using 1.1 exclusively for a while. Are you sure you're not imagining things kame? :P your problem is kinda vague

I'm 100% sure I'm not imagining anything, the vars that I keep track of literally do not change. My AI does not do any of the routes its supposed to. My problem is pretty specific, when using movehit=1 or movecontact=1 in the cmd it does not work in 1.1....ok I probably should have pointed out the .cmd part but yeah.

EDIT: just watch two falcons fight each other. If they both just sit there after hitting with his dash uppercut(raptor boost) then it's not working at all.
Want to feel useful for a useless show? click here
118/150 Chars, I'm not dead yet....the true surprise is in my thread.
Hahahah fuck you photobucket.
Last Edit: September 18, 2015, 04:41:34 pm by Kamekaze
Re: MoveContact (Triggers)
#13  September 18, 2015, 05:11:18 pm
  • ******
  • [E]
    • Mexico
try doing the "mugen parser is an idiot" thing and change movehit=1 to (movehit=1) as wellas  putting it in separate lines, etc...
Re: MoveContact (Triggers)
#14  September 18, 2015, 05:14:26 pm
  • avatar
  • *****
  • Sr. Black Person
  • Mess with the chuchu you get the pewpew
    • USA
    • network.mugenguild.com/kamekaze/
That OR is there for a reason but I'll try parenthesis when I get home.
Want to feel useful for a useless show? click here
118/150 Chars, I'm not dead yet....the true surprise is in my thread.
Hahahah fuck you photobucket.
Re: MoveContact (Triggers)
#15  September 18, 2015, 07:14:35 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Only thing I see that's odd here is this:
Code:
triggerall = movehit=1 || p2statetype=A && p2movetype=A

It's not clear as to what you're going for without proper parentheses here.
Code:
(movehit=1 || p2statetype=A) && p2movetype=A 
OR
movehit=1 || (p2statetype=A && p2movetype=A)

Still... you said that it's working fine in Mugen 1.0, so it's likely not that. It's more about being clear/verbose than an error, but you never know. Maybe 1.1 fucked up the way it processes lines like this without parentheses to solidify groups of expressions.

-[Все слова это только слова.]-
Re: MoveContact (Triggers)
#16  September 18, 2015, 07:26:24 pm
  • avatar
  • *****
  • Sr. Black Person
  • Mess with the chuchu you get the pewpew
    • USA
    • network.mugenguild.com/kamekaze/
It's not odd even lol. It's logic: 1 OR 2 and 3 means either 1 is true or that both 2 and 3 are true. No parenthesis needed(in a world where the code works) so I'm 100% sure it's not that.

So I'd say it's pretty clear....to coders anyway. but what you have as "3" is what it does. MUGEN knows and I know in any case lol
Want to feel useful for a useless show? click here
118/150 Chars, I'm not dead yet....the true surprise is in my thread.
Hahahah fuck you photobucket.

Bea

Re: MoveContact (Triggers)
#17  September 18, 2015, 09:30:37 pm
  • *****
  • MUGEN Grandma
    • Brazil
    • www.smeenet.org
You put way too much trust in Elecbyte programming operator precedence right...
Princess Adora: "My friend saw She-Ra take her dress off in the shower. She said she has an 8 pack. She said She-Ra is shredded."

SF2NES is dead. Long live SF2NES.
Re: MoveContact (Triggers)
#18  September 18, 2015, 10:39:45 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
You put way too much trust in Elecbyte programming operator precedence right...
Yes, this is my point exactly. Maybe by some strange chance in your specific setup, the engine fails with that statement. It's mugen... trust nothing, lol.

Spoiler, click to toggle visibilty
Anyways, it's just about being verbose. Even though I know what the result would be, I'd want to make it as obvious as possible. In a world where code works we'd be able to use ternary expressions, non-number typed variables, and name our damn variables, lol.

-[Все слова это только слова.]-
Re: MoveContact (Triggers)
#19  September 18, 2015, 10:54:07 pm
  • avatar
  • *****
  • Sr. Black Person
  • Mess with the chuchu you get the pewpew
    • USA
    • network.mugenguild.com/kamekaze/
OK HERES THE PROBLEM AND LIKE TOMORROW ALL OF THIS DISCUSSION SHOULD BE DUMPED CAUSE:

AIlevel......mine was set to 4
:magneto:
You may notice that on that very code same I provided it says AILEvel >6

We're done here. I'm retarded. PACK IT UP!
Want to feel useful for a useless show? click here
118/150 Chars, I'm not dead yet....the true surprise is in my thread.
Hahahah fuck you photobucket.
Re: MoveContact (Triggers)
#20  September 18, 2015, 11:34:05 pm
  • ******
    • www.justnopoint.com/
LOL I'm sure this will confuse, entertain, and educate future users all at the same time!

I'm glad you were able to get it resolved even if it wasn't something the trigger was causing. But why did it still work in 1.0 and not 1.1?

EDIT:Your 1.0 was set for 6 wasn't it?