Wired Camera(Expressionn)

From GMod Wiki

Jump to: navigation, search

This camera will scan with a ranger. While it scans it makes black/gray pixels on a digital screen. Let's get started!

The things you need is: A flat prop(1x1 prop in PHX can be an good example),a Timer from "Gate - Time", 1 ranger, 1 expression(code is below) and 2 buttons (1 toggled 1 untoggled, make sure it is on value 1)

1. Spawn 1x1 prop.

2. Put a Digital screen on the side of the 1x1 prop.

3. Spawn a timer gate on the prop.

4. Spawn expression "Camera" somewhere on the prop.

5. Put 2 buttons on the prop.

6. Put the Ranger on the middle of the prop on the backside(there you don't have spawn your digital screen)

Code

N@Camera 
I@Timer On Dist 
O@ScrX ScrY ScrG RangX RangY Run Reset 
On==1->Run=1,Reset=0;Timer>=64->Run=0,Reset=1; 
ScrX=floor(Timer%2*16) 
ScrY=floor(Timer%64/2) 
ScrG=1000-Dist 
RangX=ScrX/16-1 
RangY=ScrY/16-1


The Wire Setup

1. Wire from expression chip: Timer-> Timer. Dist-> Ranger. On-> Button(toggled)

2. Wire Ranger Y -> exp.chip output:rang Y and wire from ranger X -> exp.chip output:rang X

3. Wire from your digitalscreen Pixel X-> exp.chip output:ScrX and Pixel Y-> exp.chip output: ScrY and Pixel G -> exp.chip output: ScrG

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox