logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic A request for one of my upcoming mods the "HillBilly" mod (Read 199 times)
makemeunreal
Betatester
Offline


Unreal maniac

Posts: 412
Joined: Mar 23rd, 2013
Gender: Male
A request for one of my upcoming mods the "HillBilly" mod
Mar 14th, 2019 at 9:11am
Print Post  
Hey there!

As some of you might know, I've got a rather interesting mod in the works called the "HillBilly" mod or "HillBilly" simulator.

However, development came to a stop as I am not experienced enough to make a melee weapon from scratch. I've got all the models and stuff, but I can't make them into working weapons.

I wonder if any of you have like a melee template that I could use.

(Note that they could all be based on the same script. All they would need is a different sound, damage, and reach.)

Let me link some very old WIP shots:

(This test was played online with my clan.)





  
Back to top
 
IP Logged
 
Matrix224
God Member
*****
Offline



Posts: 736
Location: New York
Joined: Feb 20th, 2008
Gender: Male
Re: A request for one of my upcoming mods the "HillBilly" mod
Reply #1 - Mar 14th, 2019 at 11:29am
Print Post  
This was some older code I had used for various melee weapons. I can't guarantee it's perfect, but it should at least be a good jumping off point

Code
Select All
//=============================================================================
// Base class for all Melee Weapons
//=============================================================================
class MeleeWeapon extends MWeapon
	abstract;

var() array<Sound> FleshSounds; // Sounds for hitting flesh
var() array<Sound> WorldSounds; // Sounds for hitting world
var() float Range;
var() int Damage;
var() Class<Effects> WallEffect; // Wall hit effect

function PlayEnemyHitSound() {
	if (array_size(FleshSounds) > 0) {
		PlaySound(FleshSounds[rand(array_size(FleshSounds))]);
	}
}


function PlayLevelHitSound() {
	if (array_size(WorldSounds) > 0) {
		PlaySound(WorldSounds[rand(array_size(WorldSounds))]);
	}
}


function TraceFire(float accuracy) {
	local vector HitLocation, HitNormal, StartTrace, EndTrace, X,Y,Z;
	local actor Other;
	local Pawn PawnOwner;

	PawnOwner = Pawn(Owner);

	Owner.MakeNoise(PawnOwner.SoundDampening);
	GetAxes(PawnOwner.ViewRotation,X,Y,Z);
	StartTrace = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
	AdjustedAim = PawnOwner.AdjustAim(1000000, StartTrace, 2.75*AimError, False, False);
	EndTrace = StartTrace + accuracy * (FRand() - 0.5 )* Y * 1000 + accuracy * (FRand() - 0.5 ) * Z * 1000;
	X = vector(AdjustedAim);
	EndTrace += ((Owner.CollisionRadius+range) * X);
	Other = PawnOwner.TraceShot(HitLocation,HitNormal,EndTrace,StartTrace);
	ProcessTraceHit(Other, HitLocation, HitNormal, X,Y,Z);
}

simulated function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z) {
	local vector StartT;
	local rotator Dummy;
	local byte HitCount;
	local ZoneInfo HitZone;

	HitZone = Level.GetLocZone(HitLocation+HitNormal).Zone;
	while ( WarpZoneInfo(HitZone)!=None && WarpZoneInfo(HitZone).OtherSideActor!=None && HitCount++<5 ) {
		StartT = HitLocation;
		WarpZoneInfo(HitZone).UnWarp(StartT,X,Dummy);
		WarpZoneInfo(HitZone).OtherSideActor.Warp(StartT,X,Dummy);
		Z = StartT+X*10000;
		Other = Trace(HitLocation,HitNormal,Z,StartT,True); // We dont use owner pawn trace here because we could hit ourselves.
		while ( Other!=None && Other.bIsPawn && !Pawn(Other).AdjustHitLocation(HitLocation, Z - StartT) ) {
			StartT = HitLocation;
			Other = Other.Trace(HitLocation,HitNormal,Z,StartT,True);
		}
		if ( Other==None )
			Break;
		HitZone = Level.GetLocZone(HitLocation+HitNormal).Zone;
	}


	if(Other == None) {
		return;
	}


	if (Other == Level || Other.bWorldGeometry || Other.IsA('Brush')) {
		if (WallEffect != None) {
			Spawn(WallEffect,,, HitLocation+HitNormal*9, Rotator(HitNormal));
		}
	} else if ( (Other != self) && (Other != Owner) ) {
		if ( Other.IsA('Pawn') && (HitLocation.Z - Other.Location.Z > 0.62 * Other.CollisionHeight)
			&& (instigator.IsA('PlayerPawn') || (instigator.skill > 1))
			&& (!Other.IsA('ScriptedPawn') || !ScriptedPawn(Other).bIsBoss) )
			Other.TakeDamage(Damage*1.6, Pawn(Owner), HitLocation, 35000 * X, 'decapitated');
		else
			Other.TakeDamage(Damage,  Pawn(Owner), HitLocation, 30000.0*X, 'stabbed');

	}
	if (Other == Level || Other.IsA('Brush')) {
		Spawn(class'chip',,, HitLocation+HitNormal*9, Rotator(HitNormal));
		Spawn(class'smallspark',,, HitLocation+HitNormal*9, Rotator(HitNormal));
		PlayLevelHitSound();
	}

	if(Other.isa('Pawn') || (Other.IsA('Carcass'))) {
		PlayEnemyHitSound();
	}
}

state AltFiring  {
	ignores  AltFire, Fire;
 
	begin:
		PlayAltFiring();
		Sleep(0.15);
		TraceFire(0.05);
		FinishAnim();
		Finish();
}


state NormalFire  {
	ignores  AltFire, Fire; 
	begin:
		PlayFiring();
		Sleep(0.15);
		TraceFire(0.05);
		FinishAnim();
		Finish();
}

function AltFire (float Value) {
	if (Owner != None) {
		GotoState('AltFiring');
		bPointing = True;
		Pawn(Owner).PlayRecoil(FiringSpeed);
		if ( Owner.bHidden ) {
			CheckVisibility();
		}
	}
}


function Fire (float Value) {
	if (Owner != None) {
		GotoState('NormalFire');
		bPointing = True;
		Pawn(Owner).PlayRecoil(FiringSpeed);
		if ( Owner.bHidden ) {
			CheckVisibility();
		}
	}
}

function TweenDown() {
}

function PlayIdleAnim () {
}

function PlayPostSelect() {
}

function PlaySelect() {
}

function PlayFiring() {
}

function PlayAltFiring() {
}


defaultproperties
{
    AmmoName=Class'UnrealShare.DefaultAmmo'
    PickupAmmoCount=1
    bInstantHit=True
    bAltInstantHit=True
    Range=50.0
    WallEffect=Class'UnrealShare.HeavyWallHitEffect'
}
 

  
Back to top
IP Logged
 
makemeunreal
Betatester
Offline


Unreal maniac

Posts: 412
Joined: Mar 23rd, 2013
Gender: Male
Re: A request for one of my upcoming mods the "HillBilly" mod
Reply #2 - Mar 14th, 2019 at 5:32pm
Print Post  
Thank you! I'll try to tinker around with this! Cheesy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo