Raised This Month: $51 Target: $400
 12% 

[TF2] Visible Laser Sight for Sniper Riffle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Marverlous
Senior Member
Join Date: May 2013
Old 03-10-2014 , 21:20   [TF2] Visible Laser Sight for Sniper Riffle
Reply With Quote #1

Hello, I notice that in mvm, the robot sniper have very cool laser sight coming out of their riffles. Would someone be kind enough to make that feature into normal gameplay?
__________________
Marverlous is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 03-11-2014 , 16:15   Re: [TF2] Visible Laser Sight for Sniper Riffle
Reply With Quote #2

I'm just gonna put this here, if someone wanna finish it, go ahead !
You can download it here : https://forums.alliedmods.net/showthread.php?p=2121702
__________________
Want to check my plugins ?

Last edited by Arkarr; 04-10-2014 at 06:35.
Arkarr is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-11-2014 , 17:54   Re: [TF2] Visible Laser Sight for Sniper Riffle
Reply With Quote #3

Not sure if this will be an issue, but if you regconsolecmd on mapstart you're registering it multiple times. Not sure if it will make the command execute twice, but i would recommend on just making it OnPluginStart
Mitchell is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 03-11-2014 , 23:58   Re: [TF2] Visible Laser Sight for Sniper Riffle
Reply With Quote #4

What arkarr is doing is attaching a jerky sprite onto the base of the player model (aka between its feet). So it is not what the OP is looking for.
Best way would be to browse around in the particles, attributes, materials and textures of TF2 and also at the sniper rifle's model if there are any useful attachment point you can use (for research or directly to attach something to it). Might even be an extra entity with therefore accessible props.

I.e. from the datamaps:
Code:
CTFLaserPointer - tf_weapon_laser_pointer
- CTFWeaponBaseGunZoomOutIn (FunctionTable)(0 Bytes)
- CTFWeaponBaseGunZoomOut (FunctionTable)(0 Bytes)
- CTFWeaponBaseGunZoomIn (FunctionTable)(0 Bytes)
- CTFWeaponBaseFallThink (FunctionTable)(0 Bytes)
- m_flNextPrimaryAttack (Save)(4 Bytes)
- m_flNextSecondaryAttack (Save)(4 Bytes)
- m_flTimeWeaponIdle (Save)(4 Bytes)
- m_bInReload (Save)(1 Bytes)
- m_bFireOnEmpty (Save)(1 Bytes)
- m_hOwner (Save)(4 Bytes)
- m_iState (Save)(4 Bytes)
- m_iszName (Save)(4 Bytes)
- m_iPrimaryAmmoType (Save)(4 Bytes)
- m_iSecondaryAmmoType (Save)(4 Bytes)
- m_iClip1 (Save)(4 Bytes)
- m_iClip2 (Save)(4 Bytes)
- m_bFiresUnderwater (Save)(1 Bytes)
- m_bAltFiresUnderwater (Save)(1 Bytes)
- m_fMinRange1 (Save)(4 Bytes)
- m_fMinRange2 (Save)(4 Bytes)
- m_fMaxRange1 (Save)(4 Bytes)
- m_fMaxRange2 (Save)(4 Bytes)
- m_iPrimaryAmmoCount (Save)(4 Bytes)
- m_iSecondaryAmmoCount (Save)(4 Bytes)
- m_nViewModelIndex (Save)(4 Bytes)
- m_nIdealSequence (Save)(4 Bytes)
- m_IdealActivity (Save)(4 Bytes)
- m_fFireDuration (Save)(4 Bytes)
- m_bReloadsSingly (Save)(1 Bytes)
- m_iSubType (Save)(4 Bytes)
- m_bRemoveable (Save)(1 Bytes)
- m_flUnlockTime (Save)(4 Bytes)
- m_hLocker (Save)(4 Bytes)
- m_pConstraint (Save)(0 Bytes)
- m_iReloadHudHintCount (Save)(4 Bytes)
- m_iAltFireHudHintCount (Save)(4 Bytes)
- m_bReloadHudHintDisplayed (Save)(1 Bytes)
- m_bAltFireHudHintDisplayed (Save)(1 Bytes)
- m_flHudHintPollTime (Save)(4 Bytes)
- m_flHudHintMinDisplayTime (Save)(4 Bytes)
- CBaseCombatWeaponDefaultTouch (FunctionTable)(0 Bytes)
- CBaseCombatWeaponFallThink (FunctionTable)(0 Bytes)
- CBaseCombatWeaponMaterialize (FunctionTable)(0 Bytes)
- CBaseCombatWeaponAttemptToMaterialize (FunctionTable)(0 Bytes)
- CBaseCombatWeaponDestroyItem (FunctionTable)(0 Bytes)
- CBaseCombatWeaponSetPickupTouch (FunctionTable)(0 Bytes)
- CBaseCombatWeaponHideThink (FunctionTable)(0 Bytes)
- InputHideWeapon (Input)(0 Bytes) - HideWeapon
- m_OnPlayerUse (Save|Key|Output)(0 Bytes) - OnPlayerUse
- m_OnPlayerPickup (Save|Key|Output)(0 Bytes) - OnPlayerPickup
- m_OnNPCPickup (Save|Key|Output)(0 Bytes) - OnNPCPickup
- m_OnCacheInteraction (Save|Key|Output)(0 Bytes) - OnCacheInteraction
- m_flGroundSpeed (Save)(4 Bytes)
- m_flLastEventCheck (Save)(4 Bytes)
- m_bSequenceFinished (Save)(1 Bytes)
- m_bSequenceLoops (Save)(1 Bytes)
- m_nSkin (Save|Key|Input)(4 Bytes) - skin
- m_nBody (Save|Key)(4 Bytes) - body
- m_nBody (Save|Key|Input)(4 Bytes) - SetBodyGroup
- m_nHitboxSet (Save|Key)(4 Bytes) - hitboxset
- m_nSequence (Save|Key)(4 Bytes) - sequence
- m_flPoseParameter (Save)(96 Bytes)
- m_flEncodedController (Save)(16 Bytes)
- m_flPlaybackRate (Save|Key)(4 Bytes) - playbackrate
- m_flCycle (Save|Key)(4 Bytes) - cycle
- m_pIk (Save)(0 Bytes)
- m_iIKCounter (Save)(4 Bytes)
- m_bClientSideAnimation (Save)(1 Bytes)
- m_bClientSideFrameReset (Save)(1 Bytes)
- m_nNewSequenceParity (Save)(4 Bytes)
- m_nResetEventsParity (Save)(4 Bytes)
- m_nMuzzleFlashParity (Save)(1 Bytes)
- m_iszLightingOriginRelative (Save|Key)(4 Bytes) - LightingOriginHack
- m_iszLightingOrigin (Save|Key)(4 Bytes) - LightingOrigin
- m_hLightingOrigin (Save)(4 Bytes)
- m_hLightingOriginRelative (Save)(4 Bytes)
- m_flModelScale (Save)(4 Bytes)
- m_flDissolveStartTime (Save)(4 Bytes)
- InputIgnite (Input)(0 Bytes) - Ignite
- InputIgniteLifetime (Input)(0 Bytes) - IgniteLifetime
- InputIgniteNumHitboxFires (Input)(0 Bytes) - IgniteNumHitboxFires
- InputIgniteHitboxFireScale (Input)(0 Bytes) - IgniteHitboxFireScale
- InputBecomeRagdoll (Input)(0 Bytes) - BecomeRagdoll
- InputSetLightingOriginRelative (Input)(0 Bytes) - SetLightingOriginHack
- InputSetLightingOrigin (Input)(0 Bytes) - SetLightingOrigin
- m_OnIgnite (Save|Key|Output)(0 Bytes) - OnIgnite
- m_fadeMinDist (Save|Key|Input)(4 Bytes) - fademindist
- m_fadeMaxDist (Save|Key|Input)(4 Bytes) - fademaxdist
- m_flFadeScale (Save|Key)(4 Bytes) - fadescale
- m_flModelScale (Save|Key)(4 Bytes) - modelscale
- InputSetModelScale (Input)(0 Bytes) - SetModelScale
- m_fBoneCacheFlags (Save)(2 Bytes)
- m_iClassname (Save|Key)(4 Bytes) - classname
- m_iGlobalname (Global|Save|Key)(4 Bytes) - globalname
- m_iParent (Save|Key)(4 Bytes) - parentname
- m_iHammerID (Save|Key)(4 Bytes) - hammerid
- m_flSpeed (Save|Key)(4 Bytes) - speed
- m_nRenderFX (Save|Key)(1 Bytes) - renderfx
- m_nRenderMode (Save|Key)(1 Bytes) - rendermode
- m_flPrevAnimTime (Save)(4 Bytes)
- m_flAnimTime (Save)(4 Bytes)
- m_flSimulationTime (Save)(4 Bytes)
- m_nLastThinkTick (Save)(4 Bytes)
- m_nNextThinkTick (Save|Key)(4 Bytes) - nextthink
- m_fEffects (Save|Key)(4 Bytes) - effects
- m_clrRender (Save|Key)(4 Bytes) - rendercolor
- m_nModelIndex (Global|Save|Key)(2 Bytes) - modelindex
- touchStamp (Save)(4 Bytes)
- m_aThinkFunctions (Save)(0 Bytes)
- m_ResponseContexts (Save)(0 Bytes)
- m_iszResponseContext (Save|Key)(4 Bytes) - ResponseContext
- m_pfnThink (Save)(8 Bytes)
- m_pfnTouch (Save)(8 Bytes)
- m_pfnUse (Save)(8 Bytes)
- m_pfnBlocked (Save)(8 Bytes)
- m_pfnMoveDone (Save)(8 Bytes)
- m_lifeState (Save)(1 Bytes)
- m_takedamage (Save)(1 Bytes)
- m_iMaxHealth (Save|Key)(4 Bytes) - max_health
- m_iHealth (Save|Key)(4 Bytes) - health
- m_target (Save|Key)(4 Bytes) - target
- m_iszDamageFilterName (Save|Key)(4 Bytes) - damagefilter
- m_hDamageFilter (Save)(4 Bytes)
- m_debugOverlays (Save)(4 Bytes)
- m_pParent (Global|Save)(4 Bytes)
- m_iParentAttachment (Save)(1 Bytes)
- m_hMoveParent (Global|Save)(4 Bytes)
- m_hMoveChild (Global|Save)(4 Bytes)
- m_hMovePeer (Global|Save)(4 Bytes)
- m_iEFlags (Save)(4 Bytes)
- m_iName (Save)(4 Bytes)
 Sub-Class Table (1 Deep): m_Collision - CCollisionProperty
 - m_vecMinsPreScaled (Global|Save)(12 Bytes)
 - m_vecMaxsPreScaled (Global|Save)(12 Bytes)
 - m_vecMins (Global|Save)(12 Bytes)
 - m_vecMaxs (Global|Save)(12 Bytes)
 - m_nSolidType (Save|Key)(1 Bytes) - solid
 - m_usSolidFlags (Save)(2 Bytes)
 - m_nSurroundType (Save)(1 Bytes)
 - m_flRadius (Save)(4 Bytes)
 - m_triggerBloat (Save)(1 Bytes)
 - m_vecSpecifiedSurroundingMinsPreScaled (Save)(12 Bytes)
 - m_vecSpecifiedSurroundingMaxsPreScaled (Save)(12 Bytes)
 - m_vecSpecifiedSurroundingMins (Save)(12 Bytes)
 - m_vecSpecifiedSurroundingMaxs (Save)(12 Bytes)
 - m_vecSurroundingMins (Save)(12 Bytes)
 - m_vecSurroundingMaxs (Save)(12 Bytes)
 Sub-Class Table (1 Deep): m_Network - CServerNetworkProperty
 - m_hParent (Global|Save)(4 Bytes)
- m_MoveType (Save)(1 Bytes)
- m_MoveCollide (Save)(1 Bytes)
- m_hOwnerEntity (Save)(4 Bytes)
- m_CollisionGroup (Save)(4 Bytes)
- m_pPhysicsObject (Save)(0 Bytes)
- m_flElasticity (Save)(4 Bytes)
- m_flShadowCastDistance (Save|Key)(4 Bytes) - shadowcastdist
- m_flDesiredShadowCastDistance (Save)(4 Bytes)
- m_iInitialTeamNum (Save|Key|Input)(4 Bytes) - TeamNum
- m_iTeamNum (Save)(4 Bytes)
- m_hGroundEntity (Save)(4 Bytes)
- m_flGroundChangeTime (Save)(4 Bytes)
- m_ModelName (Global|Save|Key)(4 Bytes) - model
- m_vecBaseVelocity (Save|Key)(12 Bytes) - basevelocity
- m_vecAbsVelocity (Save)(12 Bytes)
- m_vecAngVelocity (Save|Key)(12 Bytes) - avelocity
- m_rgflCoordinateFrame (Save)(48 Bytes)
- m_nWaterLevel (Save|Key)(1 Bytes) - waterlevel
- m_nWaterType (Save)(1 Bytes)
- m_pBlocker (Save)(4 Bytes)
- m_flGravity (Save|Key)(4 Bytes) - gravity
- m_flFriction (Save|Key)(4 Bytes) - friction
- m_flLocalTime (Save|Key)(4 Bytes) - ltime
- m_flVPhysicsUpdateLocalTime (Save)(4 Bytes)
- m_flMoveDoneTime (Save)(4 Bytes)
- m_vecAbsOrigin (Save)(12 Bytes)
- m_vecVelocity (Save|Key)(12 Bytes) - velocity
- m_iTextureFrameIndex (Save|Key)(1 Bytes) - texframeindex
- m_bSimulatedEveryTick (Save)(1 Bytes)
- m_bAnimatedEveryTick (Save)(1 Bytes)
- m_bAlternateSorting (Save)(1 Bytes)
- m_spawnflags (Save|Key)(4 Bytes) - spawnflags
- m_nTransmitStateOwnedCounter (Save)(1 Bytes)
- m_angAbsRotation (Save)(12 Bytes)
- m_vecOrigin (Save)(12 Bytes)
- m_angRotation (Save)(12 Bytes)
- m_vecViewOffset (Save|Key)(12 Bytes) - view_ofs
- m_fFlags (Save)(4 Bytes)
- m_nSimulationTick (Save)(4 Bytes)
- m_flNavIgnoreUntilTime (Save)(4 Bytes)
- InputSetTeam (Input)(0 Bytes) - SetTeam
- InputKill (Input)(0 Bytes) - Kill
- InputKillHierarchy (Input)(0 Bytes) - KillHierarchy
- InputUse (Input)(0 Bytes) - Use
- InputAlpha (Input)(0 Bytes) - Alpha
- InputAlternativeSorting (Input)(0 Bytes) - AlternativeSorting
- InputColor (Input)(0 Bytes) - Color
- InputSetParent (Input)(0 Bytes) - SetParent
- InputSetParentAttachment (Input)(0 Bytes) - SetParentAttachment
- InputSetParentAttachmentMaintainOffset (Input)(0 Bytes) - SetParentAttachmentMaintainOffset
- InputClearParent (Input)(0 Bytes) - ClearParent
- InputSetDamageFilter (Input)(0 Bytes) - SetDamageFilter
- InputEnableDamageForces (Input)(0 Bytes) - EnableDamageForces
- InputDisableDamageForces (Input)(0 Bytes) - DisableDamageForces
- InputDispatchEffect (Input)(0 Bytes) - DispatchEffect
- InputDispatchResponse (Input)(0 Bytes) - DispatchResponse
- InputAddContext (Input)(0 Bytes) - AddContext
- InputRemoveContext (Input)(0 Bytes) - RemoveContext
- InputClearContext (Input)(0 Bytes) - ClearContext
- InputDisableShadow (Input)(0 Bytes) - DisableShadow
- InputEnableShadow (Input)(0 Bytes) - EnableShadow
- InputAddOutput (Input)(0 Bytes) - AddOutput
- InputFireUser1 (Input)(0 Bytes) - FireUser1
- InputFireUser2 (Input)(0 Bytes) - FireUser2
- InputFireUser3 (Input)(0 Bytes) - FireUser3
- InputFireUser4 (Input)(0 Bytes) - FireUser4
- m_OnUser1 (Save|Key|Output)(0 Bytes) - OnUser1
- m_OnUser2 (Save|Key|Output)(0 Bytes) - OnUser2
- m_OnUser3 (Save|Key|Output)(0 Bytes) - OnUser3
- m_OnUser4 (Save|Key|Output)(0 Bytes) - OnUser4
- CBaseEntitySUB_Remove (FunctionTable)(0 Bytes)
- CBaseEntitySUB_DoNothing (FunctionTable)(0 Bytes)
- CBaseEntitySUB_StartFadeOut (FunctionTable)(0 Bytes)
- CBaseEntitySUB_StartFadeOutInstant (FunctionTable)(0 Bytes)
- CBaseEntitySUB_FadeOut (FunctionTable)(0 Bytes)
- CBaseEntitySUB_Vanish (FunctionTable)(0 Bytes)
- CBaseEntitySUB_CallUseToggle (FunctionTable)(0 Bytes)
- CBaseEntityShadowCastDistThink (FunctionTable)(0 Bytes)
- m_hEffectEntity (Save)(4 Bytes)
- m_nModelIndexOverrides (Save)(16 Bytes)
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.

Last edited by Dr. Greg House; 03-12-2014 at 00:01.
Dr. Greg House is offline
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 03-12-2014 , 01:49   Re: [TF2] Visible Laser Sight for Sniper Riffle
Reply With Quote #5

tf_weapon_laser_pointer = The Wrangler
Pelipoika is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 03-12-2014 , 07:37   Re: [TF2] Visible Laser Sight for Sniper Riffle
Reply With Quote #6

Awwwww didn't want to reg the consoke on map start ! And well, this was made yesterday quickly. Anyway I forget to say thanks to Pelipoika for is usefull help.

PHP Code:
New Float:position_p[3];
Position_p[2] += 20;
GetEntPropVector(iProp_Send"m_vecOrigini"position_p);
//Arkarr: Doesn't work, beam still at foot
//Pelipoika:  ... You silly.
//Arkarr: ... 
//Arkarr: Sec please, gonna suicide and come back later with other genius questions... 
Gonna update this night.
__________________
Want to check my plugins ?
Arkarr is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-12-2014 , 09:27   Re: [TF2] Visible Laser Sight for Sniper Riffle
Reply With Quote #7

"m_vecOrigini" ?

Why not just use: http://docs.sourcemod.net/api/index....d=show&id=179&
Since you cant attach things to attachment points on the players with out it not being transmitted, it'd be alot of work arounds to get it to work.
Mitchell is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 03-12-2014 , 11:15   Re: [TF2] Visible Laser Sight for Sniper Riffle
Reply With Quote #8

Quote:
Originally Posted by Mitchell View Post
"m_vecOrigini" ?

Why not just use: http://docs.sourcemod.net/api/index....d=show&id=179&
Since you cant attach things to attachment points on the players with out it not being transmitted, it'd be alot of work arounds to get it to work.
Because it was quickly written and late done. In fact I plane to rescript it.
__________________
Want to check my plugins ?

Last edited by Arkarr; 03-12-2014 at 13:10.
Arkarr is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 03-12-2014 , 12:03   Re: [TF2] Visible Laser Sight for Sniper Riffle
Reply With Quote #9

Quote:
Originally Posted by Arkarr View Post
I'm just gonna put this here, if someone wanna and finish it, go ahead !
This gives me idea
There's a function called GetWeaponShootPos
1. Use it to get sniper rifle's bullet hole
2. make it shoot trace laser from there at the player's aim pos
Would look lovely imo
__________________
...
Oshizu is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 03-12-2014 , 13:14   Re: [TF2] Visible Laser Sight for Sniper Riffle
Reply With Quote #10

Quote:
Originally Posted by Oshizu View Post
This gives me idea
There's a function called GetWeaponShootPos
1. Use it to get sniper rifle's bullet hole
2. make it shoot trace laser from there at the player's aim pos
Would look lovely imo
Machina shot effect for every sniper, basically ? Sounds fun !
Anyway, pretty sure you can do it with attributs.
__________________
Want to check my plugins ?

Last edited by Arkarr; 03-12-2014 at 13:15.
Arkarr is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode