'invert' sensor option doesn't trigger controllers unless it's positive once #32181

Closed
opened 2012-07-25 07:12:00 +02:00 by Dalai Felinto · 8 comments

Category: Logic

%%%how to test it:
0) select the default cube

  1. create an Int property and set value 37

  2. create a property sensor - mode Equal, Prop: prop, Value: 37

  3. connect it with a Motion Actuator with rotation 1 for Z
    play the game, the cube will rotate

  4. now select invert in the sensor and set the controller to NAnd.
    play the game, the cube will not rotate

I consider that a bug, though it's been around since 2.49 at least.

The same happens if I use an Expression Controller: to replace the And controller use 'sensor=True' to replace the NAnd use 'sensor=False'
(replace sensor by the name of the sensor)

attached is a sample file demonstrating that in trunk (>2.63)
%%%

**Category**: Logic %%%how to test it: 0) select the default cube 1) create an Int property and set value 37 2) create a property sensor - mode Equal, Prop: prop, Value: 37 3) connect it with a Motion Actuator with rotation 1 for Z play the game, the cube will rotate 4) now select invert in the sensor and set the controller to NAnd. play the game, the cube will *not* rotate I consider that a bug, though it's been around since 2.49 at least. The same happens if I use an Expression Controller: to replace the And controller use 'sensor=True' to replace the NAnd use 'sensor=False' (replace sensor by the name of the sensor) attached is a sample file demonstrating that in trunk (>2.63) %%%
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Author
Owner

%%%note: setting Level to true makes it work as I expected. So maybe not a bug after all. thoughts?%%%

%%%note: setting Level to true makes it work as I expected. So maybe not a bug after all. thoughts?%%%
Author
Owner

%%%note2 : setting pulse negative on also 'fixes' it. so yeah there are workarounds. Mitchell, any thoughts?%%%

%%%note2 : setting pulse negative on also 'fixes' it. so yeah there are workarounds. Mitchell, any thoughts?%%%
Member

Added subscriber: @JorgeBernalMartinez

Added subscriber: @JorgeBernalMartinez
Member

I think this is not a "bug" related to the Nand controller. I mean, as you can see in the blend I've attached if you set it during runtime (pressing spacebar) the combination invert + Nand controller works right.

The issue I think is the following:

The initial State of the sensor seems that is set to FALSE. When you check for a TRUE condition (for example no "invert" press) at the beginning a pulse is generated. Also if you set the conditions during runtime it works OK.

But when you check at the beginning for a FALSE condition (invert button pressed) there is no change of state and no pulse is generated at the beginning. If you set it during runtime it works because the sensor state pass from a TRUE state to FALSE state and a pulse is generated.

BTW, If you check for FALSE condition (invert button pressed) with the false leveling pressed, it will work but it will do spending more processing resources as it will generate a pulse with each tick.

I think the possible solution would be setting the initial state of the sensor to something different to FALSE (i.e INITIAL_STATE) as it will generate a pulse at the beginning when it pass to TRUE or FALSE condition. I will check the code related to see if I can do a fix.

P.D. the best web page for BGE sensor pulses is http://gameblender.wikia.com/wiki/Sensors

I think this is not a "bug" related to the Nand controller. I mean, as you can see in the blend I've attached if you set it during runtime (pressing spacebar) the combination invert + Nand controller works right. The issue I think is the following: The initial State of the sensor seems that is set to FALSE. When you check for a TRUE condition (for example no "invert" press) at the beginning a pulse is generated. Also if you set the conditions during runtime it works OK. But when you check at the beginning for a FALSE condition (invert button pressed) there is no change of state and no pulse is generated at the beginning. If you set it during runtime it works because the sensor state pass from a TRUE state to FALSE state and a pulse is generated. BTW, If you check for FALSE condition (invert button pressed) with the false leveling pressed, it will work but it will do spending more processing resources as it will generate a pulse with each tick. I think the possible solution would be setting the initial state of the sensor to something different to FALSE (i.e INITIAL_STATE) as it will generate a pulse at the beginning when it pass to TRUE or FALSE condition. I will check the code related to see if I can do a fix. P.D. the best web page for BGE sensor pulses is http://gameblender.wikia.com/wiki/Sensors
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Aaron Carlisle self-assigned this 2019-06-29 02:20:35 +02:00
Member

This task is being closed because the BGE has been removed in Blender 2.8.

This task is being closed because the BGE has been removed in Blender 2.8.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#32181
No description provided.