Gah - a solution with more questions. – EntropicLqd

Legacy:Sweavo/MutWalkDontRun

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search

9/01/06

looking good now. I used a dynamic array of WalkEnforcers which correspond 1:1 with playercontrollers. CheckReplacement is used to populate this. I need to add user-configurability but the player experience is getting there. http://www.sweavo.34sp.com/misc/utmods/MutWalkDontRun_64.tgz http://www.sweavo.34sp.com/misc/utmods/MutWalkDontRun_64_src.tgz

Foxpaw: Have you considered using Tick instead of using a timer synced across the server? This should eliminate the issue described in "Cut #2." ...

Sweavo: Heheh thanks for the feedback. If ony you'd posted three days ago! Many of these fixes I arrived at myself - the key problem was trying to do too much in the interaction rather than in an actor. The reason I couldn't use Tick() is because I was not an Actor but an Interaction, which does not have actor in its ancestry. I now have the architecture you describe. Grace is a float and updated in tick() in an Actor-based object. There is also a 1-second timer that issues penalties and rewards based on whether Grace is ==0 or ==GraceMax. Display is done with a LocalMessage because I couldn't get drawLineHoriz() or whatever it's called to work so didn't bother trying to go as far as making some textures etc. Would be cool to get someone to fix up the display better though. Version 64 above makes a lot more sense than the example at cut2 (which I'll remove to save anyone else painstakingly going through the bad code!)

5/1/06

Cut #3: There is an object called a WalkEnforcer which runs its clock independently for a given pawn. The intention is to have it display a charge bar like the scorp or the hellbender rear turret, instead of instantly penalising health. Then if the chargebar maxes out, a large penalty is made (100%?).

At present, this simply calls TakeDamage like yesterday's mut. I need to find out about displaying chargebars and figure out what's on the client and what on the server.

4/1/06

Cut #2: I looked at Regen Mutator and adapted it so that it took 10 health per second off you if you were moving (VSize(P.Velocity))>0 and added 1 health per second if you were still and bCrouched.

The problem with this was that the 1 second period was independent of the player, and synced across the whole playing area... so if you have a sense of rhythm you can run for 0.7 seconds and walk for 0.3 and get about faster... or more realistically, you would creep around in a well-behaved manner and then take one jump and get an instant penalty!

4/1/06

For a first cut, I just hooked into ModifyPlayer and altered the running speed to be the same as the walking speed:

(Note that this is not endorsed by SAS sniper clan, just inspired by their server!)

class MutWalkDontRun extends Mutator;
 
function ModifyPlayer(Pawn Other)
{
	local xPawn myxPawn;
 
	myxPawn = xPawn(Other);
 
	if (myxPawn != None)
	{
		myxPawn.GroundSpeed = myxPawn.GroundSpeed * myxPawn.WalkingPct;
		myxPawn.CrouchedPct=myxPawn.CrouchedPct/myxPawn.WalkingPct;
		myxPawn.WalkingPct=1;
	}
 
	if ( NextMutator != None )
	{
		NextMutator.ModifyPlayer(Other);
	}
}
 
defaultproperties
{
     GroupName="Sniper Mods"
     FriendlyName="SAS Walk Don't Run"
     Description="Sets all players' running speeds to the same as walking speeds."
}

This is amusing because the running animations still play, and everyone moonwalks around the map. A problem with is straight away is that if you use the speed combo, when your adrenaline runs out, the combo calls game.setplayerdefaults(you) but does not cause ModifyPlayer() to be called again - so you revert to your original running speed.