YesNoOk
avatar

How to best solve this problem with HitDefAttr? (Read 38312 times)

Started by DNZRX768, April 26, 2023, 03:19:05 pm
Share this topic:
How to best solve this problem with HitDefAttr?
#1  April 26, 2023, 03:19:05 pm
  • *****
  • Hug Pikachus!
    • USA
So, running some tests with Ikemen with all of the characters I have loaded into the program when I got this error flashed at me:

.\external\script\start.lua:1403: ./chars/Bowsette/Bowsette.cmd:883:
Missing '=' or '!='
stack traceback:
   [G]: in function 'game'
   .\external\script\start.lua:1403: in function 'f_game'
   .\external\script\start.lua:1839: in function 'launchFight'
   external/script/default.lua:2: in function <external/script/default.lua:0>
   .\external\script\start.lua:1457: in function 'f'
   external/script/main.lua:3069: in function 'loop'
   external/script/main.lua:3189: in function 'loop'
   external/script/main.lua:4156: in main chunk
   [G]: ?

Here is the coding in question:

Code:
;---------------------------------------------------------------------------
;Dodge
[State -1, Dodge]
type = ChangeState
value = 760
trigger1 = command = "z"
trigger1 = command != "holdback"
trigger1 = command != "holdfwd"
trigger1 = command != "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = hitdefattr
trigger2 = statetype != A
trigger2 = ctrl

;---------------------------------------------------------------------------
;Dodge Forwards
[State -1, Dodge Forwards]
type = ChangeState
value = 761
trigger1 = command = "z"
trigger1 = command = "holdfwd"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = hitdefattr
trigger2 = command = "holdfwd"
trigger2 = statetype != A
trigger2 = ctrl


;---------------------------------------------------------------------------
;Dodge Backwards
[State -1, Dodge Backwards]
type = ChangeState
value = 762
trigger1 = command = "z"
trigger1 = command = "holdback"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = hitdefattr
trigger2 = command = "holdback"
trigger2 = statetype != A
trigger2 = ctrl

;---------------------------------------------------------------------------
;Dodge Down
[State -1, Dodge Down]
type = ChangeState
value = 763
trigger1 = command = "z"
trigger1 = command = "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = hitdefattr
trigger2 = command = "holddown"
trigger2 = statetype != A
trigger2 = ctrl

I think the problem is that all of the hitdefattr needs some more after the "hitdefattr" part, per the program's documentation. The problem is: WHAT I should put at the end? These moves in questions are dodges: press button and do a dodge or a dodge roll to avoid attacks; can't be attacking while doing so though...

This problem is affecting multiple characters, particularly of the same creator since the coding was copied to them, and I never had this problem when working in MUGEN 1.0 or (as best I can recall at the moment) previous versions of Ikemen, so this problem first appeared for me in Ikemen 99.0 RC1.

With that background info out of the way: what is the best way to address this problem?
Hug the Pikachus!

Hug A Pikachu Today!
Re: How to best solve this problem with HitDefAttr?
#2  April 26, 2023, 04:16:09 pm
  • *****
  • Resident Tosspot
  • Pftheh
    • UK
    • plasmoidthunder.neocities.org
Ultimately it depends on how MUGEN interprets that syntax. If it always returns false, you can safely remove the entire group of triggers (in this case, trigger2) since they'd never return true anyway.

Oh, I want a diagram. I fucking love diagrams.
Re: How to best solve this problem with HitDefAttr?
#3  April 26, 2023, 04:42:34 pm
  • ******
  • 90's Kawaii
  • :thinking:
    • Guatemala
Per Elecbyte's documentation, hitdefattr needs two parameters:

https://mugenguild.com/forum/topics/hitdefattr-triggers-169654.0.html

Now the question is, how do these characters work in mugen 1.0? you can cancel any and all attacks into a dodge?

Depending on how it works on 1.0 this is either an undocumented compatibility issue on Ikemen's end or really dogshit syntax on the coder's end that elecbyte's parser just didn't pick up.

I am inclined to think it's human error because those blocks of code look poorly optimized.
Re: How to best solve this problem with HitDefAttr?
#4  April 26, 2023, 05:03:35 pm
  • *****
  • Hug Pikachus!
    • USA
More testing is needed on my end and I am not at my computer. However, from the brief testing I did, I cannot cancel my attacks into a dodge.

I wonder if the coding is in to make sure the AI does not go crazy and cancel attacks into dodges...
Hug the Pikachus!

Hug A Pikachu Today!
Re: How to best solve this problem with HitDefAttr?
#5  April 27, 2023, 08:06:37 am
  • *****
  • Resident Tosspot
  • Pftheh
    • UK
    • plasmoidthunder.neocities.org
A.I. only does what you tell it to. Even without hitdefattr being there, the A.I. wouldn't be able to cancel anything into a dodge unless they had flagged the holdback command as true, were not in the air, and had ctrl.

Oh, I want a diagram. I fucking love diagrams.
Re: How to best solve this problem with HitDefAttr?
#6  April 30, 2023, 09:48:54 pm
  • *****
  • Hug Pikachus!
    • USA
In case if you're wondering, I've solved the problem by removing all offending pieces of code.

Was it ideal? Not really, but without knowing what is the creator's intent for the pieces of code, this is probably the only way forward to deal with the problem.

I guess it is another reason why to input a ton of comments into the code itself, just in case something needs to be fixed.
Hug the Pikachus!

Hug A Pikachu Today!