YesNoOk
avatar

Implementing Close Normal attacks (Read 775 times)

Started by DestinNotDustin, May 11, 2019, 02:18:55 am
Share this topic:
Implementing Close Normal attacks
New #1  May 11, 2019, 02:18:55 am
  • avatar
  • *
  • Dreams Demand Hustle
    • USA
Using base Kung Fu Man as the example. I am having difficulty implementing close range normal attacks where Kung Fu Man performs a unique jab when close to an opponent. What command would I implement in the CMD file to resolve this?
Last Edit: May 11, 2019, 04:16:52 am by DestinNotDustin
Re: Implementing Close Normal attacks
#2  May 11, 2019, 02:31:11 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 You would need a trigger based on distance between p1 and p2 in conjunction of a cond for changestate in statedef -1.

 An example in one of my characters to perform a close and mid version of an attack using the same exact command would look something like this.

value = cond((p2dist x <= 40),210,220)

 if P2 is within 40 pixels of P1, this command sends P1 to state 210 (aka: the close version), while if too far will send P1 into state 220 instead.
Re: Implementing Close Normal attacks
#3  May 11, 2019, 02:37:11 am
  • avatar
  • *
  • Dreams Demand Hustle
    • USA
I would implement the value in the CMD of Kung Fu Man? Would it resemble something like this?

[Command]
name = "a"
command = a
time = 1
value = cond((p2dist x <= 40),210,220)
Re: Implementing Close Normal attacks
#4  May 11, 2019, 02:47:34 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 No, that's for the command. You want to do that for the changestate in statedef -1, the command stays the same no matter what.

[State -1, Medium Attack]
type = ChangeState
value = cond((p2dist x <= 40),210,220)
triggerall = !ishelper
triggerall = statetype != A
triggerall = command = "y"
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = movecontact
trigger3 = stateno = 300
trigger3 = movecontact
trigger4 = stateno = [300,315]
trigger4 = movecontact

 Either way, mine is just an example of two different states that are entered depending on distance from P2. You can switch it out with any value depending on what you have set as your close range and mid range versions of the same button. Say if you have close range being state 200 and ranges outside of say... 80 pixels go into state 250, it would look like this instead.

cond((p2dist x <= 80),200,250)

 Also, I would strongly recommend studying the cond trigger, it's extremely useful for simplifying multiple choice stuff like this.
Re: Implementing Close Normal attacks
#5  May 11, 2019, 03:04:09 am
  • avatar
  • *
  • Dreams Demand Hustle
    • USA
This is what I have thus far;

[Statedef 200]
type = S
value = cond((p2dist x <= 50),200)                     
movetype= A                     
physics = S                     
juggle = 1                     

I have two Statedef 200s, just one has the 'value' condition. Thank you for your time and continued patience, coding is a struggle for me.       
Re: Implementing Close Normal attacks
#6  May 11, 2019, 03:08:24 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 If you're a beginner, I would recommend studying the documents that come included with default MUGEN since they break down all the basics like state controllers and triggers that you'll be able to memorize with enough practice. KFM himself also comes with small hints in his codes that will give simple instructions on how these concepts work as well, so, you should read those tips in his CNS as well.
Re: Implementing Close Normal attacks
#7  May 11, 2019, 03:58:45 am
  • avatar
  • *
  • Dreams Demand Hustle
    • USA
Read and reread what you said and I believe I'm onto something! Downloaded your Haruhi Suzumiya and peeked at her Normals.cns to get a better understanding on how to implement Close attacks.

200 statedef is St. LP
205, I labeled at St. CLOSE LP

Now my code resembles this;
Spoiler, click to toggle visibilty
Appreciate the help :)