Muzzle Flash

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Muzzle Flash

Postby clyzm » Mon Jul 03, 06 8:28 pm

I think this belongs in scripting society ... anyways how does it work on a gun? Do you need to make a mesh of a flat plane, and texture it with a blackmasktex or...?
Image
User avatar
clyzm
Forum Master God
 
Posts: 16023
Joined: Sun Nov 28, 04 2:48 am
Location: Chiraq

Re: Muzzle Flash

Postby MainMan » Mon Jul 03, 06 8:33 pm

chococataclyzm wrote:I think this belongs in scripting society ... anyways how does it work on a gun? Do you need to make a mesh of a flat plane, and texture it with a blackmasktex or...?

Yup :) , the mesh has to have a flat plane coming out of the muzzle, which is set to blackmasktex. It must* be Skin Number 2, and then in the code it calls that to be changed when the gun is fired.

*I say must, but you can recode the class to use any of the MultiSkins (0 - 7), so really there is no need for no' 2. :P
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Re: Muzzle Flash

Postby clyzm » Mon Jul 03, 06 8:35 pm

~MainMan~ wrote:
chococataclyzm wrote:I think this belongs in scripting society ... anyways how does it work on a gun? Do you need to make a mesh of a flat plane, and texture it with a blackmasktex or...?

Yup :) , the mesh has to have a flat plane coming out of the muzzle, which is set to blackmasktex. It must* be Skin Number 2, and then in the code it calls that to be changed when the gun is fired.

*I say must, but you can recode the class to use any of the MultiSkins (0 - 7), so really there is no need for no' 2. :P


Yeah, but I was browsing around DX textures, and there seems to be a shitload of weapon muzzle flashes. How does the game notify itself which one to use?

Oh, and it is second. Thanks :P
Image
User avatar
clyzm
Forum Master God
 
Posts: 16023
Joined: Sun Nov 28, 04 2:48 am
Location: Chiraq

Re: Muzzle Flash

Postby MainMan » Mon Jul 03, 06 8:40 pm

chococataclyzm wrote:
~MainMan~ wrote:
chococataclyzm wrote:I think this belongs in scripting society ... anyways how does it work on a gun? Do you need to make a mesh of a flat plane, and texture it with a blackmasktex or...?

Yup :) , the mesh has to have a flat plane coming out of the muzzle, which is set to blackmasktex. It must* be Skin Number 2, and then in the code it calls that to be changed when the gun is fired.

*I say must, but you can recode the class to use any of the MultiSkins (0 - 7), so really there is no need for no' 2. :P


Yeah, but I was browsing around DX textures, and there seems to be a shitload of weapon muzzle flashes. How does the game notify itself which one to use?

Oh, and it is second. Thanks :P



3 functions in DeusExWeapon:

Draw the texture, one of 2, depending on a random number (50/50 chance for each)
Code: Select all
simulated function SwapMuzzleFlashTexture()
{
   if (!bHasMuzzleFlash)
      return;
   if (FRand() < 0.5)
      MultiSkins[2] = Texture'FlatFXTex34';
   else
      MultiSkins[2] = Texture'FlatFXTex37';

   MuzzleFlashLight();
//(MainMan: The SetTimer calls EraseMuzzleFlashTexture function)
   SetTimer(0.1, False);
}


Sets the skin back, erasing the muzzle flash.
Code: Select all
simulated function EraseMuzzleFlashTexture()
{
   MultiSkins[2] = None;
}




adds a light, so it looks more realistic. This is not relevant for modelling, unless you want a new light, e.g. for some blue muzzle flash or something :P
Code: Select all
simulated function MuzzleFlashLight()
{
   local Vector offset, X, Y, Z;

    if (!bHasMuzzleFlash)
      return;

   if ((flash != None) && !flash.bDeleteMe)
      flash.LifeSpan = flash.Default.LifeSpan;
   else
   {
      GetAxes(Pawn(Owner).ViewRotation,X,Y,Z);
      offset = Owner.Location;
      offset += X * Owner.CollisionRadius * 2;
      flash = spawn(class'MuzzleFlash',,, offset);
      if (flash != None)
         flash.SetBase(Owner);
   }
}
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby clyzm » Mon Jul 03, 06 9:01 pm

Ah, okay good.

But, does it automatically know that the second mesh is the muzzle flash or do I need to notify the game of that?
Image
User avatar
clyzm
Forum Master God
 
Posts: 16023
Joined: Sun Nov 28, 04 2:48 am
Location: Chiraq

Postby MainMan » Mon Jul 03, 06 9:04 pm

chococataclyzm wrote:Ah, okay good.

But, does it automatically know that the second mesh is the muzzle flash or do I need to notify the game of that?

Second texture you mean?

Yeah it already knows.
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby clyzm » Mon Jul 03, 06 9:07 pm

~MainMan~ wrote:
chococataclyzm wrote:Ah, okay good.

But, does it automatically know that the second mesh is the muzzle flash or do I need to notify the game of that?

Second texture you mean?

Yeah it already knows.


Oh, okay good.

So, all I need to do is make a first person mesh, where the second group is the blackmask tex muzzle flash and it works automatically?
Image
User avatar
clyzm
Forum Master God
 
Posts: 16023
Joined: Sun Nov 28, 04 2:48 am
Location: Chiraq

Postby MainMan » Mon Jul 03, 06 9:09 pm

chococataclyzm wrote:
~MainMan~ wrote:
chococataclyzm wrote:Ah, okay good.

But, does it automatically know that the second mesh is the muzzle flash or do I need to notify the game of that?

Second texture you mean?

Yeah it already knows.


Oh, okay good.

So, all I need to do is make a first person mesh, where the second group is the blackmask tex muzzle flash and it works automatically?

Yup!
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby clyzm » Mon Jul 03, 06 10:41 pm

Hmm ... it's not working. I've set the blackmask muzzle flash mesh to group 2 on all meshes, made sure of it, and yet ... it has a black, visible mesh in front of it's barrel.

Here's the .uc i used:

Code: Select all
/////////////////////////////////////////////////////////////////
// xcr1. Player-view first person mesh.
/////////////////////////////////////////////////////////////////

class xcr1 extends Actor;

#exec MESH IMPORT MESH=xcr1 ANIVFILE=MODELS\xcr1_a.3d DATAFILE=MODELS\xcr1_d.3d X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=xcr1 X=0 Y=-27 Z=-18

#exec MESH SEQUENCE MESH=xcr1 SEQ=All STARTFRAME=0 NUMFRAMES=50
#exec MESH SEQUENCE MESH=xcr1 SEQ=Still STARTFRAME=0 NUMFRAMES=1
#exec MESH SEQUENCE MESH=xcr1 SEQ=Shoot STARTFRAME=2 NUMFRAMES=3
#exec MESH SEQUENCE MESH=xcr1 SEQ=ReloadBegin STARTFRAME=7 NUMFRAMES=3  RATE=3
#exec MESH SEQUENCE MESH=xcr1 SEQ=Reload STARTFRAME=11 NUMFRAMES=3  RATE=5
#exec MESH SEQUENCE MESH=xcr1 SEQ=ReloadEnd STARTFRAME=15 NUMFRAMES=3  RATE=3
#exec MESH SEQUENCE MESH=xcr1 SEQ=Select STARTFRAME=19 NUMFRAMES=3
#exec MESH SEQUENCE MESH=xcr1 SEQ=Down STARTFRAME=23 NUMFRAMES=3
#exec MESH SEQUENCE MESH=xcr1 SEQ=Idle1 STARTFRAME=27 NUMFRAMES=3

#exec MESHMAP NEW MESHMAP=xcr1 MESH=xcr1


//Edit X, Y, and Z values in line below to change size of mesh in game
#exec MESHMAP SCALE MESHMAP=xcr1 X=0.3 Y=0.3 Z=0.3

#exec TEXTURE IMPORT NAME=xcr1Tex0 FILE=textures\WeaponHandsTex.pcx GROUP=Skins FLAGS=2
#exec MESHMAP SETTEXTURE MESHMAP=xcr1 NUM=0 TEXTURE=xcr1Tex0

#exec MESHMAP SETTEXTURE MESHMAP=xcr1 NUM=1 TEXTURE=BlackMaskTex

#exec TEXTURE IMPORT NAME=xcr1Tex2 FILE=textures\WeaponHandsTex.pcx GROUP=Skins FLAGS=2
#exec MESHMAP SETTEXTURE MESHMAP=xcr1 NUM=2 TEXTURE=xcr1Tex2

#exec TEXTURE IMPORT NAME=xcr1Tex3 FILE=textures\xcrtex.pcx GROUP=Skins FLAGS=2
#exec MESHMAP SETTEXTURE MESHMAP=xcr1 NUM=3 TEXTURE=xcr1Tex3
#exec MESHMAP SETTEXTURE MESHMAP=xcr1 NUM=4 TEXTURE=xcr1Tex3


defaultproperties
{
    DrawType=DT_Mesh
    Mesh=xcr1
}


And here's the weapon uc:

Code: Select all
//=============================================================================
// WeaponXCR.
//=============================================================================
class WeaponXCR extends DeusExWeapon;

var float   mpRecoilStrength;

simulated function PreBeginPlay()
{
   Super.PreBeginPlay();

   // If this is a netgame, then override defaults
   if ( Level.NetMode != NM_StandAlone )
   {
      HitDamage = mpHitDamage;
      BaseAccuracy = mpBaseAccuracy;
      ReloadTime = mpReloadTime;
      AccurateRange = mpAccurateRange;
      MaxRange = mpMaxRange;
      ReloadCount = mpReloadCount;

      // Tuned for advanced -> master skill system (Monte & Ricardo's number) client-side
      recoilStrength = 0.75;
   }
}

defaultproperties
{
     LowAmmoWaterMark=30
     GoverningSkill=Class'DeusEx.SkillWeaponRifle'
     EnviroEffective=ENVEFF_Air
     Concealability=CONC_Visual
     bAutomatic=False
     ShotTime=0.300000
     reloadTime=3.000000
     HitDamage=8
     BaseAccuracy=0.500000
     bCanHaveLaser=True
     bCanHaveSilencer=False
     recoilStrength=0.600000
     MinWeaponAcc=0.200000
     mpReloadTime=0.500000
     mpHitDamage=15
     mpBaseAccuracy=1.000000
     mpAccurateRange=2400
     mpMaxRange=2400
     mpReloadCount=30
     bCanHaveModBaseAccuracy=True
     bCanHaveModReloadCount=True
     bCanHaveModAccurateRange=True
     bCanHaveModReloadTime=True
     bCanHaveModRecoilStrength=True
     AmmoName=Class'DeusEx.Ammo762mm'
     ReloadCount=30
     PickupAmmoCount=30
     bInstantHit=True
     FireOffset=(X=-16.000000,Y=5.000000,Z=11.500000)
     shakemag=200.000000
     FireSound=Sound'DeusExSounds.Weapons.RifleFire'
     AltFireSound=Sound'DeusExSounds.Weapons.AssaultGunReloadEnd'
     CockingSound=Sound'DeusExSounds.Weapons.AssaultGunReload'
     SelectSound=Sound'DeusExSounds.Weapons.AssaultGunSelect'
     InventoryGroup=4
     ItemName="XCR Assault Gun"
     ItemArticle="an"
     PlayerViewOffset=(X=16.000000,Y=-5.000000,Z=-11.500000)
     PlayerViewMesh=LodMesh'WeaponXCR.xcr1'
     PickupViewMesh=LodMesh'WeaponXCR.xcrpickup'
     ThirdPersonMesh=LodMesh'WeaponXCR.xcr3rd'
     LandSound=Sound'DeusExSounds.Generic.DropMediumWeapon'
     Icon=Texture'DeusExUI.Icons.BeltIconAssaultGun'
     largeIcon=Texture'DeusExUI.Icons.LargeIconAssaultGun'
     largeIconWidth=94
     largeIconHeight=65
     invSlotsX=2
     invSlotsY=2
     Description="An XCR assault rifle with semi-automatic fire."
     beltDescription="XCR"
     Mesh=LodMesh'DeusExItems.AssaultGunPickup'
     CollisionRadius=15.000000
     CollisionHeight=1.100000
     Mass=30.000000
}
Image
User avatar
clyzm
Forum Master God
 
Posts: 16023
Joined: Sun Nov 28, 04 2:48 am
Location: Chiraq

Postby clyzm » Thu Jul 06, 06 8:36 am

Edit, nvm, fixed.
Image
User avatar
clyzm
Forum Master God
 
Posts: 16023
Joined: Sun Nov 28, 04 2:48 am
Location: Chiraq


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 9 guests