can anyone mod the laser so that its viewable by other players when you toggel it, or so that it stays on?
i had it working, but couldn't get it to aim right from my gun to the crosshairs :[

something like this ^
Moderator: Forum Guards
Raiiiny wrote:the laser on guns in DX was a fail, absolutely no purpose.
can anyone mod the laser so that its viewable by other players when you toggel it, or so that it stays on?
i had it working, but couldn't get it to aim right from my gun to the crosshairs :[--------------------------------------------------------
something like this ^
var LaserEmitter emitter;
var float zapTimer;
var vector GunLocation;
var vector lastHitLocation;
// force Fire damage
function name WeaponDamageType()
{
return 'Flamed';
}
function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
{
Super.ProcessTraceHit(Other, HitLocation, HitNormal, X, Y, Z);
//in cases of successive firing, it may happen that a new emitter is created before the previous one
//is destroyed. This corrects the problem.
if (emitter!=None)
emitter.Destroy();
//creates a laser beam
emitter = Spawn(class'LaserEmitter',Self);
if (emitter != None)
emitter.Instigator = Pawn(Owner);
//it keeps firing for 0.3 seconds
zapTimer = 0.3;
}
// intercept the hit and turn on the emitter
function NewTrace()
{
local vector HitLocation, HitNormal, StartTrace, EndTrace, X,Y,Z;
local actor Other;
local Pawn PawnOwner;
//old - taken from the original Trace() function
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*AimError, False, False);
EndTrace = StartTrace;
X = vector(AdjustedAim);
EndTrace += (1000000 * X);
Other = PawnOwner.TraceShot(HitLocation,HitNormal,EndTrace,StartTrace);
//new - upgrades the origin and destination of the beam
if (emitter != None)
{
GunLocation=Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
emitter.SetLocation(GunLocation);
emitter.SetRotation(Rotator(HitLocation - emitter.Location));
emitter.TurnOn();
emitter.SetBase(Owner);
lastHitLocation = HitLocation;
}
}
function Tick(float deltaTime)
{
Super.Tick(deltaTime);
if (zapTimer > 0)
{
zapTimer -= deltaTime;
// updates the rotation of the emitter
NewTrace();
if (zapTimer < 0)
{
zapTimer = 0;
emitter.Destroy();
}
}
}
function Destroyed()
{
if (emitter != None)
{
emitter.Destroy();
emitter = None;
}
Super.Destroyed();
}
simulated function PreBeginPlay()
{
Super.PreBeginPlay();
{
emitter = Spawn(class'LaserEmitter',Self);
if (emitter != None)
emitter.Instigator = Pawn(Owner);
}
}
function Tick(float deltaTime)
{
Super.Tick(deltaTime);
}
var LaserSpot LX;
replication
{
Reliable if(Role==ROLE_Authority)
LX;
Unreliable if (Role==ROLE_Authority)
MoveLaserSpot;
}
function MoveLaserSpot()
{
local Rotator PR,V;
local Vector HL, HN, TStart, TEnd;
local vector X,Y,Z;
local Pawn POwner;
local Actor A;
POwner=Pawn(Owner);
if(POwner==None)
{
return;
}
if(!bLasing)
{
return;
}
GetAxes(POwner.ViewRotation,X,Y,Z);
TStart = ComputeProjectileStart(X, Y, Z);
V = POwner.AdjustAim(1000000,TStart, 0, False, False);
TEnd = TStart + 0.0 * (FRand()-0.5)*Y*1000 + 0.0 * (FRand()-0.5)*Z*1000;
TEnd += MaxRange * vector(V);
A=Trace(HL,HN,TEnd,TStart,True);
if(LX==None)
{
LX=spawn(class'LaserSpot',POwner,,HL,POwner.ViewRotation);
}
else
{
LX.SetLocation(HL);
LX.SetRotation(POwner.ViewRotation);
if(LX.bHidden)
{
LX.bHidden=False;
}
}
}
// Maaaan, I can't believe I have to dump all of this in, JUST TO REPLACE THE LASER!
simulated function Tick(float deltaTime)
{
local vector loc;
local rotator rot;
local float beepspeed, recoil;
local DeusExPlayer player;
local Actor RealTarget;
local Pawn pawn;
player = DeusExPlayer(Owner);
pawn = Pawn(Owner);
Super(Weapon).Tick(deltaTime);
// don't do any of this if this weapon isn't currently in use
if (pawn == None)
{
LockMode = LOCK_None;
MaintainLockTimer = 0;
LockTarget = None;
LockTimer = 0;
return;
}
if (pawn.Weapon != self)
{
LockMode = LOCK_None;
MaintainLockTimer = 0;
LockTarget = None;
LockTimer = 0;
return;
}
// all this should only happen IF you have ammo loaded
if (ClipCount < ReloadCount)
{
// check for LAM or other placed mine placement
if (bHandToHand && (ProjectileClass != None) && (!Self.IsA('WeaponShuriken')))
{
if (NearWallCheck())
{
if (( Level.NetMode != NM_Standalone ) && IsAnimating() && (AnimSequence == 'Select'))
{
}
else
{
if (!bNearWall || (AnimSequence == 'Select'))
{
PlayAnim('PlaceBegin',, 0.1);
bNearWall = True;
}
}
}
else
{
if (bNearWall)
{
PlayAnim('PlaceEnd',, 0.1);
bNearWall = False;
}
}
}
SoundTimer += deltaTime;
if ( (Level.Netmode == NM_Standalone) || ( (Player != None) && (Player.PlayerIsClient()) ) )
{
if (bCanTrack)
{
Target = AcquireTarget();
RealTarget = Target;
// calculate the range
if (Target != None)
TargetRange = Abs(VSize(Target.Location - Location));
// update our timers
//SoundTimer += deltaTime;
MaintainLockTimer -= deltaTime;
// check target and range info to see what our mode is
if ((Target == None) || IsInState('Reload'))
{
if (MaintainLockTimer <= 0)
{
SetLockMode(LOCK_None);
MaintainLockTimer = 0;
LockTarget = None;
}
else if (LockMode == LOCK_Locked)
{
Target = LockTarget;
}
}
else if ((Target != LockTarget) && (Target.IsA('Pawn')) && (LockMode == LOCK_Locked))
{
SetLockMode(LOCK_None);
LockTarget = None;
}
else if (!Target.IsA('Pawn'))
{
if (MaintainLockTimer <0> MaxRange)
{
SetLockMode(LOCK_Range);
}
else
{
// change LockTime based on skill
// -0.7 = max skill
// DEUS_EX AMSD Only do weaponskill check here when first checking.
if (LockTimer == 0)
{
LockTime = FMax(Default.LockTime + 3.0 * GetWeaponSkill(), 0.0);
if ((Level.Netmode != NM_Standalone) && (LockTime <0>= LockTime)
{
SetLockMode(LOCK_Locked);
}
else
{
SetLockMode(LOCK_Acquire);
}
}
}
// act on the lock mode
switch (LockMode)
{
case LOCK_None:
TargetMessage = msgNone;
LockTimer -= deltaTime;
break;
case LOCK_Invalid:
TargetMessage = msgLockInvalid;
LockTimer -= deltaTime;
break;
case LOCK_Range:
TargetMessage = msgLockRange @ Int(TargetRange/16) @ msgRangeUnit;
LockTimer -= deltaTime;
break;
case LOCK_Acquire:
TargetMessage = msgLockAcquire @ Left(String(LockTime-LockTimer), 4) @ msgTimeUnit;
beepspeed = FClamp((LockTime - LockTimer) / Default.LockTime, 0.2, 1.0);
if (SoundTimer > beepspeed)
{
Owner.PlaySound(TrackingSound, SLOT_None);
SoundTimer = 0;
}
break;
case LOCK_Locked:
// If maintaining a lock, or getting a new one, increment maintainlocktimer
if ((RealTarget != None) && ((RealTarget == LockTarget) || (LockTarget == None)))
{
if (Level.NetMode != NM_Standalone)
MaintainLockTimer = default.MaintainLockTimer;
else
MaintainLockTimer = 0;
LockTarget = Target;
}
TargetMessage = msgLockLocked @ Int(TargetRange/16) @ msgRangeUnit;
// DEUS_EX AMSD Moved out so server can play it so that client knows for sure when locked.
/*if (SoundTimer > 0.1)
{
Owner.PlaySound(LockedSound, SLOT_None);
SoundTimer = 0;
}*/
break;
}
}
else
{
LockMode = LOCK_None;
TargetMessage = msgNone;
LockTimer = 0;
MaintainLockTimer = 0;
LockTarget = None;
}
if (LockTimer <0> 0.1) && (Role == ROLE_Authority))
{
PlayLockSound();
SoundTimer = 0;
}
currentAccuracy = CalculateAccuracy();
if (player != None)
{
// reduce the recoil based on skill
recoil = recoilStrength + GetWeaponSkill() * 2.0;
if (recoil <0> 0.0))
{
player.ViewRotation.Yaw += deltaTime * (Rand(4096) - 2048) * recoil;
player.ViewRotation.Pitch += deltaTime * (Rand(4096) + 4096) * recoil;
if ((player.ViewRotation.Pitch > 16384) && (player.ViewRotation.Pitch < 32768))
player.ViewRotation.Pitch = 16384;
}
}
// if were standing still, increase the timer
if (VSize(Owner.Velocity) <10> 0.25)
{
ShakeYaw = currentAccuracy * (Rand(4096) - 2048);
ShakePitch = currentAccuracy * (Rand(4096) - 2048);
ShakeTimer -= 0.25;
}
ShakeTimer += deltaTime;
if (bLasing)
{
MoveLaserSpot();
}
if ((player != None) && bZoomed)
{
player.ViewRotation.Yaw += deltaTime * ShakeYaw;
player.ViewRotation.Pitch += deltaTime * ShakePitch;
}
}
}
function LaserOn()
{
if (bHasLaser && !bLasing)
{
MoveLaserSpot();
bLasing = True;
}
}
function LaserOff()
{
if (bHasLaser && bLasing)
{
bLasing = False;
LX.bHidden=True;
}
}
Longc[A]t wrote:I still think Dae is a russian spambot.
~[A]Daedalus~ wrote:There will be a day when my patience goes away and you, along with all who rant with you, will get banned.
ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
ShadowRunner wrote:lol, the mayhem of this thread is huge...
~][FGS][Nobody~ wrote:Is there anything I can put in your mouth to make you stop talking rubbish?
anax wrote:wow you are amazing. like this woman
http://www.youtube.com/watch?v=bl4B9NA-NLE
[FGS]Kalman wrote:Lol I thought for 2-3 months everybody talks like a sir here, then I realised it's the forum's censorship
Longc[A]t wrote:I still think Dae is a russian spambot.
~[A]Daedalus~ wrote:There will be a day when my patience goes away and you, along with all who rant with you, will get banned.
ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
code
ShadowRunner wrote:lol, the mayhem of this thread is huge...
~][FGS][Nobody~ wrote:Is there anything I can put in your mouth to make you stop talking rubbish?
anax wrote:wow you are amazing. like this woman
http://www.youtube.com/watch?v=bl4B9NA-NLE
[FGS]Kalman wrote:Lol I thought for 2-3 months everybody talks like a sir here, then I realised it's the forum's censorship
Longc[A]t wrote:I still think Dae is a russian spambot.
~[A]Daedalus~ wrote:There will be a day when my patience goes away and you, along with all who rant with you, will get banned.
ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.