Use key and IST_Hold

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Acropole

New Member
Nov 27, 2004
3
0
0
Use key and IST_Hold vs Alias

Hi,

I try to find a way to build a new interaction with the use key. In this interaction the player must hold the use key within a time limit in order to activate/deactivate an actor. It should work like the defuse action in counter strike or like the ion canon (it use bHoldingFire, but there is no bHoldingUse in any package).
I'm looking for solution for one week now and don't found any working one.
Anyone know how to do this ?
 
Last edited:

Acropole

New Member
Nov 27, 2004
3
0
0
if I use U=Button bHoldingUse
the classic U=Use will be deleted :(

currently I try this in the user.ini :

Aliases[36]=(Command="bHoldingUse | Use",Alias="HodlingUse")

but it doesn't work properly :

Code:
function HoldingUse(){
            log("bHoldingUse : "$bHoldingUse);
            log("aHoldingUse : "$aHoldingUse);
      if (bHoldingUse == 1)
      {
            aHoldingUse = true;
            log("bHoldingUse : "$bHoldingUse);
            log("bHoldingUse : "$aHoldingUse);
            }
      else
      {
            aHoldingUse = False;
            log("bHoldingUse : "$bHoldingUse);
            log("aHoldingUse : "$aHoldingUse);
      }
}

the result is :

Code:
ScriptLog: bHoldingUse : 0
ScriptLog: aHoldingUse : Faux
ScriptLog: bHoldingUse : 0
ScriptLog: aHoldingUse : Vrai

is it a good or a wrong way ?
 

Acropole

New Member
Nov 27, 2004
3
0
0
ok I have done this :

Code:
user.ini
Aliases[36]=(Command="bHoldingUse | Use",Alias="Use")

into the new class myPlayerClass.uc, duplication of unrealPlayer.uc :

Code:
simulated function use()
{
      super.use();

            Log("bHoldingUse : "$bHoldingUse);
            Log("bHoldingUse : "$aHoldingUse);
}

so I got an alias and à function that should print some things in hte log file. But now I must tell the game that it must use myPlayerClass instead of unrealPlayer class.

I have tried various things like this one in my gameRule class :
Code:
var() class<UnrealPlayer> DefaultPlayerClass; 
DefaultPlayerClass == DynamicLoadObject("Abysse.AbyssePlayer",class 'Class');

but it doesn't work at all.
Anyone know how to force the engine to load my playerClass instead of the unrealPlayer class ?
 
Last edited: