Topic: Use Move File with Cancel Move On Landing

Like the title suggests have an option to override the cancel move on landing with a move file.
https://i.imgur.com/X4T5jr6.png

The option to use a move file in basic moves was recently added and it opens a a ton of possibilities. Would like to see this same system used on cancel move on landing.
https://i.imgur.com/oFr0jhx.png

Share

Thumbs up +4 Thumbs down

Re: Use Move File with Cancel Move On Landing

+1 for this. It would be an easy way to add custom landing animations to certain attacks.

Share

Thumbs up Thumbs down

Re: Use Move File with Cancel Move On Landing

it would be a really nice addition!

Me encontraste en un negro camino como un peregrino sin rumbo ni fe, pero la luz de tus ojos divinos cambió mi suerte por dicha y placer.

4 (edited by MrPonton 2021-05-10 10:03:25)

Re: Use Move File with Cancel Move On Landing

The area of the code to functionally modify for such an endeavor would be in the PhysicsScript.cs:

                        if (moveSetScript.basicMoves.landing.animMap[0].clip != null
                            && (controlScript.currentMove == null ||
                            (controlScript.currentMove != null && controlScript.currentMove.cancelMoveWheLanding)))
                        {

                            controlScript.isAirRecovering = false;
                            airAnimation = moveSetScript.basicMoves.landing;
                            moveDirection = 0;
                            horizontalJumpForce = 0;
                            isLanding = true;
                            controlScript.KillCurrentMove();
                            delayTime = (Fix64)controlScript.myInfo.physics.landingDelay / (Fix64)UFE.Config.fps;
                            UFE.DelaySynchronizedAction(ResetLanding, delayTime);

                            if (airAnimation.autoSpeed)
                            {
                                animationSpeed = moveSetScript.GetAnimationLength(airAnimation.name) / delayTime;
                            }
                        }

Something like the following (untested code fyi):

In PhysicsScript.cs

                        if (moveSetScript.basicMoves.landing.animMap[0].clip != null
                            && (controlScript.currentMove == null ||
                            (controlScript.currentMove != null && controlScript.currentMove.cancelMoveWheLanding)))
                        {
                            if (controlScript.currentMove.cancelMoveWheLanding && controlScript.currentMove.moveToCancelLanding != null) {
                                controlScript.CastMove(controlScript.currentMove.moveToCancelLanding, true);
                            } else {
                                controlScript.isAirRecovering = false;
                                airAnimation = moveSetScript.basicMoves.landing;
                                moveDirection = 0;
                                horizontalJumpForce = 0;
                                isLanding = true;
                                controlScript.KillCurrentMove();
                                delayTime = (Fix64)controlScript.myInfo.physics.landingDelay / (Fix64)UFE.Config.fps;
                                UFE.DelaySynchronizedAction(ResetLanding, delayTime);

                                if (airAnimation.autoSpeed)
                                {
                                    animationSpeed = moveSetScript.GetAnimationLength(airAnimation.name) / delayTime;
                                }
                            }
                        }

In MoveEditorWindow.cs:

                            moveInfo.cancelMoveWheLanding = EditorGUILayout.Toggle("Cancel Move On Landing", moveInfo.cancelMoveWheLanding, toggleStyle);

to

                            moveInfo.cancelMoveWheLanding = EditorGUILayout.Toggle("Cancel Move On Landing", moveInfo.cancelMoveWheLanding, toggleStyle);
                            if (moveInfo.cancelMoveWheLanding) {
                                moveInfo.moveToCancelLanding = (MoveInfo)EditorGUILayout.ObjectField("Move To Cancel Into:", moveInfo.moveToCancelLanding, typeof(MoveInfo), false);
                            }

and in MoveInfo.cs add anywhere in the class:

        public MoveInfo moveToCancelLanding;

Again, haven't tested it, but that'd be my first attempt.

Share

Thumbs up Thumbs down

Re: Use Move File with Cancel Move On Landing

Move editor window change
https://i.imgur.com/VLR1QmA.png

I got an error from the Physics Script
https://i.imgur.com/KgdGxny.png
but it was an easy fix

Tested out those changes but didn't get expected result.
https://i.imgur.com/5MPKcOr.gif

Share

Thumbs up Thumbs down

6 (edited by MrPonton 2021-05-10 17:35:30)

Re: Use Move File with Cancel Move On Landing

FreedTerror wrote:

I got an error from the Physics Script
https://i.imgur.com/KgdGxny.png
but it was an easy fix

Yeah this error typically means you've forgotten an Opening or Closing { }.

FreedTerror wrote:

Tested out those changes but didn't get expected result.
https://i.imgur.com/5MPKcOr.gif

Interesting, what happens if the move you set into the slot has a cancel when landing of itself? lol

You could alternatively change the CastMove() call to a Debug.Log("Cancel landing into move."); and see if it's hitting when and only when it should be hitting.

Share

Thumbs up Thumbs down

Re: Use Move File with Cancel Move On Landing

Is this code okay to test with?

if (controlScript.currentMove.cancelMoveWheLanding && controlScript.currentMove.moveToCancelLanding != null)
                        {
                            Debug.Log("Cancel landing into move.");
                            controlScript.CastMove(controlScript.currentMove.moveToCancelLanding, true);

It didn't fire the debug.log not matter what I tried and what i put into the moveinfo slot of the cancel move on landing.

Share

Thumbs up Thumbs down

8 (edited by MrPonton 2021-05-10 20:43:01)

Re: Use Move File with Cancel Move On Landing

If that line of code is in the same spot I think it is, then yeah it should be triggering at least the Debug.Log().

Can you run it with the debug text in the hud to show the current move being played and its frames?
I would think it's possible that the jab is finishing before it hits the landing frames.

Share

Thumbs up Thumbs down

Re: Use Move File with Cancel Move On Landing

Tried to make sure that the jab started airborne and lands during the move.
https://i.imgur.com/uESFDNM.gif

Share

Thumbs up Thumbs down

Re: Use Move File with Cancel Move On Landing

can you try assigning it to a slower move like round house kick?
And you verified that it didn't output the Debug.Log()?

Share

Thumbs up Thumbs down

Re: Use Move File with Cancel Move On Landing

@MrPonton your code did end up working but had a few error regarding normal landing.
I made a new thread regarding this topic http://www.ufe3d.com/forum/viewtopic.php?id=3143

Share

Thumbs up Thumbs down

Re: Use Move File with Cancel Move On Landing

I got it working myself! I used the code posed in @FreedTerror's thread but altered it slightly so there weren't any errors. I made a response there if you need the fix!

FreedTerror wrote:

@MrPonton your code did end up working but had a few error regarding normal landing.
I made a new thread regarding this topic http://www.ufe3d.com/forum/viewtopic.php?id=3143

Share

Thumbs up Thumbs down