|
Page 1 of 1
|
[ 7 posts ] |
|
Author |
Message |
XavierStudios
Joined: Tue Feb 08, 2011 4:14 am Posts: 59
|
Laser Pointer
Could anyone link me to an easy-to-implement laser pointer system? I'd rather not hack at Darkstorm or S.A.W. to get a proper laser pointer.
Bonus points if the laser can be toggled on and off using the PIE Menu.
Thanks in advance. Xavier Studios
|
Sun Sep 25, 2011 8:20 pm |
|
|
Shook
Joined: Fri Feb 16, 2007 8:43 pm Posts: 1695 Location: AH SHIT FUCK AUGH
|
Re: Laser Pointer
Here ya go, freshly adapted from my own stuff. If neither of us screwed up too badly, it should look like this: Comments are added, so be sure to check the files. Yes, pie slices are in there too, but they're optional. Everyone's welcome to use this if they need a laser sight really badly. Edit: Check down below for the download. Somehow it's gone from this post.
Last edited by Shook on Tue Sep 27, 2011 4:32 pm, edited 1 time in total.
|
Sun Sep 25, 2011 10:26 pm |
|
|
XavierStudios
Joined: Tue Feb 08, 2011 4:14 am Posts: 59
|
Re: Laser Pointer
Shook wrote: Here ya go, freshly adapted from my own stuff. If neither of us screwed up too badly, it should look like this:
Comments are added, so be sure to check the files. Yes, pie slices are in there too, but they're optional. Everyone's welcome to use this if they need a laser sight really badly. Thank you very much, good sir. I'll test it out. In Laser.lua, would the local newPos = Vector(0,0) on line 12 be what I change if I didn't want the laser to emit from the barrel? Just change the 0,0 to 0,3?
|
Sun Sep 25, 2011 10:48 pm |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Laser Pointer
Negative. To move the initial point of the beam, change line 10 of Laser.lua: Code: local initPos = self.MuzzlePos; Make it: Code: local initPos = Vector(self.MuzzlePos.X,self.MuzzlePos.Y); and then to change it just do: Code: local initPos = Vector(self.MuzzlePos.X,self.MuzzlePos.Y + 3); Also a quick note, the self.pixelRatio variable currently in the script doesn't actually do anything. Not a huge deal, but if you want to modify it it would take slightly more work.
|
Mon Sep 26, 2011 6:42 am |
|
|
Shook
Joined: Fri Feb 16, 2007 8:43 pm Posts: 1695 Location: AH SHIT FUCK AUGH
|
Re: Laser Pointer
Yargh, good thing there's someone who pays more attention than i do. I was kinda tired and in a rush yesterday, so i present you the slightly more functional version here. The pixel ratio variable works now, and it also supports origins at the muzzle or gun center (whichever is more convenient for you, it can be switched in the script very easily), along with offsets (plus the script is actually shorter now). I've tested it thoroughly this time, so hopefully it works as expected. As another benefit, i found out how extremely useful the GetXFlipped function for vectors is. Should've known that one before.
|
Mon Sep 26, 2011 1:09 pm |
|
|
XavierStudios
Joined: Tue Feb 08, 2011 4:14 am Posts: 59
|
Re: Laser Pointer
Thank you, Grif and Shook. You both have been helpful.
|
Mon Sep 26, 2011 1:38 pm |
|
|
danielpower
Joined: Tue Sep 27, 2011 2:39 pm Posts: 1
|
Re: Laser Pointer
Thanks for your tips,very helpful.And a real 100mw laser pointeris also very interesting.
|
Tue Sep 27, 2011 2:44 pm |
|
|
|
|
Page 1 of 1
|
[ 7 posts ] |
|
Who is online |
Users browsing this forum: Google [Bot] |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|