1 (edited by acidfmhq 2017-03-27 15:51:23)

Topic: [Solved] Limiting a moves usage per round.

In my project we have a move called a helper these moves enabled a free hit to enable long combos or to change the balance of the fight.

I was looking in to how the engine uses gauge requirement percentage to disable a move from working but haven't found the code for this within the scripting.

Main things I wanna figure out how to do is:


  • Set a float within the move editor window so I can set the usage of the move lets say 2.

  • Then if this move is depleted to have it default to another move if this move uses the heavy attack button I can tell the engine to use heavy attack if the input is used.

  • Then just something simple to add to the GUI to show how many uses you have left in the previous game we had images showing this.


Hope this isn't too much to ask for if someone is willing to help out. With this we can start making a small demo for the game.

EDIT
This was solved for me you can find the solution at this post: http://www.ufe3d.com/forum/viewtopic.php?id=1112

Terrordrome Reign of the Legends Out now on Steam!!
https://store.steampowered.com/app/1291 … e_Legends/
Terrordrome Project Manager

Re: [Solved] Limiting a moves usage per round.

you can create a secondary meter. strictly for "helper"

have it be full at start of round .

have the code for adding in an extra meter but its source only

Eternal Rift Studios
    Current Projects:
         Destined Soels
Always happy to help when possible. If its something pretty minor ill just help you out. But i do commissions as well. Hit me up if you need a commission.

Share

Thumbs up Thumbs down

Re: [Solved] Limiting a moves usage per round.

I have the source version if your willing to share the coding.

Terrordrome Reign of the Legends Out now on Steam!!
https://store.steampowered.com/app/1291 … e_Legends/
Terrordrome Project Manager

Re: [Solved] Limiting a moves usage per round.

I know FTL created custom bars, so until he responds I'll let you know to look for currentGauge in ControlsScript.cs. There you can follow the breadcrumbs I imagine until FTL writes something up.

Share

Thumbs up Thumbs down

Re: [Solved] Limiting a moves usage per round.

I can tutorial this up in a bit. Just woke up.

Eternal Rift Studios
    Current Projects:
         Destined Soels
Always happy to help when possible. If its something pretty minor ill just help you out. But i do commissions as well. Hit me up if you need a commission.

Share

Thumbs up Thumbs down

Re: [Solved] Limiting a moves usage per round.

Awesome thanks alot!!

This will enabled me to check this off the to do list smile

Terrordrome Reign of the Legends Out now on Steam!!
https://store.steampowered.com/app/1291 … e_Legends/
Terrordrome Project Manager

Re: [Solved] Limiting a moves usage per round.

Ill get on that tutorial in about an hour or so

Eternal Rift Studios
    Current Projects:
         Destined Soels
Always happy to help when possible. If its something pretty minor ill just help you out. But i do commissions as well. Hit me up if you need a commission.

Share

Thumbs up +1 Thumbs down

Re: [Solved] Limiting a moves usage per round.

http://www.ufe3d.com/forum/viewtopic.php?pid=5483#p5483

Eternal Rift Studios
    Current Projects:
         Destined Soels
Always happy to help when possible. If its something pretty minor ill just help you out. But i do commissions as well. Hit me up if you need a commission.

Share

Thumbs up Thumbs down

Re: [Solved] Limiting a moves usage per round.

Are you only using the gauge for this purpose? In our game, we have one button that has two different uses depending on how much gauge you have, and I think it might work well for what you need, if I'm understanding correctly. I remember having to add a "Gauge Limit" variable, which meant that if you had over X gauge then your Helper move wouldn't come out. When I get to the office later today I'll look for the different code snippets I used.

Share

Thumbs up +1 Thumbs down

Re: [Solved] Limiting a moves usage per round.

In MoveInfo.cs, find the first line, add the second line

public float gaugeRequired;
    public float gaugeLimit;

In MoveEditorWindow.cs, find the first line, add the second line

moveInfo.gaugeRequired = StyledSlider("Gauge Required (%)", moveInfo.gaugeRequired, EditorGUI.indentLevel, 0, 100);
                        moveInfo.gaugeLimit = StyledSlider("Gauge Limit (%)", moveInfo.gaugeLimit, EditorGUI.indentLevel, 0, 100);

In MoveSetScript.cs, we have a few things to change/add.

Find the first function, add the second function

private bool hasEnoughGauge(float gaugeNeeded){
        if (!UFE.config.gameGUI.hasGauge) return true;
        if (controlsScript.myInfo.currentGaugePoints < (controlsScript.myInfo.maxGaugePoints * (gaugeNeeded / 100))) return false;
        return true;
    }

    private bool hasTooMuchGauge(float gaugeLimit){
        if (!UFE.config.gameGUI.hasGauge) return true;
        if ((gaugeLimit > 0 ) && (controlsScript.myInfo.currentGaugePoints >= (controlsScript.myInfo.maxGaugePoints * (gaugeLimit / 100)))) return true;
        return false;
    }

Find this function

public MoveInfo GetNextMove(MoveInfo currentMove){

and replace

return InstantiateMove(move);

with

if (!hasEnoughGauge(move.gaugeRequired) || hasTooMuchGauge(move.gaugeLimit)) continue;
                        return InstantiateMove(move);

This also fixes a bug where move links would execute even when the gauge requirement was not met.

Find this function

public bool ValidateMoveExecution(MoveInfo move) {

Find this line

if (!hasEnoughGauge(move.gaugeRequired)) return false;

and replace with this

if (!hasEnoughGauge(move.gaugeRequired) || hasTooMuchGauge(move.gaugeLimit)) return false;

Find this function

private MoveInfo TestMoveExecution(MoveInfo move, MoveInfo currentMove, ButtonPress[] buttonPress, bool inputUp, bool fromSequence, bool forceExecution) {

same as above, find this line(should be first)

if (!hasEnoughGauge(move.gaugeRequired)) return null;

and replace with this

if (!hasEnoughGauge(move.gaugeRequired) || hasTooMuchGauge(move.gaugeLimit)) return null;

I believe that's everything. Now in the move editor window you should have a new slider called Gauge Limit. I would set your helper to require 50 gauge and cost 50 gauge, with a gauge limit of 0. Have the default Heavy move require and cost 0 gauge, but put a gauge limit of .1(or anything over 0 should probably work).

For the GUI, you could just track total gauge / gauge left, which should give you either 2, 1, or 0, and setup your icons to show depending on the value returned.

Share

Thumbs up +1 Thumbs down

Re: [Solved] Limiting a moves usage per round.

Well we are not really using the special gauge for this since we have to use that for our super moves and/or ex moves.

Helper moves have to be independent on it's on variable so it's not changing the gameplay style of the original game.

If you haven't checked out the original game it was made with FM2nd can find it at terrordrome-thegame.com.

Terrordrome Reign of the Legends Out now on Steam!!
https://store.steampowered.com/app/1291 … e_Legends/
Terrordrome Project Manager

12 (edited by soonk 2017-03-25 16:38:32)

Re: [Solved] Limiting a moves usage per round.

Ah, that's why I asked if you were using the gauge for anything else. If that's the case, I would probably go about this another way, but I see King is helping you add another gauge so hopefully that does what you need.

Share

Thumbs up Thumbs down

Re: [Solved] Limiting a moves usage per round.

Got the second meter working!

Now I just got to figure where I should put this global variable I made to fill the bar at the start of a round.

opControlsScript.AddGauge2(UFE.config.roundOptions.helperGauge);

I tried pasting it at line 565 in ControlScripts.cs under UFE.CastNewRound(); but it gives me a Object reference not set to an instance of an object error at runtime and only player 1's bar is filled.

Anyone have an idea of how to get this working?

Terrordrome Reign of the Legends Out now on Steam!!
https://store.steampowered.com/app/1291 … e_Legends/
Terrordrome Project Manager

Re: [Solved] Limiting a moves usage per round.

Simple fix i answered in the other thread

Eternal Rift Studios
    Current Projects:
         Destined Soels
Always happy to help when possible. If its something pretty minor ill just help you out. But i do commissions as well. Hit me up if you need a commission.

Share

Thumbs up Thumbs down

Re: [Solved] Limiting a moves usage per round.

I got it working for training mode I need this working in all other modes too.

Terrordrome Reign of the Legends Out now on Steam!!
https://store.steampowered.com/app/1291 … e_Legends/
Terrordrome Project Manager

Re: [Solved] Limiting a moves usage per round.

Ill find it tonight

Eternal Rift Studios
    Current Projects:
         Destined Soels
Always happy to help when possible. If its something pretty minor ill just help you out. But i do commissions as well. Hit me up if you need a commission.

Share

Thumbs up Thumbs down

Re: [Solved] Limiting a moves usage per round.

maybe you can use the intros to give the helper gauge.

then you can tae my next fix. which is Round outros

and have those also give helper gauge

i am stil trying to find the code though

Eternal Rift Studios
    Current Projects:
         Destined Soels
Always happy to help when possible. If its something pretty minor ill just help you out. But i do commissions as well. Hit me up if you need a commission.

Share

Thumbs up Thumbs down

Re: [Solved] Limiting a moves usage per round.

That's where I was putting my above line code is when the intro's play but gives the Object reference error when a fight starts.

Terrordrome Reign of the Legends Out now on Steam!!
https://store.steampowered.com/app/1291 … e_Legends/
Terrordrome Project Manager

Re: [Solved] Limiting a moves usage per round.

thats not at all what i meant

i have a different patch i added to have an intro/outro like move in between rounds

Eternal Rift Studios
    Current Projects:
         Destined Soels
Always happy to help when possible. If its something pretty minor ill just help you out. But i do commissions as well. Hit me up if you need a commission.

Share

Thumbs up Thumbs down