YesNoOk
avatar

A couple questions (Read 268 times)

Started by SPzero65, March 22, 2021, 10:08:08 PM
Share this topic:
A couple questions
#1  March 22, 2021, 10:08:08 PM
  • avatar
    • Canada
Hey everyone,

I have scanned through the FAQs, but haven't found this anywhere, so please forgive me if I have missed it

In looking through code examples, I keep coming across certain punctuation marks (!,%, and the like) before a command such as MoveHit or MoveContact, and I have no idea what they do to the command. I thought they maybe act as an "=1" kind of thing, but I have no idea, and I can't seem to find anything that explains it.

Second, and this is a more specific request, is there a trigger I could put in a HitDef that causes p2 to get hit as soon as they come in contact with the attack, but then only at certain intervals (say every 5 ticks, or every 5 frames) after the initial hit? For example, I want p2 to change to a custom state that freezes them in place as soon as they come in contact with the attack, but they continue to get hit say every 5 ticks or animelems afterward until he attack ends. I've played around with a few different things, but can't seem to get it to work, and all my searches have come up empty. Not looking for anyone to write any codes out for me, just a possible nudge to lead me in the right direction.

While I'm at it (so I don't keep bugging you guys unnecessarily), I have an attack that loops after so many frames so I can cut down on Anim frames. But the attack doesn't hit the opponent on the frames that are being looped, despite there being collision boxes. In this case, should I be using 'time=" triggers in the HitDef instead of "AnimElem="? Perhaps I should forget loops for this purpose. Any suggestions would be appreciated.

Thanks!
Re: A couple questions
#2  March 22, 2021, 10:37:09 PM
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
I'd have to think about the second, but the first and third I can answer immediately

! before a trigger always means that the trigger is to be activated if it's not true, that is, returns 0. It's used like a boolean, but instead of working as either 1 or 0, it's any integer, positive or negative, or 0.

!movecontact is equivalent to movecontact = 0
movecontact is equivalent to movecontact = 1

!var(30) is equivalent to var(30) = 0
var(30) is equivalent to var(30)=1 AND var(30) = -1



For the looping attack, use multiple hitdefs. Generally you can use one with trigger1 = animelem = x and trigger2 = animelem = y, but sometimes triggering one hitdef multiple times can get buggy. It also gives you more control over each hit in the sequence as opposed to having to use the same values each time.
Re: A couple questions
#3  March 23, 2021, 12:34:21 AM
  • avatar
    • Canada
I'd have to think about the second, but the first and third I can answer immediately

! before a trigger always means that the trigger is to be activated if it's not true, that is, returns 0. It's used like a boolean, but instead of working as either 1 or 0, it's any integer, positive or negative, or 0.

!movecontact is equivalent to movecontact = 0
movecontact is equivalent to movecontact = 1

!var(30) is equivalent to var(30) = 0
var(30) is equivalent to var(30)=1 AND var(30) = -1



For the looping attack, use multiple hitdefs. Generally you can use one with trigger1 = animelem = x and trigger2 = animelem = y, but sometimes triggering one hitdef multiple times can get buggy. It also gives you more control over each hit in the sequence as opposed to having to use the same values each time.

Thank you, you have been most helpful. In searching out some more code, I was finally able to answer my second and possibly third question (and was just coming on here to edit my initial comment so I didn't waste your time when I saw your response), but that first part about the punctuation was still a mystery

Really appreciate it!
Re: A couple questions
#4  March 29, 2021, 04:04:12 AM
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Irc hitdef has a misstime parameter. Check the docs for that. Otherwise you can do

Time > number
Persistent = 5

And the attack will hit every 5 ticks

Or trigger1 = time%5 = 5
Which will hit every 5 ticks after tick 5.

Last one i forget how loopstart behaves with hitdefs. Hitdefs are one of the weirder sctrls in that you can activate them early and they stay active till they hit.


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.