![]() |
|
|
#1 | |
|
Registered User
Join Date: Feb. 27th, 2001
Location: Equestria
Posts: 654
|
I’m working on a mold braking “laser sight” style aiming system mutator, it uses code based on the Agent X laser code and the “Laser sight” mutator by Glen Sharman that I downloaded from ModSquad.
So far it looks really sweet and works beautifully. Though there are several features that still need added before it’s finished I need it to change to a different texture when it hits a target/pawn, and the draw scale needs to also increase, basically I’m having a small dot crosshairs turn into a large circle to encircle the target pawn. Can “simulated” be used to modify the function so only the owners will be able to see their own “laser aimer” and if so, which function should be the simulated one? If this would not affect it then how can I make it so only the owner can see it??? If it does not hit anything in between, then the laser dot needs to spawn at a fixed distance to hang in the air. Which part of the “start trace” “end trace” needs to be modified to get this rang limit??? Below is the original unmodified class so you can see what I’m talking about. Quote:
__________________
Infiltration 2.75 Extended 1.05 New Improved Realistic gun mod for UT99 that I highly recommend. |
|
|
|
|
|
|
#2 |
|
Simple really:
first you need to call PostBeginPlay() in the LDot actor and set bOnlyOwnerSee to true: class LDot expands Actor; //Laser dot object for Laser Sights mutator - Glen Sharman, March 2001 simulated function PostBeginPlay() { bOnlyOwnerSee = true; //**This mean only the owner can see the sight** } Then we modify the LSight class, check the comments with **'s: class LSight expands TournamentPickup; //Laser sight object for Laser Sights mutator - Glen Sharman, 2001 //Texture, sound and original concept - Jon Bartram (aka Mr White) var ldot LD; #exec AUDIO IMPORT FILE="Sounds\zoom.wav" NAME="ActLS" GROUP="Pickups" #exec TEXTURE IMPORT FILE=Textures\pdot.bmp NAME=LaserDot function Activate() { GoToState('Activated'); } state Activated { function BeginState() { Owner.PlaySound(sound'ActLS', SLOT_None, Pawn(Owner).SoundDampening); LD = Spawn(Class'LDot', Owner); bActive = true; } function Tick(float DeltaTime) { local actor TargetedActor; //**Create an actor object**. local vector X, Y, Z, StartTrace, EndTrace, HitLocation, HitNormal; if ( Pawn(Owner).Weapon.bMeleeWeapon && bActive ) { LD.Destroy(); bActive = false; } if ( Pawn(Owner).IsInState('FeigningDeath') && bActive ) { LD.Destroy(); bActive = false; } if ( !bActive && !Pawn(Owner).Weapon.bMeleeWeapon && !Pawn(Owner).IsInState('FeigningDeath') ) { LD = Spawn(Class'LDot', Owner); bActive = true; } GetAxes(Pawn(Owner).ViewRotation, X, Y, Z); StartTrace = Pawn(Owner).Location + CalcDrawOffset(); EndTrace = StartTrace + vector(Pawn(Owner).ViewRotation) * 10000; //**The Trace function returns an actor type variable.** TargetedActor = Trace(HitLocation, HitNormal, EndTrace, StartTrace, True); LD.SetLocation(HitLocation); if(TargetedActor.IsA('Pawn')) //**Verify that the actor is a Pawn** { //**Yes it's a Pawn** LD.DrawScale = <New DrawScale>; //**you can change the drawscale here** //**call SetDisplayProperties to change the texture** LD.SetDisplayProperties(STY_Translucent, Texture'<New Texture>', //**new texture goes here** false, false); } else //**Else, if there's not an actor at the end of the trace, reset the LDot tp it's default values** { LD.DrawScale = LD.Default.DrawScale; LD.SetDisplayProperties(LD.Default.Style, LD.Default.Texture, false, false); } } function EndState() //destroy laser dot if player dies { LD.Destroy(); bActive = false; } function Activate() { GoToState('DeActivated'); } } state DeActivated { function BeginState() { Owner.PlaySound(Sound'ActLS', SLOT_None, Pawn(Owner).SoundDampening); LD.Destroy(); bActive = false; } } As for the distance limit, if you modify the following: EndTrace = StartTrace + vector(Pawn(Owner).ViewRotation) * 10000; //**notice the 10000** If you lower the 10000 you might be able to adjust the maximum distance of the LDot, you can even make a configurable variable so the user of your mutator can adjust this to it's liking. I hope that helps good luck with your mut
Last edited by Brood_of_Evil; 6th Nov 2001 at 11:14 PM. |
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Feb. 27th, 2001
Location: Equestria
Posts: 654
|
Thanks for the info, that really helped
__________________
Infiltration 2.75 Extended 1.05 New Improved Realistic gun mod for UT99 that I highly recommend. |
|
|
|
|
|
#4 | |
|
Registered User
Join Date: Feb. 27th, 2001
Location: Equestria
Posts: 654
|
The problem is that I need the aimer to work while the Behindview is set to true
The laser sight works great in first person, though now it disappears when in third person view, I need a way to tell it the third person camera is it’s owner Here is the bit of the code where the camera gets setup in the character class. Quote:
__________________
Infiltration 2.75 Extended 1.05 New Improved Realistic gun mod for UT99 that I highly recommend. Last edited by Silver_Ibex; 7th Nov 2001 at 12:06 PM. |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|