Logic Gadgets: Controller Sensor

 

Icon
Name of gadget Controller Sensor
Section Sensors & Input
Number of Tweak pages 6
Author LadylexUK, QuietlyWrong
Last updated 23 May 2019 [EA v1.02]

Description

This gadget is fundamental to most Dreams as it allows you to read controller inputs and act on them accordingly. It detects when buttons are pressed, joysticks are moved and the controller is turned. It also houses the information on microphone inputs, camera settings, and spawning. You can change it so that button presses are only detected if an object or character is possessed or at any time, and can control which players can do what in multiplayer games.

It also controls the appearance of the imp when controlling characters or objects, the default settings for the player camera and some built-in gameplay triggers such as dying and resetting from checkpoints. The gadget even comes with an imp “handle” that lets you position where the imp will appear during possession (if at all).

By default, when you stamp a new controller sensor, a couple of wires are already connected. These enable typical behaviours but you may need to delete them if they do not serve your intentions for the gadget:

  • the “Circle button” output is connected to “De-Possess” input
  • The “Is Dead” output is connected to the “Respawn” input.

Example Tutorial (from Media Molecule)

  1. Stamp a controller sensor
  2. On the Important properties page (page 5) select remote controllable.
  3. Switch to sound mode and search sound effects and choose one to stamp in your scene.
  4. Tweak the sound effect (L1+square). Under slice payback mode select once.
  5. Go to the panning page and select controller under pan style
  6. In the controller sensor, Connect the output port of the square to the power port of the sound effect.
  7. Hit start time
  8. When you press square the sound effect will play from the controller itself.

Tweak Menus

Tweak Menu 1: Controller I/O [1]

Image: Beta. v1.02 Confirmed same
  1. Tweak Menu page 1:Controller I/O
  2. L2 Button
    2a. Input
    2b. Output
  3. R2 Button
    3a. Input
    3b. Output
  4. L1 Button
    4a. Input
    4b. Output
  5. R1 Button
    5a. Input
    5b. Output
  6. Triangle Button
    6a. Input
    6b. Output
  7. Square Button
    7a. Input
    7b. Output
  8. Circle Button
    8a. Input
    8b. Output
  9. Cross Button
    9a. Input
    9b.Output
  10. Power
  1. Menu page indicator
  2. L2 Button
    This slider can detect the amount of pressure applied to the L2 trigger button and will send an output signal when the button is pressed. The output range is 0% (not being pressed) to 100% (fully pressed in).
  3. R2 Button
    This slider can detect the amount of pressure applied to the R2 trigger button and will send an output signal when the button is pressed to. The output range is 0% (not being pressed) to 100% (fully pressed in).
  4. – 9. Button presses
    Each will send a signal when one of these buttons is pressed, which is only continuous if the button is held down.
  1. Power
    This is where you turn the gadget on/off.
Tweak Menu 2: Controller I/O [2]

Image: Beta. v1.02 Confirmed same
  1. Tweak Menu page 2: Controller I/O
  2. Left Stick
    2a. Input
    2b. Output
  3. Right Stick
    3a. Input
    3a. Output
  4. Direction Buttons
    4a. Input
    4b. Output
  5. Motion sensor
    5a. Input
    5b. Output
  6. Touchpad Button
    6a. Input
    6b. Output
  7. L3 Button
    7a. Input
    7b.Output
  8. R3 Button
    8a. Input
    8b.Output
  9. Power
  1. Menu page indicator
  2. Left Stick
    This detects if the left joystick is moved. It produces a fat wire that can be split into left/right (X) and up/down (Y) signals; these vary from -100% to +100% as you move the stick from fully up (left) to fully down (right) with 0% output when they are centred. The output is relative to the camera direction and therefore depends on the relative orientation of the gadget to the current viewpoint.
  3. Right Stick
    This detects if the right joystick is moved. It produces a fat wire that can be split into left/right (X) and up/down (Y) signals; these vary from -100% to +100% as you move the stick from (negative) fully up/left to (positive) fully down/right with 0% output when they are centred. The output is relative to the camera direction and therefore depends on the relative orientation of the gadget to the current viewpoint.
  4. Directional Buttons
    This detects any D pad press in any direction and produces a fat wire that can be split into left/right (A) and up/down (B) directions (negative for up/left, positive for down/right). Signals from the d-pad are always either 100% or -100% when buttons are pressed. This gizmo is relative to the current camera direction and therefore depends on the relative orientation of the gadget to the current viewpoint.
  5. Motion Sensor
    This detects any movement of the controller with the motion sensor (the way the imp moves). It outputs a fat wire with rotational data in three axes. If you split them out, these are A (pitching – imagine nodding your head), B (yawing – like shaking your head) and C (rolling – like tilting your head). The outputs are angles in radians, from -π to +π.
  6. Touchpad Button
    This detects if the touchpad is pressed. It cannot detect other movements on the touchpad (such as a stroke, or two-fingered press), nor the location of the press.
  7. L3 Button
    This detects a press in of the left joystick.
  8. R3 Button
    This detects a press in of the right joystick.
  9. Power
    This is where you turn the gadget on/off.
Tweak Menu 3: Controller I/O [3]

Image: Beta. v1.02 Confirmed same
  1. Tweak Menu 3: Controller I/O
  2. Left Stick Local
    2a. Input
    2b. Output
  3. Right Stick Local
    3a.Input
    3b. Output
  4. Up Button
    4a. Input
    4b. Output
  5. Down Button
    5a. Input
    5b. Output
  6. Left Button
    6a. Input
    6b. Output
  7. Right Button
    7a. Input
    7b. Output
  8. Enter
    8a. Input
    8b.Output
  9. Back
    9a. Input
    9b. Output
  10. Power
  1. Menu page indicator
  2. Left Stick Local
    This detects if the left joystick is moved. It produces a fat wire that can be split into up/down and left/right signals; these vary from -100% (fully down or left) to +100% (fully up or right respectively). The output is independent from the camera direction.
  3. Right Stick Local
    This detects if the left joystick is moved. It produces a fat wire that can be split into up/down and left/right signals; these vary from -100% (fully down or left) to +100% (fully up or right respectively). The output is independent from the camera direction.
  4. Up Button
    This detects if the D-pad up button is pressed. The output is independent from the camera direction (unlike the “Directional Buttons” gizmo on the previous page).
  5. Down Button
    This detects if the D-pad down button is pressed. The output is independent from the camera direction.
  6. Left Button
    This detects if the D-pad left button is pressed. The output is independent from the camera direction.
  7. Right Button
    This detects if the D-pad right button is pressed. The output is independent from the camera direction.
  8. Enter
    This detects if the system-standard “Enter” (or “Confirm”) button is pressed. In most regions this is the Cross Button (in Japan it is the Circle Button) and is therefore best used for menu navigation.
  9. Back
    This detects if the system-standard “Back” (or “Cancel”) button is pressed. In most regions this is the Circle Button (in Japan it is the Cross Button) and is therefore best used for menu navigation.
  10. Power
    This is where you turn the gadget on/off.
Tweak Menu 4: Camera Properties
controller sensor - camera
Image: Beta. v1.02 Confirmed same
  1. Tweak Menu page 4: Camera Properties
  2. Camera Height
    2a. Input
    2b. Output
  3. Camera Distance
    3a. Input
    3b. Output
  4. Camera Tilt
    4a. Input
    4b. Output
  5. Field of View
    5a. Input
    5b. Output
  6. Aperture
    6a. Input
    6b. Output
  7. Platforming Shadow
    7a. Input
    7b. Output
  8. Power

Note: the camera settings here apply to the standard player camera. Any camera gadgets in your scene will override these.

  1. Menu page indicator
  2. Camera Height
    Here you can tweak the height at which the player camera follows the player.
  3. Camera Distance
    Here you can tweak the distance behind which the player camera follows the player.
  4. Camera Tilt
    Here you can tweak the angle at which the player camera is tilted.
  5. Field of View
    Here you can tweak the player camera’s field of view setting, i.e. how much of an angle is visible on screen. Higher values give a wider view of the environment, lower values a narrower one.
  6. Aperture
    Here you can tweak the player camera’s aperture which affects the degree of focus.
  7. Platforming Shadow
    Here you can choose the intensity of a spot shadow that is cast directly below the player, mainly to assist them when lining up jumps in platforming games.
  8. Power
    This is where you turn the gadget on/off.
Tweak Menu 5: Important Properties & I/O
controller sensor - important
Image: v1.01. v1.02 Confirmed same
  1. Tweak Menu: Page 5: Important Properties & I/O
  2. Possession Mode
  3. Player 1
    3a. Input
  4. Player 2
    4a. Input
  5. Player 3
    5a. Input
  6. Player 4
    6a. Input
  7. ‘Follow Imp’ Behaviour
  8. Allow Imp During Possession
    8a. Input
    8b. Output
  9. Force Possession
    9a. Input
    9b. Output
  10. Depossess
    10a. Input
  11. Possession Visual
  12. Imp Docking Tag
    12a. Input
  13. Disable Controls
    13a. Input
  14. Power
  1. Menu page indicator
  2. Possession Mode
    This is where you select when the controller gadget will be active. The choices are

    • None
      No player can possess the controller
    • Possessable
      This is the default. The controller will only work if the character or object has been possessed by the imp
    • Follow Imp
      If you possess an object with this setting, the object will move around the screen with the imp (whether or not the imp is visible). You might use this to create a screen cursor effect, for example
    • Remote Controllable
      This allows the controller to be active all the time. You set this for menu options for example, where there is no imp or no possessed characters.
  3. – 6. Multiplayer options.
    Each of the four “Players” can be toggled on or off to determine whether each one can possess this particular Controller Sensor. You might use this to force multiple player into separate teams, for example.
  4. ‘Follow Imp’ Behaviour
    There are two options for the behaviour of any object set to “follow imp”:

    • Maintain Orientation
      The default setting. When you possess the object, it doesn’t change its orientation – so if you pick it up from the back, it will continue to show its back to the player. If the imp’s head or eyes are set to be visible, this can be disconcerting as the imp’s face may be partially or wholly obscured by the object being controlled.
    • Imp Faces Camera
      This alternative behaviour causes the object to automatically rotate itself, on possession, so that the imp is face-up. Even if the imp’s Possession Visual [11] is set to “Invisible Imp”, the object will re-orient itself accordingly. This could be useful in, for example, an adventure game such that when the player “picks up” objects via possession, they are automatically rotated to present a particular view, such as the front of an envelope, regardless of what angle they were picked up from.
  5. Allow Imp During Possession
    If this is activated, it makes your imp remain in the Scene even when you’re possessing a character. In this way you could use the stick outputs to move a puppet around while angling the controller to move the imp independently to grab obstacles.
  6. Force possession
    When selected this will force each player to take control of the nearest possessable character/object.
  7. Depossess
    Send a signal to the input (9a) to force the player to depossess this Control Sensor. The default wires the circle button output to this input so the player can exit possession with a button press.
  8. Possession Visual
    Here is where you choose the imp’s appearance while possessing a character or object. Note that these may be affected by other settings that determine the imp’s visibility in a Scene.

    • Invisible Imp
      The default setting. When the imp possesses a character/object it does not appear at all.
    • Eyes only
      This allows the face of the imp to be seen when it possesses an object.
    • Visible (Body on Target)
      The imp appears in full, attached by its body.
    • Visible (Tip on Target)
      The imp appears in full, attached by its tip.
  9. Imp Docking Tag
    By default, when the imp visibly possesses an object, it attaches to a special handle that starts off immediately above the Controller sensor gadget. You can drag this wherever you need. However by wiring this input (12a) back to a Tag gadget, you can specify the location that the imp will appear at when possessing that object. Then you can dynamically alter the imp’s location in-game by moving the tag.
  10. Disable Controls
    Here you can send a signal to disable all controls on the controller sensor, a useful  option for handling cut-scenes, for example.
  11. Power
    Here is where you turn the gadget on/off.
Tweak Menu 6: Miscellaneous I/O

Image: Beta. v1.02 Confirmed same
  1. Tweak Menu page 6 : Miscellaneous I/O
  2. Possessed
    2b. Output
  3. Player Ownership
    3b. Output
  4. Microphone
    4a. Input
    4b. Output
  5. Respawn
    5a. Input
  6. Die
    6a. Input
  7. Is Dead
    7b. Output
  8. Offscreen Indicator
    8a. Input
    8b. Output
  9. Stay Onscreen
    9a. Input
    9b. Output
  10. Offscreen Death
    10b. Output
  11. Power
  1. Menu page indicator
  2. Possessed
    This outputs a constant signal as long as this Control Sensor is being possessed by a player.
  3. Player Ownership
    Outputs a signal corresponding to the player currently possessing this sensor.
  4. Microphone
    This is where any noise from the player’s microphone can be determined – requires an active microphone to be plugged into the PlayStation. Based on volume of the sound this output can be used to power gadgets allowing the creator to make mouth animations, sound activated switches, movement and other contraptions.
  5. Respawn
    This is where you send a signal to force the player to respawn. By default, there is a wire connecting the “Is Dead” output (7b) into this input so the player automatically respawns upon dying.
  6. Die
    This is where you send a signal to force the player to “die”. This will cause any logic associated with “Is Dead” to be triggered.
  7. Is Dead
    This output sends a continuous signal for as long as the player is “dead” in a Scene. By default, this is wired into the “Respawn” input (5a) so as soon as the player respawns, they will no longer be “dead” and this output will turn off.
  8. Offscreen Indicator
    Toggle this to determine whether an indicator will appear on screen in multiplayer games to show that a player is offscreen.
  9. Stay Onscreen
    When this is active, the camera tries to keep a possessed controller sensor onscreen at all times. If it cannot (for example in a multiplayer game where one player gets separated from another) a countdown starts (set the countdown timer with the Global Settings gadget), after which it will be destroyed if the controller sensor cannot return to the screen in time.
  10. Offscreen Death
    If you have configured an “Offscreen Timeout” using a Global Settings gadget, this will output a signal specifically if the player times out due to being offscreen for too long in a multiplayer game.
  11. Power
    This is where you turn the gadget on/off.

Lex Tips

Button presses last for as long as the button is pressed, so in order for something to turn on and stay on without you having to hold the button down you need to create something more permanent. Use a counter between the button press and the thing you want to power. (See How to make button presses power things on.)

QW Tips

imp location handle
The imp position handle

Initially found immediately above the Controller Sensor gadget is a handle by which you can position the imp’s eyes and body (when you want them to be visible). The handle’s appearance depends on the “Possession Visual” setting (Important Properties tab). Simply drag it and orient it anywhere you like with relation to the gadget.

Useful Tutorials

Resident Evil Style Controls

Sound activated switch

Version Updates

v1.01 – the VR scale tweak has been removed from the Camera Properties tab. ‘Follow Imp’ Behaviour has been added to the Important Properties & I/O tab. The appearance of the imp handle (for positioning imp eyes/face) has been updated.
v1.02 Menu confirmed same. Added info to microphone. Added link.

Comments and Feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: