
Originally Posted by
Schilcote
How fast is it? I've been looking for a super-speedy rangercam for the VSP...
You can't make digital scanner faster then about 62 pixel/tick (66.6 ticks/sec in gmod) (Thats about 4129 pixel/sec (about 4 times filling a 32x32 Screen(1024 pixels)) ).
I had made a simple one, with WSR Support:
Code:
@name Hispeed Digital Screen Camera
@inputs On Reset NoAuto Pixel XView YView Distance Screen:wirelink
@outputs Process WSRmode
@persist PixelAll Mem X Y Ranger AllowAuto WSRoffset Speed
@persist XView2 YView2 Distance2
@trigger On
if(!On & ~On | changed(Pixel) | changed(Screen) | first())
{
WSRoffset = 15
Mem = -1
Speed = 1 # Set the Speed, 1 = Half of max speed. More then 2 can cause heavy lags!
Process = 0
Pixel = clamp(Pixel,1,512)
PixelAll = Pixel^2
WSRmode = Screen:entity():type() == "gmod_wire_socketradio"
if (Pixel <= 128)
{
AllowAuto = 1
}
else
{
AllowAuto = 0
}
if(WSRmode)
{
Screen[WSRoffset + 1048574] = 1
Screen[WSRoffset + 1048572] = Pixel
Screen[WSRoffset + 1048573] = Pixel
Screen[WSRoffset + 1048569] = 0
}
else
{
Screen[1048574] = 1
Screen[1048572] = Pixel
Screen[1048573] = Pixel
Screen[1048569] = 0
}
}
if(Reset & ~Reset)
{
reset()
}
if (On & (Mem <= PixelAll | (AllowAuto & !NoAuto)))
{
runOnTick(1)
Loops = 0
if(AllowAuto & !NoAuto & Mem > PixelAll)
{
Mem = -1
}
while(Loops < 31*Speed & minquota() > 5000)
{
Loops++
Mem++
XView2 = clamp(XView,0.01,360)
YView2 = clamp(YView,0.01,360)
Distance2 = clamp(Distance,32,(2^15))
X = (Mem % Pixel) * XView2 / Pixel - (XView2 / 2)
Y = floor(Mem / Pixel) * YView2 / Pixel - (YView2 / 2)
Ranger = rangerAngle(Distance2,X,Y):distance() / Distance2 * 255
if(WSRmode)
{
Screen[WSRoffset + Mem] = Ranger
}
else
{
Screen[Mem] = Ranger
}
}
Process = clamp((Mem / PixelAll) * 100,0,100)
}
Bookmarks