26

(16 replies, posted in General)

Here's my modification. I made a Self Draining Guage that affects both players. The speed of the drain is how I want it. It works for me but feel free to make modifications.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UFE3D;
using FPLibrary;

public class VPSelfDrainingGuageVP : MonoBehaviour
{
    private enum Player
    {
        Player1,
        Player2
    }
    [SerializeField]
    private Player player;
    [SerializeField]
    private GaugeId gaugeId;
    [Range(-100, 100)]
    [SerializeField]
    private float percent;

    private void Update()
    {
        
        switch (player)
        {
            case Player.Player1:
                AddOrSubtractGaugePointsPercent(UFE.GetPlayer1ControlsScript(), gaugeId, percent);
                AddOrSubtractGaugePointsPercent(UFE.GetPlayer2ControlsScript(), gaugeId, percent);
                break;

            case Player.Player2:
                AddOrSubtractGaugePointsPercent(UFE.GetPlayer1ControlsScript(), gaugeId, percent);
                AddOrSubtractGaugePointsPercent(UFE.GetPlayer2ControlsScript(), gaugeId, percent);
                break;
        }     
    }

    /// <summary>
    /// A positive percent value will add. A negative percent value will subtract.
    /// </summary>
    /// <param name="player"></param>
    /// <param name="percent"></param>
    public static void AddOrSubtractGaugePointsPercent(ControlsScript player, GaugeId gaugeId, Fix64 percent)
    {
        if (player == null)
        {
            return;
        }

        player.currentGaugesPoints[(int)gaugeId] -= (player.myInfo.maxGaugePoints * (percent / 100) / UFE.config.fps) * 0.1;

        if (player.currentGaugesPoints[(int)gaugeId] > player.myInfo.maxGaugePoints)
        {
            player.currentGaugesPoints[(int)gaugeId] = player.myInfo.maxGaugePoints;
        }
        else if (player.currentGaugesPoints[(int)gaugeId] < 0)
        {
            player.currentGaugesPoints[(int)gaugeId] = 0;
        }
    }
}

27

(16 replies, posted in General)

I tinkered around and mad a Self Draining Guage. Both players have self drain but the drain is too fast.

Any help is apprecited.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;


using UFE3D;
using FPLibrary;

public class SelfDrainingGuage : MonoBehaviour
{
    private enum Player
    {
        Player1,
        Player2
    }
    [SerializeField]
    private Player player;
    [SerializeField]
    private GaugeId gaugeId;
    [Range(-100, 100)]
    [SerializeField]
    private float percent;

    private void Update()
    {
        
        switch (player)
        {
            case Player.Player1:
                AddOrSubtractGaugePointsPercent(UFE.GetPlayer1ControlsScript(), gaugeId, percent);
                AddOrSubtractGaugePointsPercent(UFE.GetPlayer2ControlsScript(), gaugeId, percent);
                break;

            case Player.Player2:
                AddOrSubtractGaugePointsPercent(UFE.GetPlayer1ControlsScript(), gaugeId, percent);
                AddOrSubtractGaugePointsPercent(UFE.GetPlayer2ControlsScript(), gaugeId, percent);
                break;
        }     
    }

    /// <summary>
    /// A positive percent value will add. A negative percent value will subtract.
    /// </summary>
    /// <param name="player"></param>
    /// <param name="percent"></param>
    public static void AddOrSubtractGaugePointsPercent(ControlsScript player, GaugeId gaugeId, Fix64 percent)
    {
        if (player == null)
        {
            return;
        }

        player.currentGaugesPoints[(int)gaugeId] -= (player.myInfo.maxGaugePoints * (percent / 100) / UFE.config.fps) * UFE.timeScale;

        if (player.currentGaugesPoints[(int)gaugeId] > player.myInfo.maxGaugePoints)
        {
            player.currentGaugesPoints[(int)gaugeId] = player.myInfo.maxGaugePoints;
        }
        else if (player.currentGaugesPoints[(int)gaugeId] < 0)
        {
            player.currentGaugesPoints[(int)gaugeId] = 0;
        }
    }
}

28

(16 replies, posted in General)

FreedTerror wrote:

I whipped up this example script.

using UnityEngine;
using UFE3D;
using FPLibrary;

public class RefillingGaugeExample : MonoBehaviour
{
    private enum Player
    {
        Player1,
        Player2
    }
    [SerializeField]
    private Player player;
    [SerializeField]
    private GaugeId gaugeId;
    [Range(-100, 100)]
    [SerializeField]
    private float percent;

    private void Update()
    {
        switch (player)
        {
            case Player.Player1:
                AddOrSubtractGaugePointsPercent(UFE.GetPlayer1ControlsScript(), gaugeId, percent);
                break;

            case Player.Player2:
                AddOrSubtractGaugePointsPercent(UFE.GetPlayer2ControlsScript(), gaugeId, percent);
                break;
        }     
    }

    /// <summary>
    /// A positive percent value will add. A negative percent value will subtract.
    /// </summary>
    /// <param name="player"></param>
    /// <param name="percent"></param>
    public static void AddOrSubtractGaugePointsPercent(ControlsScript player, GaugeId gaugeId, Fix64 percent)
    {
        if (player == null)
        {
            return;
        }

        player.currentGaugesPoints[(int)gaugeId] += player.myInfo.maxGaugePoints * (percent / 100);

        if (player.currentGaugesPoints[(int)gaugeId] > player.myInfo.maxGaugePoints)
        {
            player.currentGaugesPoints[(int)gaugeId] = player.myInfo.maxGaugePoints;
        }
        else if (player.currentGaugesPoints[(int)gaugeId] < 0)
        {
            player.currentGaugesPoints[(int)gaugeId] = 0;
        }
    }
}

Where would this code go? A character's prefab?

29

(16 replies, posted in General)

Any advice if I want a gauge to drain if a player is on idle or doing a basics move like jump or crouch?

Android build restarts when phone rings when played in the background between other mobile apps.

Is there a way to deal with this?

How can I make a text alert explaining why a move couldn't be executed? Let's say there is a move that needs the character's energy meter to be at least 10%. I'd like to a text alert to tell the user that the energy meter is 0% when the user tries to execute the move but can't.

I'm using Control Freak and I would like to know how to get my game to work on a game controller. I connected my Android build to a PC controller and only the thumbstick works.

How can you summon an assist character when the main character is hit such as a knockdown or sweep? How can you summon an assist character when the main character actually attacking their opponent?

Any advise?

I'd like to get assist character to get hit by an opponent. A bug happens when the assist character is hit by a projectile, that assists zig zags across the screen.

Has anyone figured this out yet?

Hello, character can't take damage when they are summoning an assist character. I use an idle animation for my main character when they have summoned an assist. And I increase the animation speed to a point where the move is just one frame long. I have attached a hitbox to the character's idle animation but they still can't take damage.

Please add Character shake and camera shake option when a character blocks a projectile.

Please add a Guage Drain option for basic moves like idle, jump, crotch, ect. This option is already availble when you want to create special moves.

38

(3 replies, posted in General)

Where to you attach this script? And what do you assign myGameObject to?

Play around with the z-index for the particle effect.

40

(5 replies, posted in 2D Gameplay)

@miladzarrin1: Yes.

Here's mine:

https://youtu.be/-qSNrrtfOPU?t=1644


Here's how I did it.

1)  Animator, I deleted some frames to create the teleport effect

2) I created a move file for teleportation.

3) I that move, I added particle effect in place of the frames that were invible

4) I changed the x-axis in the move's Self Applied Forces section so that I can set the distance of the teleporation disappearence and reappearance. I also had a sound effect to the teleporation as well.

5) In the move's Invincible Frames section, I enabled Completely Invincible and I enabled Ignore Body Colliders.

I have to relay your question to the Mythreal team

42

(4 replies, posted in Showcase)

Thank you very much! I credit this forum for the the project to this point.

and another topic for continuous running

http://www.ufe3d.com/forum/viewtopic.php?id=4120

there is a topic for dash:

http://www.ufe3d.com/forum/viewtopic.php?id=4021

45

(4 replies, posted in Showcase)

@Luima Thank you!

46

(4 replies, posted in Showcase)

Vanguard Princess Mobile Walkthrough Gameplay as an Early Stage Build. https://youtu.be/-qSNrrtfOPU

Hello;

I'm trying to use this Unity asset to stream my UFE game onto Roku TV.

Mythreal Stream Host

https://assetstore.unity.com/packages/t … ost-233709

However I've been having trouble fully intergrating Mythreal into UFE 2; it has something to do with the Unity camera.

The Mythreal team and I want to reach out to Mind Studios team to help us figure out how we can successfully stream UFE games onto Roku TV through Mythreal asset.

The Mythreal team made a video to better articulate the issue.

https://youtu.be/-OifH1OL1m0

48

(1 replies, posted in General)

How do I uninstall Bluetooth support? Installing Bluetooth doesn't work most times and it forces my whole game to no longer play on Android 13.

I tried deleting the Bluetooth assets but it causes code errors in other places.

49

(4 replies, posted in General)

Can you show a code example? I'd like to better understand, please

this is what I did:

    public static void FireGaugeChange(int targetGauge, Fix64 newValue, ControlsScript player){
        OnGaugeUpdate?.Invoke(targetGauge, (float)newValue, player);
        SuperIsReady();
    }

// Define boolean flag variables to keep track of whether the alerts have been fired
private static bool isP1SuperReadyAlertFired = false;
private static bool isP2SuperReadyAlertFired = false;

// Modify the SuperIsReady method to check both players and their flag variables
public static void SuperIsReady()
{
    if (UFE.gameMode != GameMode.TrainingRoom && UFE.gameMode != GameMode.ChallengeMode)
    {
        if (!isP1SuperReadyAlertFired && UFE.p1ControlsScript.currentGaugesPoints[0] == UFE.p1ControlsScript.myInfo.maxGaugePoints)
        {
            // Fire the alert for player 1 and set its flag variable to true
            UFE.FireAlert("Super Is Ready", UFE.p1ControlsScript);
            isP1SuperReadyAlertFired = true;
        }
        
        if (isP1SuperReadyAlertFired && UFE.p1ControlsScript.currentGaugesPoints[0] != UFE.p1ControlsScript.myInfo.maxGaugePoints)
        {
            isP1SuperReadyAlertFired = false;
        }        

        if (!isP2SuperReadyAlertFired && UFE.p2ControlsScript.currentGaugesPoints[0] == UFE.p2ControlsScript.myInfo.maxGaugePoints)
        {
            // Fire the alert for player 2 and set its flag variable to true
            UFE.FireAlert("Super Is Ready", UFE.p2ControlsScript);
            isP2SuperReadyAlertFired = true;
        }
        
        if (isP2SuperReadyAlertFired && UFE.p2ControlsScript.currentGaugesPoints[0] != UFE.p2ControlsScript.myInfo.maxGaugePoints)
        {
            isP2SuperReadyAlertFired = false;
        }        
    }
}