1 (edited by k.chen8880 2016-03-17 21:28:28)

Topic: Changing move parameters during runtime

Hi, I'm using UFE for a school project where I'm demonstrating a system that allows me to change how a given fighting game move behaves based on the state of the game.


Here are some examples that hopefully demonstrate what I'm trying to do:

[Example 1]
Suppose button T corresponds to a punch.
During a fight, if the opponent's HP is low, I add a stun effect to the punch.

[Example 2]
Suppose button U corresponds to an in-place evasion move.
If the player is close and the opponent has higher HP, I want to replace this move with a dash that puts the player behind the opponent (this dash is another move in the moveset).


I attempted to implement this by changing the fields in MoveInfo move, which is found in the OnMove event. Basically, for each parameter in the move, I manually set it equal to the corresponding parameter in the other move. However, when I do this, the animation does not fire and the parameters aren't set properly. In addition, hitboxes, applied forces, and other effects disappear entirely.

My code looks something like this (where destination is the move passed into OnMove() and source is the move that I'm trying to copy information from):

private void CloneInto(MoveInfo destination, MoveInfo source)
{
    destination.appliedForces = source.appliedForces;
    destination.animationClip = source.animationClip;
    // etc.
}

In summary, I've found that object-related fields like appliedForces and AnimationClip do NOT transfer, while float, bool, etc. do. In order to successfully create modifiable moves, I want to be able to edit Hit[] hits, AppliedForce[] appliedForces, and AnimationClip animationClip.


I was wondering if UFE supports dynamic move changing during a fight as I described it above and how it should be implemented. As this project is due soon, I would greatly appreciate it if you could get back to me on this matter as soon as possible. Thanks.

Share

Thumbs up Thumbs down