Moderator: Forum Guards
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...?
~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.
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.
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
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);
}
simulated function EraseMuzzleFlashTexture()
{
MultiSkins[2] = None;
}
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);
}
}
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?
~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.
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?
/////////////////////////////////////////////////////////////////
// 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
}
//=============================================================================
// 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
}