Topic: [Small Tut] MKDA/MKD/MKA Themed Fight Style Switching

In Midway(now NetherRealm)'s 3d Mortal Kombat games that released on PS2/XBOX, they had the ability to switch fighting styles with one click of a button, and in some cases it could be used during combos to extend them. Each character had two "fight styles" and a third one that was a weapon of some sort. Here I am going to explain you a quick way to implement this in UFE if you like.

1.For testing purposes, copy a move set from a existing character, and paste it into another character you may have (Copy/Paste are in the small tab by "Stance 1").

2. Make a new move, add a quick animation to it. You don't have to, but Unity marks a small error every time you switch stances and although this doesn't break the game it has a tiny second of lag each time the player switches stances. If you use a animation, make sure it is VERY fast, otherwise players will be left open for attacks when switching. (Or add Super Armor similar to Bloody Roar series.)

3. In the Stance Change section of the Move Editor, simply add the starting frame that you want the change to take effect, and set the button/command to whatever you like. In my case, its simply Button 4. Set the target stance to Stance 2.

4. Add the move to the character's moveset for Stance 1. Save your Assets.

5. Duplicate the move file, rename it, and add it to Stance 2. Go into the Stance Change section of the Move Editor and change the target stance to Stance 1.

Test it out. In the example here, every time I press 4, the stance gets changed for the character, back and forth between Stance 1 and 2.

Share

Thumbs up +2 Thumbs down

2 (edited by Xialya 2016-03-13 20:24:08)

Re: [Small Tut] MKDA/MKD/MKA Themed Fight Style Switching

I was following this tip, but when the switch between stances should occur, the game freeze with the following error looping:

NullReferenceException: Object reference not set to an instance of an object
MoveSetScript.ChangeMoveStances (CombatStances newStance) (at Assets/UFE/Scripts/MoveSetScript.cs:219)
ControlsScript.ReadMove (.MoveInfo move) (at Assets/UFE/Scripts/ControlsScript.cs:1274)
ControlsScript.DoFixedUpdate () (at Assets/UFE/Scripts/ControlsScript.cs:488)
UFE.FixedUpdate () (at Assets/UFE/Scripts/UFE.cs:1997)

What could be causing this?

(I've got UFE Bundle 1.7.1)


EDIT:
Solved.
I had forgotten to add a move somewhere in the list and left a box empty.

Still having other issues though:
* I use the stance switch to swap between unarmed and armed, and make the weapon visible. But the weapon appears only for a second then disappears, although the stance has changed and I've got the animations from Stance 2.

Share

Thumbs up Thumbs down

Re: [Small Tut] MKDA/MKD/MKA Themed Fight Style Switching

What if I'd like to display the name of the current stance

Share

Thumbs up Thumbs down