Page 1 of 1
A request for one of my upcoming mods the "HillBilly" mod
Posted: Thu Mar 14, 2019 9:11 am
by makemeunreal
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.)
Re: A request for one of my upcoming mods the "HillBilly" mod
Posted: Thu Mar 14, 2019 11:29 am
by Matrix224
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 FleshSounds; // Sounds for hitting flesh
var() array WorldSounds; // Sounds for hitting world
var() float Range;
var() int Damage;
var() Class 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++ 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'
}
Re: A request for one of my upcoming mods the "HillBilly" mod
Posted: Thu Mar 14, 2019 5:32 pm
by makemeunreal
Thank you! I'll try to tinker around with this!