Topic: Cancel Move When Landing With Move File Results
A while back @MrPonton posted some code to use a movefile on cancel move on landing http://www.ufe3d.com/forum/viewtopic.php?id=2751
I just wanted to make a new thread to show the results of said code.
The Code:
In PhysicsScript.cs change this
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;
}
}
to this
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 change this
moveInfo.cancelMoveWheLanding = EditorGUILayout.Toggle("Cancel Move On Landing", moveInfo.cancelMoveWheLanding, toggleStyle);
to this
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);
}
In MoveInfo.cs find this
public bool cancelMoveWheLanding;
add this under it
public MoveInfo moveToCancelLanding;
Result:
you'll see this in the move editor now
Good news is it does work
Bad news is we do get some errors
This happens when a normal landing occurs
errors in console
Hopefully this will help @mistermind at getting this feature implemented!