Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Shift Dodge mutator code help

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Shift Dodge mutator code help

    Ever since UT4, it's annoying to go back to previous UT games without the single tap dodge. I know of a ShiftDodge mutator for UT 2004, but can't find one for UT3. I do have the source code however for the UT 2004 one, and I'm wondering if someone with coding knowledge would be able to modify it to work in UT3. I've modified source code before and even made some mutators, but that's just extending pawn and weapon class values. Since I know nothing about coding language this is out of my zone. Would really appreciate if someone could help.

    Code:
    //====================================================================================
    // Shift Dodge - Interaction
    // by Chatouille
    //====================================================================================
    class ShiftDodgeInt extends Interaction;
    
    var bool bHoldingShift;
    var Actor.EDoubleClickDir lastDClick;
    
    var string keyForward;
    var string keyBackward;
    var string keyLeft;
    var string keyRight;
    
    var array<Actor.EDoubleClickDir> activeDir;
    
    event Initialized()
    {
    	keyForward = Class'GameInfo'.static.GetKeyBindName("moveforward", ViewportOwner.Actor);
    	keyBackward = Class'GameInfo'.static.GetKeyBindName("movebackward", ViewportOwner.Actor);
    	keyLeft = Class'GameInfo'.static.GetKeyBindName("strafeleft", ViewportOwner.Actor);
    	keyRight = Class'GameInfo'.static.GetKeyBindName("straferight", ViewportOwner.Actor);
    }
    /*close*/
    
    function bool KeyEvent(out EInputKey Key, out EInputAction Action, float Delta)
    {
    	local PlayerController PC;
    	local string keyName;
    
    	if ( ViewportOwner == None || ViewportOwner.Actor == None )
    		return Super.KeyEvent(Key, Action, Delta);
    
    	PC = ViewportOwner.Actor;
    	keyName = GetFriendlyName(Key);
    
    	if ( keyName ~= keyForward )
    		updateDir(DCLICK_Forward, (Action == IST_Press));
    	else if ( keyName ~= keyBackward )
    		updateDir(DCLICK_Back, (Action == IST_Press));
    	else if ( keyName ~= keyLeft )
    		updateDir(DCLICK_Left, (Action == IST_Press));
    	else if ( keyName ~= keyRight )
    		updateDir(DCLICK_Right, (Action == IST_Press));
    	else if ( keyName ~= "Shift" && Action == IST_Press && PC.Pawn != None )
    	{
    		if ( activeDir.length > 0 && PC.DoubleClickDir < DCLICK_Active )
    		{
    			PC.Pawn.Dodge(activeDir[0]);
    			PC.DoubleClickDir = DCLICK_Active;
    		}
    		return true;
    	}
    	return Super.KeyEvent(Key, Action, Delta);
    }
    /*close*/
    
    function updateDir(Actor.EDoubleClickDir dir, bool press)
    {
    	local int i;
    
    	if ( press && activeDir[0] != dir )
    	{
    		activeDir.Insert(0,1);
    		activeDir[0] = dir;
    	}
    	else if ( !press )
    	{
    		for ( i=0; i<activeDir.length; i++ )
    		{
    			if ( activeDir[i] == dir )
    			{
    				activeDir.Remove(i,1);
    				i--;
    			}
    		}
    	}
    }
    /*close*/
    
    event NotifyLevelChange()
    {
    	if ( Master != None )
    		Master.RemoveInteraction(Self);
    }
    /*close*/
    
    defaultproperties
    {
    	bActive=true
    }

    And the mutator

    Code:
    //====================================================================================
    // Shift Dodge - Mutator
    // by Chatouille
    //====================================================================================
    class MutShiftDodge extends Mutator;
    
    var bool bHasInteraction;
    
    simulated function Tick(float DeltaTime)
    {
    	local PlayerController PC;
    
    	if ( bHasInteraction )
    		return;
    
    	PC = Level.GetLocalPlayerController();
    	if ( PC != None )
    	{
    		PC.Player.InteractionMaster.AddInteraction(string(class'ShiftDodgeInt'), PC.Player);
    		bHasInteraction = true;
    		Disable('Tick');
    	}
    }
    /*close*/
    
    defaultproperties
    {
    	FriendlyName="Shift Dodge v1"
    	Description="Shift Dodge 1 - press shift while holding movement key to dodge"
    	bAlwaysRelevant=true
    	RemoteRole=ROLE_SimulatedProxy
    }

    #2
    I replied to this specific request here :
    https://forums.epicgames.com/threads...9#post31937079

    Comment


      #3
      thanks you.

      Comment

      Working...
      X