First off, hello!
Simple question, are there any mods/mutators that allow you to change default muzzleflash effects?
Thanks
EDIT: Just to clarify, I'm not looking for weapon mods, I'm looking for new muzzleflash that can be used with game's vanilla weapons.
New muzzleflash?
-
- Godlike
- Posts: 5498
- Joined: Wed Feb 27, 2008 6:24 pm
- Personal rank: Work In Progress
- Location: Liandri
Re: New muzzleflash?
That's such a specific and niche idea, that I doubt there's anything already out there that does that.
Re: New muzzleflash?
I see.
I thought it'd be as easy as dropping some files inside UT directory (like you do with games like Counter-Strike), I was totally wrong though.
Thanks for replying.
I thought it'd be as easy as dropping some files inside UT directory (like you do with games like Counter-Strike), I was totally wrong though.
Thanks for replying.
-
- Adept
- Posts: 302
- Joined: Wed Nov 09, 2016 1:48 am
Re: New muzzleflash?
I agree with Feralidragon, it is unlikely that anyone has done this before.
But, there is nothing stopping you from doing it now!
The vanilla weapons that actually use a MuzzleFlash are:
-Enforcer* (and DoubleEnforcer by extension)
-Minigun2*
-PulseGun
-SniperRifle
-UT_FlakCannon
*The Enforcer and Minigun2 both have extended code for multiple MuzzleFlash textures.
This is all the MuzzleFlash variables (from Weapon class)
In the editor you can look at the DefaultProperties of any of the weapons I listed before to get an idea of how they work.
You don't have to look at or understand any of the code relating to MuzzleFlash or Weapons** outside of these variables.
**Enforcer has an extra variable:
**Minigun2 has one too:
So with all of this, all you need to do is wright a Mutator to change the MuzzleFlash variables from whatever they are to whatever you want.
There are many ways to go about this but I would use the CheckReplacement Mutator function.
As an example:
This (entirely untested) Mutator changes the MuzzleFlash of the SniperRifle to the MuzzleFlash of the UT_FlakCannon.
By extension, to modify all the Weapons you want:
Best of luck!
But, there is nothing stopping you from doing it now!
The vanilla weapons that actually use a MuzzleFlash are:
-Enforcer* (and DoubleEnforcer by extension)
-Minigun2*
-PulseGun
-SniperRifle
-UT_FlakCannon
*The Enforcer and Minigun2 both have extended code for multiple MuzzleFlash textures.
This is all the MuzzleFlash variables (from Weapon class)
Code: Select all
// Muzzle Flash
// weapon is responsible for setting and clearing bMuzzleFlash whenever it wants the
// MFTexture drawn on the canvas (see RenderOverlays() )
var bool bSetFlashTime;
var(MuzzleFlash) bool bDrawMuzzleFlash;
var byte bMuzzleFlash;
var float FlashTime;
var(MuzzleFlash) float MuzzleScale, FlashY, FlashO, FlashC, FlashLength;
var(MuzzleFlash) int FlashS; // size of (square) texture/2
var(MuzzleFlash) texture MFTexture;
var(MuzzleFlash) texture MuzzleFlare;
var(MuzzleFlash) float FlareOffset;
You don't have to look at or understand any of the code relating to MuzzleFlash or Weapons** outside of these variables.
**Enforcer has an extra variable:
Code: Select all
var() texture MuzzleFlashVariations[5];
Code: Select all
var() texture MuzzleFlashVariations[10];
There are many ways to go about this but I would use the CheckReplacement Mutator function.
As an example:
Code: Select all
class NameOfMutator expands Mutator;
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if (Other.IsA('SniperRifle'))
{
Weapon(Other).FlashC = 0.1;
Weapon(Other).FlashLength = 0.02;
Weapon(Other).FlashO = 0.015;
Weapon(Other).FlashY = 0.16;
Weapon(Other).MFTexture = Texture'Botpack.Skins.Flakmuz';
Weapon(Other).MuzzleFlashMesh = Mesh'Botpack.muzzFF3';
Weapon(Other).MuzzleFlashScale = 0.4;
Weapon(Other).MuzzleFlashTexture = Texture'Botpack.Skins.MuzzyFlak';
Weapon(Other).MuzzleScale = 2.0;
return false;
}
}
By extension, to modify all the Weapons you want:
Code: Select all
class NameOfMutator expands Mutator;
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if (Other.IsA('Weapon you want to change'))
{
Weapon(Other).make changes here
return false;
}
if (Other.IsA('Another Weapon you want to change'))
{
Weapon(Other).make changes here
return false;
}
if (Other.IsA('Another Weapon you want to change'))
{
Weapon(Other).make changes here
return false;
}
if (Other.IsA('Another Weapon you want to change'))
{
Weapon(Other).make changes here
return false;
}
}
Signature goes here.
-
- Godlike
- Posts: 3746
- Joined: Sat Sep 12, 2015 8:46 pm
Re: New muzzleflash?
Your first example there causes the game to crash with the following error
The following ScriptWarnings are in the log
I thought maybe it needed a Return True at the end but that simply removed sniper rifles from the map I tried.
Code: Select all
Warning: Login failed: Failed to spawn player actor
Critical: appError called:
Critical: Failed to spawn player actor
Critical: Windows GetLastError: Not enough memory. (8)
Exit: Executing UObject::StaticShutdownAfterError
Exit: Executing UWindowsClient::ShutdownAfterError
Exit: UGalaxyAudioSubsystem::ShutdownAfterError
Log: DirectDraw End Mode
Exit: UD3D9RenderDevice::ShutdownAfterError
Spoiler
Function Engine.GameInfo.InitGameReplicationInfo:0039) Attempt to assign variable through None
Function Engine.GameInfo.InitGameReplicationInfo:0046) Accessed None 'GameReplicationInfo'
Function Botpack.DeathMatchPlus.InitGameReplicationInfo:001A) Attempt to assign variable through None
Function Botpack.DeathMatchPlus.InitGameReplicationInfo:002B) Accessed None 'GameReplicationInfo'
Function Botpack.DeathMatchPlus.PostBeginPlay:0060) Accessed None 'GameReplicationInfo'
Function Botpack.DeathMatchPlus.PostBeginPlay:0068) Attempt to assign variable through None
Function Engine.GameInfo.InitGameReplicationInfo:0046) Accessed None 'GameReplicationInfo'
Function Botpack.DeathMatchPlus.InitGameReplicationInfo:001A) Attempt to assign variable through None
Function Botpack.DeathMatchPlus.InitGameReplicationInfo:002B) Accessed None 'GameReplicationInfo'
Function Botpack.DeathMatchPlus.PostBeginPlay:0060) Accessed None 'GameReplicationInfo'
Function Botpack.DeathMatchPlus.PostBeginPlay:0068) Attempt to assign variable through None
-
- Adept
- Posts: 302
- Joined: Wed Nov 09, 2016 1:48 am
Re: New muzzleflash?
Dang, Code is now tested and fixed:OjitroC wrote: ↑Sun Oct 23, 2022 10:11 pm Your first example there causes the game to crash with the following errorThe following ScriptWarnings are in the logCode: Select all
Warning: Login failed: Failed to spawn player actor Critical: appError called: Critical: Failed to spawn player actor Critical: Windows GetLastError: Not enough memory. (8) Exit: Executing UObject::StaticShutdownAfterError Exit: Executing UWindowsClient::ShutdownAfterError Exit: UGalaxyAudioSubsystem::ShutdownAfterError Log: DirectDraw End Mode Exit: UD3D9RenderDevice::ShutdownAfterError
I thought maybe it needed a Return True at the end but that simply removed sniper rifles from the map I tried.Spoiler
Function Engine.GameInfo.InitGameReplicationInfo:0039) Attempt to assign variable through None
Function Engine.GameInfo.InitGameReplicationInfo:0046) Accessed None 'GameReplicationInfo'
Function Botpack.DeathMatchPlus.InitGameReplicationInfo:001A) Attempt to assign variable through None
Function Botpack.DeathMatchPlus.InitGameReplicationInfo:002B) Accessed None 'GameReplicationInfo'
Function Botpack.DeathMatchPlus.PostBeginPlay:0060) Accessed None 'GameReplicationInfo'
Function Botpack.DeathMatchPlus.PostBeginPlay:0068) Attempt to assign variable through None
Code: Select all
class MFTest_Mutator expands Mutator;
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if (Other.IsA('SniperRifle'))
{
Weapon(Other).FlashC = 0.1;
Weapon(Other).FlashLength = 0.02;
Weapon(Other).FlashO = 0.015;
Weapon(Other).FlashY = 0.16;
Weapon(Other).MFTexture = Texture'Botpack.Skins.Flakmuz';
Weapon(Other).MuzzleFlashMesh = Mesh'Botpack.muzzFF3';
Weapon(Other).MuzzleFlashScale = 0.4;
Weapon(Other).MuzzleFlashTexture = Texture'Botpack.Skins.MuzzyFlak';
Weapon(Other).MuzzleScale = 2.0;
return true; //Fixed here
}
bSuperRelevant = 0; //Fixed here
return true; //Fixed here
}
Signature goes here.