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

Guns shooting beams


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 08-23-2007 , 10:51   Guns shooting beams
Reply With Quote #1

This morning I was trying to complete Half-Life 2 for 3rd time and when I saw the snipers (the chapter that you rescue barney from the snipers).
The snipers has something like a laser sight. A beam drawn from the gun to the aimed place. I thought that we can make beam-shooting guns for CS: S.
Here is an image:
[IMG]http://**************.to/i/beamcopy.png[/IMG]
When a player fires, a beam is started to drawn. The beam keeps growing longer till it hits somewhere and when it hits it disappears.
How can I do that? (Maybe it's imposible?!?!)
__________________
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
dalto
Veteran Member
Join Date: Jul 2007
Old 08-23-2007 , 11:17   Re: Guns shooting beams
Reply With Quote #2

Look in sdktools_trace.inc. I think this is what you need although I have never used it myself.
dalto is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 08-23-2007 , 13:00   Re: Guns shooting beams
Reply With Quote #3

The problem is I don't know anything about entities. I didn't know when I was using AMXMX and I don't know now.
I have that kind of problems. For example; I know PHP, but I suck when it comes to SQL
__________________
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
pRED*
Join Date: Dec 2006
Old 08-23-2007 , 15:04   Re: Guns shooting beams
Reply With Quote #4

Look at the code for hook. That draws a line where you are aiming. It's just a temp entity
pRED* is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 08-24-2007 , 16:15   Re: Guns shooting beams
Reply With Quote #5

I used the code from HGR, but I realized that I did a stupid mistake. In that code it gives the aiming coordinate, but I need the exact bullet hit coordinate. I will try doing it using bullet_impact.
__________________
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 08-27-2007 , 17:29   Re: Guns shooting beams
Reply With Quote #6

You could try creating some kind of beam entity and attach it to the player's weapon... though it probably won't be easy.
__________________
sslice is offline
pRED*
Join Date: Dec 2006
Old 08-27-2007 , 18:25   Re: Guns shooting beams
Reply With Quote #7

Does the hl2sdk include the single player code stuff? You could try find the actual c++ code that made the original..

-e- Yup. have a look in hl2sdk/dlls/hl2_dll/proto_sniper.cpp Has all the code for creating the temp entity beam and moving it. Wouldn't be too hard to create a SM equivalent. You'd have to use tasks or gameframe instead of nextthink though

Last edited by pRED*; 08-27-2007 at 18:32.
pRED* is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 09-05-2007 , 06:26   Re: Guns shooting beams
Reply With Quote #8

Whoa! C++? I don't know how to write extensions. A year ago I tried to make a calculator with C++, but I couldn't I have lots of things to learn.
__________________
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 09-05-2007 , 09:16   Re: Guns shooting beams
Reply With Quote #9

Quote:
Originally Posted by Shaman View Post
Whoa! C++? I don't know how to write extensions. A year ago I tried to make a calculator with C++, but I couldn't I have lots of things to learn.
You are not alone.

I bought the book "C++ for dummies," but it did not help much D:
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
dalto
Veteran Member
Join Date: Jul 2007
Old 09-05-2007 , 09:48   Re: Guns shooting beams
Reply With Quote #10

Have you tried looking at the laser tag plugin? Isn't that basically what he does in there?
dalto 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 15:37.


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