Topic: On Button Release &| On Button Press

Can we please have both an On Button Release and an On Button Press as toggles in http://www.ufe3d.com/doku.php/move:input

This way, it's possible to have a special attack execute on both the Press and the Release.  Pretty much all command specials in SF2 do this (they are actioned on Press and on Release).  Keeping both as toggles should also allow for specific situations you don't want Press to execute (Balrog TAP, Zero's Buster as mentioned in Docs).  You can have the default setting to be On Press only, since that's what we should want for all normal attacks.

I believe I can currently get the intended above functionality by copying the Move file, and in the 2nd version toggle On Button Release.  But having a toggle for both would be much simpler and less cluttered. smile

Thanks!

Share

Thumbs up +1 Thumbs down

Re: On Button Release &| On Button Press

I thought I'd have a quick look to see if this was easy enough to add, and it was! big_smile

Here's my edits to get this working:

In MoveInfo.cs, add:

public bool onPress = true;

to the line above:

public bool onRelease;

In MoveEditorWindow.cs, add:

moveInfo.onPress = EditorGUILayout.Toggle("On Button Press", moveInfo.onPress, toggleStyle);

to the line above:

moveInfo.onRelease = EditorGUILayout.Toggle("On Button Release", moveInfo.onRelease, toggleStyle);

Then in MoveSetScript.cs, add:

if (!inputUp && !move.onPress) return null;

on the line below:

if (inputUp && !move.onRelease) return null;

Note sure if there's a better way to do that last one (maybe combine both in single if statement?) or if the order matters, but with my quick testing it seems to work fine.

Please feel free to move this into the Code forum too.

BTW, thanks for making this easy to extend.  I don't consider myself a very coder, but even I've found it quite easy to add in additional functionality.

Share

Thumbs up +1 Thumbs down

Re: On Button Release &| On Button Press

Fantastic work YumChaGames!
I'll bookmark this page and add that snippet to the code. It was absolutely the best approach!

Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.
Don't forget to check our discord channel.