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, or configurable single tap dodge for UT3

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

    Shift Dodge, or configurable single tap dodge for UT3

    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.

    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
    Even before UT4 got single-tap-dodge, the community did some effort in order to introduce a new mechnic to dodge. (Epic included the single tap dodge after some time). With that initial time, I also create a prototype mutator (for UT3; as UT4 wasn't polished that mush) which would allow a dodge without that double tapping. However, that mutators differs as you need to press the opposite key to dodge in one direction. Double-tap is still possible. I wanted to have a dodge in this way as it would keep it to the 4 movement buttons without adding another button (here Shift; in UT4 a dodge modifier key).

    I might extent that mutator (and finish it) to allow a shift dodge and also my type of dodge, configurable client-sided. Not sure when I'll do it because I currently create a mutator/gamemode for UT4.

    Please bump this thread more often... in order to remind me to finish/start this mutator . I browse the forum quite frequently.

    Note:
    The shift dodge mutator by Chatouille couldn't be converted that easily. IT would be easiert to re-create it for UT3 as most of the codebase that mutator is using has heavily changed with UT3/UE3.

    PS: I've also read your PM.

    Comment


      #3
      Originally posted by RattleSN4K3 View Post
      Even before UT4 got single-tap-dodge, the community did some effort in order to introduce a new mechnic to dodge. (Epic included the single tap dodge after some time). With that initial time, I also create a prototype mutator (for UT3; as UT4 wasn't polished that mush) which would allow a dodge without that double tapping. However, that mutators differs as you need to press the opposite key to dodge in one direction. Double-tap is still possible. I wanted to have a dodge in this way as it would keep it to the 4 movement buttons without adding another button (here Shift; in UT4 a dodge modifier key).

      I might extent that mutator (and finish it) to allow a shift dodge and also my type of dodge, configurable client-sided. Not sure when I'll do it because I currently create a mutator/gamemode for UT4.

      Please bump this thread more often... in order to remind me to finish/start this mutator . I browse the forum quite frequently.
      Alright thanks, I appreciate it. Was worried the UT3 community was too dead.

      Originally posted by RattleSN4K3 View Post
      Note:
      The shift dodge mutator by Chatouille couldn't be converted that easily. IT would be easiert to re-create it for UT3 as most of the codebase that mutator is using has heavily changed with UT3/UE3.
      Yeah, I figured as much. Was just checking since I noticed some similarities in the Interaction source code for both games and was wondering how alike they were.

      Comment

      Working...
      X