Topic: [Updated for 1.5] Live Combo Update display

Hi,

** This is updated to work with 1.5 **

I wanted to have my combo count display as it's being done rather than after the combo is finished, so I created a bool in Combo Options that allows it to be switched between a live update mode or the current default mode after the combo finished.  Live combo display would be better for MvC3 style game, where combos are common place or you want more instant feedback for combos connecting.

Here's the code I changed to implement it:

In GlobalInfo.cs,
change:

public class ComboOptions {
    public Sizes hitStunDeterioration;

to:

public class ComboOptions {
    public bool displayLive;
    public Sizes hitStunDeterioration;

In GlobalEditorWindow.cs (search for // Combo Options),
change:

                        EditorGUIUtility.labelWidth = 200;
                        globalInfo.comboOptions.maxCombo = EditorGUILayout.IntField("Maximum Hits:", globalInfo.comboOptions.maxCombo);

to:

                        EditorGUIUtility.labelWidth = 200;
                        globalInfo.comboOptions.displayLive = EditorGUILayout.Toggle("Display Live Combo", globalInfo.comboOptions.displayLive);

                        globalInfo.comboOptions.maxCombo = EditorGUILayout.IntField("Maximum Hits:", globalInfo.comboOptions.maxCombo);

In ControlsScript.cs, look for:

        combohits ++;

and below add:

        if (comboHits > 1 && UFE.config.comboOptions.displayLive ) {
            UFE.FireAlert(SetStringValues(UFE.config.selectedLanguage.combo, opInfo), opInfo);
        }

look for // Release character to be playable again,
change:

UFE.FireAlert(SetStringValues(UFE.config.selectedLanguage.combo, opInfo), opInfo);

to:

            if (!UFE.config.comboOptions.displayLive) {
                UFE.FireAlert(SetStringValues(UFE.config.selectedLanguage.combo, opInfo), opInfo);
            }

P.S.  The anti spam captcha is annoying when you're editing code snippets tongue

Share

Thumbs up +4 Thumbs down

Re: [Updated for 1.5] Live Combo Update display

Again, amazing work!


@ P.S.  The anti spam captcha is annoying when you're editing code snippets
Humm, will look into it, see if I find a variable that reflects that.

Re: [Updated for 1.5] Live Combo Update display

Oh, actually that captcha isn't there now.  Looks like it's there for the first 5 posts to prevent bots?  It's all good now, so don't worry about it wink.

Share

Thumbs up +1 Thumbs down

Re: [Updated for 1.5] Live Combo Update display

Excellent! i have a question about this, is there a way to make the combo message don't enter the screen every time a new hit is added, it makes the effects a bit unclear i think, THANKS!

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

Re: [Updated for 1.5] Live Combo Update display

You mean so the combo message moves into the screen on 2nd hit (initial alert), but then for each hit after it stays still and doesn't move?

That should be simple enough.  You just have to adjust GUIScript.cs to only move the alert if it's the first one.

Find:

    void OnNewAlert(string alertMsg, CharacterInfo player){
        // You can use this to have your own custom events when a new text alert is fired from the engine
        if (player == player1){

And just below where it says:

            startingLocation.x -= .1f;

change that to:

            if (alertMsg.StartsWith("2h")) {
                startingLocation.x -= .1f;
            }

You should adjust "2h" to suit your game.  For instance, in my example my Languages Combo option is "%combo%hits!".  There's no space between the combo value and the string "hits!", so 2h works best for me.  If your language option was "%combo% hit combo!", then you'd have a space, and "2 " would be better.

We use StartsWith() method, because we want the actual start of the combo message.  This way, we know it's only 2 hits and not 20 or something.

Admittedly, if I were to do this properly, I would have comboHits passed into the alert message instead (or have some way to pass comboHits), so we can check for just the value of the combo rather than the message string that's passed after.  But this is the quickest way to add the functionality, and also the easiest to code.

Share

Thumbs up +2 Thumbs down

Re: [Updated for 1.5] Live Combo Update display

Thanks!

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